Repository navigation
agentHost: isolate Mission Control credential sponsorship - #341455
Merged
Merged
Conversation
Keep Mission Control credentials out of legacy authentication and pin protected execution to client-owned grants. Preserve untouched local, SSH and tunnel behavior; cover cold restore, queues, native GitHub work, scoped SDK runtimes and configuration races. Co-authored-by: Copilot <[email protected]> (cherry picked from commit 99da3e5)
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Credential rotation is not represented in changeset-operation deduplication, allowing a later request to reuse an operation admitted under an older credential.
1 open finding
What changed in this PR
This PR isolates Mission Control credential sponsorship from desktop authentication across Agent Host execution and GitHub operations.
Changes:
- Adds connection-scoped credential capture, persistence, and validation.
- Propagates sponsorship through turns, continuations, GitHub operations, cloning, and Agent Merge.
- Removes legacy local-credential delegation and adds extensive regression coverage.
| File | Description |
|---|---|
agentHostCredentials.ts |
Defines scoped credential capture. |
agentHostAuthenticationScope.ts |
Owns connection credentials. |
agentHostAuthenticationService.ts |
Separates and persists sponsorship. |
agentService.ts |
Enforces sponsorship across sessions and turns. |
protocolServerHandler.ts |
Routes connection credential sources. |
copilotAgent.ts |
Manages isolated SDK runtimes. |
copilotGitHubCredentials.ts |
Supplies captured SDK credentials. |
copilotSessionLauncher.ts |
Restricts scoped runtime features. |
agentHostGitHubService.ts |
Creates sponsored GitHub clients. |
agentHostChangesetOperationService.ts |
Captures credentials for native operations. |
agentHostGitStateService.ts |
Propagates sponsorship to background work. |
agentMergeController.ts |
Separates Agent Merge sponsorship. |
agentSideEffects.ts |
Preserves credentials through execution. |
sessionServerTools.ts |
Propagates sponsorship through agent-created work. |
missionControlAuthentication.ts |
Uses relay credentials without desktop substitution. |
missionControlProjects.ts |
Isolates Git clone authentication. |
missionControlSharingService.ts |
Removes local-credential delegation. |
missionControlContribution.test.ts |
Updates removed-setting coverage. |
sessionWorkspaceConversion.test.ts |
Covers sponsored continuation. |
worktreeIsolation.test.ts |
Updates credential-aware test fixtures. |
testGitHubService.ts |
Supports credential sources in tests. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Report failed clone outcomes instead of masking Git errors behind a readiness timeout, and include the actual SSH failure in assertion output. Co-authored-by: Copilot <[email protected]>
Contributor
|
Base:
|
Git for Windows cannot read Node's Win32 null-device path as a config file. Use the Git-recognized empty config path while preserving scoped clone authentication and transport restrictions. Co-authored-by: Copilot <[email protected]>
Make chat credential contexts authoritative, separate history observation from execution sponsorship, preserve local control and Git refresh without implicit authentication, and correct scoped SDK tool, configuration and storage lifecycles. Add actual-provider exact-token and coding-parity coverage while preserving untouched legacy behavior. Co-authored-by: Copilot <[email protected]>
Keep the disconnected-sponsor discard assertion platform-neutral by comparing the restored native filesystem path. Co-authored-by: Copilot <[email protected]>
Capture and validate operation credentials before deduplication, and include the captured grant generation in the retry key without retaining token values in keys. Preserve mutation serialization and same-generation retries; cover rotation and disconnected sponsors. Co-authored-by: Copilot <[email protected]>
Canonicalize CRLF before removing reviewed SQL instruction sections so Windows prompt parity compares content rather than leftover blank lines. Cover both line-ending styles and ensure unreviewed differences still fail. Co-authored-by: Copilot <[email protected]>
Preserve current upstream Connector reconciliation, SDK updates, archived-chat handling and authenticated host settings while retaining scoped credential boundaries. Adapt regression fixtures to per-session Connector authentication and validated changeset membership. Co-authored-by: Copilot <[email protected]>
Normalize JSON-escaped copies of the known fixture home and workspace while preserving unrelated paths and prompt differences. Add token-safe mismatch metadata so cross-platform parity failures remain actionable without printing prompt or credential contents. Co-authored-by: Copilot <[email protected]>
Match the lowercased Windows drive letter supplied through URI.fsPath while preserving unrelated paths and the strict prompt digest assertion. Co-authored-by: Copilot <[email protected]>
Describe stable implementation boundaries and standing release checks rather than in-progress CI status. Identify the two accepted MCP attribution deferrals against the pinned upstream authentication documentation. Co-authored-by: Copilot <[email protected]>
Adapt the scoped startup test to the upstream HydraFusion multi-root constructor argument and register it at suite scope. Keep exact file-content assertions while expecting native CRLF for new Windows patch files. Co-authored-by: Copilot <[email protected]>
Adapt S03 routing to central session state, per-chat configuration, live owner references and recorded chat storage. Preserve scoped credentials through provider resume, workspace conversion and read-only terminal/history restoration while retaining upstream customization anchors and configuration behavior. Co-authored-by: Copilot <[email protected]>
Preserve upstream canvas handoff settlement while keeping each resume on its chat-owned credential runtime. Include upstream telemetry-consent propagation without overriding either authentication or telemetry policy. Co-authored-by: Copilot <[email protected]>
Include the landed panel-tab geometry correction and separate ESLint scheduling fix. Preserve the S03 implementation unchanged; credential-rotation and disconnected-sponsor regressions remain green. Co-authored-by: Copilot <[email protected]>
Replace the worktree archive regression's fixed 10ms sleep with working-directory change events registered before dispatch. This waits for the detach/attach contract without changing production behavior, timeouts or expected state. Co-authored-by: Copilot <[email protected]>
Authorize steering by the existing same-owner identity boundary without requiring the running turn's token. Retain the running credential for client, trusted-local and agent-to-agent steering; new turns and queued work still use their own credentials. Document the accepted limitation rather than claiming complete per-device permission isolation. Co-authored-by: Copilot <[email protected]>
Use normal Copilot runtime features and VS Code settings with explicit caller GitHub credentials. Remove scoped profile/tool/skill restrictions, treat GitHub scopes as OAuth hints, preserve BYOK, seed caller credentials for agent shells, and clone with the requesting connection API token and normal network configuration. Keep legacy authentication paths and MCP challenge scope checks unchanged. Co-authored-by: Copilot <[email protected]>
Preserve upstream passive metadata serialization, cold chat read updates and asynchronous database ownership alongside caller-bound credentials. Include the new Copilot SDK/runtime preview and the upstream deterministic worktree archive regression. Co-authored-by: Copilot <[email protected]>
Preserve upstream working-directory reservations, live subagent URI format, multi-account environment sharing, and managed model defaults. Resolve per-chat model policy with the caller runtime and captured GitHub token. Reuse the catalog client for policy reads so concurrent startup configuration changes cannot acquire a stale client during restart. Adapt new context test construction and retain exact restart assertions. Co-authored-by: Copilot <[email protected]>
Resolve metadata, normalized chat catalog and Copilot early-launch conflicts while preserving explicit caller credentials and legacy behavior. Capture the caller credential before pre-warming, retain per-chat runtime selection and stale-state cleanup, and verify rotation, unavailable credentials and real-SDK warm/cold prompt and tool parity. Co-authored-by: Copilot <[email protected]>
Retain caller authentication imports while incorporating upstream model option aliases and worker message origins. Co-authored-by: Copilot <[email protected]>
Preserve connection credentials through the unified pending-message queue and move-aware chat preparation. Retain upstream storage conversion, discard-changes behavior, automation resume checks and image-generation setup alongside caller isolation. Adapt regression fixtures to the updated provider contracts and SDK preview.2. Co-authored-by: Copilot <[email protected]>
roblourens
marked this pull request as ready for review
October 16, 2026 19:10
roblourens
enabled auto-merge (squash)
October 16, 2026 19:10
Bhavya U (bhavyaus)
previously approved these changes
Oct 16, 2026
roblourens
disabled auto-merge
October 16, 2026 19:58
roblourens
enabled auto-merge (squash)
October 16, 2026 19:58
Preserve scoped credential environment and proxy isolation while using the upstream injected Copilot home service. Retain backend setting scope and data-handling metadata without restoring desktop-token delegation. Co-authored-by: Copilot <[email protected]>
Dileep Yavanmandha (dileepyavan)
approved these changes
Oct 16, 2026
Sandeep Somavarapu (sandy081)
added a commit
that referenced
this pull request
Oct 16, 2026
Fixes TS1117 after #341455 and #342128 both added the same shorthand property to the test fixture. Co-authored-by: Copilot <[email protected]>
Sandeep Somavarapu (sandy081)
added a commit
that referenced
this pull request
Oct 16, 2026
Fixes the duplicate-import lint error after #341455 and #342128 both imported from the same module. Co-authored-by: Copilot <[email protected]>
Sandeep Somavarapu (sandy081)
added a commit
that referenced
this pull request
Oct 16, 2026
…hown (#342117) * sessions: close side pane on last tab close when multiple chats are shown Closing the last editor tab while several chats of the same session are shown in the per-chat layout left an empty side pane open. The last-editor-close guards only need to defer to another visible session, since chats of the same session share its main editor part. Co-authored-by: Copilot <[email protected]> * sessions: ignore mounted sessions that are not shown on last tab close In the per-chat layout a maximized chat can leave other sessions mounted but not shown; only block the last-editor close when another session's chat is actually shown. Co-authored-by: Copilot <[email protected]> * agentHost: remove duplicate gitService property in git state test Fixes TS1117 after #341455 and #342128 both added the same shorthand property to the test fixture. Co-authored-by: Copilot <[email protected]> * agentHost: merge duplicate agentHostBranchChangesetScope import Fixes the duplicate-import lint error after #341455 and #342128 both imported from the same module. Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
This was referenced Oct 19, 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.

Summary
Addresses Mission Control security requirement S03: starting work from one connection must not silently select a more powerful GitHub token supplied by the desktop or another connection. No standalone issue was supplied.
The compatibility simplification removes a net 150 TypeScript lines, including 101 production lines, without removing the connection ownership and explicit-credential machinery.
Scope and limitations
Same-owner mid-turn steering matches Copilot Host: device B can steer an already-running turn using A's active credential. B's new or queued turn uses B's credential. This is not complete permission isolation between same-owner devices, and the documentation states that explicitly.
Mission Control remains Copilot-only. Local Claude/Codex behavior is unchanged. Mission Control automations remain unavailable until they have durable sponsorship; local automations are unchanged.
Native VS Code repository/PR actions retain their existing separate repository-resource contract. Project cloning follows the requester API-token behavior. Normal machine Git configuration is not an OS/authentication sandbox.
The upstream MCP-App current-session-token execution and resource-keyed OAuth correlation limitations remain explicitly documented. No universal JavaScript zeroization, OS containment or detection of unobserved remote revocation is claimed.
Validation
Published head:
17384d6b275fe6e8ac0ca4a2c49320e5d0364827; upstream throughb8e38a5b05e; Copilot SDK1.0.23-preview.2, runtime1.0.99-2. GitHub reports the PR mergeable after resolving the latest conflicts. The PR is ready for review with squash auto-merge enabled; required approvals and checks remain enforced.npm run build-fast -- --client-onlynpm run typecheck-clientf4b8f9c41bf; current actual-SDK test also verifies exact Connector headers./scripts/test.sh --run src/vs/workbench/contrib/chat/test/browser/remoteAgentHost/missionControlContribution.test.ts --reporter dot --timeout 30000with the cleanup prefixgit diff HEAD --name-only -z --diff-filter=ACM -- 'src/vs/platform/agentHost/**/*.ts' 'src/vs/workbench/contrib/chat/test/browser/remoteAgentHost/missionControlContribution.test.ts' ':(exclude)src/vs/platform/agentHost/node/codex/protocol/generated/**' | xargs -0 npm run eslint --(before the merge commit)git diff --cached --checkandgit diff --checknpm run valid-layers-checkandnpm run check-cyclic-dependenciesThe actual SDK test requires complete legacy/scoped tool and normalized prompt parity, including SQL instructions and skill catalogs. It executes file/search/patch/shell tools, discovers a workspace skill, checks exact fake A/B/legacy-L model and Connector headers, checks caller credentials inside the native shell by comparison only, exercises rotation/configuration replacement, and verifies concurrent unauthenticated storage deletion makes no HTTP requests. Fake ambient credentials are negative controls; unknown credentials are never logged.
Steering regressions failed before the correction. Foreign-owner rejection remains tested, B's steering must not replace A's running token, and B's subsequent turn selects B's token. Project tests also exercise the actual Git credential helper with fake tokens and no network.
The latest upstream integration preserves worktree reservations, live subagent URI formatting, multi-account sharing and managed model defaults. A new regression proved that the upstream per-chat policy query would create/use the shared client; it now uses the exact caller runtime/token. The catalog policy read reuses the client that listed the models and rejects stale generations, preserving the existing restart lifecycle assertions. The focused restart/live-subagent/policy selection passed 101 tests, 1 pending, and the full unit selection above includes it.
The subsequent conflict resolution also preserves upstream normalized catalog reconciliation, passive archive toggles, PR metadata, model option aliases and experimental Copilot pre-warming. Pre-warming captures the caller credential and uses the chat-owned runtime rather than the shared client. Unit regressions cover warm reuse, rotation before first send and an unavailable caller; the actual-SDK scenario pre-warms A and legacy L while B starts cold, retaining all exact-token/native-tool/prompt assertions. The focused credential/prewarm selection passed 62 tests before the final model-option import merge; the full suite above supersedes it.
The latest main merge retains credentials in upstream's unified per-message queue, keeps move-aware chat preparation bound to the current owner's source, and preserves generation-aware native-operation deduplication alongside upstream discard changes, storage conversion, automation-resume guards and image-generation setup. Fixture construction follows the updated service contracts. The focused moved-chat/Git-state/queue/steering selection passed 108 tests before the full suite above.
Exact targeted commands
Each integration command below is run separately. The cleanup prefix prevents inherited test-host auth inputs from selecting real credentials; the fixture harness clears additional auth inputs and uses synthetic sentinels.
env -u COPILOT_HOME -u COPILOT_SDK_AUTH_TOKEN -u COPILOT_GITHUB_TOKEN \ -u GITHUB_TOKEN -u GH_TOKEN -u OPENAI_API_KEY ./scripts/test.sh \ --runGlob '**/platform/agentHost/test/{node,common}/**/*.test.js' \ --reporter dot --timeout 30000 env -u COPILOT_HOME -u COPILOT_SDK_AUTH_TOKEN -u COPILOT_GITHUB_TOKEN \ -u GITHUB_TOKEN -u GH_TOKEN -u OPENAI_API_KEY ./scripts/test-integration.sh \ --run src/vs/platform/agentHost/test/node/providerIntegration/copilotCredentialSponsorship.integrationTest.ts \ --reporter dot env -u COPILOT_HOME -u COPILOT_SDK_AUTH_TOKEN -u COPILOT_GITHUB_TOKEN \ -u GITHUB_TOKEN -u GH_TOKEN -u OPENAI_API_KEY ./scripts/test-integration.sh \ --run src/vs/platform/agentHost/test/node/providerIntegration/copilotConnectors.integrationTest.ts \ --reporter dotOrdinary Copilot regression coverage
The strict non-Mission-Control Copilot replay passed 271 tests, 24 pending on the published head and bundled SDK preview.2, without changing recordings, assertions or sandbox settings:
An earlier full all-provider replay was not green locally: Codex scenarios failed predominantly with macOS
sandbox-execexecution denial. That qualification was not silently waived, attributed to baseline without proof or made green by disabling sandboxing. No Codex feature work is part of this PR.Cross-platform qualification
Latest head
17384d6b275resolves the subsequent injected Copilot-home and backend-setting metadata conflicts without restoring desktop-token delegation or changing scoped environment/proxy isolation. Code OSS 38959798103, Azure 485386 and repeat 485387 are running on this exact head. GitHub requires approval after the latest push; squash auto-merge remains enabled.Preceding head
f4b8f9c41bf9d0edbddacb85eea5760d7a9ed36bqualification completed successfully:VS Code PR Check, with approval frombhavyaus. Later main movement necessitated the latest merge and new qualification above.GitHub macOS unit attempt 1 failed an unchanged
CapiReplayProxytiming test; attempt 2 passed that test but failed the unchanged ARC symbolic-branch timing test; attempt 3 passed the complete job. Both tests passed isolated local reruns. No tests, assertions, recordings or timeout limits were modified to obtain the passing runs.The upstream Codex replacement-thread discovery correction in
cec60b71487(#341936) is now included. The earlier Codex failure is not suppressed or gated.At preceding head
3d543029489, Code OSS run 38839039605 succeeded on attempt 2, including Linux, Windows and macOS smoke tests. The unrelated chat-pet screenshot-render failure in Component Fixtures run 38839039606 also passed its unchanged rerun. No smoke time limits, fixture baselines or assertions were changed.Earlier builds 485026/485027 failed the Codex
creates a new text filetest on an extraahp-sessionannouncement. The same failure was verified on unmodified main build 484970, at5c76d51641b. The upstream correction is included in the final head, whose two complete Azure runs above supersede that earlier qualification.The preceding head
b0d34ddb2e4completed green Code OSS 38827523570, Azure 484966 and repeat 484967, with two clean Electron integration executions per supported platform. Build 484966 initially failed Linux on an extraroot/sessionAddedin the unchanged Codexcreates a new text filetest. Its isolated local rerun passed, and the unchanged full Linux retry passed; no assertion, recording or sandbox setting was altered. Main then advanced and introduced merge conflicts, requiring the latest integration and renewed qualification above.Azure definition 111 uses CI mode with publishing/release disabled and tests enabled. Standard platform qualification is Windows/Linux x64 and macOS ARM64; macOS x64 coverage is not claimed. Earlier-head successes are not substituted for these final-head runs.
The prior credential-generation review thread was verified against the implementation and regressions, answered and resolved. Draft status and review/approval requirements are unchanged.
Earlier live validation
Code OSS Dev on macOS ARM64 at
2392ed3completed local and loopback-remote real Copilot file work, continuation, running-shell cancellation/recovery, renderer reload and standalone host restart. With explicit authorization, two independent clients used a temporary owner-only Mission Control environment, one reconnected while the peer/local session remained usable, and token-free debugger checks confirmed separate connection scopes and selected-source/SDK equality. Sharing was withdrawn; all owned clients, temporary profiles/workspaces and five test sessions were cleaned up.That run predates subsequent main/SDK changes and the compatibility simplification; it is not current-head live proof. It used same-account credentials, not distinct real privilege levels. Direct remote was loopback, not SSH/tunnel. Screenshots and observable results remain; complete long recordings were lost. Current exact-token/tool/prompt assertions use the synthetic actual-provider test.
(Written by Copilot)