Repository navigation
chat: start cloud sandbox sessions from a draft participant like the cloud agent - #341697
Merged
Osvaldo Ortega (osortega) merged 10 commits intoOct 15, 2026
Merged
Conversation
Osvaldo Ortega (osortega)
force-pushed
the
osortega/cloud-sandbox-transcript-progress
branch
from
October 15, 2026 07:28
b3c8920 to
1edfb56
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Follow-up messages retain the draft-agent lock, and repository searches exclude accessible collaborator repositories.
2 open findings
What changed in this PR
Moves cloud sandbox provisioning progress into the chat transcript and corrects first-send agent routing, alongside the stacked repository-picker changes.
Changes:
- Adds transcript progress and cancellation through the chat sessions service.
- Re-keys silent agent selection when a draft materializes.
- Moves repository discovery into the renderer and expands regression coverage.
| File | Description |
|---|---|
src/vs/workbench/contrib/chat/test/common/mockChatSessionsService.ts |
Mocks preparation progress. |
src/vs/workbench/contrib/chat/test/common/chatService/chatService.test.ts |
Tests cross-type first-send routing. |
src/vs/workbench/contrib/chat/test/browser/widget/chatWidget.test.ts |
Tests progress-aware empty state. |
src/vs/workbench/contrib/chat/test/browser/remoteAgentHost/editorCloudSandboxContribution.test.ts |
Tests provisioning progress, cancellation, and picker integration. |
src/vs/workbench/contrib/chat/test/browser/remoteAgentHost/cloudSandboxRepositoryPicker.test.ts |
Tests repository searches and authentication failures. |
src/vs/workbench/contrib/chat/common/chatSessionsService.ts |
Defines preparation progress APIs. |
src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.ts |
Re-keys silent agents during materialization. |
src/vs/workbench/contrib/chat/browser/widget/chatWidget.ts |
Displays preparation progress in the transcript. |
src/vs/workbench/contrib/chat/browser/remoteAgentHost/editorCloudSandboxContribution.ts |
Publishes provisioning progress and integrates repository picking. |
src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxRepositoryPicker.ts |
Implements renderer-side GitHub repository discovery. |
src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.ts |
Stores and broadcasts preparation progress. |
src/vs/workbench/contrib/chat/browser/chat.shared.contribution.ts |
Normalizes null picker options from RPC. |
src/vs/workbench/contrib/chat/browser/agentSessions/repositoryPicker.ts |
Supports normalized local filtering. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
|
Base:
|
Osvaldo Ortega (osortega)
force-pushed
the
osortega/cloud-sandbox-transcript-progress
branch
from
October 15, 2026 17:44
c65659d to
ca51afc
Compare
Osvaldo Ortega (osortega)
force-pushed
the
osortega/cloud-sandbox-transcript-progress
branch
from
October 15, 2026 18:51
ca51afc to
51fbcec
Compare
…cloud agent Sending a cloud sandbox draft used to go through `newChatSessionItem`, which reported provisioning in a notification and left the chat input spinning until the real session loaded. The Copilot cloud agent instead serves the draft's first turn with a chat participant and commits the draft to the real session once it exists, so the same chat machinery (editor swap, state transfer, queued request migration, `onDidCommitSession`) is reused here: - `commitChatSession` is the commit logic that `mainThreadChatSessions` applied for extension providers, extracted so core providers can commit a draft too. - The cloud sandbox contribution registers a participant for the `cloud-sandbox` draft type. Its first turn provisions the sandbox while updating a single shimmering progress line in the transcript, commits the draft to the environment's session and re-sends the turn there with the draft's mode, model and attachments, where the environment's Agent Host handler runs it. Errors and cancellation surface on the draft turn instead of a notification.
…ession A fresh sandbox session is titled after its id by the host, so the chat editor showed a UUID once the session's state arrived. The Agents window already ignores that stand-in (`isSessionTitlePlaceholder`); the remote agent host handler now does the same through a connection customization the cloud sandbox contribution supplies, so the chat keeps its current title until the agent names the session.
…agent names it
The sessions list labelled a new repo-less sandbox with the Mission Control
task id, flipped to the task's name ("New remote session") once discovery ran,
and then to the session id once the host listed the session. Seed the entry
with the task name discovery will report, and keep the listed label when the
host reports the session id as the title, as the Agents window does.
…nts window Drop the seeded "New remote session" label: the Agents window titles a new cloud session's placeholder after the first line of the prompt and names the Mission Control task the same way (`setInitialSessionTitle`), so neither the task id nor Mission Control's default name is ever shown. Provisioning now seeds the list entry with that prompt-derived title and the editor renames the task to it before the first turn, tolerating a transient Mission Control failure the same way. The host still auto-titles the session; that title replaces the prompt when it arrives.
Keeps the placeholder handling for default-chat titles that came with it.
Osvaldo Ortega (osortega)
force-pushed
the
osortega/cloud-sandbox-transcript-progress
branch
from
October 15, 2026 21:20
9671503 to
f164d9b
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The draft-to-session handoff can lose queued prompts and image context, ignore cancellation, and hide failures.
5 open findings
Prevent queued follow-ups from being lost during provisioning · New Check cancellation before re-sending the committed draft · New Treat transient rename transport failures as recoverable · New Forward resolved directory images when re-sending · New Preserve failed re-sends and display their errors · New
2 resolved since last review
🧠 Review effort: Balanced
…while naming the task `renameTask` rethrows transport errors unwrapped, so the `instanceof CloudSandboxRequestError` guard treated them as permanent and failed creation after the sandbox was already connected. Only cancellation and non-retryable HTTP failures abort now.
- Block the draft's input while its sandbox is provisioned, as the Agents window keeps its placeholder read-only: a follow-up queued on the draft would be dropped when the environment's first turn hydrates the host's empty queue over the migrated one. - Stop before re-sending when the draft was cancelled while being committed. - Forward images the widget expanded from directory attachments; they only exist on the resolved request, not in the attached context. - Record a rejected re-send on the committed session, since the draft that would have shown the error is already replaced.
The host reports the session id as the title of an untitled session; define that once, with why it exists and when it can go, instead of three private copies.
Osvaldo Ortega (osortega)
marked this pull request as ready for review
October 15, 2026 22:54
Osvaldo Ortega (osortega)
enabled auto-merge (squash)
October 15, 2026 22:58
roblourens
approved these changes
Oct 15, 2026
Osvaldo Ortega (osortega)
deleted the
osortega/cloud-sandbox-transcript-progress
branch
October 15, 2026 23:58
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.


