* agentHost: expand regression E2Es (Written by Copilot)
Add 79 focused declarations covering managed OTel and permission enforcement, live client tools, native MCP payloads and recovery, history and forks, Git changesets, and real terminal lifecycle behavior. Preserve demonstrated provider defects as narrowly tracked expected failures and refresh measured host coverage.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agentHost: stabilize E2E fixtures on CI (Written by Copilot)
Read Claude files before editing them, compare directory identity across Windows short and long paths, render ConPTY output before counting scrollback bytes, and exercise Unicode input in a ready child independently of shell locale. Preserve exact byte and successful-tool assertions.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
<!-- Thank you for submitting a Pull Request. Please:
* Read our Pull Request guidelines:
https://github.com/microsoft/vscode/wiki/How-to-Contribute#pull-requests
* Associate an issue with the Pull Request.
* Ensure that the code is up-to-date with the `main` branch.
* Include a description of the proposed changes and how to test them.
-->
Fixes#338719
The MCP server details in Chat Customizations didn't say where built-in
servers come from. The header showed a made-up `mcp.json`, and
Configuration only said "No definition is available". This PR uses what
the agent runtime already reports about each server (its source, display
name and contributing plugin) to show the real origin, and explains when
there's nothing to show.
### What you'll see
| MCP server | Before | Now |
|---|---|---|
| `github-mcp-server` (built into Copilot CLI) | Made-up `mcp.json`
label; "No definition is available" | **Built-in: Copilot**.
Configuration explains that Copilot sets it up, with an **Open
Settings** link to `chat.agentHost.githubMcpServer.enabled` |
| Copilot connector, e.g. "Linear (Connector)" | Made-up `mcp.json`
label; "No definition is available" | **Managed by Copilot**, and an
explanation of why there's no definition |
| GitHub server from the Copilot Chat extension (local chat) | No source
| **Built-in: GitHub Copilot Chat**, linking to the extension; the `...`
menu gains **Show Extension** |
| Added via **MCP: Add Server → Add to Current Agent Session** | Could
land under Built-In; no definition | Listed under **User**, labelled
**Agent host configuration**, with its definition |
| Reported as user or workspace config, but no file is known | Made-up
`mcp.json` label | **User configuration** / **Workspace configuration**
|
| Configured in an `mcp.json` or another app's config file | File link
and Edit Configuration | Unchanged. Built-in rows backed by another
app's file (e.g. Claude Desktop) also get **Show Configuration** in the
`...` menu |
### How it works
- The Copilot agent host forwards the runtime's `sourcePlugin` (from
`session.mcp.list`) as optional, namespaced `_meta` on MCP server
customizations. Other agent hosts can leave it out.
- The agent host also declares, in `_meta`, the setting that controls a
server it adds itself. The UI only offers **Open Settings** when the
host declares one.
- The details page shows where a server comes from when there's no file
to open, and an explanation when the agent owns the definition.
- An open details page updates when the agent host reports new metadata.
For example, a server in a restored session gets its origin and settings
link once the runtime reports it, without reopening the page.
- `getMcpServers()` also exposes the definition the agent host's own
configuration holds for a server, so servers added there show their
definition.
### Notes for reviewers
- Connector names come from the connector catalog (#339431). This PR
doesn't forward the runtime's own `displayName`: for anything other than
a connector it falls back to the server's advertised title, which would
rename servers that users configured.
- Copilot Chat's own servers keep their extension ID (to link to it) but
stay under Built-In.
- The setting link is never inferred from a server's name. Another agent
host, a plugin, or a user's config can also publish a
`github-mcp-server` that `chat.agentHost.githubMcpServer.enabled` can't
control, so Copilot declares the setting only for the runtime's own
GitHub server.
- Not in this PR: showing a built-in server's tools or instructions, or
its actual definition (the Copilot SDK doesn't expose it).
### How to test
1. In a Copilot CLI agent session, open Chat Customizations → MCP
Servers and select `github-mcp-server`. The header says "Built-in:
Copilot", Configuration explains why there's no definition, and **Open
Settings** opens `chat.agentHost.githubMcpServer.enabled`.
2. Run **MCP: Add Server → Add to Current Agent Session**. The server is
listed under User with "Agent host configuration" and its definition.
3. In a local chat, select Copilot's GitHub server. The header links to
GitHub Copilot Chat, and `...` → **Show Extension** opens it.
4. A server from `.vscode/mcp.json` still shows its file link and Edit
Configuration.
5. Open a server's details while a resumed Copilot CLI session is still
starting. Once the runtime reports the server, the details update
(origin, settings link) without reopening.
The `EmbeddedMcpDetailBuiltinAgent` and
`EmbeddedMcpDetailBuiltinExtension` component fixtures show the new
details states.
Validation (run locally on top of current `main`):
- Unit tests: passed, 1236 passing and 0 failing.
```
./scripts/test.sh \
--run src/vs/platform/agentHost/test/common/agentMetaReaders.test.ts \
--run
src/vs/platform/agentHost/test/common/metadataCompatibility.test.ts \
--run
src/vs/platform/agentHost/test/node/shared/mcpCustomizationController.test.ts
\
--run src/vs/platform/agentHost/test/node/shared/githubMcpServer.test.ts
\
--run src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts \
--run
src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostCustomizationService.test.ts
\
--run
src/vs/workbench/contrib/chat/test/browser/aiCustomization/embeddedMcpServerDetail.test.ts
\
--run
src/vs/workbench/contrib/chat/test/browser/aiCustomization/mcpListWidget.test.ts
\
--run
src/vs/workbench/contrib/chat/test/browser/aiCustomization/aiCustomizationManagementEditor.test.ts
\
--run
src/vs/workbench/contrib/chat/test/browser/widget/chatContentParts/chatMcpAuthenticationContentPart.test.ts
\
--run
src/vs/workbench/contrib/chat/test/browser/widget/chatContentParts/chatMcpServersStartingContentPart.test.ts
\
--run
src/vs/workbench/contrib/chat/test/browser/widget/chatContentParts/chatToolAuthenticationSubPart.test.ts
```
- Connector-name suites from #339431: passed.
`copilotSessionLauncher.test.ts` and `stateToProgressAdapter.test.ts`
had 301 passing; `mcpCommands.test.ts` had 2 passing.
- `npx tsc --project ./src/tsconfig.json --noEmit --skipLibCheck`: no
errors in code this PR changes. My locally installed dependencies are
older than `main`'s lockfile (Copilot SDK 1.0.15-preview.4 vs
1.0.17-preview.4). That causes 23 errors about newer APIs (`proxyCa`,
`managedSettings.resolve`, `FoundryLocalManager`), all in lines this PR
doesn't change.
- `npx eslint --max-warnings 0` on the changed files: passed.
- `node build/stylelint.ts
src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css`:
passed.
- `node build/checker/layersChecker.ts`: passed.
- Pre-commit hygiene: passed.
Align root and remote SDK/runtime pins with 1.0.92-5. Handle the SDK's credential-free account authentication variant in connector account selection, with coverage for both provider and token-callback accounts.
(Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Make native Agent Host session identities interoperable with AHP
Negotiate standard addressing for new allocations while preserving existing backend and frontend identities, explicit provider routing, and version-skew compatibility. Add regression coverage and contributor identity guardrails.
(Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix remaining AHP identity consumers and CI regressions
Require connection-based committed session resolution, preserve exact owner deletion resources, route Copilot MCP replay explicitly, and keep cloud discovery/provisioning backend identity consistent. Add a public turn-tracker interface and repair CI fixture and class-field initialization wiring.
Validated 555 Chromium tests, 171 MCP/history/telemetry tests, and 29 native identity tests; both client and define-class-fields type checks, transpilation, lint and diff checks passed. (Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Wire committed identity resolution in generic config chip tests
Update the provisional-generation fixture for the required connections contract. All 24 generic-config/submit-handler Chromium tests pass. (Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Register eager Agent Host session identity before first send
Record each acknowledged allocation on its owning connection before subscriptions and first-send routing, and verify the host preserves the requested URI. Keep native allocation collision checks scoped away from non-native providers. Preserve historical recovery fixture addressing and use explicit Copilot provider IDs in MCP expectations.
Validated all 2096 affected unit tests (27 pending), all 3 local AgentHost and SDK-sandbox smoke scenarios, client and class-field type checks, transpilation and lint. (Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Validate Agent Host identities before allocating disposable adapters
Reject conflicting backend registration before constructing adapters, preventing orphaned instances on refresh retry. Interpret older cloud-sandbox cached UI addresses only in the sandbox cache path, preserving generic/native advertised resources.
Reproduced five leaked adapters before the fix; 571 provider tests pass afterward. Live Code OSS with isolated cached state completed five session refreshes and ten forced GCs with zero leaked-disposable warnings or identity conflicts. Typecheck and lint pass. (Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Protect explicit session ownership and cold backing teardown
Serialize explicit creation by raw storage identity, preserve same-provider retries and legacy provenance, and prevent competing legacy/standard claims. Resolve persisted provider ownership before deletion and prepare all cold backings before destructive disposal, preserving metadata on unavailable-provider or preparation failures.
Added controlled contention and fresh-service cold-deletion regressions for all native providers, individual peer/default preparation failures and unresolved legacy identities. Full affected suites: 2290 passed, 27 pending; actual local AgentHost/SDK-sandbox smoke: 3 passed. Both typecheck modes, transpile and lint passed. (Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix cold session discovery and immutable rebind allocations
Preserve exact delegation sources and owning-connection links; constrain legacy resolution to advertised identities; keep sandbox task operations isolated from colliding provider IDs. Add cold restoration, standard tombstone races, frontend publication and opaque scoped-link regressions. (Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
<!-- Thank you for submitting a Pull Request. Please:
* Read our Pull Request guidelines:
https://github.com/microsoft/vscode/wiki/How-to-Contribute#pull-requests
* Associate an issue with the Pull Request.
* Ensure that the code is up-to-date with the `main` branch.
* Include a description of the proposed changes and how to test them.
-->
Fixes#326538
## Problem
The Manage Models (Language Models) editor can show several groups that
are all labelled **Copilot**. Copilot models come from:
- the regular Copilot provider (`copilot`)
- the Copilot CLI extension (`copilotcli`)
- each agent host harness. The Copilot CLI agent host groups its models
under `copilotcli`; the Claude and Codex agent hosts group theirs under
`copilot`, reaching them through the Copilot subscription (Claude via
its `copilot` transport, Codex via `vscode-proxy`).
Each of these lists only works in its own harness, but they all appear
together with the same label.
## Change
Manage Models now scopes the "Copilot" lists to the harness it was
opened for:
- If the harness publishes its own Copilot models (models with
`targetChatSessionType` equal to the harness), only that list is shown.
- Otherwise, only the regular Copilot models are shown.
- Models from other providers (BYOK, Ollama, OpenRouter, a harness's
non-Copilot groups, …) are unaffected.
How the editor learns the harness:
- The model picker's **Manage Models...** action passes the harness it
picks models for: `ChatInputPart.modelTargetSessionType` in the chat
input, or the current model's target in the Agents window picker.
- Other entry points (Command Palette, account menu, notifications) fall
back to the last focused chat's harness, then to the active
customization harness.
Scope is limited to the Manage Models editor. The Chat Customizations
editor's Models section and the model picker contents are unchanged.
## How to test
1. Make sure Copilot models from more than one harness are registered
(e.g. local, Copilot CLI agent host, Claude/Codex agent hosts).
2. In a chat, select the **Local** harness, open the model picker and
choose **Manage Models...**. Only the regular **Copilot** group is
listed; other providers are unchanged.
3. Switch the chat to the **Copilot CLI** agent host harness and open
**Manage Models...** again. Only the agent host's Copilot group is
listed.
4. Repeat with the **Claude** and **Codex** agent host harnesses. Each
shows only its own Copilot group.
## Validation
- `./scripts/test.sh --grep
"ChatModelsViewModel|ChatModelsWidget|modelPicker|ModelPicker|ChatInputPart"`:
passed, 372 tests, including a new `ChatModelsViewModel` test covering
all four Copilot sources plus a non-Copilot harness group.
- `npx eslint` on the changed files: passed.
- `npm run typecheck-client`: no errors in the changed files. It fails
only on errors that already exist in
`src/vs/platform/agentHost/test/node/*` (`proxyCa`), which this change
doesn't touch.
- `npm run valid-layers-check`: passed.
- Manual steps 2–4 above have not been run yet.
* chat: restore Codex continuation with safe session routing
Reapply the continuation feature from #339074 while preserving the parent-session resolver and the peer-chat recovery added in #339476. Decline reverse mappings that cannot resolve back to the exact backend identity.
Add real configuration-control regression coverage for local and remote Copilot, Codex, and Claude peer selections. The six cases fail when the original fragment-preserving behavior is reintroduced. Validated 2,930 tests, compilation, lint, layers, hygiene, and an isolated persistence replay. Signed-in UI validation remains pending macOS Keychain access.
* chat: address continuation review and add hidden preview
Release failed visibility claims and use the shared dismiss button. Add an excluded experimental setting and a private preview command that leaves shared suppression and experiment telemetry untouched.
* chat: make Codex continuation threshold experimental
Add a hidden percentage setting with a 90 percent default and automatic ExP updates. Preserve the threshold in saved warning boundaries so other windows cannot clear suppression using a different assignment.
Fixes#339595Fixes#339439
## Problem
In agent-host sessions, a BYOK (OpenAI-compatible) model never received
images returned by tools such as `view`. It only received the text
receipt `Viewed image file successfully.`
## Root cause
There were two problems:
1. **Vision capability never reached the runtime.**
`synthesizeByokSessionConfig` registered BYOK models with token limits
only. The renderer already reports `supportsVision`, but it wasn't
passed on, so the Copilot runtime treated every BYOK model as text-only.
It replaced tool-result images with the text receipt before the request
reached the BYOK proxy. I confirmed this by running the SDK runtime
against a stub `/responses` server. Without the capability,
`function_call_output.output` is the plain string. With
`capabilities.supports.vision: true`, it's an `[input_text,
input_image]` array.
2. **The BYOK LM bridge had no image channel for tool outputs.** Once
vision is declared, the array output was passed through untyped, and the
renderer wrapped it in a text part.
## Changes
- `copilotSessionLauncher.ts`: forward `supportsVision` as
`capabilities.supports.vision` on each BYOK `ProviderModelConfig`.
- `agentHostByokLm.ts`: add an optional `images` field to the two
tool-output bridge items. `output` stays text, so a renderer that
doesn't know the new field still gets today's text result.
- `byokResponsesTranslation.ts`: split array tool outputs into text plus
images, reusing the existing data-URL and MIME validation from user
messages.
- `agentHostByokLmHandler.ts`: forward the images as `data` parts inside
the LM API `tool_result`, the same shape the in-extension path produces.
## How to test
1. Turn on `chat.agentHost.byokModels.enabled`.
2. Add an OpenAI-compatible BYOK model that supports images (e.g.
`gpt-4o`), with `"vision": true` and `"toolCalling": true`.
3. Put an image containing text the model can't guess (e.g.
`ZEBRA-7341`) in the workspace.
4. In an agent-host session with that model, ask: *"Use the view tool to
open probe.png and tell me exactly what text it contains. If you didn't
receive image pixels, say so."*
- Before this change: the model says it only got "Viewed image file
successfully."
- After this change: the model reads the text.
5. With `"vision": false`, the model should still get the text receipt
and the turn should finish cleanly.
## Validation
- `./scripts/test.sh --run
src/vs/platform/agentHost/test/node/byokResponsesTranslation.test.ts
--run src/vs/platform/agentHost/test/node/copilotSessionLauncher.test.ts
--run src/vs/platform/agentHost/test/node/byokLmProxyService.test.ts
--run
src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostByokLmHandler.test.ts`:
passed, 145 tests.
- New tests use the exact payload captured from the runtime, plus a
renderer `tool_result` mapping test. The launcher snapshot test now
covers `supportsVision`.
- `npm run typecheck-client`: reports 20 errors, the same 20 as without
this change. They come from the locally installed `@github/copilot-sdk`
(1.0.16) being older than the version pinned in `package.json`. None are
in files this PR touches.
Keep the Agents Window command center focused on workspace and branch context in every chat presentation. Add light and dark screenshot fixtures for single-chat folder, worktree, and no-workspace states.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Address review feedback:
- "Hide All Models" on a Copilot group now only toggles the models listed for
the selected harness. Groups from different harnesses can share an id (e.g.
the regular Copilot group and Codex's `copilot` group).
- Provider status rows that render as a Copilot group (e.g. a Copilot agent
host that failed to load its models) are scoped to their harness like models.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot models are published separately by the regular Copilot provider and
by each agent host harness (Copilot CLI, Claude, Codex), and every one of
those lists is labelled "Copilot" in the Manage Models editor. Scope the
"Copilot" lists to the harness the editor is opened for: show that harness's
own Copilot models, or the regular Copilot models if it has none. Models from
other providers are unaffected.
The model picker's "Manage Models..." action now passes the harness it picks
models for. Other entry points fall back to the last focused chat's harness,
then the active customization harness.
Fixes#326538
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Reconcile with #339431 (Show connector names in MCP authentication), which
added its own MCP display-name metadata:
- Adopt main's display name everywhere: the connector catalog name under
`vscode.mcpServerDisplayName`, published from connector reconciliation
and shown as "<name> (Connector)" by getMcpServerDisplayLabel.
- Stop forwarding the runtime's `mcp.list` display name. It falls back to a
server's own advertised title, which would rename user-configured servers
on every surface that now uses the display name.
- Remove getActiveSessionServerLabel in favour of getMcpServerDisplayLabel.
- Keep this branch's source plugin and controlling setting metadata, the
host configuration, and the details refresh.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Carry tool outputs that contain images as ordered content parts so each image keeps its caption, instead of one concatenated text plus a separate image list. The text output stays populated for renderers that predate the field.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
BYOK models were registered with the Copilot runtime without their vision capability, so the runtime replaced tool-result images (e.g. from the view tool) with a text receipt. Pass supportsVision through as capabilities.supports.vision, and carry the resulting input_image parts across the BYOK LM bridge into the LM API tool result.
Fixes#339595
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Default Insiders builds to the workspaceAndModel tour variant while retaining experiment gating and treatment selection for other product qualities.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The Chat view's pane container registers as a Gesture target, which cancels touchstart/touchend and suppresses the compatibility mousedown. The model picker buttons only listened for mousedown, so finger and pen taps never opened them. Register the buttons as Gesture targets and handle Tap.
Fixes#339467
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* extensions: keep update checks on polling cadence
Do not reschedule the full installed-extension update check when an extension's auto-update delay expires. Clarify that delay expiry makes an update eligible rather than guaranteeing its installation time.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5e8ac536-0855-45fb-bd88-3b651e80b60d
* extensions: clarify auto update eligibility
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Jimmy Lewis <jamlew@microsoft.com>
Co-authored-by: Sandeep Somavarapu <sasomava@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5e8ac536-0855-45fb-bd88-3b651e80b60d
* agentHost: isolate all chats in an existing session
Add the main-chat-only isolate_session tool, defer conversion until active chats finish, and preserve session histories while switching all Copilot backings to one worktree.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agentHost: support Codex isolation and preserve worktree branch identity
Enable session-wide Codex isolation with durable directory updates and rollback handling. Seed the generated branch before exposing the worktree and simplify the isolation divider.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agentHost: isolate only the calling chat in a worktree
Allow main and peer chats to request isolation while preserving other chat scopes. Persist exact-chat provider directories, update the Sessions workspace and branch model, and quarantine uncertain changes per chat.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agentHost: refine chat isolation scope and workspace conversion
Allow single-chat isolation without multi-root support while preserving repository identity. Keep multi-chat isolation gated, correct Git-state ownership, avoid refresh cooldown waits, and remove the superseded session-wide provider path.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agentHost: change a chat workspace through the set_workspace and isolate_session tools
A chat can now move to another folder or into a new Git worktree when the model calls set_workspace or isolate_session, including in sessions that already have a workspace. The change is deferred until the requesting turn ends and the original task then continues automatically. Only the addressed chat changes: a single user chat replaces the session roots under the chat catalog lock, and with several chats the siblings keep their folders.
Host: restore sibling chats before the provider moves, validate the chat identity across the asynchronous steps, quarantine the exact chat durably when the outcome is uncertain, and reject cancel, steering, new turns, truncation and archive while the host-owned conversion turn is running. Publish a per-chat workspace change state so clients can block input and show a blocked notice.
Providers: pin sibling working directories before a main chat move, guard archived-history resume, distinguish definitive Codex rejections from uncertain outcomes, and retain or reconcile worktrees through ownership records.
Client: block input while a conversion runs, render the workspace transition notice, and roll back an archive that the host rejects. There is no UI for changing the workspace; the tools are the only entry point.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agentHost: keep the workspace change feature to the tool path
There is no UI to start a workspace change, so remove the client reactions that only supported a user-initiated change: the workbench input blocking and notice, the Sessions archive rollback and bulk archive handling, and the published per-chat state they read. The host still rejects cancel, steering, new turns, truncation and archive while a conversion owns the turn.
Drop incidental churn from the feature diff and keep the project and worktree handling the Agents Window adapter needs after a tool-driven change. The transition notice now reads 'Workspace changed to a new worktree of {0}' for a worktree and 'Workspace changed to {0}' for a folder.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agentHost: shorten the worktree workspace transition label
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Revert "agentHost: shorten the worktree workspace transition label"
This reverts commit a155fcbaa2.
* agentHost: allow set_workspace to move a worktree chat to a worktree of another folder
A chat already in its session's worktree was refused a new worktree of a
different folder with a generic error. Only reject when the target is the
chat's current folder, keep the old worktree on disk, and explain the
rejection.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agentHost: update e2e expectations for set_workspace on chats with a workspace
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agentHost: update Copilot prompt snapshots for the workspace tools
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: Suppress archive nudges after continuing a conversation
Remember the shown pull requests and chat turns across reloads. Hide the suggestion when the session continues and allow it again only after a new pull request is added and all pull requests are merged.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: Keep archive nudge visible when removing a turn
Require a request timestamp at or after the nudge impression before treating a changed last request as continuation. Cover removal revealing older history, removing every request, reload, and sending a new turn.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* test: Stabilize flaky component fixtures
Use local decoded avatars, browser-owned readiness conditions and deferred paint to keep component screenshots deterministic. Replace the discovery SVG loader with the shared DOM spinner and preserve reduced-motion behavior. Document the fixture design contract and extend loading-state regression coverage.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat: Scope discovery spinner styles to the result row
Ensure the hidden spinner state wins over the shared spinner stylesheet regardless of CSS load order. This fixes the continuation regression assertion in the full Electron and browser test suites.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fixes#336738
This makes the Agents window bottom panel configurable so it can remain
full-span or align beneath chat without squeezing the side pane.
### Changes
- Add a checkable **Align Panel with Chat** action to the existing panel
overflow and persist the selected alignment per profile.
- Reparent the existing Grid views while preserving panel height,
side-pane width, focus, hidden views, and maximize/restore behavior.
- Preserve hidden leaf and branch visibility in the shared Grid
operations exercised by these transitions.
- Keep the panel inset when the primary sidebar is collapsed, match
native macOS lower-corner geometry, and retain the full-span layout on
mobile.
- Add focused Grid, layout-action, topology, sizing, and styling
regression coverage.
### Validation
- `npm run compile` — passed with 0 errors.
- `./scripts/test.sh --run src/vs/base/test/browser/ui/grid/grid.test.ts
--run src/vs/sessions/test/browser/workbench.test.ts --run
src/vs/sessions/test/browser/layoutActions.test.ts` — passed, 172 tests.
- `npm run typecheck-client` — passed.
- Targeted ESLint for all changed TypeScript files — passed.
- `npm run stylelint -- src/vs/sessions/browser/media/workbench.css` —
passed.
- `git diff --check` — passed.
- Agents window Dev UI scenario PA-01 through PA-08 — passed, covering
both alignments, existing-overflow placement, collapsed-sidebar spacing,
native macOS corners, maximization restoration, hidden views, and sash
regressions.
### UI validation
**Chat-aligned panel**

**Full-span panel**

**Chat-aligned panel with the primary sidebar collapsed**

**Full-span panel after maximization and alignment restoration**

* github: migrate Dev Container sample reads
Use the local anonymous GitHub engine to resolve repository HEAD and read commit-pinned Contents API JSON. Preserve the sample cache and container lifecycle, validate bounded base64 envelopes, and cover cancellation and lease ownership.
The desktop migration must not merge until compatible shared-process proxy and certificate transport is available and verified.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* github: expose repository reads through a service domain
Compose the public repository workflow under IGitHubService.repositories instead of requiring consumers to pass the service into a free helper. Keep anonymous client leases, commit pinning, cancellation and deadlines owned by the domain, and cover service startup and disposal.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* github: use AbortSignal for repository file reads
Align the repository domain with the existing GitHub cancellation APIs. Forward the caller signal and abort reason unchanged, and adapt Dev Container cancellation tokens only at the caller boundary with scoped listener cleanup.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* github: normalize cancellation inputs inside the service
Accept AbortSignal or CancellationToken for repository reads and share operation-scoped normalization with the GitHub IPC boundary. Preserve caller signals and abort reasons, release token listeners with the request lifetime, and remove adapter boilerplate from Dev Container callers.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* github: scope repository reads to anonymous clients
Move the repository domain from the root service to IGitHubAnonymousClient and rename readPublicFile to readFile. Use the owning client endpoint and get capability without nested lease acquisition; preserve shared cancellation normalization and explicit caller lease ownership.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* github: simplify anonymous client API
Move the anonymous client into its own module and expose readFile directly. Default omitted acquisition options to GitHub.com while preserving explicit endpoints, shorten the cancellation helper name, and remove the requested sample-cancellation test suite.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* github: consolidate anonymous client tests
Rename the client tests to anonymousClient.test.ts and include the repository file-read coverage in the same module. Retain all existing test definitions and update documented test selectors.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* github: let anonymous callers supply request options
Accept GitHubCancellation in get and readFile, use signal parameter names, and remove the IPC token adapter. Forward readFile caller, priority and deadline options; attribute interactive Dev Container reads at their call site instead of hardcoding github.query in the reusable client.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Updates
* github: use governed raw downloads for repository files
Add a configurable raw-content base to anonymous host options and retain one REST commit lookup followed by a SHA-pinned raw download. Reuse bounded download handling with credential omission, pinned redirects and raw-origin quota isolation, preserving the sample cache and author SHA/path helpers.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Updates
* PR feedback
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: fix canvas reopen failures
Treat undefined editor results without a matching open editor as failures, and scope presentation cleanup to the exact canvas input generation. Add regressions for undefined results and overlapping stale/new opens.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: harden canvas reopen cleanup
Ignore disposed editor matches when validating undefined open results, and cover rejected close cleanup so the same live canvas can create a fresh input generation.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: support read state with legacy Agent Hosts
Treat missing per-chat read state from pre-0.10 Agent Hosts as unknown, preserve the client's conservative state across refreshes, and translate read updates to the legacy session-level action.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: fix legacy chat read fallback
Update the requested chat optimistically on pre-0.10 hosts and always dispatch retryable session-level read actions.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: use valid protocol version in remote tests
Use the generated current AHP version in remote provider mocks so capability checks exercise a valid negotiated SemVer.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agentHost: Eagerly load set_workspace for workspaceless chats
Keep the base tool deferred, but expose it eagerly when a session is workspaceless. Add Copilot and Codex end-to-end coverage for first-prompt workspace conversion.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agentHost: Expand workspace file URI placeholders on replay
Preserve file URI semantics when replaying workdir placeholders so Windows drive paths are parsed as file paths rather than URI authorities. Regenerate the workspace conversion fixtures and cover the expansion directly.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: synchronize session read aggregate
Dispatch the session-level read action whenever a participating chat changes the effective aggregate, while leaving hidden and tool chats independent.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agentHost: synchronize session read state from chats
Move aggregate read-state authority to Agent Host so clients only dispatch chat changes. Promote the session when the last participating unread chat becomes read, while preserving explicitly unread sessions on redundant chat updates.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agentHost: restore chat read action documentation
Keep session aggregate synchronization as an Agent Host implementation detail without changing the existing protocol action contract.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agentHost: avoid duplicate read state persistence
Apply an explicit session read action before synchronizing its sole chat so the chat transition does not recursively promote and persist the same session state twice.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* test: Match Dev Container smoke CLI quality and commit
Prefer the desktop commit CLI when published, and explicitly fall back to the latest CLI in the same quality channel for unpublished builds. Stable smoke runs no longer depend on an Insiders-only fixture.
Fixes#339677
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* test: Match source Dev Container CLI server directory
Apply the runtime source-only -dev suffix after merging product overrides so the provisioned commit-pinned CLI is reused by the production installer. Packaged and legacy fallback paths remain unchanged.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Notify layout consumers after Grid maximization is committed so panelMaximized updates immediately.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Honor the owning host's automatic PR association setting when resolving chat PR pills. Map recorded artifact owners from host chat URIs to UI resources so created PRs remain visible, including during chat catalog hydration.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Allow the Agents Window panel to span the main region or align beneath chat from the existing panel overflow. Preserve hidden Grid views, pane sizing, maximized state restoration, collapsed-sidebar spacing, and native macOS corner treatment across layout transitions.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Configure the actual Mocha runner with local and CI defaults, and forward explicit timeout overrides instead of relying on the outer CLI.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: release output channel disposal listeners with their channel
* test: cover output disposal retention without explicit GC
* test: isolate output channel disposal from shared registry
Save and clear pre-existing output channel descriptors before constructing the test service, then restore them after its disposal. This prevents order-dependent active-channel assertions and initialization-after-shutdown leaks when agent-session tests run first.