Open worktree sessions in matching VS Code windows - #26
Merged
Conversation
foundev
force-pushed
the
agent/worktree-editor-handoff
branch
from
July 28, 2026 11:54
d8ee2ce to
4cc785d
Compare
foundev
marked this pull request as ready for review
July 28, 2026 11:56
Collaborator
Author
|
Live VS Code validation on macOS passed after commit 25ab67a: the new-session picker defaulted to Create an isolated worktree, VS Code opened keen-grove in a new window, Brokk ACP focused automatically with Anvil Ready and a usable composer, and both the bundled Anvil process cwd and persisted session cwd matched .brokk/worktrees/keen-grove. Full npm test and VSIX packaging also passed. |
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.
Summary
Root cause
The worktree plumbing correctly passed a selected checkout through the Rust host, ACP lifecycle requests, filesystem/terminal boundary, and persisted session record. However, the start screen defaulted to Current workspace, the command-palette path bypassed the working-directory choice entirely, and opening the selected worktree in VS Code required a small manual action. It was therefore easy to start both the editor and agent in the repository root and conclude that worktree support had not taken effect.
Runtime evidence
Before this change, the active Mjolnir session was persisted with
cwd: $HOME/code/mjolnirand no worktree metadata, and its bundled Anvil process had that same live process cwd. A separatesharp-grovesession was correctly persisted at$HOME/code/mjolnir/.brokk/worktrees/sharp-grove, confirming that the path handoff worked only when the non-default worktree option was explicitly selected.Validation
97f6333(fix duplicate streaming cursors (#25)), retaining both unreleased changelog entries and both webview regression suitesnpx vitest run test/sessionStore.test.ts test/extension.test.ts test/webview.test.ts(37 tests)npm test(51 TypeScript tests, 29 Rust tests, every production module above the per-file 80% gate, plus Markdown/layout/plan/lifecycle/packaging/release checks)npm run package(Darwin ARM64 VSIX built successfully from the rebased source)git diff --check origin/master...HEADThe VSIX was packaged without installing, reloading, or controlling the active VS Code window.