Move to InputState instead of metadata on sessions#311060
Merged
TylerLeonhardt merged 2 commits intomainfrom Apr 17, 2026
Merged
Move to InputState instead of metadata on sessions#311060TylerLeonhardt merged 2 commits intomainfrom
TylerLeonhardt merged 2 commits intomainfrom
Conversation
Cleans up more old patterns with new patterns. Co-authored-by: Copilot <copilot@github.com>
Contributor
Screenshot ChangesBase: Changed (36)Added (6) |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates Claude chat sessions away from storing UI selections in ChatSessionItem.metadata, and instead uses ChatSessionInputState + IClaudeSessionStateService as the source of truth for permission mode and folder selection.
Changes:
- Updates the Claude chat request handler to read permission mode / folder selection from
inputStateand commit them tosessionStateService. - Removes metadata persistence/wiring in
ClaudeChatSessionItemController, including metadata cloning on fork, and switches folder resolution to useinputState+ session state + session file fallback. - Refactors and updates tests to seed/verify state via
inputStateandsessionStateServiceinstead of metadata.
Show a summary per file
| File | Description |
|---|---|
| extensions/copilot/src/extension/chatSessions/vscode-node/test/claudeChatSessionContentProvider.spec.ts | Updates tests/helpers to build inputState groups and stop mutating ChatSessionItem.metadata. |
| extensions/copilot/src/extension/chatSessions/vscode-node/claudeSessionOptionBuilder.ts | Minor API tweak: buildNewSessionGroups parameter becomes optional. |
| extensions/copilot/src/extension/chatSessions/vscode-node/claudeChatSessionContentProvider.ts | Moves handler/controller logic from metadata to input-state + session-state; updates fork behavior and folder resolution. |
Copilot's findings
Comments suppressed due to low confidence (1)
extensions/copilot/src/extension/chatSessions/vscode-node/claudeChatSessionContentProvider.ts:438
- This session lookup uses
CancellationToken.None, which means folder resolution can’t be cancelled even when the caller cancels input-state construction. Consider taking a token in_resolveSessionFolderand using it here.
const sessionResource = ClaudeSessionUri.forSessionId(sessionId);
const session = await this._claudeCodeSessionService.getSession(sessionResource, CancellationToken.None);
if (session?.cwd) {
return URI.file(session.cwd);
- Files reviewed: 3/3 changed files
- Comments generated: 5
auto-merge was automatically disabled
April 17, 2026 18:54
Pull request was converted to draft
pwang347
approved these changes
Apr 17, 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.
Cleans up more old patterns with new patterns.
Co-authored-by: Copilot copilot@github.com