Skip to content

agentHost: use CLI host OAuth credentials for Mission Control - #348787

Merged
roblourens merged 6 commits into
mainfrom
roblou/agents/auth-token-issue-microsoft-org
Nov 17, 2026
Merged

roblourens merged 6 commits into
mainfrom
roblou/agents/auth-token-issue-microsoft-org

Conversation

@roblourens

@roblourens roblourens commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

CLI-hosted GitHub environments have a repository-capable OAuth login, but Mission Control sessions use the connecting client's identity-only token unless host execution credentials are configured.

Install the CLI host's OAuth credential for Copilot and repository operations before registration, and reinstall it after an agent-host crash. Keep it in a trusted-parent-owned slot so direct-client authentication or sign-out cannot replace or revoke it. Apply explicit host/client credential choices through the same owner-validated configuration for desktop and CLI hosts. Live requests and restored background work use the shared host authentication mode; registration withdrawal does not reset that choice.

Same-account client admission, independent MCP authentication, and SSH/dev-tunnel credential behavior remain unchanged. The host OAuth login still needs any organization-required SSO authorization.

Local validation passed:

pnpm run build-fast --client-only
pnpm run typecheck-client
./scripts/test.sh --run src/vs/server/test/node/serverAgentHostManager.test.ts --run src/vs/platform/agentHost/test/node/missionControlHost.test.ts --run src/vs/platform/agentHost/test/node/missionControlProtocolServer.test.ts --run src/vs/platform/agentHost/test/node/missionControlAuthentication.test.ts --run src/vs/platform/agentHost/test/node/agentHostAuthenticationScope.test.ts --run src/vs/workbench/contrib/chat/test/browser/remoteAgentHost/missionControlContribution.test.ts --reporter dot

Result: build and type-check passed; 497 tests passed and 5 were pending. Live Windows host SSO was not exercised. To verify against GitHub, start an updated CLI GitHub environment, connect from the same GitHub account, and confirm an agent-shell gh repo view can access an organization repository authorized for the host's OAuth login.

(Written by Copilot)

roblourens and others added 2 commits November 16, 2026 22:16
Install CLI-owned GitHub execution credentials through trusted management IPC, separate from direct-client authentication. Apply the host's credential choice consistently to live and restored Mission Control work while retaining same-owner admission and credential revocation.

Co-authored-by: Copilot <[email protected]>
Preserve standard authentication account hints alongside parent-owned execution credentials.

Co-authored-by: Copilot <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 17, 2026 06:20
@vs-code-engineering

This comment has been minimized.

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

The local credential source rejects valid parent-owned credentials without a matching _tokens entry, causing host operations such as opening a session canvas to fail with AuthRequired.

1 open issue
What changed in this PR

This PR enables CLI-hosted Mission Control sessions to use the host’s GitHub OAuth credential for Copilot and repository operations, independently of connecting clients’ credentials.

Changes:

  • Install parent-owned execution credentials before registration and reinstall them after an agent-host crash.
  • Apply explicit host/client credential choices through owner-validated configuration, preserving the choice when registration is withdrawn.
  • Add credential-isolation and lifecycle tests, and document the authentication boundaries.
File Description
src/​vs/​workbench/​contrib/​chat/​browser/​remoteAgentHost/​missionControlSharingService.ts Send explicit host/client credential choices.
src/​vs/​server/​test/​node/​serverAgentHostManager.test.ts Test credential installation, crash recovery, and startup rejection.
src/​vs/​server/​node/​serverAgentHostManager.ts Install CLI OAuth credentials before registration.
src/​vs/​platform/​agentHost/​test/​node/​missionControlProtocolServer.test.ts Test owner validation and credential-mode persistence.
src/​vs/​platform/​agentHost/​test/​node/​missionControlHost.test.ts Exercise shared authentication configuration.
src/​vs/​platform/​agentHost/​test/​node/​agentService.test.ts Supply the new management-service dependency.
src/​vs/​platform/​agentHost/​test/​node/​agentHostAuthenticationScope.test.ts Test parent-owned credential isolation, replacement, and expiry.
src/​vs/​platform/​agentHost/​node/​missionControl/​missionControlHost.ts Use shared authentication mode for relay credentials.
src/​vs/​platform/​agentHost/​node/​missionControl/​missionControlEnvironment.ts Apply validated credential choices before relay attachment.
src/​vs/​platform/​agentHost/​node/​missionControl/​MISSION_CONTROL.md Document CLI credentials and mode persistence.
src/​vs/​platform/​agentHost/​node/​missionControl/​MISSION_CONTROL_SECURITY_REQUIREMENTS.md Document parent-owned credential security boundaries.
src/​vs/​platform/​agentHost/​node/​agentHostManagementService.ts Expose trusted credential installation.
src/​vs/​platform/​agentHost/​node/​agentHostAuthenticationService.ts Store and resolve isolated parent-owned credentials.
src/​vs/​platform/​agentHost/​common/​agentService.ts Define the management API and credential-choice semantics.

Review effort: Balanced

Accept a current shared parent credential in local continuation without requiring an entry in the direct-client token pool. Retain capture lifetime and revocation checks.

Co-authored-by: Copilot <[email protected]>
@vs-code-engineering

This comment has been minimized.

@roblourens
roblourens marked this pull request as ready for review November 17, 2026 06:52
@roblourens
roblourens enabled auto-merge November 17, 2026 06:53
@roblourens
roblourens added this pull request to the merge queue Nov 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 17, 2026
Preserve categorized Mission Control configuration errors alongside host credential selection.

Co-authored-by: Copilot <[email protected]>
@vs-code-engineering

This comment has been minimized.

@roblourens
roblourens added this pull request to the merge queue Nov 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 17, 2026
@roblourens
roblourens added this pull request to the merge queue Nov 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 17, 2026
roblourens and others added 2 commits November 17, 2026 11:15
Expect explicit host-credential mode when validating canonical Windows drive grants through CLI environment registration.

Co-authored-by: Copilot <[email protected]>
Preserve Mission Control background recovery alongside shared host execution authentication.

Co-authored-by: Copilot <[email protected]>
@vs-code-engineering

vs-code-engineering Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

No demo for a16a8e4. Internal host OAuth credential handling changes; no visible UI change. Workflow run

@roblourens
roblourens enabled auto-merge November 17, 2026 19:29
@roblourens
roblourens added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit 46393f0 Nov 17, 2026
37 of 38 checks passed
@roblourens
roblourens deleted the roblou/agents/auth-token-issue-microsoft-org branch November 17, 2026 20:03
@vs-code-engineering vs-code-engineering Bot added this to the 1.148.0 milestone Nov 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.

5 participants