Skip to content

agentHost: chats with their own harness in a session (multipleChatProviders) - #344685

Merged
Sandeep Somavarapu (sandy081) merged 100 commits into
mainfrom
sandy081/agents/multiple-chat-harness-support
Oct 28, 2026
Merged

Sandeep Somavarapu (sandy081) merged 100 commits into
mainfrom
sandy081/agents/multiple-chat-harness-support

Conversation

@sandy081

@sandy081 Sandeep Somavarapu (sandy081) commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Summary

Lets one Agents-window session hold chats on different harnesses (agents), for example a Claude chat in a Copilot session.

The feature is behind chat.agentHost.multipleChatProviders.enabled (APPLICATION scope, off by default). With the setting off, behaviour, protocol offers and tool descriptions are identical to main.

It builds on AHP microsoft/agent-host-protocol#534 (merged; synced at 5872a476).

What's included

  • Per-chat agent: create, route and persist a chat's agent in the agent-host.db metadata (chatAgentProvider:<chat>). Downgrade-safe.
  • Per-chat config model: each chat has its own chatMutable values. A chat on another agent has its own schema. The main chat follows the session pickers.
  • Harness picker in the new-chat and nested-session composers.
  • Per-chat model and mode pickers.
  • Cross-agent moves, also requiring chat.agentHost.moveChats.enabled.
  • chat/moved.
  • Safety for older clients: config keys are validated against the chat's agent, and foreign models are ignored.
  • create_session harness for agent-to-agent work.
  • Turning the setting on without a reload: the local host gets the setting when it is spawned.
  • F1 fixes:
    • No subscription fan-out: the response file-changes provider no longer subscribes every chat in a session's catalog.
    • A subscribe dropped by a reconnect is sent again.
    • A subscribe or refresh that resolves after its subscription was released is unsubscribed again.

Validation

Final head 747060d951c

The final head is latest main (883544e3cad) + host option A (be0fadd2ff5: per-chat config stays an overlay while the setting is off) + D1 (complete chat config is read only from a host that declares the setting).

  • Delta code review of 00ad7a5d728 → 747060d951c: SHIP. All three Copilot review threads are resolved.
  • CI fixes in this round:
    • test mocks (ChatModelConfigurationStore, agentHostModePicker fixtures);
    • stale e2e expectations (unknown-agent message; a different-agent chat has its own schema since Allow user-level installations #534).
  • Static checks: npm run typecheck-client is clean, and npm run eslint is clean on the changed files.
  • Unit tests at 00ad7a5d728 (after npm run transpile-client):
    • ./scripts/test.sh --reporter dot --runGlob "vs/platform/agentHost/test/common/**/*.test.js": 1631 passing
    • ./scripts/test.sh --reporter dot --runGlob "vs/platform/agentHost/test/browser/**/*.test.js": 167 passing
    • ./scripts/test.sh --reporter dot --runGlob "vs/platform/agentHost/test/electron-browser/**/*.test.js": 587 passing
    • ./scripts/test.sh --reporter dot --runGlob "vs/sessions/**/*.test.js": 9020 passing, 25 pending
    • ./scripts/test.sh --reporter dot --runGlob "vs/workbench/contrib/chat/test/browser/agentSessions/**/*.test.js": 3129 passing
    • ./scripts/test.sh --reporter dot --runGlob "vs/workbench/contrib/chat/test/browser/agentHost/**/*.test.js": 252 passing
    • ./scripts/test.sh --reporter dot --runGlob "vs/workbench/contrib/chat/test/browser/widget/**/*.test.js": 3709 passing, 1 failing. The failure is ChatListWidget › "clips MCP app overlays…", a new upstream test (mcp: expose app tools to agent host sessions #344747) that fails only under full-suite load and passes alone (124 passing).
    • npm run test-node -- --reporter dot (all node unit tests): 30082 passing, 240 pending, 0 failing.
    • Component fixtures (component-explorer render --fixture-id-regex 'agentHostModePicker/.*/Light$'): 28 rendered, 0 errors.
  • Earlier in the round, before the host merge (eae45cd9645):
    • Agent Host e2e in replay (./scripts/test-integration.sh --run conformance + Claude + Copilot + Codex): 952 passing, 113 pending, 0 failing.
    • Browser unit tests:
      • vs/sessions: 8784 passing
      • chat browser: 12915 passing, 1 failing (the same ChatListWidget load flake)
      • agentHost common + browser: 1795 passing
  • Tests at 747060d951c (D1):
    • npm run test-node -- --run agentConfigurationService.test.ts --run agentServiceChatProviders.test.ts: 79 passing
    • chat agentHost: 252 passing
    • chat agentSessions: 3130 passing
  • Live run 4 (mock host with a second agent, on 00ad7a5d728):
Row Result
1 Gate OFF parity PASS: matches main. Main-chat writes go to the default chat; the host emits no chat config of its own; a session write leaves chat rows as overlays.
2 Runtime flip OFF→ON→OFF + restarts PASS: no reload. One re-initialize per host on ON and none on OFF. ON routes main-chat changes to the session (the default chat follows and its own value is cleared; the peer keeps its own). OFF republishes the default chat's own values. Restarts keep the state.
3 Gate ON regression (A2, B1, R-cold) PASS
4 Thread 2: harness switch, then send at once PASS (limited: the mock's folder control is a static label)
5 Thread 3: subagent chat model vendor PASS
6 H3 plain regression, log and isolation scans PASS

Earlier rounds

  • Code review: SHIP at 557ea425bc6. All findings are resolved: H1, M1–M4, L1–L5, N1, P1, R1, S1.
  • Performance: NO REGRESSION, measured A/B against merge base 5893cd55828 with two windows on different workspaces, gate off and on.
    • 0 toolbar re-renders per focus switch.
    • Session-switch CPU and file-system calls are within noise.
    • 1 resolveSessionConfig.
  • Real data: a sandboxed private copy of real Insiders data (865 sessions, 2169 chats, 251 overlay rows).
    • Upgrade with the gate off and on: PASS (0 lost, 0 effective mismatches).
    • Downgrade to Insiders 1.144: PASS.
    • Re-upgrade: PASS.
    • Stable 1.143 round trip: NOT RUN.
  • Live matrix (mock agent host with a second agent): PASS for A1–A6, B1–B3, B5, C1, C3, D1–D3, E1, F1+B1, F2–F5, F8, G1, G2, G4–G6, H1, H2, R-reload and I1–I3. The remaining rows are running on the final build and will be added in a follow-up comment: restart/restore, reconnect resend with the changes pill, no re-initialize of the local host at launch, and two-window stress.
  • Static checks: typecheck-client clean; eslint clean on all 110 changed TS files; valid-layers-check passes; no cyclic dependencies.
  • Merged with the latest main: new base ea8056df9f0, merged in f36b6e2653d, plus the host's test-only de7d2529153 in 86cf91d96f8. No dependency, .nvmrc or AHP protocol changes upstream.
  • Merged-tree static checks: npm run typecheck-client clean; npm run eslint on all 113 changed TS files clean; npm run valid-layers-check passes; npm run check-cyclic-dependencies reports no cycles in 10903 files.
  • Unit tests (after npm run transpile-client, at f36b6e2653d):
    • ./scripts/test.sh --reporter dot --runGlob "vs/platform/agentHost/test/common/**/*.test.js": 1623 passing
    • ./scripts/test.sh --reporter dot --runGlob "vs/platform/agentHost/test/browser/**/*.test.js": 167 passing
    • ./scripts/test.sh --reporter dot --runGlob "vs/platform/agentHost/test/electron-browser/**/*.test.js": 580 passing
    • ./scripts/test.sh --reporter dot --runGlob "vs/sessions/**/*.test.js": 8987 passing, 25 pending
    • ./scripts/test.sh --reporter dot --runGlob "vs/workbench/contrib/chat/test/browser/agentHost/**/*.test.js": 252 passing
    • ./scripts/test.sh --reporter dot --runGlob "vs/workbench/contrib/chat/test/browser/agentSessions/**/*.test.js": 3086 passing
    • ./scripts/test.sh --reporter dot --run the chatWidget, chatInputPart and chatAccessibilityProvider tests: 194 passing, 4 pending
    • npm run test-node -- --reporter dot (all node unit tests, rerun at 86cf91d96f8): 29940 passing, 240 pending, 0 failing

Needs real providers (please try)

  • A Copilot + Claude session.
  • Move to New Session of a Claude chat.
  • Per-chat model and auto-approve pickers.
  • A side chat of a Claude chat.
  • The main chat following the session pickers.

Known follow-ups / not in this PR

  • F3: a chat whose agent is disabled shows "Resource not found".
  • B4: Send to New Chat. Under investigation; likely pre-existing.
  • Draft tombstones on a harness switch. Under investigation.
  • The agent-plugins dev-launch argv.json note is pre-existing.

…ess contracts

Sync AHP at 05b7553 (multipleChatProviders capability, per-chat provider, ChatConfigState.schema), add the off-by-default chat.agentHost.multipleChatProviders.enabled gate, and add provider-neutral IChat.harness, ISessionCapabilities.supportsChatHarnesses and ICreateNewChatOptions.

Co-authored-by: Copilot <[email protected]>
Derive ISessionCapabilities.supportsChatHarnesses from agents that support
multiple chats (not policy-disabled) only when the connection advertises
multipleChatProviders, chat.agentHost.multipleChatProviders.enabled is on, and
the session supports multiple chats. Map ChatSummary/SessionChatSummary.provider
to IChat.harness, resolve each chat's models and config against its own agent
(ChatConfigState.schema when present), send `provider` on createChat only for a
different harness, keep fork/side chats on the source chat's agent, and only
reuse an Untitled chat whose harness matches the requested one.

Co-authored-by: Copilot <[email protected]>
Add a harness picker to the new-chat composer, shown only while the active
chat is an unsent peer draft and the session advertises more than one entry in
supportsChatHarnesses; choosing another harness replaces the draft with one of
that harness. Chat tabs show the harness icon (and name it for screen readers)
when a chat's harness differs from the main chat's, and Sessions list rows mark
sessions whose chats use more than one harness. Providers present harnesses
through the optional getHarnessPresentation, and the accessibility help
describes the picker while the setting is enabled.

Co-authored-by: Copilot <[email protected]>
Chats of one session can use another agent than the session when the off-by-default `multipleChatProviders.enabled` host setting is on (renamed from `chatProviders.enabled`). The host advertises `InitializeResult.multipleChatProviders` only then and from protocol 1.1.0, and rejects `CreateChatParams.provider` otherwise.

- createChat resolves the chat's agent (requested, fork/side-chat source, or session) and rejects unknown agents, agents without multipleChats and fork/side-chat mismatches with InvalidParams.
- The state manager records each chat's agent and publishes `provider` on ChatState, ChatSummary and SessionChatSummary when it differs; chatUpdated never carries it.
- IAgentHostProviderService.getProviderForChat routes every chat-addressed operation (turns, input, steering, abort, canvases, background work, watches, release, dispose, telemetry, utility model, workspace conversion).
- The agent is persisted in the chat's chats_v2 metadata and the list payload, so listing, restore and deleting an unloaded session route each chat before hydration.
- Such a chat gets its own ChatConfigState.schema seeded with its agent's defaults, never takes or changes the session's config, and is validated against its own schema.
- Moves keep a chat's agent; moves that would add or drop a chat's own agent, and promoting such a chat, are refused with differentProvider.

Co-authored-by: Copilot <[email protected]>
- Rebuild a peer chat whose reported agent changes (e.g. moved in from
  another session) so its harness and config schema refresh.
- Re-read harness presentation as session types load, falling back to a
  localized generic label instead of the raw harness id.
- Restore iconForAgentProvider's doc and document getHarnessPresentation.
- Register the mixed-harness hover only while a row is mixed and use
  Codicon.agent for it.
- Render the harness picker before an explicit anchor.
- Gate the accessibility help sentence on a visible session offering
  several harnesses.
- Pin main-harness reuse and reset, and composer survival on a harness
  switch, in tests.

Co-authored-by: Copilot <[email protected]>
- Never route a chat whose own agent is unavailable to its session's agent: release, dispose and fork/side-chat resolution skip or reject it.
- Write a chat's agent in the same transaction as its new chats_v2 row; subagent rows record their spawning chat's agent, and subagent restore uses it.
- Route a chat to its agent already while the agent creates it, before registration.
- Restore resolves an agent's chat config once per agent and folder and drops persisted keys its schema no longer has.
- A fork or side chat whose source has no loaded own schema takes its agent's schema, never the session's.
- Chat-scoped folder checks use the chat's agent; archive changes notify the agents of chats with their own agent.
- Skip the own-schema lookup in config reads while no chat uses its own agent.

Co-authored-by: Copilot <[email protected]>
Keep ChatCompositeBar's class documentation on the class by documenting the
tab hover helper above it, build a tab's harness marker only for a chat on
another harness than the main chat's (still reactive to presentation), and
mark sessions mixing harnesses with Codicon.combine so it does not read as
the generic agent icon used for unknown harnesses.

Co-authored-by: Copilot <[email protected]>
Older builds re-encode the sessions_v2 payload and chats_v2 metadata through validators that strip unknown keys, so a `provider` inside them made the payload non-canonical there and was lost on their next metadata write.

- Store each chat's agent in agent-host.db `metadata` under `chatAgentProvider:<chat>` (optional IAgentHostDatabase read/record/delete, forwarded by CompatibleAgentHostDatabase), written before the chat's catalog row and at spawn for a subagent of such a chat.
- Remove `provider` from chats_v2 metadata, the catalog payload, its source resolver, list reader, normalization and migration: the validators are again byte-identical to release/1.143.
- Listing, restore, subagent restore and deleting an unloaded session read the agents from the key; listing still reports IAgentSessionChatMetadata.provider before any chat opens.
- Delete the key with the chat, on a rolled-back creation, and with its session.

Co-authored-by: Copilot <[email protected]>
- Refuse a chat with its own agent on a host that can't persist its agent, instead of keeping it only in memory.
- Forget the recorded agents of a deleted chat's subagents with it.
- Record a spawned subagent's agent before its catalog row.
- When the recorded agents can't be read, warn and skip unknown chats on restore and session deletion instead of failing or using the session's agent.
- Drop a stale stacked doc comment.

Co-authored-by: Copilot <[email protected]>
Clients offered only the compatibility baselines (1.0.0, 0.10.0, 0.9.0), so a host negotiated 1.0.0 and never advertised `multipleChatProviders`, which needs 1.1.0: the harness picker never appeared.

- AgentHostProtocolClient (shared by the local, remote/tunnel, SSH, WSL and editor remote hosts) offers PROTOCOL_VERSION first while `chat.agentHost.multipleChatProviders.enabled` is on, read on every initialize; with the setting off the offer is unchanged.
- The setting's description says it applies on the next connection.
- Tests: the offered list per setting, the real client's initialize offer, and that offer through the server handler advertising the capability only with the setting on.

Co-authored-by: Copilot <[email protected]>
…own agents

The host decides `multipleChatProviders` from its root config at the handshake, while the client mirrors `multipleChatProviders.enabled` only after it, so a fresh host or profile needed a second reconnect before the harness picker appeared.

With the setting on, once the host's root config shows the gate on after a handshake that negotiated 1.1.0 without the capability, the client re-initializes once through the fresh-initialize reconnect path. It doesn't again until the host's gate turns off, so it never loops; with the setting off nothing changes.

Co-authored-by: Copilot <[email protected]>
A host decides `multipleChatProviders` at the handshake, but another window can later mirror `multipleChatProviders.enabled = false`, after which the host rejects chats with their own agent. Chat harnesses are now advertised only while the host's root config also has the gate on.

Co-authored-by: Copilot <[email protected]>
A peer chat answered by another agent than its session's (e.g. a Claude chat
in a Copilot session) offered the session agent's models and presented itself
as that agent. The Agents window chat view now binds a respondent for such a
chat, derived from its harness presentation (with the generic fallback until
known) and the session type its models are published under. ChatWidget
applies it to the input placeholder and the response identity, and the input
part selects models only from that session type's pool, offering nothing while
it is empty. Requests still route by the chat's resource. Chats on the
session's harness, and sessions with the gate off, are unchanged.

Co-authored-by: Copilot <[email protected]>
- Clear a placeholder this widget set when no respondent, locked agent or
  view-model placeholder applies, and drop a respondent (and its model pool
  override) for another chat on setModel.
- Bind the respondent ahead of the model, scoped to the incoming chat, so a
  chat answered by another agent never validates against its session's
  models; the input part only revalidates when the bound chat is affected.
- Always present a chat on another harness, re-deriving its model pool as
  the provider's models or session types change; while the pool is not
  resolved apart from the session's, nothing is selectable.
- Name that harness in the response aria label.
- Pin that agent-host session types require custom models, which keeps
  their pools empty instead of falling back while models load.

Co-authored-by: Copilot <[email protected]>
Dropping or replacing the bound chat's respondent while switching chats
revalidated it against its session's pool, which could sync another
harness's model into it. The input part now revalidates only for the chat
bound to the view and only when asked; respondents set ahead for an
incoming chat, dropped on setModel, or cleared by an unbind never
revalidate. Unbinding clears the respondent, a "none" declared for another
chat leaves the bound chat's alone, and the renderer's response identity
is only updated when it changes.

Co-authored-by: Copilot <[email protected]>
Replace the bespoke ChatHarnessPicker with SessionTypePicker in a new
peer-chat mode: it offers the session types of the active session's
supportsChatHarnesses (via the provider's getHarnessSessionType), shows the
unsent peer chat's harness, never persists a pick, and hands it to the
composer, which swaps the draft for one of that harness and deletes the
replaced draft. Availability, initialization on selection, grouping,
keyboard, accessibility and telemetry (with its own source) now come from
the shared picker; the new-session view is unchanged.

Co-authored-by: Copilot <[email protected]>
The Sessions list hover of a peer chat on another harness than its
session's showed the session's harness (e.g. "Copilot" for a Claude chat).
A chat hover now takes its provider label from the chat's harness
presentation, with the generic fallback while unknown, and the chat row's
aria label names that harness. Main and same-harness chats are unchanged.

Co-authored-by: Copilot <[email protected]>
Name the peer-chat mode of the session-type picker "Harness for New Chat"
(trigger, popup and mobile sheet) and in the accessibility help, ignore a
harness pick while a switch is pending and only replace the draft while the
user is still in that session's composer, keep the composer helpers above
the widget's documentation, and document the resolve-before-read ordering of
the peer-chat harnesses and that getHarnessSessionType is not reactive.

Co-authored-by: Copilot <[email protected]>
Render the peer-chat session-type picker in the new-session view's header
row above the input (the quick-chat header host and the pill slot classes)
instead of the session controls below it. The row is shown only while the
picker is (an unsent peer draft with at least two harnesses), so it leaves
no gap; labels and behavior are unchanged.

Co-authored-by: Copilot <[email protected]>
… chat

Nest the new chat's harness pill in a session-options group as the
new-session view does, so its label spacing (and width) match, and space
the header row from the content below with the new-session picker row's
spacing token.

The picker shows a picked harness before its chat is open, so a send made
meanwhile reached the draft being replaced, which was then deleted: the
typed text was consumed and no turn ran. A send now waits for the
in-flight harness switch and goes to the picked harness's chat.

Co-authored-by: Copilot <[email protected]>
# Conflicts:
#	src/vs/platform/agentHost/common/agentHostStarter.config.contribution.ts
#	src/vs/sessions/contrib/providers/agentHost/browser/baseAgentHostSessionsProvider.ts
#	src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsProvider.ts
#	src/vs/sessions/services/sessions/common/sessionsManagement.ts
Copilot AI balanced review requested due to automatic review settings October 28, 2026 06:11
@sandy081 Sandeep Somavarapu (sandy081) added this to the 1.145.0 milestone Oct 28, 2026
Forking a restored, not yet loaded chat of another session looked its agent
up under the new chat's session, found none and refused ("The agent of chat
… is unavailable"). The source's agent is now resolved through the state
manager's owner and recorded agent: a fork keeps an own-agent source's
agent, and with chats with their own agents on, its source's session's.
With them off, only a source that already uses its own agent imposes it;
other forks use their new session's agent, as before.

Co-authored-by: Copilot <[email protected]>
…' into sandy081/agents/multiple-chat-harness-support
…ple-chat-harness-support

# Conflicts:
#	src/vs/sessions/contrib/sessions/test/browser/sessionsList.test.ts
The fork test now also forks a restored chat of a 'second' session (on its
session's agent) into a copilot session: 'second' with chats with their own
agents on, 'copilot' with them off.

Co-authored-by: Copilot <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Configuration inheritance changes even when the feature is disabled, while a workspace-resolution race can bypass the selected worktree and query-only chat addressing can restore models under the wrong provider.

3 open issues
What changed in this PR

Adds experimental support for chats backed by different agents within one Agents-window session, spanning Agent Host routing, persistence, protocol support, and chat presentation.

Changes:

  • Introduces per-chat provider identity, independent configuration, and cross-agent move support.
  • Makes model selection and harness presentation chat-aware, including accessibility labels.
  • Tightens subscription cleanup and adds regression tests and replay captures.
File Description
src/​vs/​workbench/​contrib/​chat/​test/​browser/​widget/​input/​chatInputPart.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/​agentHostGenericConfigChips.test.ts Updated as part of this pull request.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​agentSessions/​agentHostChatInputPicker.test.ts Updated as part of this pull request.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​agentSessions/​agentHostChatContribution.test.ts Updated as part of this pull request.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​agentHost/​agentHostResponseFileChanges.test.ts Updated as part of this pull request.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​accessibility/​chatAccessibilityProvider.test.ts Updated as part of this pull request.
src/​vs/​workbench/​contrib/​chat/​browser/​widget/​input/​chatInputPart.ts Updated as part of this pull request.
src/​vs/​workbench/​contrib/​chat/​browser/​widget/​chatListWidget.ts Updated as part of this pull request.
src/​vs/​workbench/​contrib/​chat/​browser/​widget/​chatListRenderer.ts Updated as part of this pull request.
src/​vs/​workbench/​contrib/​chat/​browser/​chat.ts Updated as part of this pull request.
src/​vs/​workbench/​contrib/​chat/​browser/​agentSessions/​agentHost/​agentHostSessionHandler.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/​workbench/​contrib/​chat/​browser/​agentSessions/​agentHost/​agentHostResponseFileChanges.ts Updated as part of this pull request.
src/​vs/​workbench/​contrib/​chat/​browser/​agentSessions/​agentHost/​agentHostChatInputPicker.ts Updated as part of this pull request.
src/​vs/​workbench/​contrib/​chat/​browser/​accessibility/​chatAccessibilityProvider.ts Updated as part of this pull request.
src/​vs/​sessions/​test/​browser/​chatGroupsView.test.ts Updated as part of this pull request.
src/​vs/​sessions/​test/​browser/​chatCompositeBar.test.ts Updated as part of this pull request.
src/​vs/​sessions/​SESSIONS.md Updated as part of this pull request.
src/​vs/​sessions/​services/​sessions/​test/​common/​session.test.ts Updated as part of this pull request.
src/​vs/​sessions/​services/​sessions/​test/​browser/​sessionsManagementService.test.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/​services/​sessions/​common/​sessionsManagement.ts Updated as part of this pull request.
src/​vs/​sessions/​services/​sessions/​common/​session.ts Updated as part of this pull request.
src/​vs/​sessions/​services/​sessions/​browser/​sessionsManagementService.ts Updated as part of this pull request.
src/​vs/​sessions/​contrib/​sessions/​test/​browser/​sessionsListChatMoveDnd.test.ts Updated as part of this pull request.
src/​vs/​sessions/​contrib/​sessions/​browser/​sessionsActions.ts Updated as part of this pull request.
src/​vs/​sessions/​contrib/​sessions/​browser/​sessionHoverContent.ts Updated as part of this pull request.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​browser/​remoteAgentHostSessionsProvider.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/​agentHostChatMoveErrors.test.ts Updated as part of this pull request.
src/​vs/​sessions/​contrib/​providers/​agentHost/​browser/​agentHostChatMoveErrors.ts Updated as part of this pull request.
src/​vs/​sessions/​contrib/​chat/​test/​browser/​nestedChatComposer.test.ts Updated as part of this pull request.
src/​vs/​sessions/​contrib/​chat/​browser/​sessionsChatAccessibilityHelp.ts Updated as part of this pull request.
src/​vs/​sessions/​contrib/​chat/​browser/​sessionModelSelection.ts Updated as part of this pull request.
src/​vs/​sessions/​contrib/​chat/​browser/​nestedChatWorkspacePicker.ts Updated as part of this pull request.
src/​vs/​sessions/​contrib/​chat/​browser/​mobile/​mobileSessionTypePicker.ts Updated as part of this pull request.
src/​vs/​sessions/​contrib/​chat/​browser/​chatView.ts Updated as part of this pull request.
src/​vs/​sessions/​browser/​parts/​chatCompositeBar.ts Updated as part of this pull request.
src/​vs/​platform/​agentHost/​test/​node/​testAgentHostProviderService.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/​sessionSandbox.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/​nodeAgentHostStarter.test.ts Updated as part of this pull request.
src/​vs/​platform/​agentHost/​test/​node/​e2e/​suites/​agentHostE2ESuites.ts Updated as part of this pull request.
src/​vs/​platform/​agentHost/​test/​node/​e2e/​KNOWN_ISSUES.md Updated as part of this pull request.
src/​vs/​platform/​agentHost/​test/​node/​e2e/​captures/​claude-chats-of-one-session-run-turns-in-their-own-agent.yaml Updated as part of this pull request.
src/​vs/​platform/​agentHost/​test/​node/​e2e/​captures/​claude-chats-keep-their-own-agent-across-a-host-restart.yaml Updated as part of this pull request.
src/​vs/​platform/​agentHost/​test/​node/​e2e/​captures/​claude-a-fork-stays-on-its-source-chat-s-agent-and-rejects-another-provider.yaml Updated as part of this pull request.
src/​vs/​platform/​agentHost/​test/​node/​copilotShellTools.test.ts Updated as part of this pull request.
src/​vs/​platform/​agentHost/​test/​node/​copilotAgentSession.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/​agentMergeController.test.ts Updated as part of this pull request.
src/​vs/​platform/​agentHost/​test/​node/​agentHostUtilityModelService.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/​agentHostSessionOpenTelemetry.test.ts Updated as part of this pull request.
src/​vs/​platform/​agentHost/​test/​node/​agentHostPullRequestOperationHandler.test.ts Updated as part of this pull request.
src/​vs/​platform/​agentHost/​test/​node/​agentHostChangesetService.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/​agentConfigurationService.test.ts Updated as part of this pull request.
src/​vs/​platform/​agentHost/​test/​common/​sessionConfigProperties.test.ts Updated as part of this pull request.
src/​vs/​platform/​agentHost/​test/​common/​agentSubscription.test.ts Updated as part of this pull request.
src/​vs/​platform/​agentHost/​test/​common/​agentHostProtocolCompatibility.test.ts Updated as part of this pull request.
src/​vs/​platform/​agentHost/​node/​shared/​sessionMoveTools.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/​nodeAgentHostStarter.ts Updated as part of this pull request.
src/​vs/​platform/​agentHost/​node/​compatibleAgentHostDatabase.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/​sessionInputNeeded/​sessionInputNeededContribution.ts Updated as part of this pull request.
src/​vs/​platform/​agentHost/​node/​chatContributions/​queueDrain/​queueDrainContribution.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/​agentServiceFoundation.ts Updated as part of this pull request.
src/​vs/​platform/​agentHost/​node/​agentServiceComposition.ts Updated as part of this pull request.
src/​vs/​platform/​agentHost/​node/​agentHostUtilityModelService.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/​agentHostSessionOpenTelemetry.ts Updated as part of this pull request.
src/​vs/​platform/​agentHost/​node/​agentHostProviderService.ts Updated as part of this pull request.
src/​vs/​platform/​agentHost/​node/​agentHostMain.ts Updated as part of this pull request.
src/​vs/​platform/​agentHost/​node/​agentHostDatabase.ts Updated as part of this pull request.
src/​vs/​platform/​agentHost/​node/​agentHostChatInputService.ts Updated as part of this pull request.
src/​vs/​platform/​agentHost/​node/​agentHostChangesetService.ts Updated as part of this pull request.
src/​vs/​platform/​agentHost/​electron-main/​electronAgentHostStarter.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/​protocol/​version/​registry.ts Updated as part of this pull request.
src/​vs/​platform/​agentHost/​common/​state/​protocol/​common/​commands.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-session/​reducer.ts Updated as part of this pull request.
src/​vs/​platform/​agentHost/​common/​state/​protocol/​channels-session/​actions.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/​commands.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/​state/​agentSubscription.ts 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/​agentService.ts Updated as part of this pull request.
src/​vs/​platform/​agentHost/​common/​agentHostStarter.config.contribution.ts Updated as part of this pull request.
src/​vs/​platform/​agentHost/​common/​agentHostProtocolCompatibility.ts Updated as part of this pull request.
src/​vs/​platform/​agentHost/​common/​agentHostChatProviders.ts Updated as part of this pull request.
src/​vs/​platform/​agentHost/​common/​agentHostChatMove.ts Updated as part of this pull request.
src/​vs/​platform/​agentHost/​common/​agent.ts Updated as part of this pull request.

Review effort: Balanced

…' into sandy081/agents/multiple-chat-harness-support
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Base: c35365ad Current: 444f3de0

No screenshot changes.

@sandy081

Copy link
Copy Markdown
Member Author

Live validation update. The final build validated is 86cf91d96f8: latest main (ea8056df9f0) + the host fork-source fix + T1.

Live run 2 (the pending rows): all PASS

  • A7.
  • G3: moving a never-opened chat after a cold restart.
  • H3.
  • R-cold.
  • R-host DB: the database is byte-identical across a host restart.
  • F1:
    • The local host doesn't re-initialize at launch.
    • An in-flight subscribe is resent after a reconnect.
    • No chat-subscription fan-out (1 vs 9 chats).
    • The changes pill is scoped. This check is limited: the mock can't give chats their own folders.
  • STRESS, two windows with a running task: 0% main CPU and 0 reads/s at idle; gate on vs off within noise.
  • Log and isolation scans: clean.

Live run 3 (final smoke on 86cf91d96f8): all PASS

  • A2.
  • Nested composer picker → mock2.
  • F1+B1.
  • Move to Session… across agents.
  • R-cold.
  • F1: no re-initialize of the local host.
  • H3.
  • Fork of a restored, unopened peer: no hang, and it keeps its agent.

NOT RUN (mock limits; needs real providers):

  • Side chat.
  • Per-chat model and auto-approve pickers, and the main chat following the session pickers, with real chatMutable keys.
  • Fork of a host-unloaded source after a host restart.
  • Move to New Session of a chat on its own agent.

Follow-ups (not in this PR)

  1. Each harness switch in the nested composer leaves a tombstoned draft chat: +1 per switch, never cleaned up.
  2. F3: a chat whose agent is disabled shows "Resource not found".
  3. Not caused by this feature (they also happen with the gate off):
    • A composer draft leaks into the next composer.
    • "Send to New Chat" sends into the current chat in agent host sessions.
    • "New Session · New" rows appear for unsent nested composers.
    • "New Worktree" is offered where the agent can't give a nested chat its own folder.

…dy081/agents/multi-agent-chat-support-implementation
…ple-chat-harness-support

# Conflicts:
#	src/vs/sessions/contrib/providers/agentHost/browser/baseAgentHostSessionsProvider.ts
…ents

Addresses review thread 4397526053 on #344685: the complete-values model
(a chat's values are its complete config, completed from its session,
the default chat following session writes) changed per-chat config
inheritance even with chat.agentHost.multipleChatProviders.enabled off.

It now applies only while the host's multipleChatProviders.enabled is on.
With it off, a chat's values are an overlay on its session's, as on main:
getEffectiveChatConfig applies them over the session's (applyChatConfigLayers),
the host completes, mirrors, clears and rewrites no chat values, and restored
rows stay overlays. Clients read the same way (hostPublishesCompleteChatConfig
from the host's root config), and route main-chat writes to the default chat
as before. Turning the setting on completes loaded chats; turning it off
reads complete values as overlays again and the default chat publishes only
its own values. Main's per-chat config tests are restored unchanged; the
complete-values tests run with the setting on.

Co-authored-by: Copilot <[email protected]>
…refresh before send, resolve a query-addressed chat's model vendor

- e2e: expect the host's current unknown-agent refusal and a different-agent chat's own config schema (AHP #534)
- chatModelConfigurationStore test and agentHostModePicker fixture: provide the members the client now reads
- nestedChatWorkspacePicker: resolveWorkspace awaits a refresh's folder re-read so a kept worktree choice is sent
- agentHostSessionHandler: resolve a chat addressed only by its subagent query to its catalog entry for its model vendor

Co-authored-by: Copilot <[email protected]>
…' into sandy081/agents/multiple-chat-harness-support

# Conflicts:
#	src/vs/sessions/contrib/providers/agentHost/browser/baseAgentHostSessionsProvider.ts
…the chat-providers key; test the default chat's flip-off republish; note copied peer values

- hostPublishesCompleteChatConfig requires the root schema to declare multipleChatProviders.enabled, as an older host keeps the value a client mirrors to it (D1)
- test: turning the setting off republishes only the default chat's own values, without a write or chat config change, and it follows its session again (L-a)
- AGENTS.md: a peer completed while the setting was on keeps its copied values when it is turned off (L-b)

Co-authored-by: Copilot <[email protected]>
@sandy081
Sandeep Somavarapu (sandy081) marked this pull request as ready for review October 28, 2026 19:05
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Ladislau Szomoru (@lszomoru)

Matched files:

  • src/vs/sessions/services/sessions/browser/sessionsManagementService.ts
  • src/vs/sessions/services/sessions/common/session.ts
  • src/vs/sessions/services/sessions/common/sessionsManagement.ts
  • src/vs/sessions/services/sessions/common/sessionsProvider.ts
  • src/vs/sessions/services/sessions/test/browser/sessionsManagementService.test.ts
  • src/vs/sessions/services/sessions/test/common/session.test.ts

@sandy081
Sandeep Somavarapu (sandy081) merged commit 8c18263 into main Oct 28, 2026
51 checks passed
@sandy081
Sandeep Somavarapu (sandy081) deleted the sandy081/agents/multiple-chat-harness-support branch October 28, 2026 19:53
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