Skip to content

fix(vscode): speed up settings saves - #12093

Merged
marius-kilocode merged 3 commits into
mainfrom
fix-slow-settings-save
Jul 10, 2026
Merged

fix(vscode): speed up settings saves#12093
marius-kilocode merged 3 commits into
mainfrom
fix-slow-settings-save

Conversation

@marius-kilocode

@marius-kilocode marius-kilocode commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

VS Code settings saves currently scale with the number of mounted Agent Manager directories. Before a config write starts, the extension serially checks pending permissions, questions, suggestions, and network waits for every directory. Global writes then dispose loaded backend instances serially.

This change bounds both directory-level phases to four concurrent worktrees while preserving per-directory cleanup order and save failure behavior. Process-global suggestions are drained once, active prompt drains settle before errors are returned, and instance disposal still completes before the global config response. Concurrent instance disposal is all-settled and uninterruptible, so a failed notification listener or interrupted caller cannot strand sibling worktrees in a partially disposed cache state.

Profiling

The before/after profiles exercise the real KiloConnectionService.drainPendingPrompts() and InstanceStore.disposeAll() implementations with controlled delays so the comparison is deterministic.

Scenario Workload Before After
Pending prompt drain 49 mounted directories, 25 ms per backend list call 5,113 ms 1,042 ms
Instance disposal 4 loaded directories, 1 second cleanup callback per directory 4,015 ms 1,005 ms

The prompt-drain profile represents the high-worktree Agent Manager case that produced four-to-five-second saves. The disposal profile isolates the second serial fan-out in the backend. Both improvements come from bounded concurrency rather than skipping cleanup or acknowledging writes before config changes are effective.

Comment thread packages/kilo-vscode/src/services/cli-backend/connection-service.ts
Comment thread packages/opencode/src/project/instance-store.ts
@kilo-code-bot

kilo-code-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

The latest commit (643dc9e3a4) fixes both previously reported WARNINGs by logging concurrent failures beyond the first, instead of dropping them silently:

  • connection-service.ts: parallel() now logs every additional prompt-drain failure via console.warn before throwing the lowest-index error.
  • instance-store.ts: disposeAllOnce() now logs every failed disposal exit via Effect.logWarning before re-throwing the first failure.

No new issues found in the incremental diff.

Files Reviewed (2 files)
  • packages/kilo-vscode/src/services/cli-backend/connection-service.ts
  • packages/opencode/src/project/instance-store.ts
Previous Review Summary (commit 45ced29)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 45ced29)

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 2
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
packages/kilo-vscode/src/services/cli-backend/connection-service.ts 33 parallel() silently drops all but the lowest-index concurrent error, with no logging
packages/opencode/src/project/instance-store.ts 186 disposeAllOnce() re-throws only the first failing exit; other concurrent sibling disposal failures go unlogged
Files Reviewed (5 files)
  • .changeset/faster-vscode-settings-save.md
  • packages/kilo-vscode/src/services/cli-backend/connection-service.test.ts
  • packages/kilo-vscode/src/services/cli-backend/connection-service.ts - 1 issue
  • packages/opencode/src/project/instance-store.ts - 1 issue
  • packages/opencode/test/kilocode/project/instance-store.test.ts

Both findings are diagnosability gaps in otherwise sound bounded-concurrency implementations: the concurrency-bound design, kilocode_change annotations, uninterruptible all-settled disposal semantics, and test coverage (including the verified assumption that suggestions are process-global rather than per-directory) all check out correctly.

Fix these issues in Kilo Cloud


Reviewed by claude-sonnet-5 · Input: 36 · Output: 8.8K · Cached: 856K

Review guidance: REVIEW.md from base branch main

@marius-kilocode
marius-kilocode merged commit 2031f94 into main Jul 10, 2026
42 of 45 checks passed
@marius-kilocode
marius-kilocode deleted the fix-slow-settings-save branch July 10, 2026 13:59
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants