Repository navigation
agentHost: refuse moving a chat whose working directory is missing - #342619
Merged
Sandeep Somavarapu (sandy081) merged 1 commit intoOct 19, 2026
Merged
Conversation
Resolving a chat's folders for a move rethrew the provider's untyped SessionWorkingDirectoryMissingError. Refuse it as SessionNotReady before anything changes, like promoting does. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused fix preserves promotion behavior and consistently handles resolution failures before move mutations, with regression coverage.
No open issues 🎉
What changed in this PR
Makes chat moves return a typed sessionNotReady refusal when chat history cannot load, including when its working directory is missing.
Changes:
- Shares error handling across promotion and moved-chat folder resolution.
- Adds regression coverage for move and promotion refusals while preserving chat ownership.
| File | Description |
|---|---|
| src/vs/platform/agentHost/test/node/agentService.test.ts | Tests missing-directory refusals and unchanged ownership. |
| src/vs/platform/agentHost/node/agentService.ts | Centralizes chat-resolution failures into typed move refusals. |
Review effort: Balanced
Vritant Bhardwaj (vritant24)
approved these changes
Oct 19, 2026
Sandeep Somavarapu (sandy081)
deleted the
agents/fix-move-chat-missing-folder
branch
October 19, 2026 18:18
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.
Follow-up to #342546.
moveChatof a nested chat whose working directory no longer exists on disk failed with an untypedSessionWorkingDirectoryMissingError, andjsonRpcErrorFromsent its fullerr.stackto the client as the message. Promoting the same chat already refused correctly withsessionNotReady.Root cause:
_moveChatreads the moved chat's folders via_movedChatFolders/_movedSubtreeFolders, which callresolveChatState. That lazily loads the chat through the provider, which throws when the working directory is gone. Only the promote path wrapped its own read.Fix: a small
_resolveChatForMovehelper turns a failed resolve intoAgentChatMoveRefusedError(SessionNotReady, …). It is used by both folder readers and by the promote check. The refusal happens before anything changes. Behindchat.agentHost.moveChats.enabled(default off).Validation:
scripts/test.sh --run …agentService.test.ts --run …agentHostDatabase.test.ts --run …localAgentHostSessionsProvider.test.ts: 1840 passing, 27 pending, 0 failing. The new test failed before the fix with the untyped error.npm run typecheck-client: passed.npm run eslint -- <changed files>: passed.