Repository navigation
Conversation
Why: - Restart falls back to the missing checkout because the original repository was only in memory (HarnessMD#298). What: - Persist and return origin/path for isolated hires, including main-initiated hires. - Resolve the saved recipe centrally for team restore, restart and sleep revival. - Reuse dirty checkouts or safely fall back to the saved origin without pruning branches or files. - Persist the corrected renderer recipe and show an actionable legacy-origin error. Risk: - Already-deleted legacy worktrees with no saved origin cannot be reconstructed safely. - This does not change worktree exit/deletion policy (HarnessMD#297) or provider session identity (HarnessMD#299). Tests: - 12 production-function/Git/registry/renderer/roster regressions: red on upstream, green after. - Full suite with catalog-test PR HarnessMD#669: 977 passed, 1 skipped, 0 failed. - Independent full suite retains only the known HarnessMD#652 catalog error. - npm run typecheck and npm run build passed on macOS, Node 24.13.0. Live Docs: - Before/after evidence under docs/pr-evidence/worktree-origin-*.png.
This was referenced Oct 2, 2026
This branch has not been deployed
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
Closes #298 by persisting the original repository alongside the actual isolated checkout, then resolving that durable recipe in the shared main-process spawn path.
worktreePath/worktreeOriginin registry and roster, including voice/orchestrator hires..claude/falls back to the saved origin, returns that corrected cwd to the renderer and clears stale isolation fields. The floor card saysworktree gone — using base repo.This chooses the issue's explicitly suggested origin-cwd fallback, not automatic recreation. It never prunes stale registrations, resets/deletes an
agent/<id>branch, or removes a leftover directory. Existing unmerged commits remain available for manual recovery. #297's worktree exit policy and #299's CLI session-id capture remain separate concerns (the latter is in #665).Before
Same 12 regression scenarios against upstream
f44b986aproduction spawn and Restore Team functions: 1 pass / 11 fail. Images render actual node:test output; they are not GUI screenshots.After
12 pass / 0 fail. Real Git subprocesses and temporary repositories with spaces, the real HiveManager and RosterStore, and the production main/renderer functions are exercised. The external CLI spawn and React mount are test boundaries, not real model invocations.
Validation
macOS / Node 24.13.0:
.claude/-only residue, registry-independent roster recovery, missing legacy origin, live legacy origin inference, missing origin repo, intentional cwd relocation, repeated restore, normal-repo cleanup guard, renderer/roster round trip.npm run typecheck,npm run build,git diff --check: passed.Self-review
Provider-neutral path resolution, Node path helpers, and paths-with-spaces tests; no dependencies or permission escalation for agents. Dirty checkout contents, unmerged branch tips and stale Git registrations are explicitly asserted to survive fallback. The shared resolver is before provisioning, so an unknown/missing origin returns an actionable failure without rewriting registry/identity files. No claim of Windows/Linux GUI or real paid CLI session validation; those remain useful follow-up smoke tests.