Enable “Continue in Claude” for chat handoffs#318232
Open
Chulong-Li wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds robust “Continue in Claude” delegation support, including preserving the selected model when opening the new session and improving how delegated context is forwarded.
Changes:
- Enable Claude as a valid “continue in” provider and surface it in continue-in UI/actions.
- Propagate
userSelectedModelIdwhen opening a new chat session and apply it to the model input state (editor + sidebar). - Delegate from non-Claude chats into a new Claude session with optional summarized context, and resolve summary-URI references into actual text blocks.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/test/browser/agentSessions/agentSessionViewModel.test.ts | Adds coverage for getAgentCanContinueIn returning true for Claude. |
| src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.ts | Allows partial model input state and applies it earlier during editor initialization. |
| src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.ts | Imports Claude provider and introduces ordering for “continue in” contributions. |
| src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.ts | Adds userSelectedModelId plumbing, initializes input state from model metadata, and forwards the hint to sendRequest. |
| src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.ts | Updates continue-in eligibility to include Claude. |
| src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.ts | Adds “Continue in Claude” option when delegation is supported. |
| extensions/copilot/src/extension/chatSessions/vscode-node/test/claudeChatSessionContentProvider.spec.ts | Adds tests for delegation behavior, summary attachment forwarding, and cancellation handling. |
| extensions/copilot/src/extension/chatSessions/vscode-node/claudeChatSessionContentProvider.ts | Implements delegation to a new Claude session with summary attachment handling + model hinting. |
| extensions/copilot/src/extension/chatSessions/vscode-node/chatSessions.ts | Registers the delegation summary service in the extension’s service collection. |
| extensions/copilot/src/extension/chatSessions/claude/node/test/resolvePromptToContentBlocks.spec.ts | Adds test for resolving non-inline URI references via provided text. |
| extensions/copilot/src/extension/chatSessions/claude/node/claudePromptResolver.ts | Adds optional resolver hook to replace URI references with actual text. |
| extensions/copilot/src/extension/chatSessions/claude/node/claudeCodeAgent.ts | Uses the resolver hook to inject summary document content into prompt blocks. |
Comment on lines
128
to
+132
| case AgentSessionProviders.Local: | ||
| case AgentSessionProviders.Background: | ||
| case AgentSessionProviders.Cloud: | ||
| return true; | ||
| case AgentSessionProviders.Claude: | ||
| return true; |
Comment on lines
+22
to
+26
| const continueInProviderOrder = new Map<AgentSessionProviders, number>([ | ||
| [AgentSessionProviders.Background, 0], | ||
| [AgentSessionProviders.Cloud, 1], | ||
| [AgentSessionProviders.Claude, 2], | ||
| ]); |
Comment on lines
+162
to
166
| }).sort((a, b) => { | ||
| const providerA = getAgentSessionProvider(a.type)!; | ||
| const providerB = getAgentSessionProvider(b.type)!; | ||
| return (continueInProviderOrder.get(providerA) ?? Number.MAX_SAFE_INTEGER) - (continueInProviderOrder.get(providerB) ?? Number.MAX_SAFE_INTEGER); | ||
| }); |
| return {}; | ||
| } | ||
|
|
||
| const attachedContext = []; |
Comment on lines
+219
to
+222
| const chatOptions: { prompt: string; attachedContext: typeof attachedContext; userSelectedModelId?: string } = { | ||
| prompt, | ||
| attachedContext, | ||
| }; |
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.
Fixes #300531
This enables Claude Agent as a functional
Continue Indestination from chat and plan-mode handoffs.Summary
Users can now continue work in Claude Agent from the existing
Continue InUI, including the plan-modeStart Implementationdropdown. The handoff opens a real Claude Agent session and starts it with the delegated task context.The implementation follows the existing Copilot CLI handoff pattern: when Claude is invoked from a non-Claude session, the Claude provider treats the request as a delegation, creates a new target session, and starts that session with summarized context rather than trying to process the source chat resource directly.
Details
@clauderequests from non-Claude sessions as delegated handoffs, matching the Copilot CLI pattern.claude-codesession with a concise delegated prompt and summary attachment.Validation
Figure 1: Claude Added to the Start Implementation Continue In Menu

Figure 2: Claude Handoff Starts a Delegated Agent Session From Plan Mode

Figure 3: Delegated Claude Session Uses Summary Context and Preserves the Selected Model
