Skip to content

chat: pick cloud sandbox repository fixes - #341695

Merged
Osvaldo Ortega (osortega) merged 3 commits into
mainfrom
osortega/accepted-firefly
Oct 15, 2026
Merged

Osvaldo Ortega (osortega) merged 3 commits into
mainfrom
osortega/accepted-firefly

Conversation

@osortega

@osortega Osvaldo Ortega (osortega) commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The cloud sandbox draft's Select repository... button round-tripped through the Copilot Chat extension (embarassing):

renderer workbench.action.chat.cloudSandbox.selectRepository → extension github.copilot.chat.cloudSessions.openRepository → renderer _chat.pickRepository → extension github.copilot.chat.cloudSessions.searchRepositories (Octokit) per keystroke.

That contradicted CloudSandboxApiService's stated goal of working in VS Code Web without an extension host, broke whenever the extension was not yet activated, and surfaced a TypeError: Cannot read properties of null (reading 'placeholder') because undefined arguments become null across the extension-host RPC.

This PR removes the extension dependency from the cloud sandbox contribution entirely.

Changes

  • New CloudSandboxRepositoryPicker (remoteAgentHost/cloudSandboxRepositoryPicker.ts): drives the existing shared RepositoryPicker quick pick with the platform GitHub client from IWorkbenchGitHubService.acquireDefaultAccountClient:
    • empty query → client.query.listRepositories (owner,collaborator,organization_member, sorted by updated)
    • typed query → client.query.searchRepositories with <term> in:name fork:true user:<login> org:<…>; pasted GitHub URLs normalize to owner/repo
    • the viewer/org scope needs /user + /user/orgs, fetched lazily (only once a non-empty query is typed) and cached per pick
    • requests go through the platform transport, so they get shared rate-limit coordination, ETags, priority lanes and telemetry
  • EditorCloudSandboxSessionContribution: drops OPEN_REPOSITORY_COMMAND_ID and ICommandService; _selectRepository calls a protected _pickRepository() that lazily creates the picker.
  • _chat.pickRepository: normalizes null → undefined for its remaining extension caller.
  • Repository option group description reads "Select repository...".

Testing

  • New cloudSandboxRepositoryPicker.test.ts asserts the request sequence (list → user → orgs → scoped search) and that an auth failure rejects without opening a picker.
  • editorCloudSandboxContribution.test.ts swaps the fake extension command for the _pickRepository seam.
  • ./scripts/test.sh --run on the picker, contribution and RepositoryPicker suites: 112 passing. ESLint clean.
  • Manual: open a Cloud session draft in a window without a GitHub remote, click Select repository..., type part of a repo name and pick one → the draft's repository option updates; no notification error.

…ot extension

The cloud sandbox "Select repository..." button round-tripped through the
Copilot Chat extension (openRepository -> _chat.pickRepository ->
searchRepositories), which broke on web and whenever the extension was not
active, and also surfaced a null-vs-undefined RPC bug.

Add CloudSandboxRepositoryPicker, which drives the shared RepositoryPicker
UI with IWorkbenchGitHubService: listRepositories for an empty query and
searchRepositories scoped to the viewer and their organizations otherwise.
The contribution no longer references any extension command.
Copilot AI balanced review requested due to automatic review settings October 15, 2026 06:47
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Base: 83caa64d Current: a08ff05a

No screenshot changes.

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.

🟡 Changes recommended

Local QuickPick filtering hides returned repositories when users paste GitHub URLs.

1 open finding
What changed in this PR

Moves cloud sandbox repository selection into the renderer, removing its dependency on the Copilot Chat extension.

Changes:

  • Adds repository listing and scoped search through the platform GitHub client.
  • Connects cloud sandbox drafts to the new picker and updates tests.
  • Normalizes null options for the remaining extension-backed picker command.
File Description
src/​vs/​workbench/​contrib/​chat/​test/​browser/​remoteAgentHost/​editorCloudSandboxContribution.test.ts Replaces extension-command mocks with a picker seam.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​remoteAgentHost/​cloudSandboxRepositoryPicker.test.ts Tests request sequencing and authentication failure.
src/​vs/​workbench/​contrib/​chat/​browser/​remoteAgentHost/​editorCloudSandboxContribution.ts Uses the renderer picker and updates repository descriptions.
src/​vs/​workbench/​contrib/​chat/​browser/​remoteAgentHost/​cloudSandboxRepositoryPicker.ts Implements GitHub repository listing and search.
src/​vs/​workbench/​contrib/​chat/​browser/​chat.shared.contribution.ts Normalizes null picker options from extension RPC.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

A pasted GitHub URL was rewritten to owner/repo for the API query only, so
the quick pick's local label filter still used the raw URL and hid the
matching result. Let RepositoryPicker callers supply a filterValue and apply
the same normalization there.
@osortega
Osvaldo Ortega (osortega) marked this pull request as ready for review October 15, 2026 07:07
@osortega Osvaldo Ortega (osortega) changed the title chat: pick cloud sandbox repository in the renderer without the Copilot extension chat: pick cloud sandbox repository fixes Oct 15, 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.

3 participants