agentHost: use vacuum into for safer sqlite migration during forking#311477
Merged
connor4312 merged 3 commits intomainfrom Apr 20, 2026
Merged
agentHost: use vacuum into for safer sqlite migration during forking#311477connor4312 merged 3 commits intomainfrom
connor4312 merged 3 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
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 inSessionDatabaseusingVACUUM INTO. - Switch Copilot session forking to use
vacuumIntoinstead of file-copying the DB file. - Add a unit test validating
vacuumIntoproduces 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
DonJayamanne
approved these changes
Apr 20, 2026
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.
No description provided.