fix(agent-manager): survive inaccessible historical project paths - #14557
Merged
marius-kilocode merged 2 commits intoSep 25, 2026
Merged
Conversation
A saved historical sandbox that returns PermissionDenied aborted Project.fromDirectory, so an otherwise valid current checkout could not initialize and Agent Manager showed no providers. Isolate that probe for historical paths only: keep the saved association for later recovery and log the warning. Errors for the current checkout and non-permission filesystem failures still surface. Retry config and provider initialization when Agent Manager activates a project, so a healthy project recovers without a restart when the opened workspace failed to initialize. Fixes #13768
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Previous Review Summary (commit 9a6abc0)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 9a6abc0)Status: 3 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (9 files)
Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0 Review guidance: REVIEW.md from base branch |
Key the cached providers and config payloads to the directory they were loaded for, so retryInitialization means "bootstrapped for this project" rather than "bootstrapped for any project". Without this, switching to a project whose bootstrap failed could silently reuse the previous project's config and providers. Guard SessionTranscript scope resolution against a retained inaccessible sandbox. Filesystem.resolve throws EACCES/EPERM for such a path, which previously could die when attaching a past chat. Unresolvable paths are now treated as out of scope, matching the session family resolution. Add coverage for the refreshConfig staleness guard.
marius-kilocode
enabled auto-merge
September 25, 2026 09:04
chrarnoldus
approved these changes
Sep 25, 2026
marius-kilocode
deleted the
research-worktree-session-binding-strategy
branch
September 25, 2026 09:06
This was referenced Sep 25, 2026
This was referenced Sep 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
A repository that was moved (or whose old location became inaccessible) could break Kilo startup entirely, even when the current checkout was valid.
Project.fromDirectoryprobes every saved sandbox withfs.exists(...).pipe(Effect.orDie). When a historical path returnsPermissionDenied, that defect aborts initialization, so the current project does not boot and Agent Manager shows No providers. A healthy project added next to the failing opened workspace stayed blocked too: selecting it restored sessions and worktrees but never retried the failed config and provider bootstrap.Fixes #13768.
Why This Change Was Made
Two independent failure boundaries are hardened, without changing project identity or adding automatic relocation:
PermissionDeniedno longer aborts startup. The association is retained (denied access does not prove deletion) and a warning is logged. The current checkout and non-permission filesystem errors still propagate, and missing historical paths continue to be pruned as before.Sessions and worktrees remain bound to folders. Moving a repository does not transfer sessions or worktrees, which is intentional.
User Impact
Evidence
packages/opencode:bun test test/kilocode/project-sandbox.test.ts test/project/project.test.ts(39 pass),bun run typecheck.packages/kilo-vscode:bun run build:check(host types, webview types, lint, bundle),bun run knip, and focused provider/Agent Manager tests (201 pass).bun run script/check-opencode-annotations.ts --worktree,git diff --check.Manual verification used an isolated VS Code instance with a rebuilt CLI and extension and disposable Git repositories:
Also confirmed the reproduction against current source before the fix: with the historical path denied, the opened workspace showed no providers and could not create a session. Test artifacts and fixtures were removed after verification.