Skip to content

agentHost: recover from expired GitHub credentials - #330556

Merged
Connor Peet (connor4312) merged 3 commits into
mainfrom
connor4312/agent-host-auth-recovery
Aug 13, 2026
Merged

agentHost: recover from expired GitHub credentials#330556
Connor Peet (connor4312) merged 3 commits into
mainfrom
connor4312/agent-host-auth-recovery

Conversation

@connor4312

Copy link
Copy Markdown
Member

agentHost: recover from expired GitHub credentials

Recover Agent Host sessions when GitHub credentials expire without requiring a
window restart.

  • Emit complete protected resource metadata when providers require authentication.
  • Resend the current client token before escalating to the shared sign-in flow.
  • Update live Copilot SDK sessions with new credentials and restart only as a fallback.
  • Re-arm authentication notifications after each client authentication attempt.
  • Handle model-list authorization failures as authentication challenges.
  • Keep recovery and transformed-token state isolated per Agent Host connection.
  • Add local, remote, multi-host, concurrency, and live credential update coverage.

Protocol contract: microsoft/agent-host-protocol#396

(Commit message generated by Copilot)

Recover Agent Host sessions when GitHub credentials expire without requiring a
window restart.

- Emit complete protected resource metadata when providers require authentication.
- Resend the current client token before escalating to the shared sign-in flow.
- Update live Copilot SDK sessions with new credentials and restart only as a fallback.
- Re-arm authentication notifications after each client authentication attempt.
- Handle model-list authorization failures as authentication challenges.
- Keep recovery and transformed-token state isolated per Agent Host connection.
- Add local, remote, multi-host, concurrency, and live credential update coverage.

(Commit message generated by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…-auth-recovery

# Conflicts:
#	src/vs/platform/agentHost/node/copilot/copilotAgent.ts
#	src/vs/platform/agentHost/test/node/copilotAgent.test.ts
#	src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostAuth.ts
#	src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostChatContribution.test.ts
Clear a notification-scoped Agent Host credential when the client no longer has
a matching authentication session.

- Forward an empty token after token resolution fails.
- Reset staged recovery state after credential removal.
- Verify that a later token can start recovery again without prompting.

(Commit message generated by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings August 12, 2026 22:10
@connor4312
Connor Peet (connor4312) enabled auto-merge (squash) August 12, 2026 22:10
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Tyler James Leonhardt (@TylerLeonhardt)

Matched files:

  • src/vs/platform/agentHost/node/claude/claudeAgent.ts

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.

Pull request overview

Adds live recovery for expired Agent Host GitHub credentials without restarting the window.

Changes:

  • Adds connection-scoped token resend and sign-in escalation.
  • Updates live Copilot SDK sessions, with safe restart fallback.
  • Expands authentication protocol metadata and recovery coverage.
Show a summary per file
File Description
agentHostChatContribution.test.ts Tests local recovery flows.
agentHostAuth.test.ts Tests token recovery state.
agentHostChatContribution.ts Handles authentication notifications.
agentHostAuth.ts Implements recovery coordination.
remoteAgentHost.contribution.test.ts Tests remote and multi-host recovery.
REMOTE_AGENT_HOST_SESSIONS_PROVIDER.md Documents remote recovery behavior.
remoteAgentHost.contribution.ts Adds per-connection recovery.
mockAgent.ts Adds observable authentication state.
copilotAgentSession.test.ts Tests live credential updates.
copilotAgent.test.ts Covers updates, concurrency, and fallback.
claudeAgent.test.ts Updates authentication-state assertions.
agentSideEffects.test.ts Tests observable notification emission.
copilotAgentSession.ts Updates SDK session credentials.
copilotAgent.ts Coordinates credential updates and restarts.
codexAgent.ts Removes obsolete auth events.
claudeAgent.ts Removes obsolete auth events.
agentSideEffects.ts Publishes observable auth requirements.
agentService.ts Emits complete resource metadata.
notifications.ts Changes the authentication wire contract.
agent.ts Exposes observable auth state.
.github/skills/sessions/SKILL.md Documents recovery guidance.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 21/21 changed files
  • Comments generated: 1
  • Review effort level: Balanced

@connor4312
Connor Peet (connor4312) merged commit 670963f into main Aug 13, 2026
60 of 64 checks passed
@connor4312
Connor Peet (connor4312) deleted the connor4312/agent-host-auth-recovery branch August 13, 2026 01:01
@vs-code-engineering vs-code-engineering Bot added this to the 1.134.0 milestone Aug 13, 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