Repository navigation
agentHost: per-chat configuration (Block 3b) - #341714
Merged
Sandeep Somavarapu (sandy081) merged 47 commits intoOct 15, 2026
Merged
Sandeep Somavarapu (sandy081) merged 47 commits into
Sandeep Somavarapu (sandy081) merged 47 commits into
Conversation
Sync the generated protocol from 13277064 to agent-host-protocol dbbd1217 (microsoft/agent-host-protocol#527), which adds per-chat config: `chatMutable` on session config schema properties, the `ChatState.config` overlay and the client-dispatchable `chat/configChanged` action (introduced in 1.1.0; PROTOCOL_VERSION unchanged). The range also brings the optional `SessionModelInfo.vendor` field (#505). Re-export `ChatConfigState` and `ChatConfigChangedAction` from the wrappers. Co-authored-by: Copilot <[email protected]>
A property with `chatMutable` in the session's config schema can be set per chat; a chat's effective config is the session's config with its own values applied over it. Add the shared helpers the host and clients use to tell the two apart, split a patch between chat and session, compute the effective config, and validate a chat write. Co-authored-by: Copilot <[email protected]>
`ChatState.config` holds the values a chat sets for itself. The state manager keeps them on the chat's registration so they exist before a restored chat's state is resolved: a `chat/configChanged` for such a chat updates them, and resolution carries them into its state. Restore, restored peers and new chats accept initial values; hydration contributions can return them through `IRestoredChat.config`. Co-authored-by: Copilot <[email protected]>
…k 3b) A chat's effective config is its own values, then those of the chats that spawned it (by the recorded spawn edge), then the session's and the host's. Own values only count for properties a chat may set (`chatMutable`). Add chat reads, `updateChatConfig` (settable properties change the chat, a subagent's go to the chat it inherits from, the rest change the session), `onDidChatConfigChange` (fired for a changed chat and its subagents, and for chats that inherit a changed session key), and seeds that give a chat being created its values before it is registered. The session chain no longer derives a parent from the shape of a subagent session URI; inheritance follows recorded spawn edges only. Co-authored-by: Copilot <[email protected]>
A client may set only properties that the session's schema lets a chat set (`chatMutable`), never host-written or read-only ones, and only with values the session's write rules accept. A subagent has no config of its own: it inherits from the chat that spawned it. A replacement keeps the chat's host-written values. Co-authored-by: Copilot <[email protected]>
The values a chat sets for itself are stored under `agentHost.chatConfigValues` in the chat's own database (the session database for the default chat, separate from the session's `configValues`). Nothing is mirrored: older builds never read them. The value records the chat it belongs to, so a copied database (a fork's `VACUUM INTO`) is never read as another chat's values. The new `chatConfig` contribution persists every accepted change, from clients, the host and providers alike, and restores the values with the chat. Subagents have none. A fork or side chat starts with its source chat's own values: a seed makes them visible to the provider while it creates the chat, and they are registered and persisted with the new chat. Other chats start with none and inherit the session's. Co-authored-by: Copilot <[email protected]>
The host's approval decisions read the effective config of the chat a tool call belongs to: its approval level (including a host-reported effective mode) and its tool permissions. "Allow in this Session" adds the tool to that chat's own permissions; from a subagent, to the chat it inherits its config from. Co-authored-by: Copilot <[email protected]>
A chat's sandbox selection is its own value over the session's, within the session's policy floor. The sandbox APIs take the chat and its session: - The applied enablement is recorded per chat in the session's `vscode.sandboxState` metadata (`chats[chat]`), read through a typed, validating reader. The session-level fields keep describing the default chat for older clients. - A policy that requires sandboxing turns a chat's own `off` back on, like the session's. - A rejected change rolls back where the selection was set (the chat's own values or the session's), unless a newer selection superseded it. - Copilot's SDK sandbox, its terminal sandbox engine and its browser tool restrictions apply the chat's selection; a session opt-out from a permission request changes that chat only. `getChatConfigValues` returns the same object while its inputs are unchanged, which keeps the superseded-request check based on identity. Co-authored-by: Copilot <[email protected]>
…lock 3b) Agent Merge elevates the chat that owns each enabled folder, not the whole session. Properties a chat may set (mode, approvals, tool permissions) are elevated in that chat's own values and restored once it owns no enabled folder; the per-chat bookkeeping (`agentMerge.chatInjectedConfiguration`, host-owned) records the chat's own values before elevation. Narrowing never waits for an active turn. Properties no chat may set keep the session-wide elevation and its bookkeeping, which also rolls back session-wide elevation an older build applied. Folder enablement and lifecycle stay per (session, folder). A fork or side chat copies its source chat's own values without the elevation. Co-authored-by: Copilot <[email protected]>
…k 3b) Each Copilot chat runtime reads its own chat's effective approvals and mode (permission mode, autopilot, the SDK mode sent with a turn) and reacts to that chat's config changes. Write-backs change that chat only: an SDK mode switch (e.g. leaving plan mode), a direct approval toggle and the effective approval mode it applied. The policy's available approval modes stay session-level and are reported by the session-backed chat. Slash-command completion state stays session-level: completions are addressed to the session, not a chat. Co-authored-by: Copilot <[email protected]>
A replacing `session/configChanged` or `chat/configChanged` removes keys it does not list. The chat change events now carry the keys the action set and the keys whose value the reduction changed, so a runtime also hears about a removed key. The state manager reports a chat's previous and new own config for this, like it does for a session's. Co-authored-by: Copilot <[email protected]>
A Claude chat runtime reads its own chat's effective permission mode (at materialize, before each send and on its chat's config changes) and records it in the chat's overlay snapshot. Approving `ExitPlanMode` switches that chat to `acceptEdits`; other chats of the session keep their mode. Co-authored-by: Copilot <[email protected]>
A Codex chat runtime reads its own chat's effective permissions preset, approval policy, sandbox mode, writable directories, network access, reasoning effort, personality and summary at thread and turn start (the session's while it is not bound to a chat yet). A fork starts from its own effective values, which Agent Host seeds with its source chat's. Co-authored-by: Copilot <[email protected]>
…lock 3b) Marks the settings a chat may set for itself `chatMutable` in each session schema: approvals, mode, tool permissions and sandbox on the host schema; Copilot's effective approval mode; Claude's permission mode; and Codex's permissions preset and its (hidden) native permission keys. Workspace and other settings stay with the session. Agent Merge now elevates these in the own values of the chat that owns each enabled folder; the session-wide path remains for anything a chat may not set. Co-authored-by: Copilot <[email protected]>
…nd Mission Control (Block 3b) - Turn telemetry reports the chat's effective approvals and mode, also for subagent turns (through their spawning chats), and a chat's own mode change reports agentHost.executionModeChanged with its initiator. - Changing a chat's workspace requests workspace trust unless that chat's effective approvals allow everything. - The Mission Control adapter translates a chat's own values in chat snapshots and chat/configChanged in both directions. Adds IAgentConfigurationService.getChatConfigState (the session's schema with the chat's effective values). Co-authored-by: Copilot <[email protected]>
Adds `chats_v2.origin_session_uri` (agent-host.db migration 16), written once when a chat row is inserted and exposed as `originSession` on the host's chat records. Rows written before it, or by an older build, read as created in their owner, which holds until chats can move (Block 4). Rebase check: #6 also adds a migration 16; this one takes the next free version. Co-authored-by: Copilot <[email protected]>
…dow (Block 3b) Session config reads and writes now name their chat (a required parameter): - `getSessionConfig(session, chat)` applies the chat's own values, from its `ChatState.config`, over the session's. Only properties the session's schema lets a chat set (`chatMutable`) apply, so a host without them reads exactly as before. The chat's state subscription is kept while it is read and released when idle, as for session state. - `setSessionConfigValue(session, chat, ...)` sends a property the chat may set as `chat/configChanged` to that chat; anything else stays a session write. - `getSessionSandboxEnabled(session, chat)` reads the chat's sandbox state, else the session's. - `getSessionOwnConfig(session)` is the session's own config, which the session settings file shows and edits. Pickers, completions and config slash commands use the chat they act on: the active chat, the submitting chat, or a draft's main chat. Co-authored-by: Copilot <[email protected]>
An editor chat backed by an agent host reads its chat's effective config (its session's, with the chat's own values from `ChatState.config` applied for the properties a chat may set) and sends a change to the chat (`chat/configChanged`) or its session (`session/configChanged`) by property. The backend chat comes from the session's chat catalog: its default chat, or the peer chat the resource's fragment names. - The chat input picker follows its chat's state alongside its session's. - Config completions and submit-time config use the same helpers. - The sandbox notice reads the chat's sandbox selection and applied state, turns off that chat's sandboxing, and reports a failed change of any chat this client made (`readChatSandboxStates`). - The Agents window refreshes its pickers when a chat's applied sandbox state changes. Co-authored-by: Copilot <[email protected]>
Describes where a chat's own config is stored and how it resolves (own, spawning chats, session, host), the client rule for chat/configChanged, the per-chat sandbox selection and state, Agent Merge's elevation per owning chat, the chats_v2 origin column, and the chatConfig contribution's order and hooks. Co-authored-by: Copilot <[email protected]>
…te (Block 3b) Mode is a chat's own setting, so the config slash command changes the chat's mode and leaves its session's. Co-authored-by: Copilot <[email protected]>
…b review L1) A fork or side chat's copy of its source chat's own config values was written in the background after the chat was announced, so a crash or a failed write left it with its session's values. It is now written before the chat is registered, and a failed write fails and rolls back the creation like the chat's other initial records. Co-authored-by: Copilot <[email protected]>
…at's config (Block 3b review L2) registerRestoredChatSummary replaces a chat's own config only while the chat has no resolved state; once resolved, the chat's live values (and its state's config) are authoritative and a later restore of its summary leaves them. Adds the test that pins this. Co-authored-by: Copilot <[email protected]>
…lock 3b review L3, L4) - L3: a write for a chat that is neither registered nor being created (it was disposed while a provider event was in flight) applies its session part and drops its chat part with a warning. Documented and tested; the host never resurrects a chat's values for it. - L4: `getChatConfigValues` is to `getChatEffectiveValue` what `getSessionConfigValues` is to `getEffectiveValue`: the same chain (own, recorded spawning chats, session), with the host's layer only in the effective value. Documented and pinned by a test. Co-authored-by: Copilot <[email protected]>
…ve approval mode (Block 3b review L5, pass 3) Comments only: a Codex runtime reads its session's values only before Agent Host binds it to its chat, before any thread or turn; Copilot's effectiveApprovalMode is chatMutable because the host writes it per chat, and stays readOnly to clients. Co-authored-by: Copilot <[email protected]>
…b review M3) Agent Merge elevated the chat owning an enabled folder only when the folder was the chat's first working directory, so a multi-root chat lost elevation for its other folders (the session-wide elevation it had before 3b). The elevated chat for a folder is now its repair owner, else the first chat with the folder among any of its working directories (recorded chat, default chat, then catalog order; never a tool chat). A folder that no chat has keeps the session-wide elevation of every property. Repairs still run in the chat whose checkout is the folder. Co-authored-by: Copilot <[email protected]>
…3b review L6, L7) With `platformSessionSchema`, a client's `chat/configChanged` for a chat's approvals and mode is validated (isolation stays a session setting), persisted in the chat's own storage and read through its chain by its subagents. Also pins the accepted downgrade behaviour (Q1): an older client's `session/configChanged` changes the session's value, which the default chat follows only for properties it has not set for itself. Co-authored-by: Copilot <[email protected]>
…rive (Block 3b review M4, L8, L9) - M4: until a chat's state (with its own values) has arrived, its config is the session's and `isSessionConfigResolving(session, chat)` is true, so a picker renders as resolving instead of briefly showing the session's value. A chat whose state cannot be read stops resolving. Hosts without per-chat properties open no chat subscription and never resolve. - L8: the config subscription of each visible session's active chat is held while it is shown, instead of re-arming an idle timer on every read; it is released after the idle period once it is no longer shown. - L9: a value chosen in a peer chat is that chat's own and is no longer remembered as the default for new sessions; a choice in the default chat still is. Co-authored-by: Copilot <[email protected]>
… 3b review L8, M4, L10) - L8: reading a chat's config (getSessionConfig, isSessionConfigResolving) never subscribes. The chat-state subscription supplying a chat's own values is acquired for the active chat of each visible session, and briefly by an explicit write, and released after the idle period once neither applies. - M4: a chat that is not subscribed yet, or whose state has not arrived, reports resolving and reads as its session; readers are notified once its values are known, including when it is subscribed again after a release. Tested for the first read and the read after the idle release. - L10: documented why splitting a mixed patch into the chat's and the session's actions (in that order) is safe. Co-authored-by: Copilot <[email protected]>
… values arrive (Block 3b review M4) The editor's chat input picker showed the session's value for a property the chat may set for itself until the chat's state arrived, then flipped to the chat's own value. Until the chat's state is known, such a picker is now dimmed and marked busy, and it cannot be opened or written; properties that stay with the session are unaffected. Co-authored-by: Copilot <[email protected]>
…t's config The completions service now tells providers the completing chat, resolved from recorded state (the requested chat, else the named session's default chat), and the Copilot provider reads that chat's effective mode and approvals instead of the session's. Co-authored-by: Copilot <[email protected]>
…-chat-config-implementation
Contributor
…ker test from main Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
One or more issues must be addressed before approval.
3 open findings
What changed in this PR
Adds per-chat Agent Host configuration so approvals, modes, permissions, and sandbox choices can differ between chats within one session.
Changes:
- Adds protocol overlays, configuration helpers, and chat-local persistence.
- Routes runtime readers and client controls through chat-specific configuration.
- Updates regression tests, fixtures, and contribution guidance.
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostSandboxNotifications.test.ts | Updated as part of this pull request. |
| src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostSandboxNotification.test.ts | Updated as part of this pull request. |
| src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostClientTools.test.ts | Updated as part of this pull request. |
| src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/media/agentHostChatInputPicker.css | Updated as part of this pull request. |
| src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSandboxNotifications.ts | Updated as part of this pull request. |
| src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSandboxNotification.ts | Updated as part of this pull request. |
| src/vs/sessions/services/sessions/common/sessionsProvider.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxSessionsProvider.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/providers/copilotChatSessions/test/browser/copilotChatSessionsProvider.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsProvider.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/providers/agentHost/test/browser/agentSessionSettingsFileSystemProvider.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/providers/agentHost/test/browser/agentHostSessionConfigPicker.fixture.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/providers/agentHost/test/browser/agentHostModePicker.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/providers/agentHost/test/browser/agentHostModePicker.fixture.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/providers/agentHost/test/browser/agentHostClaudePermissionModePicker.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/providers/agentHost/test/browser/agentHost/agentHostSessionConfigPicker.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/providers/agentHost/test/browser/agentHost/agentHostPermissionPickerDelegate.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/providers/agentHost/browser/mobile/mobileChatPhoneInputPresenter.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/providers/agentHost/browser/mobile/mobileChatInputConfigPicker.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/providers/agentHost/browser/devContainerAgentHostSessionsProvider.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/providers/agentHost/browser/agentSessionSettingsFileSystemProvider.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/providers/agentHost/browser/agentHostModePicker.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/chat/test/browser/newChatWidget.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/chat/test/browser/newChatWidget.fixture.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/chat/test/browser/agentHostInputCompletions.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/chat/browser/newChatWidget.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/chat/browser/copilotConfigSlashSubmitHandler.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/chat/browser/agentHostInputCompletions.ts | Updated as part of this pull request. |
| src/vs/sessions/common/agentHostSessionsProvider.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/shared/editArcReporter.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/sessionWorkspaceConversion.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/sessionPermissions.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/protocolServerHandler.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/e2e/suites/copilotCoverageSuite.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/customizations/claudeCommandSlashCompletion.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/copilotSessionLauncher.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/codex/codexSessionConfigKeys.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/codex/codexPrewarmEviction.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/codex/codexCompactCommand.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/claudeAgent.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/chatContributions.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/agentSideEffects.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/agentHostTurnTelemetry.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/agentHostStateManager.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/agentHostSkillCompletionProvider.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/agentHostSessionStateStore.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/agentHostSessionStateOwnershipGuard.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/agentHostSessionStateDatabase.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/agentHostRenameCommand.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/agentHostCompletions.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/agentHostChatCompletionProvider.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/agentHostChangesetOperationService.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/agentHostCatalogListReader.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/common/agentHostSchema.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/sessionSandbox.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/sessionPermissions.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/protocolServerHandler.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/missionControl/missionControlSessionConfig.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/copilot/copilotSlashCommandCompletionProvider.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/copilot/copilotShellTools.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/copilot/copilotSessionSandbox.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/copilot/copilotSessionLauncher.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/copilot/copilotSandboxPolicy.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/copilot/copilotApprovalPolicy.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/copilot/agentHostSandboxEngine.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/codexCompactCommand.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/claude/claudeSessionPermissionMode.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/claude/claudeCanUseTool.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/claude/claudeAgentSession.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/claude/claudeAgent.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/chatContributions/sessionWorkspaceConversion/sessionWorkspaceConversionService.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/chatContributions/sessionFlags/sessionFlagsContribution.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/chatContributions/chatConfig/chatConfigContribution.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/chatContributions/builtInChatContributions.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/agentSideEffects.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/agentHostTurnTelemetryContext.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/agentHostTurnStarter.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/agentHostSkillCompletionProvider.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/agentHostRenameCommand.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/agentHostFileCompletionProvider.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/agentHostCompletions.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/agentHostChatRowStore.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/agentHostChatCompletionProvider.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/agentHostBranchChangesetScope.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/common/state/sessionState.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/common/state/sessionActions.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/common/state/protocol/version/registry.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/common/state/protocol/common/actions.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/common/state/protocol/channels-session/state.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/common/state/protocol/channels-root/state.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/common/state/protocol/channels-chat/state.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/common/state/protocol/channels-chat/reducer.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/common/state/protocol/channels-chat/actions.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/common/state/protocol/action-origin.generated.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/common/state/protocol/.ahp-version | Updated as part of this pull request. |
| src/vs/platform/agentHost/common/sessionConfigProperties.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/common/sessionConfigKeys.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/common/meta/vscode/agentSandboxStateMeta.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/common/meta/agentSandboxStateMeta.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/common/copilotConfigSlashCommands.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/common/agentMerge.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/common/agentHostSessionStateStore.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/common/agentHostSchema.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/common/agentHostChatContributionsService.ts | Updated as part of this pull request. |
| .github/skills/agent-host-chat-contributions/SKILL.md | Updated as part of this pull request. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
… repairs A subagent working in the folder could own its repairs and be chosen for elevation; its writes go to its spawning chat, which may work elsewhere. The elevated chat now falls through to the first normal chat working in the folder. Co-authored-by: Copilot <[email protected]>
… that chose its own approvals A chat choosing Manual in an Allow All session still inherited the session's reported effective approval mode, so the host auto-approved its tool calls. A reported mode now applies only to the approvals of its own layer and the layers outside it (one rule for the host's chat values and both clients), and the host's approval level falls back to a chat's chosen approvals until its runtime reports the mode it applies. Co-authored-by: Copilot <[email protected]>
…is fixed chatMutable is independent of sessionMutable in AHP, but a chat write was also validated against the session's mutability, so a chat-only property was rejected. Chat writes now check chat mutability (read-only properties stay host-written), and the client write gates treat a chatMutable property as writable from its chat. Co-authored-by: Copilot <[email protected]>
… the pickers read The pickers now read a session's main and active chat for its per-chat config; the fixtures' sessions lacked them, so the new chat widget fixtures failed to render. Co-authored-by: Copilot <[email protected]>
The deferred worktree clean-up change (#341721) lands first with version 16 (its pending worktree removals table), so the chat origin migration follows it. Co-authored-by: Copilot <[email protected]>
A new chat that is not a fork, side chat or subagent now starts with the default chat's current effective values for the properties a chat may set (its own, else the session's) as its own, so Cmd+T begins where the default chat is, as when chats shared the session's values. Read-only values and Agent Merge's elevation are not copied; forks and side chats still copy their source chat's own values. Co-authored-by: Copilot <[email protected]>
Sandeep Somavarapu (sandy081)
requested review from
Aiday Marlen Kyzy (aiday-mar) and
Vritant Bhardwaj (vritant24)
October 15, 2026 10:00
Sandeep Somavarapu (sandy081)
marked this pull request as ready for review
October 15, 2026 10:00
Sandeep Somavarapu (sandy081)
enabled auto-merge (squash)
October 15, 2026 10:00
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: TylerLeonhardtMatched files:
Ladislau Szomoru (@lszomoru)Matched files:
|
Sandeep Somavarapu (sandy081)
requested
a balanced review from Copilot
and removed request for
Aiday Marlen Kyzy (aiday-mar) and
Vritant Bhardwaj (vritant24)
October 15, 2026 12:59
Ladislau Szomoru (lszomoru)
approved these changes
Oct 15, 2026
Sandeep Somavarapu (sandy081)
deleted the
agents/move-chats-per-chat-config-implementation
branch
October 15, 2026 13:05
| this.onDidChangeSandboxSettings = Event.any( | ||
| this._agentConfigurationService.onDidRootConfigChange, | ||
| Event.map(Event.filter(this._agentConfigurationService.onDidSessionConfigChange, event => event.session === resolveAgentHostRootSession(URI.parse(this._sessionId)).toString()), () => undefined), | ||
| Event.map(Event.filter(this._agentConfigurationService.onDidChatConfigChange, event => event.chat === this._target.chat), () => undefined), |
This was referenced Oct 15, 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.


Summary
Block 3b of "Move Chats": per-chat configuration. In a session with several chats, changing approvals, mode, tool permissions, sandbox, Claude's permission mode, Codex's permission preset or Agent Merge's elevation in one chat now changes only that chat. Before, every chat of a session shared the session's values, so a change in one chat silently changed the others. This is also the groundwork for moving chats between sessions (a moved chat keeps its configuration); nothing moves between sessions in this PR.
It adopts the chat-level configuration of the Agent Host Protocol (microsoft/agent-host-protocol#527):
ChatState.config(a chat's own overlay),chatMutableon session schema properties, andchat/configChanged.Host
agentHost.chatConfigValues, tagged with the chat URI so a database copied for a fork is never read as the fork's own). The default chat's are in the session database under that separate key, so older builds keep readingconfigValuesas the session's. Subagent chats store none.Toolorigins, never the chat URI's shape), then the session's, then the host's.IAgentConfigurationServicegains per-chat reads, updates and change events (the chat parameter is required everywhere); it replaces the URI-derived subagent chain.ChatState.configand validateschat/configChanged: a registered chat that is not a subagent, and only writablechatMutableproperties.chatMutableproperties: its own, else the session's. Read-only (host-reported) values and Agent Merge's elevation are not copied. Forks and side chats start with a copy of their source chat's own values. Both copies are written to the new chat's own database before creation resolves; subagents store none.chatMutableis set on approvals, mode, tool permissions, sandbox and the effective approval mode (Copilot), on Claude's permission mode, and on Codex's permission keys. Workspace properties stay session-level._meta,vscode.sandboxState.chats[chat], with the top-level fields kept for older clients);chats_v2gains a host-onlyorigin_session_uricolumn, written at chat creation (needed by Block 4).Clients (Agents window and editor)
chatMutableproperties on the chat's overlay and everything else on the session. A host withoutchatMutableproperties behaves exactly as before.Decisions and known limitations
mainwhere a new chat followed the default chat through the session's values. Forks keep copying their source chat's. Tests cover Cmd+T after changing sandbox, approvals and mode in the default chat, a fork, and a new chat after a restart.session/configChanged, which keeps editing the session's values. Those reach every chat without its own value for the property; a chat with its own value (for example the default chat's own mode or approvals, once a newer client set them) keeps it, so the older client's change is shadowed in that chat. Pinned by a test on the real Copilot schema; documented insrc/vs/platform/agentHost/AGENTS.md§3b.offfor a chat is kept while the policy allows bypass.rejectedSelectionin that chat's entry; the default chat's also at the top level) and survives the rollback until the chat's next selection./sandbox … sessioncommand path applies to the chat's runtime.chat/configChangedfor thechatMutablepart first, thensession/configChanged. They are not atomic: if the second fails, the first stays applied. The halves are independent properties.CompletionsParams.channel(the protocol documents a chat URI). The host resolves the completing chat from recorded state (the channel if it is a registered chat, else the session's default chat), so in a peer chat the slash-command toggles follow the default chat's values. Sending the chat URI from the client would break older hosts' providers; a capability-gated client change is a possible follow-up.configValues, so they lose per-chat values (accepted). The default chat's own values stay under a separate key and never overwrite the session's.agent-host.dbmigration 17 (chats_v2.origin_session_uri, with an idempotent repair gate on open). agentHost: remove archived and deleted worktrees in the background #341721 (deferred worktree clean-up) merges first with migration 16 (itspending_worktree_removalstable). The two compose:agent-host.db, session state and worktree removal tests. Rebasing onto it once it merges resolves the same three files.setChangesets: unknown chatwarnings after a restart: the catalog refresh walks restored chats that are not loaded.Resource not found.Testing
Unit tests, mutation checks and the Agent Host E2E suite in strict replay cover each rule. A separate review chat did five passes, the last one ending with no high or medium findings. Separate chats checked perf (no listing regression, +0.5 ms startup) and live behaviour on a multi-chat session (approvals, mode and sandbox per chat; restart; fork; subagent; "Allow in this session"; editor).
All of the following ran on the final head, rebased onto
main, withCOPILOT_*,AGENT_HOST_*andGITHUB_TOKENunset:npm run typecheck-clientnpm run eslint -- <148 changed .ts files>npm run valid-layers-check./scripts/test.sh --runGlob "**/platform/agentHost/test/**/*.test.js"./scripts/test.sh --runGlob "**/sessions/**/*.test.js"./scripts/test.sh --runGlob "**/workbench/contrib/chat/test/browser/agentSessions/**/*.test.js"npm run test-agent-host-e2e -- --jobs 2(strict replay)Earlier in development:
npm run smoketest-no-compile -- -g "Agents Window"passed (5 tests).Not run on the final head: