Skip to content

chat: delegate agent-host sessions#321702

Merged
DonJayamanne merged 8 commits into
mainfrom
agents/have-a-look-at-https-github-com-microsoft-5c8ec2c5
Jun 17, 2026
Merged

chat: delegate agent-host sessions#321702
DonJayamanne merged 8 commits into
mainfrom
agents/have-a-look-at-https-github-com-microsoft-5c8ec2c5

Conversation

@DonJayamanne

Copy link
Copy Markdown
Contributor
  • Pass transcript handoff as an attachment so the prompt stays user-authored.
  • Route agent-host delegation through the correct session-opening path in VS Code and Agents Window.
  • Preserve attachment round-tripping and existing Agents Window behavior while matching the updated SDK behavior.

Fixes #319819

(Commit message generated by Copilot)

- Pass transcript handoff as an attachment so the prompt stays user-authored.
- Route agent-host delegation through the correct session-opening path in VS Code and Agents Window.
- Preserve attachment round-tripping and existing Agents Window behavior while matching the updated SDK behavior.

Fixes #319819

(Commit message generated by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 17, 2026 00:45
@DonJayamanne DonJayamanne enabled auto-merge June 17, 2026 00:46
@DonJayamanne DonJayamanne marked this pull request as draft June 17, 2026 00:49
auto-merge was automatically disabled June 17, 2026 00:49

Pull request was converted to draft

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.

Pull request overview

Adds “Continue in…” delegation support for agent-host-backed sessions (local agent-host-* and remote remote-*) across the main VS Code window and the Agents window, while keeping transcript handoff user-authored by moving prior conversation context into a paste attachment.

Changes:

  • Build and hand off a bounded “delegation transcript”, passed as a paste attachment for agent-host targets (and inlined into the prompt for non-agent-host targets).
  • Route agent-host delegation via a single generic command in the Agents window, and via openChatSession in the main window; update UI state/menus to reflect pending delegation selection.
  • Add paste-attachment metadata + restoration logic to preserve attachment round-tripping, and extend/adjust tests accordingly.
Show a summary per file
File Description
src/vs/workbench/contrib/chat/test/browser/chatContinueInAction.test.ts New unit tests for delegation transcript building and transcript-as-paste attachment wrapping.
src/vs/workbench/contrib/chat/test/browser/agentSessions/agentSessionViewModel.test.ts Expands coverage for getAgentCanContinueIn to include agent-host session types.
src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostChatContribution.test.ts Tests paste variables → simple attachments and restoration back to paste variables.
src/vs/workbench/contrib/chat/common/attachments/chatVariableEntries.ts Introduces paste attachment metadata constants and helpers to create/restore paste variable entries.
src/vs/workbench/contrib/chat/common/actions/chatContextKeys.ts Adds a context key to track a pending delegation target (pre-submit).
src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.ts Enables delegation from agent-host sources and tweaks visibility rules for sessions window targets.
src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.ts Tracks pending delegation target + context key, and centralizes active session-type resolution for delegation.
src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.ts After initial send, swaps the UI to newSessionResource when the send commits a new session resource.
src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.ts Adds a generic agent-host delegation command id + request shape; broadens “can continue in” for agent-host targets.
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/stateToProgressAdapter.ts Restores paste attachments back into paste variable entries; adds tooltip for generic simple attachments.
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.ts Emits paste variables as simple attachments tagged with displayKind: 'paste' and adds extra trace diagnostics.
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatContribution.ts Marks agent-host contributions as delegation-capable in both VS Code and Agents window.
src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.ts Lets delegation resolve targets by either provider mapping or exact session type id; hides model/mode pickers while pending.
src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.ts Implements transcript generation/attachment handoff; routes agent-host delegation via generic command or openChatSession.
src/vs/sessions/SESSIONS.md Documents delegation flow in the Agents window architecture notes.
src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHost.contribution.ts Enables delegation support for remote agent-host session contributions.
src/vs/sessions/contrib/providers/agentHost/browser/baseAgentHostSessionsProvider.ts Adds trace logging for attached context in provider send path.
src/vs/sessions/contrib/providers/agentHost/browser/agentHostSessionConfigPicker.ts Hides agent-mode picker while a delegation target is pending.
src/vs/sessions/contrib/providers/agentHost/browser/agentHostAgentPicker.ts Hides agent picker while a delegation target is pending.
src/vs/sessions/contrib/chat/browser/chat.contribution.ts Wires in the new Agents-window agent-host delegation command handler.
src/vs/sessions/contrib/chat/browser/agentHostDelegation.ts Implements the generic command handler to create a new session beside the source and send the initial request with attachments.
src/vs/platform/extensions/common/extensionsApiProposals.ts Updates the generated API proposals typing to match current generator output.
src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts Adds test coverage for paste/simple attachment mapping to SDK blob attachments.
src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts Adds attachment summarization helpers + logs for protocol/SDK attachments during send.
.github/skills/sessions/SKILL.md Updates sessions guidance on not collapsing distinct provider identities in pickers.

Copilot's findings

  • Files reviewed: 25/25 changed files
  • Comments generated: 3

Comment thread src/vs/sessions/contrib/chat/browser/agentHostDelegation.ts
DonJayamanne and others added 7 commits June 17, 2026 11:30
- Keeps normal pasted chat context as opaque simple attachments so existing paste chips render as before.
- Uses delegation transcript metadata, not display kind, to restore transcript handoff attachments.
- Updates attachment restore coverage to distinguish tagged transcripts from display-kind-only paste attachments.

(Commit message generated by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
- Avoids changing generic restored attachment UI while preserving metadata-based delegation transcript restore.
- Keeps normal simple attachment rendering behavior narrowly scoped to the existing generic path.

(Commit message generated by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Removes temporary attachment and delegation trace logging added while diagnosing transcript handoff.
- Restores the Copilot attachment log to its previous low-detail trace shape.
- Reverts the unintended API proposal type change so proposal versions remain supported.

(Commit message generated by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Completes the paste attachment request test with the chat turn completion event used by the state-driven test helper.
- Keeps the assertion that normal paste variables stay simple attachments without paste display kind.

(Commit message generated by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Avoids computing chat initial session options for the Agents Window agent-host delegation path where they are not consumed.
- Keeps repository options for paths that pass them through workbench chat session creation.

(Commit message generated by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@DonJayamanne DonJayamanne marked this pull request as ready for review June 17, 2026 02:50
@DonJayamanne DonJayamanne enabled auto-merge (squash) June 17, 2026 03:54
@DonJayamanne DonJayamanne merged commit a40ad8d into main Jun 17, 2026
39 of 40 checks passed
@DonJayamanne DonJayamanne deleted the agents/have-a-look-at-https-github-com-microsoft-5c8ec2c5 branch June 17, 2026 04:26
@vs-code-engineering vs-code-engineering Bot added this to the 1.126.0 milestone Jun 17, 2026
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.

AHP: Ability to delegate to other providers

3 participants