feat(worktrees): add managed worktree sessions - #1796
Merged
Conversation
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
Worktreetool with scoped permissions and explicit remote-workspace gating.Type and Areas
Type: Feature / UI/UX / test
Areas: stable contracts, Rust services and product assembly, Agent tools, desktop/Tauri, Web UI, i18n, E2E
Motivation / Impact
Users can opt into an isolated managed Git Worktree when creating a session while normal sessions remain Local by default. Multiple sessions can start from the same immutable commit and edit the same files independently. Session history remains associated with the main project, while tools and terminals execute inside the bound Worktree. Managed Worktrees can later be branched, retained, rebuilt, or safely removed with protections for active sessions, dirty state, and unpublished detached commits.
Remote workspaces remain explicitly unsupported for this first delivery.
Verification
cargo check --workspace— passedcargo build -p bitfun-desktop— passedcargo test -p bitfun-core worktree --lib— 15 passedcargo test -p bitfun-services-integrations --features git git::managed_worktree::tests --lib— 5 passedpnpm run type-check:web— passedpnpm run i18n:contract:test— 37 passedpnpm run i18n:audit— passed with 0 warningspnpm --dir tests/e2e run test:l1:worktree— 5 passedpnpm --dir tests/e2e run test:l1:worktree-restart— create and recovery phases passed across separate Desktop processespnpm --dir tests/e2e run test:l0— 9 passedReviewer Notes
force; force removal remains a user-confirmed UI-only action.BITFUN_HOME, preventing tests from restoring real account or bot state.ChatInput.tsxpreserves both the upstream registered-workspace isolation rule and session-bound Worktree display/execution behavior.Checklist