Skip to content

agentHost: keep peer database alive during multi-root diffs - #331759

Merged
Dmitriy Vasyura (dmitrivMS) merged 1 commit into
mainfrom
chrmarti/agents/log-analysis-fix-candidate-issues-f4ada6e1
Aug 20, 2026
Merged

agentHost: keep peer database alive during multi-root diffs#331759
Dmitriy Vasyura (dmitrivMS) merged 1 commit into
mainfrom
chrmarti/agents/log-analysis-fix-candidate-issues-f4ada6e1

Conversation

@chrmarti

Copy link
Copy Markdown
Collaborator

Summary

  • await multi-root turn diff computation before releasing its tracked-edit database reference
  • add regression coverage that verifies asynchronous peer database reads complete before disposal

Why

When a turn belongs to a peer chat, the changeset service opens that chat's session database for tracked-edit fallback. The multi-root path returned its promise from inside a try without awaiting it, so the finally block disposed the database reference while repository diffing was still running. This produced repeated SessionDatabase has been disposed errors and could omit fallback changes from turn changesets.

Testing

  • npm run transpile-client
  • ./scripts/test.sh --run src/vs/platform/agentHost/test/node/agentHostChangesetService.test.ts
    • 25 passing, 38 pending
  • verified the regression test fails without the added await, with disposal occurring before the delayed database read

Await multi-root turn diff computation before releasing the tracked-edit database reference. Add a regression test that verifies asynchronous peer database reads finish before disposal.\n\nCo-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.

Pull request overview

Fixes premature peer session database disposal during asynchronous multi-root turn diff computation.

Changes:

  • Awaits multi-root diff computation before cleanup.
  • Adds regression coverage verifying reads complete before disposal.
Show a summary per file
File Description
src/vs/platform/agentHost/node/agentHostChangesetService.ts Keeps the tracked database reference alive through multi-root diffing.
src/vs/platform/agentHost/test/node/agentHostChangesetService.test.ts Tests peer database read/disposal ordering.

Review details

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

  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Balanced

@dmitrivMS
Dmitriy Vasyura (dmitrivMS) marked this pull request as ready for review August 20, 2026 17:05
@dmitrivMS
Dmitriy Vasyura (dmitrivMS) merged commit 97a9b4a into main Aug 20, 2026
28 of 29 checks passed
@dmitrivMS
Dmitriy Vasyura (dmitrivMS) deleted the chrmarti/agents/log-analysis-fix-candidate-issues-f4ada6e1 branch August 20, 2026 17:12
@vs-code-engineering vs-code-engineering Bot added this to the 1.135.0 milestone Aug 20, 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