Fix new cloud session disappearing and misgrouping after commit#326230
Open
osortega wants to merge 3 commits into
Open
Fix new cloud session disappearing and misgrouping after commit#326230osortega wants to merge 3 commits into
osortega wants to merge 3 commits into
Conversation
The Agents window (vs/sessions) drove a new cloud (RemoteNewSession) agent session through the wrong commit path, causing it to disappear ~5s after delegating, and then group under "Unknown" / flip its repo label once it did appear. Three related fixes: 1. Wait for the committed resource on cloud sessions. A cloud session commits a new resource mid-request (untitled -> /task/<id>), like Copilot CLI, so _sendFirstChat now routes RemoteNewSession through _waitForCommittedSession instead of waiting on the stale untitled resource (which timed out and removed the session). The wait is also deferred (skips the response-complete race, longer timeout) because the cloud commit is delayed by a confirmation round-trip and network delegation. 2. Attach owner/name metadata to PR-less task cards so a freshly created task groups under its repo instead of "Unknown"/"Other" until a PR resolves. Repo identity is hoisted from PullArtifactRef.repo to CloudSessionData.repo (a task has a repo regardless of a pull artifact); resolvePullArtifact now takes repo as an explicit argument. 3. Consolidate the repo label. Both the new-session workspace and the committed session adapter now derive an owner/repo label via a shared githubRemoteRepoLabel helper, so a cloud session stays in the same group before and after commit (no more microsoft/vscode -> vscode flip). Adds a regression test for the cloud commit-swap. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes cloud-session persistence, repository grouping, and label consistency after commit.
Changes:
- Waits for cloud sessions to commit to their final resource.
- Adds repository metadata to PR-less task sessions.
- Standardizes GitHub repository labels as
owner/repo.
Show a summary per file
| File | Description |
|---|---|
copilotChatSessionsProvider.test.ts |
Adds cloud commit regression coverage. |
copilotChatSessionsProvider.ts |
Handles cloud resource commits and consistent labels. |
cloudAgentBackend.ts |
Hoists repository identity into session data. |
taskApiBackend.ts |
Populates repository data for task listings. |
pullArtifactResolver.ts |
Accepts repository identity explicitly. |
copilotCloudSessionsProvider.ts |
Adds task metadata and forwards repository identity. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 4
- Review effort level: Medium
…ssion-commit-grouping # Conflicts: # src/vs/sessions/contrib/providers/copilotChatSessions/test/browser/copilotChatSessionsProvider.test.ts
osortega
marked this pull request as ready for review
July 16, 2026 22:58
osortega
enabled auto-merge (squash)
July 16, 2026 22:58
roblourens
approved these changes
Jul 17, 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.
Problem
Sending a new cloud agent session from the Agents window (
vs/sessions) failed in three ways:microsoft/vscode(pre-commit) tovscode(post-commit).Root causes & fixes
1. Session disappears — wait for the committed resource
A cloud session (
RemoteNewSession) commits a new resource mid-request (untitled-…→/task/<id>), exactly like Copilot CLI. But_sendFirstChatgrouped it with Claude (whose resource is stable), so it waited for the stale untitled resource in the cache, timed out, and removed the session.RemoteNewSessionnow routes through_waitForCommittedSessionto learn the committed/task/<id>resource.responseCompletePromiserace (which resolves early at the confirmation, not when the commit lands) and uses a longer timeout, because the cloud commit is delayed by a confirmation round-trip + network delegation + session load. Diagnosed from trace logs showing the commit event firing at ~T+6.5s while the old 5s safety timeout gave up at ~T+5.6s.2. "Unknown" group — attach repo metadata to PR-less task cards
Grouping derives the repo from
getRepositoryName(session)(metadata.owner/metadata.name). A brand-new PR-less task session item carried no metadata, so it grouped under "Unknown" (Agents window) / "Other" (core).PullArtifactRef.repoup toCloudSessionData.repo— a task has a repo regardless of whether it has a pull artifact.resolvePullArtifactnow takesrepoas an explicit argument (its only consumer).metadata: { owner, name }fromCloudSessionData.repo.3. Label flip — consolidate to
owner/repoThe two label producers derived the repo label differently: the new-session workspace used
owner/repo(stripping/HEAD), while the committed adapter usedgetRepositoryName(repo name only).githubRemoteRepoLabel(uri)helper returningowner/repo, so the session stays in the same group across the commit swap.Tests
cloud session that commits a new resource resolves without timing out).CopilotChatSessionsProvidersuite passes (77); client typecheck and copilot-extension typecheck are clean.Notes