Skip to content

agentHost: use vacuum into for safer sqlite migration during forking#311477

Merged
connor4312 merged 3 commits intomainfrom
connor4312/vacuum-into
Apr 20, 2026
Merged

agentHost: use vacuum into for safer sqlite migration during forking#311477
connor4312 merged 3 commits intomainfrom
connor4312/vacuum-into

Conversation

@connor4312
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings April 20, 2026 20:14
@connor4312 connor4312 self-assigned this Apr 20, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the agent host’s session forking flow to copy the per-session SQLite database via SQLite’s VACUUM INTO, aiming to produce a consistent snapshot even while the source DB is open.

Changes:

  • Add ISessionDatabase.vacuumInto(targetPath) and implement it in SessionDatabase using VACUUM INTO.
  • Switch Copilot session forking to use vacuumInto instead of file-copying the DB file.
  • Add a unit test validating vacuumInto produces a readable copy with the same data.
Show a summary per file
File Description
src/vs/platform/agentHost/node/sessionDatabase.ts Implements vacuumInto using VACUUM INTO on the underlying sqlite connection.
src/vs/platform/agentHost/common/sessionDataService.ts Extends ISessionDatabase with the new vacuumInto API + docs.
src/vs/platform/agentHost/node/copilot/copilotAgent.ts Updates fork logic to copy the session DB via vacuumInto.
src/vs/platform/agentHost/test/node/sessionDatabase.test.ts Adds a test ensuring vacuumInto copies turn event IDs + metadata.
src/vs/platform/agentHost/test/common/sessionTestHelpers.ts Updates test stub TestSessionDatabase to satisfy the new interface method.

Copilot's findings

  • Files reviewed: 5/5 changed files
  • Comments generated: 2

Comment thread src/vs/platform/agentHost/node/copilot/copilotAgent.ts Outdated
Comment thread src/vs/platform/agentHost/node/copilot/copilotAgent.ts Outdated
@connor4312 connor4312 marked this pull request as ready for review April 20, 2026 20:47
@connor4312 connor4312 enabled auto-merge (squash) April 20, 2026 20:47
@connor4312 connor4312 merged commit 7a0f366 into main Apr 20, 2026
40 of 41 checks passed
@connor4312 connor4312 deleted the connor4312/vacuum-into branch April 20, 2026 21:17
@vs-code-engineering vs-code-engineering bot added this to the 1.118.0 milestone Apr 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