Follows #341695 (merged).
Problem
Sending a cloud sandbox draft went through
IChatSessionItemController.newChatSessionItem. Provisioning progress was shown in a notification, the chat input stayed "in progress" with an empty transcript until the real session loaded, failures ended up in notifications instead of the thread, and until the agent named the session it showed up as a GUID in the editor header, the sessions list and recorded history.Approach
The Copilot cloud agent already solves this without new platform machinery: a chat participant serves the draft's first turn (
stream.progressfor the steps) and, once the task exists, commits the draft to the real session (onDidCommitChatSessionItem), which swaps the editor/view, transfers state and migrates queued requests. This PR gives the core cloud sandbox contribution the same shape:commitChatSession(new,chatSessions/chatSessionCommit.ts): the commit logic thatMainThreadChatSessions.$onDidCommitChatSessionItemapplied for extension providers, extracted into aServicesAccessorfunction so core providers can commit a draft too.MainThreadChatSessionsnow just resolves the session type and delegates; no behavior change for extension providers.Cloud sandbox contribution: drops
newChatSessionItem/IProgressServiceand registers a dynamic participant for thecloud-sandboxdraft type (the chat widget already locks a draft to the participant named after its type). Itsinvoke:progressMessage(shimmer) in the draft's transcript — "Creating Cloud Session for owner/repo: Setting up cloud container / Connecting to cloud container / Cloning repository…"; the draft's input is blocked meanwhile so a follow-up can't be queued against a session that doesn't exist yet;commitChatSession;agentIdSilent= the environment's session type), where the environment's Agent Host handler runs it exactly as any later turn.Cancellation (stop button) and errors now surface on the draft turn in the thread.
Nothing changes on the wire: the same Mission Control task creation and rename the Agents window already performs, and the same AHP
createSession+ turn dispatch as any other turn. The handoff is client-side orchestration only.Titles
isCloudSandboxPlaceholderTitle(cloudSandboxAgentHost.ts), and applied through the connection customization hookisSessionTitlePlaceholderfor the live handler, by the session list (which keeps the label it already shows) and for recorded history. This is a compensation, not a design: AHP'sSessionMetadata.titlehas no "untitled" meaning and VS Code's own agent host publishes an empty title. The rule can go once the sandbox host does the same or the protocol defines the untitled case.Tests
editorCloudSandboxContribution.test.tsdrives the registered participant instead ofnewChatSessionItemand covers: provisioning + alias + commit + re-send ordering with the draft's picks and attachments; a new session listed under its prompt until the agent names it, never under an id; the task rename (transient failure continues, not-found fails); cancellation before and during commit; follow-ups blocked while provisioning; a rejected re-send recorded on the committed session; non-draft resources, no-repository drafts, host config confirmation and connection failures.cloudSandboxSessionHandler.test.tsandagentHostChatContribution.test.tscover the placeholder title for recorded history and the live handler.Testing locally
Quit Code OSS,
npm run build-fast -- --client-only,./scripts/code.sh, open a GitHub repo, start a new Cloud session from the session type picker and send a prompt. Progress shows in the transcript; the thread switches to the real session when the sandbox is ready, listed under the prompt until the agent titles it.