agentHost: Filter external Copilot sessions - #331187
Merged
Benjamin Christopher Simmonds (benibenj) merged 3 commits intoAug 17, 2026
Merged
agentHost: Filter external Copilot sessions#331187Benjamin Christopher Simmonds (benibenj) merged 3 commits into
Benjamin Christopher Simmonds (benibenj) merged 3 commits into
Conversation
Only discover standalone Copilot CLI and GitHub Copilot app sessions that have repository metadata and were modified within the last seven days. Preserve legacy extension-host adoption and cover accepted and rejected metadata boundaries. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Benjamin Christopher Simmonds (benibenj)
enabled auto-merge (squash)
August 17, 2026 12:02
Copilot started reviewing on behalf of
Benjamin Christopher Simmonds (benibenj)
August 17, 2026 12:07
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Restricts Copilot external-session discovery to recent, repository-backed sessions from approved clients while preserving legacy adoption behavior.
Changes:
- Filters by client name, repository metadata, and seven-day age.
- Uses persisted SDK session data for classification.
- Adds focused boundary and exclusion tests.
Show a summary per file
| File | Description |
|---|---|
AGENT_HOST_SESSIONS_PROVIDER.md |
Documents external Copilot session eligibility. |
copilotAgent.test.ts |
Tests client, age, and repository filtering. |
copilotAgent.ts |
Implements external-session filtering and diagnostics. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Balanced
Gate the raw session-list RPC used by external discovery so the migration-toggle test no longer waits on the obsolete convenience listSessions seam. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Apply the repository TypeScript formatter to the raw session-list test fixture. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sandeep Somavarapu (sandy081)
approved these changes
Aug 17, 2026
Benjamin Christopher Simmonds (benibenj)
merged commit Aug 17, 2026
e0d6297
into
main
27 checks passed
Benjamin Christopher Simmonds (benibenj)
deleted the
agents/create-worktree-copilot-session-filter
branch
August 17, 2026 13:11
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.
What does this PR do?
Filters Copilot external SDK session discovery so it only imports sessions that:
clientNameequal togithub/cliorgithub/autopilot;Sessions with unknown or missing client names, stale sessions, and repository-less sessions are excluded. Legacy extension-host adoption remains unchanged. The provider specification documents that
clientNameidentifies the runtime client that created or last resumed a session rather than immutable creator provenance.Testing
npm run typecheck-clientnpm run eslint -- src\vs\platform\agentHost\node\copilot\copilotAgent.ts src\vs\platform\agentHost\test\node\copilotAgent.test.ts.\scripts\test.bat --run src\vs\platform\agentHost\test\node\copilotAgent.test.ts --grep "external chat discovery"(10 passing)