Add static commands for opening Agent Host chat sessions#314187
Merged
meganrogge merged 9 commits intomainfrom May 4, 2026
Merged
Add static commands for opening Agent Host chat sessions#314187meganrogge merged 9 commits intomainfrom
meganrogge merged 9 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds two stable command IDs for opening an Agent Host chat session using the umbrella agent-host-copilot scheme, ensuring automation can open a session immediately at startup (before the Agent Host asynchronously registers dynamic per-agent commands).
Changes:
- Register
workbench.action.chat.openNewSessionSidebar.agent-host-copilotto open an Agent Host session in the Chat view (sidebar). - Register
workbench.action.chat.openNewSessionEditor.agent-host-copilotto open an Agent Host session in a Chat editor. - Mirror the existing
openNewChatSessionInPlace.agent-host-copilotbehavior while removing the need for callers to pass achatSessionPositionargument.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/electron-browser/chat.contribution.ts | Adds two static commands to open agent-host-copilot chat sessions directly in the sidebar or editor to support early-startup automation. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 1
The dynamic per-agent commands (registered as workbench.action.chat.openNewSessionSidebar.agent-host-${provider}) are only registered after the agent host starts and surfaces an AgentInfo, which is asynchronous. This makes them unusable for automation that needs to open a session immediately on startup (e.g. evals).
Add stable command ids tied to the umbrella AgentHostCopilot scheme that automation can invoke before the dynamic registration has occurred:
- workbench.action.chat.openNewSessionSidebar.agent-host-copilot
- workbench.action.chat.openNewSessionEditor.agent-host-copilot
Both mirror the existing openNewChatSessionInPlace.agent-host-copilot command body but with fixed sidebar/editor positioning.
99067a9 to
b9d2840
Compare
Contributor
Screenshot ChangesBase: Changed (5)Errored (18)Fixtures that failed to render — no screenshot was produced.
|
…c agent host commands - Fix listener leak: dispose onDidChange subscription on timeout via CancellationTokenSource, preventing accumulated leaked listeners on repeated calls - Fix broken timeout fallback: throw an error instead of silently falling back to AgentHostCopilot umbrella scheme which has no registered content provider - Fix wrong-agent fallback: remove `?? rootState.agents[0]` so we only match the copilotcli provider, not an unrelated agent - Fix display name: use getAgentSessionProviderName() instead of raw scheme string for editor tab titles Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
roblourens
approved these changes
May 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The dynamic per-agent chat session commands (registered as
workbench.action.chat.openNewSessionSidebar.agent-host-${provider}) are only registered after the agent host starts and surfaces anAgentInfoviaonAgentHostStart, which is asynchronous. This makes them unusable for automation that needs to open an Agent Host session immediately on startup — for example, the VS Code copilot evaluation harness, which calls the command at the start of the agent loop and getscommand not found.Changes
Add two stable command ids tied to the umbrella
AgentHostCopilotscheme that automation can invoke before the dynamic per-agent registration has occurred:workbench.action.chat.openNewSessionSidebar.agent-host-copilot— opens an Agent Host session in the sidebarworkbench.action.chat.openNewSessionEditor.agent-host-copilot— opens an Agent Host session in the editorBoth mirror the body of the existing
workbench.action.chat.openNewChatSessionInPlace.agent-host-copilotcommand (already registered for the session type picker), but with fixed sidebar/editor positioning so callers don't need to pass achatSessionPositionargument.Context
Companion change in vscode-copilot-evaluation: https://github.com/microsoft/vscode-copilot-evaluation/pull/3675