Skip to content

agentHost: destroy Copilot sessions concurrently - #333946

Draft
Christof Marti (chrmarti) wants to merge 1 commit into
mainfrom
agents/log-analysis-fix-candidate-issues-0f604117
Draft

agentHost: destroy Copilot sessions concurrently#333946
Christof Marti (chrmarti) wants to merge 1 commit into
mainfrom
agents/log-analysis-fix-candidate-issues-0f604117

Conversation

@chrmarti

Copy link
Copy Markdown
Collaborator

Agent Host shutdown has a 1.5 second provider budget, but the Copilot provider destroyed each live SDK session serially. With several restored sessions, their disconnect latency accumulated and repeatedly produced:

Agent Host providers did not finish shutting down within 1500ms.

Destroy independent live sessions concurrently while preserving the existing ordering that waits for all sessions before stopping the shared client.

Adds a regression test that blocks two session disconnects and verifies both start before either completes.

Validation:

  • npm run transpile-client
  • ./scripts/test.sh --run src/vs/platform/agentHost/test/node/copilotAgent.test.ts --grep "shutdown" (6 passing)
  • git diff --check

The serialized teardown was introduced in #329633.

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

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.

Copilot review overview

🟢 Approval recommended

The focused implementation preserves lifecycle ordering and includes effective regression coverage.

Review tier: Balanced
Findings: None

What changed in this PR

Runs independent Copilot SDK session teardown concurrently while retaining client shutdown ordering.

Changes:

  • Destroys all live sessions with Promise.all.
  • Adds regression coverage proving both disconnects start before completion.
File Description
src/​vs/​platform/​agentHost/​node/​copilot/​copilotAgent.ts Parallelizes live-session destruction before stopping the shared client.
src/​vs/​platform/​agentHost/​test/​node/​copilotAgent.test.ts Tests concurrent session teardown during shutdown.

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

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.

2 participants