Files
vscode/test
Sandeep Somavarapu b756565b44 agentHost: adopt multi-chat sessions protocol (default-chat compat layer) (#320931)
* chore: sync agent-host-protocol to b55919a (multi-chat)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* refactor: route turn access via defaultChat helpers

Adopt the multi-chat Agent Host Protocol: turns, active turn, steering,
queued messages and input requests moved off the session and onto a
per-chat channel. A single default-chat compatibility layer recombines
the session with its default chat so existing consumers keep working:

- Server (AgentHostStateManager) routes chat actions to the default chat
  and exposes a merged ISessionWithDefaultChat view.
- Client (AgentHostSessionHandler) subscribes to both the session and its
  default chat channel and merges them for reads.
- Widen action dispatch/emit signatures to SessionAction | ChatAction and
  migrate turn/tool-call/input wire strings from session/* to chat/*.
- Update tests and mock connection to serve ChatState for default-chat
  subscriptions and route chat actions accordingly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* test: adapt post-merge tests to multi-chat Chat* action names

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: repair chat retrieval and config regressions from multi-chat adoption

The multi-chat AHP adoption introduced two classes of regressions:

1. Chat retrieval/echo routing: chat actions now emit on the derived
   default-chat channel, but several consumers were still keyed on the
   session URI. Await both the session and default-chat subscriptions
   before reading history, restore the chat channel on subscribe, forward
   ChatActions, and normalize chat<->session URIs in dispatch/side-effects.

2. Session config loss: getSessionState() now returns a merged composite
   copy (mergeSessionWithDefaultChat), and _ensureDefaultChat replaced the
   live map entry with a clone. Callers mutating the returned object
   (state.config = ...) stranded the mutation on a throwaway. Fix:
   _ensureDefaultChat mutates in place to preserve createSession/
   restoreSession return identity, and a new setSessionConfig() mutates the
   live map object for the async restore path.

Tests migrated to setSessionConfig() where they previously seeded config by
mutating getSessionState() returns; duplicate-restore and client-echo tests
updated to reflect the two-channel (session + default-chat) model.

All agentHost node suites (409) and the browser contribution suite (148)
pass; typecheck and valid-layers-check are clean.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chore: sync agent-host-protocol to d7f592e (chat interactivity)

Regenerates the vendored protocol/ from agent-host-protocol @ d7f592e,
which adds the optional `interactivity?: "full" | "read-only" | "hidden"`
metadata to `ChatState`/`ChatSummary` and the `ChatInteractivity` type.

Mechanical sync only (scripts/sync-agent-host-protocol.ts); no hand edits.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* refactor: preserve chat interactivity across summary/state helpers

Carries the new optional `interactivity` field through the VS Code glue
converters so it round-trips between `ChatState` and `ChatSummary`
(`createChatState`, `chatSummaryFromState`) and re-exports the
`ChatInteractivity` type alongside the other chat types.

Absence still defaults to "full", so single-default-chat sessions are
unchanged; this just stops the field being dropped during denormalization.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* agentHost: sync protocol to 83fae5a (ChatInteractivity const enum)

Re-sync the vendored agent-host-protocol from a685a3e to 83fae5a, which
refactors ChatInteractivity from a string-union type to a const enum.
Pure type-level change with identical runtime string values; glue code
only passes interactivity through, so no source changes required.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* address PR review feedback on multi-chat adoption

- sync protocol to b88a4a3: Snapshot.state union now includes ChatState,
  dropping the IStateSnapshot widening shim (con1)
- handler: resolve the default chat URI from the live session state's
  defaultChat field instead of assuming a URI structure, with the
  deterministic fallback clearly marked as temporary migration (con2, con3)
- protocolServerHandler: reject createChat for non-default chats with a
  ProtocolError instead of silently succeeding (ccr2)
- agentSubscription: make getPendingActions type-honest by widening the
  pending-action type to SessionAction | ChatAction and renaming the
  channel field, removing the unsafe cast (ccr3)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix turn telemetry test stranded config mutation

getSessionState returns a detached composite (session merged with its
default chat), so mutating its config stranded the change. Use the
stateManager.setSessionConfig API to write the authoritative session
state instead, matching what agentService does in production.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* test: route protocol integration tests through default chat channel

The multi-chat protocol adoption moved conversation contents (turns,
activeTurn, queued/steering messages, input requests) onto the session's
default chat channel, and renamed turn/tool-call/responsePart actions from
`session/*` to `chat/*`. The Protocol WebSocket integration tests still
subscribed only to the session channel and dispatched/awaited the old
`session/*` action types, causing notification timeouts and reads of
undefined turn arrays.

- Add `fetchSessionWithChat` helper that subscribes to both the session and
  its default chat channel and returns the merged ISessionWithDefaultChat view
- Update turnExecution, sessionFeatures, sessionLifecycle, multiClient to read
  turn/conversation state via the merged helper
- Rename stale `session/*` conversation actions to `chat/*` in clientTools,
  toolApproval, turnExecution, and realSdkTestHelpers
- Subscribe secondary multi-client clients to the default chat channel
- Fix copilotRealSdk usage assertion to read turns from the default chat

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* test: assert chat/turnStarted in AgentHost smoke test

The multi-chat protocol adoption dispatches turns as `chat/turnStarted`
on the session's default chat channel instead of `session/turnStarted`.
Update the Agents Window smoke test to look for the new action type in
the AHP JSONL transcript.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* agentHost: re-pin protocol to b3319ca (multi-chat merged to main)

The multi-chat sessions change landed on agent-host-protocol main as
b3319ca ("feat: multi-chat sessions (#213)"). The vendored copy was
previously synced from the PR branch (b88a4a3); the generated types are
byte-identical, so this only advances the .ahp-version pin to the merged
commit.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-15 15:38:54 +00:00
..
2026-06-11 19:38:19 +00:00

VS Code Tests

Contents

This folder contains the various test runners for VS Code. Please refer to the documentation within for how to run them:

  • unit: our suite of unit tests (README)
  • integration: our suite of API tests (README)
  • smoke: our suite of automated UI tests (README)
  • sanity: release sanity tests (README)