Skip to content

[cherry-pick] Avoid Agent Host session listing starvation - #333646

Merged
Benjamin Christopher Simmonds (benibenj) merged 5 commits into
mainfrom
cherry-pick/333579
Sep 1, 2026
Merged

[cherry-pick] Avoid Agent Host session listing starvation#333646
Benjamin Christopher Simmonds (benibenj) merged 5 commits into
mainfrom
cherry-pick/333579

Conversation

@vs-code-engineering

Copy link
Copy Markdown
Contributor

Cherry-pick of #333579 from release/1.136.

⚠️ This cherry-pick has merge conflicts that need manual resolution. Conflict markers (<<<<<<</=======/>>>>>>>) are committed to the branch — check it out locally, resolve, and force-push.

git fetch origin cherry-pick/333579 && git checkout cherry-pick/333579
# resolve conflicts, then:
git add -A && git commit --amend --no-edit && git push --force-with-lease

Conflicting files:

  • src/vs/platform/agentHost/test/node/codex/codexModelRefresh.test.ts

Summary

  • avoid repeated Agent Host session-list recomputation under catalog invalidation
  • persist the Recent-mode local-session cutoff without immediately reconciling active external sessions
  • defer external-session SDK discovery until startup settles while preserving legacy migration discovery
  • prevent Codex activation from starting unrequested external discovery

Addresses #333284.

Validation

  • AgentService aggregation suite: 93 passing
  • Codex model refresh suite: 50 passing
  • targeted Claude, Copilot, Codex, and external-session discovery tests

Copilot AI balanced review requested due to automatic review settings August 31, 2026 21:22
@vs-code-engineering vs-code-engineering Bot added the cherry-pick-artifact Auto-generated cherry-pick PR label Aug 31, 2026
@vs-code-engineering

Copy link
Copy Markdown
Contributor Author

📬 CODENOTIFY

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

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

Defers external-session discovery and reduces session-list invalidation to prevent Agent Host listing starvation.

Changes:

  • Defers provider discovery until startup settles.
  • Persists Recent-mode local-session cutoffs.
  • Avoids invalidation for idle provisional sessions and updates tests/documentation.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/vs/workbench/contrib/chat/browser/chat.shared.contribution.ts Updates Recent-mode description.
src/vs/platform/agentHost/test/node/copilotAgent.test.ts Explicitly starts Copilot discovery.
src/vs/platform/agentHost/test/node/codex/codexModelRefresh.test.ts Tests Codex discovery behavior; contains unresolved conflicts.
src/vs/platform/agentHost/test/node/claudeAgent.test.ts Explicitly starts Claude discovery.
src/vs/platform/agentHost/test/node/agentService.test.ts Covers discovery, cutoff persistence, and invalidation.
src/vs/platform/agentHost/node/copilot/copilotAgent.ts Exposes explicit discovery startup.
src/vs/platform/agentHost/node/codex/codexAgent.ts Tracks host-requested discovery across activation.
src/vs/platform/agentHost/node/claude/claudeAgent.ts Exposes explicit discovery startup.
src/vs/platform/agentHost/node/agentService.ts Coordinates deferred discovery and persisted recency state.
src/vs/platform/agentHost/common/agentHostSchema.ts Updates Agent Host setting description.
src/vs/platform/agentHost/common/agent.ts Adds the discovery-start API.
src/vs/platform/agentHost/AGENTS.md Documents the revised discovery lifecycle.

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

Comment thread src/vs/platform/agentHost/test/node/codex/codexModelRefresh.test.ts Outdated
Comment thread src/vs/platform/agentHost/node/agentService.ts
@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Base: 3e33b210 Current: 06badc5e

No screenshot changes.

Preserve both the main-branch model resolution coverage and the cherry-picked host-requested discovery test.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep active session-list scans coalesced and let stale callers share one trailing scan instead of starting overlapping provider, database, and Git work.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Report inactive Codex migration as deferred so AgentService does not latch an unrequested external discovery for the next activation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@benibenj
Benjamin Christopher Simmonds (benibenj) merged commit 9e59633 into main Sep 1, 2026
60 of 61 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.136.0 milestone Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-pick-artifact Auto-generated cherry-pick PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants