Repository navigation
agentHost: keep draft agents in client space - #345314
Merged
Merged
Conversation
Fixes two review findings in the draft agent flow for same-host and remote connections. - Converts the reconciled draft agent to the client-space URI that the picker and chat modes use. Before, the selection used the host URI, so the picker could show the default agent. - Compares the plugin container in client space before the loading wait and the load-error check. Before, a same-host plugin used a vscode-agent-host-file URI, so a first message did not wait for the plugin and did not report a load failure. - Decodes a vscode-agent-host-file source URI before draft agents are matched to published agents. (Commit message generated by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Dmitriy Vasyura (dmitrivMS)
previously approved these changes
Oct 31, 2026
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The Dev Container handoff can lose copied-plugin source identity under non-identity URI mapping, causing reloads to bypass loading/error guards and preventing reconciliation to a new materialized agent URI.
1 open issue
What changed in this PR
This follow-up to #345306 corrects draft-agent URI handling across local and remote Agent Host connections, addressing selection and plugin-loading problems related to #341862.
Changes:
- Keeps reconciled draft-agent selections in client URI space.
- Normalizes plugin and source URIs for matching, loading waits, and load-error checks.
- Adds regression tests for successful and failed same-host plugin loading on local and editor-remote connections.
| File | Description |
|---|---|
src/vs/workbench/contrib/chat/common/agentHostSessionCustomizations.ts |
Extracts a helper to decode same-host plugin URIs into client space. |
src/vs/sessions/contrib/providers/agentHost/test/browser/localAgentHostSessionsProvider.test.ts |
Tests loading waits, error handling, and preserved agent identity. |
src/vs/sessions/contrib/providers/agentHost/browser/baseAgentHostSessionsProvider.ts |
Updates draft-agent reconciliation and plugin containment checks to use client-space URIs. |
Review effort: Balanced
setAgent now also matches the published host-space agent URI that getCustomAgents() returns, as the Dev Container handoff passes. Before, only the client-space URI matched, so a remote connection lost the agent's client source, a plugin reload skipped the loading and error checks, and the draft agent was not reconciled. (Commit message generated by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Dmitriy Vasyura (dmitrivMS)
approved these changes
Oct 31, 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.

Follow-up to #345306 for #341862. This addresses the two Copilot review comments on that PR. It merged before the fix was pushed.
Fixes two review findings in the draft agent flow for same-host and remote connections.
vscode-agent-host-fileURI, so a first message did not wait for the plugin and did not report a load failure.vscode-agent-host-filesource URI before draft agents are matched to published agents.How to test
chat.pluginLocations.Validation
npm run eslint -- <3 changed files>: passednpm run typecheck-client: passed./scripts/test.sh --reporter dot --run src/vs/sessions/contrib/providers/agentHost/test/browser/localAgentHostSessionsProvider.test.ts --run src/vs/sessions/contrib/providers/agentHost/test/browser/agentHostAgentPicker.test.ts: passed (643 passing, 11 pending). The new editor-remote cases fail without the fix.