Repository navigation
fix(worktree): skip retirement backfill on every non-local host - #15023
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between 2fdaa10 and 5cea4a47fb1b36f5cde24b9f73a3816ec2412b30. 📒 Files selected for processing (2)
Included review availability: Your plan includes up to 10 reviews per rolling hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe change updates Merge Risk: ⚪ Minimal · up to The change limits retirement backfill to local repositories while preserving local behavior, with targeted tests for both cases; no actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
5cea4a4 to
3d3c4dd
Compare
The backfill guard tested repo.connectionId, but a runtime-owned repo carries executionHostId with no connectionId, so it read as local. The scan then walked this machine's workspace and agent-transcript directories and filed the result under the runtime host's namespace — retiring names never used there while missing the ones that were. Guard on the execution host id instead. Ongoing retirement was already correct for these repos; only the one-time historical seed was wrong.
3d3c4dd to
e10cfa9
Compare
Review summaryI reviewed the two-file change in Verified locally:
The previously reported 10 PTY-environment failures did not reproduce in either full run, so I cannot independently confirm their prior file locations or pre-existing status. Current head and base were both green under the same command; latest CI should remain the reference for platform-specific coverage. Verdict: no blocking findings; this is ready to merge. The execution-host comparison correctly prevents a runtime-owned repo without a This review made no changes to the fix. |
Resolves an import-union conflict in worktree-name-retirement.ts. Main's #15023 gates the backfill on the execution host id rather than connectionId; this branch adds a runtime-owned guard on the namespace write. Both apply.
…lyai#15023) The backfill guard tested repo.connectionId, but a runtime-owned repo carries executionHostId with no connectionId, so it read as local. The scan then walked this machine's workspace and agent-transcript directories and filed the result under the runtime host's namespace — retiring names never used there while missing the ones that were. Guard on the execution host id instead. Ongoing retirement was already correct for these repos; only the one-time historical seed was wrong.
…lyai#15023) The backfill guard tested repo.connectionId, but a runtime-owned repo carries executionHostId with no connectionId, so it read as local. The scan then walked this machine's workspace and agent-transcript directories and filed the result under the runtime host's namespace — retiring names never used there while missing the ones that were. Guard on the execution host id instead. Ongoing retirement was already correct for these repos; only the one-time historical seed was wrong.
ELI5
Follow-up to #14350. When Orca first learns which workspace names are already spent, it scans your computer's folders. For a workspace that actually runs on a different machine, it was still scanning this one — so it wrote down the wrong list of used names.
What Changed
One guard in
ensureRetiredWorktreeNamesBackfilled:Plus two tests: a runtime-owned repo is skipped, and a plain local repo still backfills (so the skip is scoped, not blanket).
Why
getRepoExecutionHostIdreturnsexecutionHostIdwhen it is set, falling back toconnectionIdonly when it is not. A runtime-owned repo carriesexecutionHostIdwith noconnectionId, so the old guard read it as local. The scan then walked this machine's workspace directory and agent-transcript buckets, and merged the result under the runtime host's namespace. Two ways that is wrong:Scope is bounded: retirement at create time was already correct for these repos, because it records the name the host actually created. Only the one-time historical seed was wrong.
Raised by CodeRabbit on #14350 (
🗄️ Data Integrity, Major) and left unresolved at merge. I verified the claim against mergedmainrather than taking it on faith —getRepoExecutionHostIdatsrc/shared/execution-host.ts:150-159confirms the precedence.Why not the other
connectionIdchecks in this module: the remaining three (getRetirementProbePath,getRemoteRetirementNamespaceKey, and its two readers) select SSH-specific path computation, whereconnectionIdis the correct discriminator rather than a general "is remote" test. Deliberately unchanged. Whether runtime-owned repos should also get the shared-namespace treatment that SSH repos get — so a re-added runtime repo recovers its retirements — is a separate design question, noted below.Linked Issue
Follow-up to #14350 (STA-4189).
Fixes #
Visual Proof
N/A— no UI change. This only affects which names the host seeds into its registry.Testing
Two tests in
src/main/worktree-name-retirement.test.ts:Red-before-green verified. I reverted the guard to the merged version and confirmed the runtime test fails on
expect(merged).toEqual([]), then restored the fix and confirmed it passes. Without that check the test would pass either way, since the local scan finds nothing when the fixture directory is empty.Verified locally: 78 tests pass across the retirement and suggestion suites;
tsc --noEmitclean on the node project;oxlintandoxfmtclean.Platforms: developed and tested on macOS. The change is a host-id comparison with no platform-specific behavior.
Review
connectionId, and are still skipped via the host id.Known gaps
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)