Skip to content

Move to InputState instead of metadata on sessions#311060

Merged
TylerLeonhardt merged 2 commits intomainfrom
tyler/mysterious-chinchilla
Apr 17, 2026
Merged

Move to InputState instead of metadata on sessions#311060
TylerLeonhardt merged 2 commits intomainfrom
tyler/mysterious-chinchilla

Conversation

@TylerLeonhardt
Copy link
Copy Markdown
Member

Cleans up more old patterns with new patterns.

Co-authored-by: Copilot copilot@github.com

Cleans up more old patterns with new patterns.

Co-authored-by: Copilot <copilot@github.com>
Copilot AI review requested due to automatic review settings April 17, 2026 18:25
@TylerLeonhardt TylerLeonhardt enabled auto-merge (squash) April 17, 2026 18:25
@TylerLeonhardt TylerLeonhardt self-assigned this Apr 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 17, 2026

Screenshot Changes

Base: 960abe89 Current: 0422ae56

Changed (36)

chat/aiCustomizations/aiCustomizationManagementEditor/LocalHarness/Light
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/CliHarness/Light
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/Sessions/Light
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/SessionsSkillsTab/Light
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/McpServersTab/Light
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/AgentsTab/Light
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/SkillsTab/Light
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/InstructionsTab/Light
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/HooksTab/Light
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/PromptsTab/Light
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/PluginsTab/Light
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/AgentsTabNarrow/Dark
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/LocalHarness/Dark
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/CliHarness/Dark
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/Sessions/Dark
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/SessionsSkillsTab/Dark
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/McpServersTab/Dark
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/AgentsTab/Dark
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/SkillsTab/Dark
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/InstructionsTab/Dark
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/HooksTab/Dark
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/PromptsTab/Dark
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/PluginsTab/Dark
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/PromptsTabScrolled/Dark
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/McpServersTabScrolled/Dark
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/PluginsTabScrolled/Dark
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/McpServersTabNarrow/Dark
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/PromptsTabScrolled/Light
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/McpServersTabScrolled/Light
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/PluginsTabScrolled/Light
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/McpServersTabNarrow/Light
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/AgentsTabNarrow/Light
Before After
before after
agentSessionsViewer/CompletedUnread/Light
Before After
before after
agentSessionsViewer/CompletedUnread/Dark
Before After
before after
agentSessionsViewer/WithDiffChanges/Light
Before After
before after
agentSessionsViewer/WithDiffChanges/Dark
Before After
before after

Added (6)

chat/aiCustomizations/aiCustomizationManagementEditor/AgentsItemEditor/Light

current

chat/aiCustomizations/aiCustomizationManagementEditor/McpServerDetail/Light

current

chat/aiCustomizations/aiCustomizationManagementEditor/PluginDetail/Light

current

chat/aiCustomizations/aiCustomizationManagementEditor/AgentsItemEditor/Dark

current

chat/aiCustomizations/aiCustomizationManagementEditor/McpServerDetail/Dark

current

chat/aiCustomizations/aiCustomizationManagementEditor/PluginDetail/Dark

current

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 inputState and commit them to sessionStateService.
  • Removes metadata persistence/wiring in ClaudeChatSessionItemController, including metadata cloning on fork, and switches folder resolution to use inputState + session state + session file fallback.
  • Refactors and updates tests to seed/verify state via inputState and sessionStateService instead 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 _resolveSessionFolder and 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

@TylerLeonhardt TylerLeonhardt marked this pull request as draft April 17, 2026 18:54
auto-merge was automatically disabled April 17, 2026 18:54

Pull request was converted to draft

Co-authored-by: Copilot <copilot@github.com>
@TylerLeonhardt TylerLeonhardt marked this pull request as ready for review April 17, 2026 19:36
@TylerLeonhardt TylerLeonhardt enabled auto-merge (squash) April 17, 2026 19:43
@TylerLeonhardt TylerLeonhardt merged commit 6a8889b into main Apr 17, 2026
39 of 41 checks passed
@TylerLeonhardt TylerLeonhardt deleted the tyler/mysterious-chinchilla branch April 17, 2026 20:29
@vs-code-engineering vs-code-engineering Bot added this to the 1.117.0 milestone Apr 17, 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.

3 participants