Skip to content

feat(worktrees): add managed worktree sessions - #1796

Merged
bobleer merged 3 commits into
GCWing:mainfrom
bobleer:bob/worktrees
Jul 27, 2026
Merged

feat(worktrees): add managed worktree sessions#1796
bobleer merged 3 commits into
GCWing:mainfrom
bobleer:bob/worktrees

Conversation

@bobleer

@bobleer bobleer commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add stable local/managed/existing Worktree execution-target contracts and preserve the main project as the session persistence scope.
  • Add managed Worktree lifecycle orchestration, registry reconciliation, idempotent commands, local-change copying, safe removal protections, recreation, promotion, and branch creation.
  • Add the deferred Agent Worktree tool with scoped permissions and explicit remote-workspace gating.
  • Add the desktop API plus Web UI launcher, project-grouped sidebar, session-bound workspace strip, Worktree manager, settings, localized copy, and event-driven refresh.
  • Add desktop E2E coverage for parallel isolation, Agent-created child sessions, safe-removal errors, and recovery across a real process restart.

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 — passed
  • cargo build -p bitfun-desktop — passed
  • cargo test -p bitfun-core worktree --lib — 15 passed
  • cargo test -p bitfun-services-integrations --features git git::managed_worktree::tests --lib — 5 passed
  • pnpm run type-check:web — passed
  • Focused Web UI Vitest suite — 7 files / 32 tests passed
  • pnpm run i18n:contract:test — 37 passed
  • pnpm run i18n:audit — passed with 0 warnings
  • pnpm --dir tests/e2e run test:l1:worktree — 5 passed
  • pnpm --dir tests/e2e run test:l1:worktree-restart — create and recovery phases passed across separate Desktop processes
  • pnpm --dir tests/e2e run test:l0 — 9 passed

Reviewer Notes

  • Managed Worktrees are created detached from a resolved commit so parallel sessions can share a baseline; branch creation is explicit.
  • Agent removal never accepts an arbitrary path or force; force removal remains a user-confirmed UI-only action.
  • E2E runtime state now consistently honors BITFUN_HOME, preventing tests from restoring real account or bot state.
  • The rebase conflict in ChatInput.tsx preserves both the upstream registered-workspace isolation rule and session-bound Worktree display/execution behavior.
  • AI-assisted implementation; testing level: fully tested locally across unit, type, build, i18n, and Desktop E2E checks.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

@bobleer
bobleer merged commit 292bd6a into GCWing:main Jul 27, 2026
6 checks passed
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.

1 participant