Repository navigation
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between 3cf1f8e2a7041ff164a6014ec5dc83cdddaaee07 and 5ff14fd6edc427cb3eec946ba207e55d2bdd4403. 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughSSH registered-worktree removal now forwards Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to SSH worktree removal now runs configured archive hooks when explicitly requested and warns when hooks are skipped, matching local removal behavior. The covered change is ready to merge. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: 36339094-a52c-43b0-a11c-1ef293d5effb
📥 Commits
Reviewing files that changed from the base of the PR and between 7106101 and c5fe6c5f51db91c30efc13e0132f8cf593222506.
📒 Files selected for processing (3)
src/main/runtime/orca-runtime-remove-managed-worktree.tssrc/main/runtime/orca-runtime-tests/ssh-worktree-lifecycle-part-02.spec.tssrc/main/runtime/runtime-registered-remote-worktree-removal.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
There was a problem hiding this comment.
Important
The archive hook still won't run for SSH repos that carry only executionHostId: 'ssh:<target>' with no connectionId field — the exact ssh:-only row shape the connectionId arg's own doc comment warns about. See the inline comment.
Reviewed changes
runHooksthreading —removeManagedWorktreenow forwards itsrunHooksflag intoremoveRuntimeRegisteredRemoteWorktree.- Archive hook over SSH — the remote removal path now runs the archive hook via the shared
getArchiveHooksForRemoval/runRemoteArchiveHookhelpers, gated byrunHooks, and returns the same skipped-hook warning the local path returns when a hook is configured but--run-hookswas not passed. - Tests — two focused specs assert the hook runs (and runs before
removeWorktree) under--run-hooks, and that the warning is returned otherwise.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — since the prior review, the connectionId routing fix landed and the test strategy was consolidated:
connectionIdthreading —getArchiveHooksForRemoval/runRemoteArchiveHooknow take an explicitconnectionIdinstead of readingrepo.connectionId, sossh:-only rows execute the archive hook against the resolved route and no longer silently no-op.- UI path preserved —
execute-worktree-removal.tshoistsremoteConnectionId = repo.connectionId ?? undefinedand forwards it, keeping existing UI removal behavior identical. - Test consolidation — the unreachable end-to-end regression was replaced with a direct unit test of
removeRuntimeRegisteredRemoteWorktreethat keys off the resolvedconnectionId(withrepo.connectionIddeliberately unset), and mocks are reset between cases.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Important
The branch picked up six commits unrelated to the archive-hook fix; they should be dropped before merge.
Reviewed changes — since the prior Pullfrog review at cb78441, no archive-hook code changed; six unrelated commits landed on the branch:
- Claude rate-limit docs — two new
docs/superpowers/files record a design and a step-by-step implementation plan for a separate Claude rate-limit precedence bug (src/main/rate-limits/service-fetch-policy.ts), plus three follow-up doc edits. None touch the archive-hook path. .gitignore— added a.worktrees/entry under a new# Linked worktreescomment.pty-login-shell-startup-commands.test.ts— normalized the zsh wrapperZDOTDIRassertion to.split(sep).join('/').
⚠️ Unrelated commits pollute this fix PR
The six commits landed since the last review — 6768017, 8585da3, fe529f5, 27881f2, 9483741, c275c1b — are all for a different workstream (a Claude rate-limit precedence bug, local-worktree housekeeping, and an unrelated test normalization). The PR body still states the branch "contains only the two commits for this fix," but it now carries twelve. Merging as-is would land a 341-line implementation plan and a 169-line design doc for an issue that is not even filed yet, under a PR titled as a worktree-removal fix.
Technical details
# Drop the six unrelated commits before merge
## Affected sites
- 6768017756 — docs: record Claude rate limit precedence design (new docs/superpowers/specs file, 169 lines)
- 8585da316c — docs: refine Claude rate limit review criteria
- fe529f5ef4 — docs: add Claude rate limit implementation plan (new docs/superpowers/plans file, 341 lines)
- 27881f2b6e — chore: ignore local linked worktrees (.gitignore `.worktrees/`)
- 9483741fff — docs: preserve Claude Fable data during live precedence
- c275c1baf3 — test: normalize zsh wrapper path expectation
## Required outcome
- The branch contains only the archive-hook fix commits (02d6c6a through 3cf1f8e) on top of main.
## Suggested approach
- Reset this branch back to 3cf1f8e (the docs-only docstring commit) and move the six unrelated commits onto their own branch/PR for the Claude rate-limit work.DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Important
The new commit is technically correct, but it is the seventh commit on this branch that is unrelated to the archive-hook fix.
Reviewed changes — since my prior review at c275c1b, one more commit landed:
5ff14fd(test: match shell wrapper path construction) — revises the zshZDOTDIRtest assertion fromjoin(...).split(sep).join('/')to a${getShellReadyWrapperRoot()}/zshtemplate literal, and drops the now-unusedsepimport.
⚠️ Scope contamination now spans seven commits
The assertion change is sound — it now matches the PTY production code verbatim (src/main/providers/local-pty-shell-ready.ts:89, ZDOTDIR: \${getShellReadyWrapperRoot()}/zsh`), and it also fixes the earlier .split(sep).join('/') form, which over-normalized separators on Windows. But it is another commit unrelated to the archive-hook fix, stacked on top of the six already flagged. The branch now carries seven unrelated commits (6768017, 8585da3, fe529f5, 27881f2, 9483741, c275c1b, 5ff14fd`) that should all be dropped before merge, per the prior review.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
cca7a6b to
7ece564
Compare
There was a problem hiding this comment.
Important
The new commit is technically sound, but it is the eighth commit on this branch unrelated to the archive-hook fix — and the rebase requested in the prior reviews still hasn't happened.
Reviewed changes — since the prior review at 5ff14fd, one commit landed:
- Windows symlink-test skip —
cca7a6badds acanCreateFileSymlinks()probe and anit.skipIf(...)guard so the three symlink-dependent tests ininstaller-utils.test.tsskip on Windows hosts lacking symlink privilege, and rethrow any non-privilege error everywhere else.
⚠️ Scope contamination now spans eight commits
The new commit is correct — the probe detects Windows file-symlink capability (the exact thing the three gated tests exercise), and non-Windows failures still fail loudly. But it has nothing to do with the SSH archive-hook fix: it modifies src/main/agent-hooks/installer-utils.test.ts, a file the fix never touches. It is now the eighth commit stacked on this branch from other workstreams, and the archive-hook code itself is unchanged since 3cf1f8e. The PR body still claims the branch "contains only the two commits for this fix," but it carries 14.
Technical details
# Drop the eight unrelated commits before merge
## Affected sites
- cca7a6b — test: skip symlink fixtures without Windows privilege (new, unrelated)
- 5ff14fd — test: match shell wrapper path construction
- c275c1b — test: normalize zsh wrapper path expectation
- 9483741 — docs: preserve Claude Fable data during live precedence
- 27881f2 — chore: ignore local linked worktrees
- fe529f5 — docs: add Claude rate limit implementation plan
- 8585da3 — docs: refine Claude rate limit review criteria
- 6768017 — docs: record Claude rate limit precedence design
## Required outcome
- The branch contains only the archive-hook fix commits (02d6c6a through 3cf1f8e) on top of main.
## Suggested approach
- Reset this branch back to 3cf1f8e and move the eight unrelated commits onto their own branch/PR.DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — since the prior review at cca7a6b, the branch was rebased to drop the eight unrelated commits, and one test-only commit landed:
- Scope cleanup — the eight unrelated commits flagged in prior reviews (the Claude rate-limit design/plan/spec docs, the
.gitignore.worktrees/entry, the zsh test tweaks, and the symlink-test skip) are gone. The branch now carries only the six archive-hook fix commits plus one new test commit, matching the PR body's claim. - POSIX-stable watcher fixtures —
7ece564switches theabsolutePathfixture helper insrc/main/ipc/worktree-base-directory-watcher.test.tsfromjoin(sep, ...)topathPosix.join('/', ...)so fixture paths are deterministic POSIX across platforms, and swaps thesepimport forposix as pathPosix.
The new commit is test-only and sound: posix.join('/', ...) yields /workspace/... everywhere, the mocked realpath returns paths unchanged, and PROJECT_GIT_COMMON_DIR is computed once and used consistently, so no assertion depends on the platform separator. The archive-hook fix itself is unchanged and correct.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — since the prior review at 7ece564, two more test-only commits landed, both Windows CI robustness fixes:
- Symlink fixture guard —
2f5460aadds acanCreateFileSymlinks()probe plus anit.skipIf(...)guard and converts the symlink-dependent tests tosymlinkIt(...)insrc/main/agent-hooks/installer-utils.test.tsandconfig/scripts/shared-electron-dist-cache.test.ts, so they skip on Windows hosts lacking symlink privilege while rethrowing any non-privilege error elsewhere. - Windows path normalization —
8f987308makesshared-electron-dist-cache.test.tscomputeexpectedGitCommonDir = path.resolve('/repo/.git')and use it in thecacheRoot/entryPathassertions (matching theexecFilemock now returning the resolved path), and makesrepo-icon-autodetect.test.tsnormalizefilePath.replaceAll('\\', '/')before the/package.jsonsuffix check.
Both changes are sound and test-only. The probe correctly treats a EPERM/EACCES on win32 as "skip" and rethrows otherwise; the path-resolution change makes the fixture and its expected value go through the same path.resolve/path.join, so they agree on Windows; and the replaceAll normalization matches backslash-terminated Windows paths. No production code is touched, and the archive-hook fix itself is unchanged and correct. The prior scope contamination is resolved — the branch now carries only the six archive-hook fix commits plus three small test-only Windows CI robustness commits.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — since the prior review at 8f987308, one test-only commit landed:
- POSIX-stable git common-dir fixture —
6d2cbc4aliasesjoin = pathPosix.joininsrc/main/ipc/worktree-base-directory-watcher.test.ts, soPROJECT_GIT_COMMON_DIRis computed with POSIX separators just likeWORKTREE_ROOT/PROJECT_ROOT.
The change completes the fixture-consistency work started in 7ece564: absolutePath already used pathPosix.join, but PROJECT_GIT_COMMON_DIR still used the platform join from node:path, which on Windows produced \-separated segments inconsistent with the POSIX fixture roots. Aliasing join closes that gap. It is test-only with no production surface; no assertion depends on a specific separator, so behavior is unchanged on POSIX and internally consistent on Windows.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found. The two new commits are test-only Windows CI robustness fixes and are sound.
Reviewed changes — since the prior review at 6d2cbc4, two test-only commits landed:
- Structured-session fixture isolation —
c25e41emockscodex-structured-turn-processesinstructured-agent-session-integration.test.tsso the fake app-server (which has no child process) never triggers host-specific descendant enumeration during cancellation; the real functions remain covered bycodex-structured-turn-processes.integration.test.ts. - Windows SSH fixture path derivation —
e413729derivesSYSTEM_SSH_PATHfromSystemRoot/WINDIRviawin32.join, matching productionsystemSshPathsinsrc/main/ssh/system-ssh-binary.tsrather than hardcodingC:\Windows.
ℹ️ PR body claim is stale
The body still states the branch "contains only the two commits for this fix," but it now carries twelve commits — the six archive-hook fix commits plus six test-only Windows CI commits. Worth a one-line body update before merge; nothing blocks.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — since the prior review at e413729, one test-only commit landed:
- Relay symlink fixture guard —
fcb7b54adds the samecanCreateFileSymlinks()probe andsymlinkIt = it.skipIf(...)guard already used in the other test files, converting the three symlink-dependentFsHandlertests (retargeted-symlink rejection,lstat,realpath) to skip on Windows hosts lacking symlink privilege while rethrowing any other error.
Sound and consistent with the previously accepted symlink-guard pattern; no production surface.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Important
Commit 89d9dec swaps the WslCodexAuthBatchReader type import for WslPaths, but two tests still reference typeof WslCodexAuthBatchReader, so pnpm tc:node fails with two TS2304 errors — despite the PR body claiming it is clean. See the inline comment.
Reviewed changes
- Local WSL path fixture —
89d9decaddedmockLocalWslPathBridge, which mocks../../shared/wsl-pathsso the sixwslHome-based tests map Linux paths to local temp dirs instead of\\wsl.localhost\...UNC paths. - Mock reset between cases —
2a540acaddedvi.doUnmock('../../shared/wsl-paths')inafterEach, keeping the mock from leaking into the two mounted-drive tests that still exercise the real module.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Important
This new commit is sound, but it does not address the typecheck failure raised in the immediately-prior review — pnpm tc:node still reports two TS2304: Cannot find name 'WslCodexAuthBatchReader' errors (now at lines 559 and 668). The PR remains blocked until the WslCodexAuthBatchReader type import is restored.
Reviewed changes
- Isolated WSL fixture processes —
3922392addedvi.doMockstubs forwsl-codex-session-bridgeandlegacy-wsl-runtime-auth-draininsidemockLocalWslPathBridge, so the six local-path-bridge tests no longer spawn the real bridge/drain background processes.
The new change is test-only and correct: the two added mocks resolve immediately, and the "waits for the legacy drain" test still overrides them with its own custom startLegacyWslRuntimeAuthDrain, so its gate assertions are unaffected.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Important
Commit f71aaae drops the const processKill = mockProcessGroupSignals() declaration when converting the two process-group tests to it.skipIf(...), so pnpm tc:node fails with four new TS2304: Cannot find name 'processKill' errors. See the inline comment.
Reviewed changes
- Windows process-group skip —
f71aaaeconverted the twogh/glabprocess-group timeout tests inrunner-command-exec.test.tsfromit(...)toit.skipIf(process.platform === 'win32')(...), since POSIX process-group signaling (process.kill(-pid)) has no Windows equivalent.
The skip itself is correct — the negative-PID process-group assertion is genuinely POSIX-only. The problem is purely the dropped processKill declaration, which leaves four dangling references and would also make the assertion a no-op against an undefined mock even if it compiled.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Important
This commit is sound, but the PR still fails pnpm tc:node on six TS2304 errors from prior commits — two WslCodexAuthBatchReader and four processKill — none of which this commit addresses. Those prior review threads remain open and block merge.
Reviewed changes
- Skip remaining POSIX gh probes on Windows —
c5ee050converted the "kills an active gh execution" and "honors explicit gh timeouts" tests toit.skipIf(process.platform === 'win32')(...), this time correctly retaining eachconst processKill = mockProcessGroupSignals()declaration.
The new change is test-only and correct: both conversions preserve the processKill declaration, and the skip is genuinely warranted since both tests assert negative-PID process-group signaling that has no Windows equivalent.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Important
The new commit is sound, but it does not address the typecheck failures that still block this PR. pnpm tc:node still reports six TS2304 errors — the missing WslCodexAuthBatchReader import (runtime-home-wsl-managed-accounts.test.ts:559,668) and the dropped processKill declarations (runner-command-exec.test.ts:317,319,338,340) — so the two open review threads from prior reviews remain unresolved.
Reviewed changes — since the prior review at c5ee050, one test-only commit landed:
- Windows daemon pipe wait after respawn —
46edb9cadds awaitForEndpointReachablehelper todaemon-endpoint-reachability-test-harness.tsthat polls the productionprobeSocketConnectuntil the endpoint reportsconnected, and makesrestartServerOnRespawnasync so itawaitsserver.start()and (onwin32) the reachability poll; all three call sites nowawaitit.
The change is sound and test-only: probeSocketConnect already handles win32 named pipes via node:net connect({ path }), the helper throws after a 2s deadline on a still-unreachable endpoint, and no production code is touched.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Important
Commit 44733a0 removed the spawnProcess type import but left two references behind, adding two new TS2304: Cannot find name 'spawnProcess' errors. pnpm tc:node now fails with eight errors across three files — the two pre-existing typecheck threads remain open, and this commit adds two more — so the PR body's "pnpm tc:node — clean" claim is still false.
Reviewed changes — since the prior Pullfrog review at 46edb9c, one test-only commit landed:
- Codex connection teardown isolation on Windows —
44733a0mockscodex-app-server-process-teardownonwin32so the connection tests exercise a syntheticSIGKILLteardown instead of the realtaskkill, and makes the concurrent-close assertion platform-aware.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Important
The new commit is sound, but the PR is still not mergeable — pnpm tc:node fails on the eight TS2304 errors left by prior commits, and this delta does not address them.
Reviewed changes — since the prior review at 44733a0, one test-only commit landed:
- Relay symlink fixture guard (
subprocess.test.ts) —2193761a69adds thecanCreateFileSymlinks()probe andsymlinkIt = it.skipIf(...)guard already accepted in the sibling relay/installer tests, converting the "reads files via symlinks resolving outside the workspace" test to skip on Windows hosts lacking symlink privilege while rethrowing any other error.
The delta itself introduces no new issues: symlinkSync is correctly hoisted to the top-level node:fs import (the local require was dropped), rmSync is imported for the probe's cleanup, and the 10_000 timeout is preserved.
⚠️ Typecheck failures from prior commits still block merge
No new issues in this delta. The remaining blocker is the typecheck failure already flagged in three open review threads — the missing WslCodexAuthBatchReader and spawnProcess type imports, and the dropped processKill declarations — none of which this commit touches.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Important
The two new commits are sound, but the PR is still not mergeable — pnpm tc:node continues to fail on the typecheck errors already flagged in the open review threads, which this delta does not touch.
Reviewed changes — since the prior review at 2193761a, two test-only commits landed in src/renderer/src/app-startup-routing.test.ts:
- Whitespace-tolerant checkpoint assertion —
423556arunscheckpointBlock.replace(/\s+/g, ' ')before thebuildWorkspaceSessionHostSnapshots(...)toContain, so the assertion no longer depends on the generated code's exact line-wrapping. - Whitespace-tolerant shutdown-source assertion —
8c2dc630feapplies the same normalization to theORCA_RENDERER_SHUTDOWN_CHECKPOINT_ABORTED_EVENTsource assertion.
Both are correct: the normalization collapses any whitespace run to a single space while still pinning the exact call and argument names, so the assertions stop being brittle to formatting without becoming tautological. No production surface is touched.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — since the prior Pullfrog review at 8c2dc630fe, a single commit landed that resolves all three open typecheck threads:
WslCodexAuthBatchReaderimport restored —runtime-home-wsl-managed-accounts.test.tsre-adds the type import the two mounted-drive tests still reference viaimportOriginal<typeof WslCodexAuthBatchReader>().spawnProcessimport restored —codex-app-server-connection.test.tsre-adds the type import alongside the newCodexAppServerProcessTeardownModuleimport.processKilldeclarations restored —runner-command-exec.test.tsfoldsmockProcessGroupSignals()intomockWedgedCliSpawn's return value so all four call sites recover theirprocessKillspy.
pnpm tc:node now passes clean (verified against a12e259). The three prior Pullfrog threads are replied-to and resolved. No production code changed; the archive-hook fix itself is unchanged and correct.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Important
The "isolate watcher lifecycle from native subprocess" commit introduces two failing tests in filesystem-watcher-local-unsubscribe.test.ts — pnpm vitest run src/main/ipc/filesystem-watcher-local-unsubscribe.test.ts now fails 2 of 24 tests (passes 24/24 at the parent commit). See the inline comment.
Reviewed changes — since the prior Pullfrog review at a12e259, two test-only commits landed:
- Per-host watcher fixture paths —
3606167freplaces the hardcoded'/tmp/repo'/'/tmp/other'strings withWORKTREE_PATH/OTHER_WORKTREE_PATH(bothpath.resolve('/tmp', ...)) so the fixtures resolve consistently on Windows. - Watcher lifecycle isolation from native subprocess —
f46aac88hoistssubscribeParcelWatcherMock/subscribeViaWatcherProcessMockand rewiresbeforeEachsosubscribeViaWatcherProcessdelegates to the in-processsubscribeParcelWatchermock.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — since the prior Pullfrog review at f46aac8, one test-only commit landed:
- Watcher abort modelling —
ef312c3rewrites thebeforeEachsubscribeViaWatcherProcessdelegation to forward the 4thhooksargument and model the abort signal: it rejects onhooks.signal, unsubscribes the orphaned subscription when the underlyingsubscribeParcelWatcherresolves after an abort, and removes the listener on settle.
This resolves the two-test regression flagged in the prior review — pnpm vitest run src/main/ipc/filesystem-watcher-local-unsubscribe.test.ts now passes 24/24, and pnpm tc:node is clean. No production code changed; the archive-hook fix is unchanged and correct.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — since the prior review at ef312c3, one test-only commit landed:
- Codex probe abort termination on Windows —
8bc0d8amakes the abort test incodex-fetcher.test.tsexercise the force-termination path on every host:rpcChild.stdin.endis made a no-op so the fake child survives graceful stdin shutdown (the default fakeexitNowwould resolve the graceful path and never callchild.kill, failing thetoHaveBeenCalledTimes(1)assertion on Windows), and timers advance past the 5sCODEX_PROBE_SHUTDOWN_DRAIN_MSdrain window.
The change is sound and test-only. Traced through terminateCodexProbeChild: on POSIX the no-op stdin.end still lets child.kill('SIGTERM') exit the fake immediately (kill once), while on win32 the 5s advance drains the shutdown window and falls through to the force child.kill() (also once). No production surface is touched, and the archive-hook fix itself remains unchanged and correct.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — since the prior review at 8bc0d8a, one test-only commit landed:
- Codex probe timeout termination on Windows —
a19dabdadds the timeout analog of the abort test incodex-fetcher.test.ts: the same no-opstdin.endkeeps the fake alive through graceful shutdown so the force-termination path runs on every host, then timers advance 30s (the RPC init deadline, since noinitializeresponse is emitted) plus 5s (theCODEX_PROBE_SHUTDOWN_DRAIN_MSdrain window).
The change is sound and test-only. It pins kill to exactly one call, asserts the stdout/stderr/error/close listeners are all removed after settle runs cleanupListeners, and confirms no PTY fallback with allowPtyFallback: false. The error string 'RPC timeout' matches armRpcDeadline verbatim. No production surface is touched, and the archive-hook fix itself remains unchanged and correct.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Merged
main— synced upstreammain(2bf298d) into the branch via a merge commit; the archive-hook fix is unchanged, and the three test-file conflicts resolved cleanly. - WSL validation mock — the first account-sync test in
service-wsl-accounts.test.tsnow mocksnode:child_process(execFileSyncreturns the WSL home path,spawna no-op) so Windows CI never spawns a realwsl.exeduring validation, matching the pattern already used by the other seven tests in the file.
Verified pnpm tc:node is clean and the affected suites pass: service-wsl-accounts (8), codex-app-server-connection (28), ssh-system-fallback (49), and runtime-registered-remote-worktree-removal (2).
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Relay spawn refactor —
src/relay/subprocess.test.tsextracts awaitForRelaySentinelhelper and collapses everyrelay = spawn(); await relay.sentinelReceivedpair intorelay = await waitForRelaySentinel(spawn()); purely mechanical, no behavior change. - Cross-version wire Windows cleanup —
cross-version-agent-session-wire.unit.test.tshoistshostto the describe scope and flushes the structured host's streamed events inafterEachbeforerm(root), so Windows cleanup no longer trips over a locked file handle.
The archive-hook fix is unchanged. Verified pnpm tc:node clean and src/relay/subprocess.test.ts passes 32/32. The cross-version spec can't run in this shallow clone (no release tags), but the 4-line change is typecheck-clean and trivially correct.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Caution
This PR's latest commit deletes the operations counter declaration that the cross-version wire test still reads, breaking the file at both typecheck and runtime.
Reviewed changes — since the prior Pullfrog review at 88e69ba, one test-only commit landed:
- Warm cross-version release checkout —
cdb86dcbumpsSUITE_TIMEOUT_MSfrom 180s to 300s and hoistsreleasedCurrent = await loadAgentSessionWireBuild('HEAD')intobeforeAll, replacing the lazy per-test load so the baseline release checkout is warmed once ahead of the first pairing.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
ℹ️ No new issues in this delta — the commit is sound. The one minor suggestion from a prior review (test coverage for
normalizeWindowsDiffHeaders, still open onconfig/scripts/xterm-patch-text.mjs:61) remains unaddressed.
Reviewed changes — since the prior Pullfrog review at c47bc89, one test-only commit landed:
- Windows recovery-command quoting —
orchestration-gate-cli.test.tsandorchestration-timeout-cli.test.tsnow build their expected recovery/resume commands through the productionrenderCommandhelper instead of hardcoding POSIX-form strings, so the assertions match cmd's argument quoting on Windows.
The change is sound. The timeout test renders the exact array question-handler.ts:102 builds (renderCommand([resolveOrchestrationCliExecutable(), 'orchestration', 'ask', '--from', …, '--resume', messageId, '--timeout-ms', …])), so expected and actual now flow through the same shell-aware renderer and agree on every platform. The gate test renders the --retry-request <id> tail, which is a substring of the message's renderCommand(retryCommand) on both POSIX and cmd. Verified both files pass 26/26; no production surface is touched, and the archive-hook fix itself is unchanged and correct.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
ℹ️ No new issues in this delta — the two new test files are sound. The one minor suggestion from a prior review (test coverage for
normalizeWindowsDiffHeaders, still open onconfig/scripts/xterm-patch-text.mjs:61) remains unaddressed.
Reviewed changes — since the prior Pullfrog review at 37676af, two test-only commits landed:
- Orchestration mutation-recovery unit tests — added
src/cli/orchestration-mutation-recovery.test.ts, pinning dispatch-vs-retry ordering, exact argv replay, legacy command-text parsing,--retry-requestidentity reuse, Windows cmd/PowerShell and POSIX quoting, a real/bin/shround-trip, and secret-stripping that blocks recovery. - RuntimeClient recovery-identity integration tests — added
src/cli/runtime/client-recovery.test.ts, exercising real RPC failure responses overnode:net(unix socket / named pipe) plus durable-prompt retry and downgraded/legacy runtime paths.
Both files are test-only and pass (24/24 total). The nextSteps assertions now route through renderCommand (matching the production orchestrationMutationRecoveryError renderer), while the plain --retry-request <id> assertions target the prompt-recovery path (terminal-prompt-mutation-recovery.ts), which interpolates literally rather than through renderCommand, so they hold on every platform. The runtimeEndpoint helper selects named pipes on win32 and unix sockets elsewhere, matching the transport kind writeRuntimeConnection emits. No production surface is touched, and the archive-hook fix itself is unchanged and correct.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
ℹ️ No new issues in this delta — the change is a correct test-only skip. The one minor suggestion from a prior review (test coverage for
normalizeWindowsDiffHeaders, still open onconfig/scripts/xterm-patch-text.mjs:61) remains unaddressed.
Reviewed changes — since the prior Pullfrog review at d0dd9b1, one test-only commit landed:
- Skip POSIX hook execution on Windows —
hook-script-outside-orca.test.tswraps the "managed hook outside an Orca terminal" suite indescribe.skipIf(process.platform === 'win32'), since those four casesspawnSync('/bin/sh', …)and have no Windows equivalent. The platform-independentantigravity out-of-band event namesuite is correctly left ungated.
The change is sound: the whole gated block is POSIX-only, and the skip condition matches the spawnSync('/bin/sh') dependency. Verified the file passes 5/5 on Linux; no production surface is touched, and the archive-hook fix itself is unchanged and correct.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
ℹ️ No new issues in this delta — the commit is sound. The one minor suggestion from a prior review (test coverage for
normalizeWindowsDiffHeaders, still open onconfig/scripts/xterm-patch-text.mjs:61) remains unaddressed.
Reviewed changes — since the prior Pullfrog review at 1e731373, one test-only commit landed:
- POSIX spool-test gating —
spool.test.tswraps the "spools when the endpoint is present but the receiver is unavailable" test init.skipIf(process.platform === 'win32'), since itexecFileSyncs/bin/shthrough a POSIX managed script and has no Windows equivalent. - Windows cleanup retry —
windows-hook-post-interpreter.test.tsaddsmaxRetries: 5, retryDelay: 100to its twoafterEachrmSynccalls so a transientEPERM/EBUSYduring teardown retries instead of failing.
Both changes are sound and test-only. The spool skip matches the same pattern as 1e731373 (the spawnSync('/bin/sh') suite in hook-script-outside-orca.test.ts), and the rmSync retry options mirror the repo's existing maxRetries/retryDelay cleanup idiom. No production surface is touched, and the archive-hook fix itself is unchanged and correct.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
ℹ️ No critical issues — one minor suggestion inline.
Reviewed changes — since the prior Pullfrog review at eefcedf3, two commits landed:
normalizeWindowsDiffHeadersrewrite — the header normalizer now tracks hunk state and requires ana//b/prefix, so---/+++lines inside hunk bodies (e.g. a deleted--- \server\deleted) are no longer rewritten. This fixes a real bug in the earlier implementation and is pinned by a new exact-output test.runGitEOL isolation —regenerate-xterm-patches.mjscentralizes-c core.autocrlf=false -c core.eol=lfpluspnpmDiffEnvironmentinto arunGithelper and routes every git call through it;diffFoldersgets the same EOL isolation.- Symlink gating refinement —
space-sharing-copy.test.tsswaps the whole-suitedescribeWithSymlinksskip for per-testit.skipIf(!symlinksAvailable)gating, andmakeTreeonly creates the link when the host supports it, so exactly the three symlink-reading tests are gated. - Recovery-command assertion — the gate-cli recovery test now renders the full
orca orchestration gate-create … --retry-requestcommand (matching productionretryCommand = [...originalCommand, '--retry-request', requestId]) instead of the tail. - Cleanup retry tuning —
windows-hook-post-interpreter.test.tsbumps the teardownrmSyncretry tomaxRetries: 20, retryDelay: 250.
The normalizeWindowsDiffHeaders coverage thread from the prior review is now addressed and resolved. The archive-hook fix itself is unchanged and correct.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — since the prior Pullfrog review at 5aa012d, two commits landed, both confined to config/scripts/ build/test code (no production surface; the archive-hook fix is unchanged and correct):
runGitconfig scoping —runGitgains anambientConfigflag, andgit remote add/git fetchopt out ofpnpmDiffEnvironmentso a developer'surl.*.insteadOfrewrites and config-filehttp.proxyare honored during--write. This resolves the fetch-config-isolation thread left open by the prior review;init/checkout/reset/apply/diffcorrectly stay on the isolated EOL environment.- Git C-quote path decoding —
normalizeWindowsDiffHeadersnow decodes Git C-style escapes through a newdecodeGitQuotedPath(simple escapes plus octal\303\251byte sequences), so quoted non-ASCII Windows headers normalize to the committed UTF-8 form instead of leaking backslash/octal text into the patch. - Portable escape assertion — the new escape-decoding test builds
éfromString.fromCodePoint(0xe9)rather than a literal non-ASCII char, keeping the test file pure ASCII.
The decodeGitQuotedPath reader matches Git's quote_c_style byte escapes (3-digit octal for control/high bytes; the 1–3-digit read is a safe superset), and the existing inHunk guard already keeps --- \server\deleted hunk-body content out of the decoder. Verified pnpm vitest run config/scripts/regenerate-xterm-patches.test.mjs passes 35/35.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — since the prior Pullfrog review at 504acb7, two commits landed, both confined to config/scripts/ build/test code (no production surface; the archive-hook fix is unchanged and correct):
- Quote-delimiter stripping —
normalizeWindowsDiffHeadersnow strips Git's outer quote delimiters via a newstripGitHeaderQuoteDelimitersstate machine instead of the blunt.replaceAll('"', ''), so a literal"inside a filename is preserved rather than silently dropped. Escaping is decided by counting preceding backslashes (odd = escaped), so\"and even-backslash runs before a closing delimiter are handled correctly. - Two new tests — one pins literal-quote preservation (
a/with"quote/name), one pins delimiter stripping after even backslash runs (a/dir\\→a/dir/). - Comment —
spool.test.tsgains a note explaining why the POSIX spool replay staysskipIf(win32).
Traced the state machine against both new cases and the pre-existing a/lib\\widget.js case: delimiters are removed, escaped quotes and backslashes survive into decodeGitQuotedPath, and the diff --git two-path space separator is preserved. Verified pnpm vitest run config/scripts/regenerate-xterm-patches.test.mjs passes 37/37.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
6f6856c to
17d50ce
Compare
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — since the prior review at 6f6856c9ca, the branch was rebased cleanly on upstream/main, dropping the Windows CI test-only tail, and now carries only the six archive-hook fix commits:
- Archive hook over SSH —
removeRuntimeRegisteredRemoteWorktreeruns the archive hook via the sharedgetArchiveHooksForRemoval/runRemoteArchiveHookhelpers, gated byrunHooks, returning the same skipped-hook warning the local path returns. - Resolved-route
connectionId— both helpers now take an explicitconnectionId, sossh:-only rows (executionHostIdwith noconnectionId) run the hook against the resolved route instead of silently no-opping. - Direct unit test — the unconstructible end-to-end regression was replaced with a direct unit test of
removeRuntimeRegisteredRemoteWorktreekeyed off the resolvedconnectionId, with mocks reset between cases. - Docstrings — added to the touched functions.
Verified pnpm tc:node clean and the two affected suites pass (11 tests total).
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
|
Cross-linking from #20153 (fixes #19334), since these two touch the same archive-hook code from opposite directions and neither of us should be surprised at merge time. This PR makes the runtime registered remote/SSH removal path run the archive hook, which it currently does not. #20153 makes a failing archive hook block the removal instead of being logged and stepped over — and its path table deliberately lists that same runtime remote path as "runs no hook at all, unchanged", precisely because of that gap. So the two are complementary rather than competing, with one consequence worth stating: once this lands, that path starts running a hook that #20153 does not gate. Whoever merges second should wire Textual overlap is four files: No action needed from you right now — flagging so the second merge is a deliberate rebase rather than a surprise. |
|
Update from #20153 (fixes #19334) now that my approach has settled, since it changes what you'll find in #20153 now makes that path refuse a hooks-requested removal, rather than deleting with the archive step silently skipped. Reasoning: #20153 advertises a runtime capability, That refusal is meant to be temporary, and your PR is what retires it. Once this path actually runs the hook, the right move is to delete Concretely, what to expect on rebase if #20153 lands first:
No action needed from you now — flagging so the interaction is a deliberate decision at review time rather than a surprise. Happy to do the retirement edit myself as a follow-up to yours if that's easier. |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — since the prior pullfrog review at 17d50ce, one commit landed (b093ad4), which re-validates the SSH worktree after the archive hook runs:
- Post-hook re-validation —
removeRuntimeRegisteredRemoteWorktreenow re-lists the execution host's worktrees after the archive hook and re-runsfindRegisteredDeletableWorktree/assertWorktreeUnlockedForRemoval, throwingWorktree registration changed during deletionif the hook unregistered the row and the formatted locked-worktree error if it left the row locked. Unconditional, matching the local removal path. - Refreshed row drives deletion — removal, watcher-gate acquisition, and
preserveBranchHeadnow use the refreshed row instead of the stale pre-hookregisteredWorktree, so a hook that moved the branch preserves the refreshed head.preserveHeadfillspreservedBranch.headbeforefinishRemoval'sremember, so the refreshed head reaches the preserved-branch cleanup. - Regression tests — three unit cases cover unregistered-after-hook, locked-after-hook, and moved-head preservation. All are falsifiable: each fails against the pre-commit code (old code would not re-list, and would pass the pre-hook head). Integration coverage is unchanged and still passes.
Verified locally: pnpm tc:node clean; runtime-registered-remote-worktree-removal.test.ts 5/5; the archive-hook integration tests 5/5 via pnpm test src/main/runtime/orca-runtime.test.ts -t "archive hook".
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Correction to one line above, after a simplification pass on #20153. I wrote that Everything else in that comment holds against the final shape:
One detail worth having if you touch hook execution: |
A repo's orca.yaml archive hook is the user's last chance to save work off a checkout Orca is about to delete. A failed hook was logged as advisory and stepped over, so the removal went ahead with nothing archived — and the caller could still be told it succeeded. The hook is now a blocking precondition, evaluated while the checkout, its Git registration, its agents and Orca's ownership evidence are all still intact: it sits ahead of the registration re-read, the lock/dirty preflights, stopPtys() and removeWorktree in every orchestrator that runs it. Failure is typed (worktree_archive_hook_failed) and carries the worktree path, outcome, exit code where one was observed, and the hook's output. unverifiable stays distinct from exited, so loss of contact is never read as a pass. The waiver rides its own field at every layer and is never implied by --force, which already carries the PTY-stop waiver; when used, the waived failure comes back on result.archiveHookOverride rather than being swallowed. worktree.archive-failure-blocking.v1 is advertised so an integration can tell "accepts --run-hooks" from "safely propagates a failing hook" without risking the data loss to find out. The runtime's SSH path cannot run a hook at all, so rather than delete with the archive step silently skipped it refuses — waivable like every other refusal here. #18563 retires that gate by making the path run the hook for real. Stacked on #20559, which makes a timed-out hook report honestly; without it a hook that traps SIGTERM and exits 0 would defeat this gate. Fixes #19334
A repo's orca.yaml archive hook is the user's last chance to save work off a checkout Orca is about to delete. A failed hook was logged as advisory and stepped over, so the removal went ahead with nothing archived — and the caller could still be told it succeeded. The hook is now a blocking precondition, evaluated while the checkout, its Git registration, its agents and Orca's ownership evidence are all still intact: it sits ahead of the registration re-read, the lock/dirty preflights, stopPtys() and removeWorktree in every orchestrator that runs it. Failure is typed (worktree_archive_hook_failed) and carries the worktree path, outcome, exit code where one was observed, and the hook's output. unverifiable stays distinct from exited, so loss of contact is never read as a pass. The waiver rides its own field at every layer and is never implied by --force, which already carries the PTY-stop waiver; when used, the waived failure comes back on result.archiveHookOverride rather than being swallowed. worktree.archive-failure-blocking.v1 is advertised so an integration can tell "accepts --run-hooks" from "safely propagates a failing hook" without risking the data loss to find out. The runtime's SSH path cannot run a hook at all, so rather than delete with the archive step silently skipped it refuses — waivable like every other refusal here. #18563 retires that gate by making the path run the hook for real. Stacked on #20559, which makes a timed-out hook report honestly; without it a hook that traps SIGTERM and exits 0 would defeat this gate. Fixes #19334
A repo's orca.yaml archive hook is the user's last chance to save work off a checkout Orca is about to delete. A failed hook was logged as advisory and stepped over, so the removal went ahead with nothing archived — and the caller could still be told it succeeded. The hook is now a blocking precondition, evaluated while the checkout, its Git registration, its agents and Orca's ownership evidence are all still intact: it sits ahead of the registration re-read, the lock/dirty preflights, stopPtys() and removeWorktree in every orchestrator that runs it. Failure is typed (worktree_archive_hook_failed) and carries the worktree path, outcome, exit code where one was observed, and the hook's output. unverifiable stays distinct from exited, so loss of contact is never read as a pass. The waiver rides its own field at every layer and is never implied by --force, which already carries the PTY-stop waiver; when used, the waived failure comes back on result.archiveHookOverride rather than being swallowed. worktree.archive-failure-blocking.v1 is advertised so an integration can tell "accepts --run-hooks" from "safely propagates a failing hook" without risking the data loss to find out. The runtime's SSH path cannot run a hook at all, so rather than delete with the archive step silently skipped it refuses — waivable like every other refusal here. #18563 retires that gate by making the path run the hook for real. Stacked on #20559, which makes a timed-out hook report honestly; without it a hook that traps SIGTERM and exits 0 would defeat this gate. Fixes #19334
A repo's orca.yaml archive hook is the user's last chance to save work off a checkout Orca is about to delete. A failed hook was logged as advisory and stepped over, so the removal went ahead with nothing archived — and the caller could still be told it succeeded. The hook is now a blocking precondition, evaluated while the checkout, its Git registration, its agents and Orca's ownership evidence are all still intact: it sits ahead of the registration re-read, the lock/dirty preflights, stopPtys() and removeWorktree in every orchestrator that runs it. Failure is typed (worktree_archive_hook_failed) and carries the worktree path, outcome, exit code where one was observed, and the hook's output. unverifiable stays distinct from exited, so loss of contact is never read as a pass. The waiver rides its own field at every layer and is never implied by --force, which already carries the PTY-stop waiver; when used, the waived failure comes back on result.archiveHookOverride rather than being swallowed. worktree.archive-failure-blocking.v1 is advertised so an integration can tell "accepts --run-hooks" from "safely propagates a failing hook" without risking the data loss to find out. The runtime's SSH path cannot run a hook at all, so rather than delete with the archive step silently skipped it refuses — waivable like every other refusal here. #18563 retires that gate by making the path run the hook for real. Stacked on #20559, which makes a timed-out hook report honestly; without it a hook that traps SIGTERM and exits 0 would defeat this gate. Fixes #19334
A repo's orca.yaml archive hook is the user's last chance to save work off a checkout Orca is about to delete. A failed hook was logged as advisory and stepped over, so the removal went ahead with nothing archived — and the caller could still be told it succeeded. The hook is now a blocking precondition, evaluated while the checkout, its Git registration, its agents and Orca's ownership evidence are all still intact: it sits ahead of the registration re-read, the lock/dirty preflights, stopPtys() and removeWorktree in every orchestrator that runs it. Failure is typed (worktree_archive_hook_failed) and carries the worktree path, outcome, exit code where one was observed, and the hook's output. unverifiable stays distinct from exited, so loss of contact is never read as a pass. The waiver rides its own field at every layer and is never implied by --force, which already carries the PTY-stop waiver; when used, the waived failure comes back on result.archiveHookOverride rather than being swallowed. worktree.archive-failure-blocking.v1 is advertised so an integration can tell "accepts --run-hooks" from "safely propagates a failing hook" without risking the data loss to find out. The runtime's SSH path cannot run a hook at all, so rather than delete with the archive step silently skipped it refuses — waivable like every other refusal here. #18563 retires that gate by making the path run the hook for real. Stacked on #20559, which makes a timed-out hook report honestly; without it a hook that traps SIGTERM and exits 0 would defeat this gate. Fixes #19334
A repo's orca.yaml archive hook is the user's last chance to save work off a checkout Orca is about to delete. A failed hook was logged as advisory and stepped over, so the removal went ahead with nothing archived — and the caller could still be told it succeeded. The hook is now a blocking precondition, evaluated while the checkout, its Git registration, its agents and Orca's ownership evidence are all still intact: it sits ahead of the registration re-read, the lock/dirty preflights, stopPtys() and removeWorktree in every orchestrator that runs it. Failure is typed (worktree_archive_hook_failed) and carries the worktree path, outcome, exit code where one was observed, and the hook's output. unverifiable stays distinct from exited, so loss of contact is never read as a pass. The waiver rides its own field at every layer and is never implied by --force, which already carries the PTY-stop waiver; when used, the waived failure comes back on result.archiveHookOverride rather than being swallowed. worktree.archive-failure-blocking.v1 is advertised so an integration can tell "accepts --run-hooks" from "safely propagates a failing hook" without risking the data loss to find out. The runtime's SSH path cannot run a hook at all, so rather than delete with the archive step silently skipped it refuses — waivable like every other refusal here. #18563 retires that gate by making the path run the hook for real. Stacked on #20559, which makes a timed-out hook report honestly; without it a hook that traps SIGTERM and exits 0 would defeat this gate. Fixes #19334
* fix(worktree): block removal when the archive hook fails A repo's orca.yaml archive hook is the user's last chance to save work off a checkout Orca is about to delete. A failed hook was logged as advisory and stepped over, so the removal went ahead with nothing archived — and the caller could still be told it succeeded. The hook is now a blocking precondition, evaluated while the checkout, its Git registration, its agents and Orca's ownership evidence are all still intact: it sits ahead of the registration re-read, the lock/dirty preflights, stopPtys() and removeWorktree in every orchestrator that runs it. Failure is typed (worktree_archive_hook_failed) and carries the worktree path, outcome, exit code where one was observed, and the hook's output. unverifiable stays distinct from exited, so loss of contact is never read as a pass. The waiver rides its own field at every layer and is never implied by --force, which already carries the PTY-stop waiver; when used, the waived failure comes back on result.archiveHookOverride rather than being swallowed. worktree.archive-failure-blocking.v1 is advertised so an integration can tell "accepts --run-hooks" from "safely propagates a failing hook" without risking the data loss to find out. The runtime's SSH path cannot run a hook at all, so rather than delete with the archive step silently skipped it refuses — waivable like every other refusal here. #18563 retires that gate by making the path run the hook for real. Stacked on #20559, which makes a timed-out hook report honestly; without it a hook that traps SIGTERM and exits 0 would defeat this gate. Fixes #19334 * fix(worktree): close the skip-confirm dead end and the client/hook timeout gap Four review findings on the gate. A retry from the failure toast could fail for a DIFFERENT reason than the one the user had just answered, and that second failure got a bare toast with no buttons. With skipDeleteWorktreeConfirm set, the delete helpers pass no force, so waiving a failed archive hook on a dirty checkout landed on the dirty preflight and stopped there. Retry failures now re-enter the same failure toast, so every retry stays as actionable as the first attempt. Third instance of this class. The renderer gave worktree.rm a 60s budget while an archive hook may run for 120s. A hook that took 90s and succeeded timed the client out and reported failure while the host went on to delete — telling the user their delete failed and their checkout was gone. The budget is now derived from the hook's, and only when a hook can run. The SSH fail-open is logged rather than silent, and the capability's doc comment scopes what it claims: a hook that RUNS and fails cannot delete the checkout; it is not a promise the hook was found. The SSH owner-resolution test now reads a real remote orca.yaml through a stubbed provider and asserts the returned script is the remote one. It previously stopped at the lookup key, which is the coverage that let this path break twice. It fails against the row-only resolution. * fix(worktree): name a signalled hook exit, and state why prunable cleanup skips the gate Two things the rebase onto #20617 and #20576 surfaced, both found by rerunning the real-repo harness rather than by reading the diff. - #20617 added a registration-cleanup branch that returns before the archive gate. That ordering is correct — both of its arms describe a row with no checkout behind it, so there is nothing to archive and running the hook would fail on the missing cwd — but the gate's ordering invariant is documented, so the exception should be too. - A signalled hook reported `Command failed with exit code null.`, which reads as a reporting glitch rather than the `unverifiable` verdict it is about to produce. It now says the command was terminated without reporting an exit code. Introduced by #20576; the withheld `exitCode` itself was always right. Fixes #19334
b093ad4 to
8910179
Compare
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — since the prior pullfrog review at b093ad4, the branch was rebased onto a main that now carries #20153's archive-hook gate, and the SSH fix was re-implemented in two commits:
- Explicit hook owner —
runRemoteArchiveHooktakes a requiredconnectionIdrather than readingrepo.connectionId, and the UI removal path passesrepo.connectionIdexplicitly. - SSH removal runs and gates the hook —
removeRuntimeRegisteredRemoteWorktreereads the execution host's hooks viagetArchiveHooksForRemoval(repo, connectionId), runsrunRemoteArchiveHookunderrunHooks, and passes the result throughgateWorktreeRemovalOnArchiveHook, so a failed or unverifiable hook throws before any mutation unlessallowFailedArchiveHookwaives it; when hooks are configured but not requested it returns the same skipped-hook warning as the local path. - Post-hook re-validation — the execution host is re-listed unconditionally,
findRegisteredDeletableWorktree/assertWorktreeUnlockedForRemovalre-run, and the refreshed row drives watcher acquisition, removal, andpreserveBranchHead, so a hook that moved the branch preserves the refreshed head. - Retired the "cannot run" gate —
gateRemovalWhereArchiveHookCannotRunandworktree-archive-hook-cannot-run.test.tsare deleted, replaced by the real hook run. - Tests — 11 cases in
runtime-registered-remote-worktree-removal.test.ts, 4 newrunRemoteArchiveHookcases, and 2 integration cases.
Verified this run: pnpm tc:node clean; both changed unit suites pass 19/19; the archive-hook integration tests pass 13/13. The refreshed head does reach preservedBranch cleanup (runtime-preserved-branch-cleanup.ts:42), and the worktree.archive-failure-blocking.v1 doc comment already scopes its claim to a hook that runs.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
) * fix(worktree): block removal when the archive hook fails A repo's orca.yaml archive hook is the user's last chance to save work off a checkout Orca is about to delete. A failed hook was logged as advisory and stepped over, so the removal went ahead with nothing archived — and the caller could still be told it succeeded. The hook is now a blocking precondition, evaluated while the checkout, its Git registration, its agents and Orca's ownership evidence are all still intact: it sits ahead of the registration re-read, the lock/dirty preflights, stopPtys() and removeWorktree in every orchestrator that runs it. Failure is typed (worktree_archive_hook_failed) and carries the worktree path, outcome, exit code where one was observed, and the hook's output. unverifiable stays distinct from exited, so loss of contact is never read as a pass. The waiver rides its own field at every layer and is never implied by --force, which already carries the PTY-stop waiver; when used, the waived failure comes back on result.archiveHookOverride rather than being swallowed. worktree.archive-failure-blocking.v1 is advertised so an integration can tell "accepts --run-hooks" from "safely propagates a failing hook" without risking the data loss to find out. The runtime's SSH path cannot run a hook at all, so rather than delete with the archive step silently skipped it refuses — waivable like every other refusal here. stablyai#18563 retires that gate by making the path run the hook for real. Stacked on stablyai#20559, which makes a timed-out hook report honestly; without it a hook that traps SIGTERM and exits 0 would defeat this gate. Fixes stablyai#19334 * fix(worktree): close the skip-confirm dead end and the client/hook timeout gap Four review findings on the gate. A retry from the failure toast could fail for a DIFFERENT reason than the one the user had just answered, and that second failure got a bare toast with no buttons. With skipDeleteWorktreeConfirm set, the delete helpers pass no force, so waiving a failed archive hook on a dirty checkout landed on the dirty preflight and stopped there. Retry failures now re-enter the same failure toast, so every retry stays as actionable as the first attempt. Third instance of this class. The renderer gave worktree.rm a 60s budget while an archive hook may run for 120s. A hook that took 90s and succeeded timed the client out and reported failure while the host went on to delete — telling the user their delete failed and their checkout was gone. The budget is now derived from the hook's, and only when a hook can run. The SSH fail-open is logged rather than silent, and the capability's doc comment scopes what it claims: a hook that RUNS and fails cannot delete the checkout; it is not a promise the hook was found. The SSH owner-resolution test now reads a real remote orca.yaml through a stubbed provider and asserts the returned script is the remote one. It previously stopped at the lookup key, which is the coverage that let this path break twice. It fails against the row-only resolution. * fix(worktree): name a signalled hook exit, and state why prunable cleanup skips the gate Two things the rebase onto stablyai#20617 and stablyai#20576 surfaced, both found by rerunning the real-repo harness rather than by reading the diff. - stablyai#20617 added a registration-cleanup branch that returns before the archive gate. That ordering is correct — both of its arms describe a row with no checkout behind it, so there is nothing to archive and running the hook would fail on the missing cwd — but the gate's ordering invariant is documented, so the exception should be too. - A signalled hook reported `Command failed with exit code null.`, which reads as a reporting glitch rather than the `unverifiable` verdict it is about to produce. It now says the command was terminated without reporting an exit code. Introduced by stablyai#20576; the withheld `exitCode` itself was always right. Fixes stablyai#19334

ELI5
When you delete an SSH-based worktree from the CLI with
--run-hooks, the app was supposed to run your configured "archive hook" (e.g. a cleanup/release script) before deleting it — like it already does for local worktrees and for deletions done from the UI. It wasn't. This PR makes the CLI/SSH deletion path run that hook too, and — matching the failure-gating behavior #20153 added for local removal — blocks the deletion if the hook fails or its outcome can't be confirmed, unless explicitly waived.What Changed
Two commits, rebased on current
mainafter#20153(fixes #19334) merged and added archive-hook failure gating for local removal:refactor(worktree): resolve remote archive hook owner explicitly—getArchiveHooksForRemoval/runRemoteArchiveHooknow take an explicit, resolvedconnectionIdargument instead of readingrepo.connectionId. This fixes rows registered only asexecutionHostId: 'ssh:<target>'(noconnectionIdfield), which previously no-oped the hook lookup.#20153'sArchiveHookRunResultshape,ARCHIVE_HOOK_TIMEOUT_MS, and observed-exit/exitCodesemantics are unchanged. Infrastructure-only: runtime SSH removal is untouched by this commit.fix(worktree): run and gate SSH archive hooks before removal—removeRuntimeRegisteredRemoteWorktreenow looks up and runs the configured archive hook over the resolved SSH connection, passes the result through#20153'sgateWorktreeRemovalOnArchiveHook(a non-zero exit or an unobserved outcome blocks unlessallowFailedArchiveHookis set), and — after the gate returns — unconditionally re-lists and revalidates the worktree's registration and lock state before acquiring the watcher, stopping PTYs, or callingremoveWorktree, using the refreshed path/head. The now-unreachable temporary refusal (gateRemovalWhereArchiveHookCannotRun) and its dedicated test are removed.Why
orca worktree rm --run-hooksremoved SSH-backed worktrees without running their configured archive hook, while the app UI removal path handled it correctly. Archive hooks commonly release worktree-scoped resources (processes, sessions, external state); skipping them on every SSH removal leaks that state. After#20153landed local-removal failure gating, the SSH path additionally needed to run the hook at all before that gate could mean anything, and needed to revalidate worktree state after the hook runs — the same ordering#20153established for the local path, since an archive hook can itself unregister, lock, or move the worktree it was called on.Linked Issue
Fixes #18558. That issue is currently closed as completed from
#20153's merge, even though#20153intentionally left this SSH path on a temporary refusal rather than executing the hook — this PR completes the fix by making the CLI/SSH path actually run the hook.Visual Proof
N/A — this is a backend/CLI behavior fix (worktree removal hook dispatch over SSH). No UI or visual surface is touched.
Testing
Steps a reviewer can follow: add an SSH-backed repo with an archive script configured in
orca.yaml, create a non-main worktree, runorca worktree rm <worktree> --run-hooks, and confirm the archive script runs before the worktree is removed. Confirm a failing hook blocks the removal (--allow-failed-archive-hookto override), and that omitting--run-hooksreturns the skipped-hook warning, matching local removal.src/main/runtime/runtime-registered-remote-worktree-removal.test.ts(new): 11 tests covering resolved-connection lookup/execution, skipped-hook warning, exited/unverifiable failure blocking with no mutation,forcenot waiving,allowFailedArchiveHookwaiving and returningarchiveHookOverride, a waived failure still revalidating fresh registration/lock state, refreshed-path/head usage for watcher/removal/branch preservation, and unconditional re-list even with no hook configured.src/main/runtime/orca-runtime-tests/ssh-worktree-lifecycle-part-02.spec.ts: service-level cases provingrunHooks: trueexecutes the remote archive command before PTY stop/delete, andrunHooks: falsereturns the warning without executing.src/main/ipc/worktrees/removal/worktree-archive-hook.test.ts: explicit-owner execution, numeric exit code retention, and timeout/spawn-failureexitCodeomission forrunRemoteArchiveHook.Verified locally (OCI Linux + a real Windows hpv2 host, at head
8910179a67):pnpm test src/main/runtime/orca-runtime.test.ts— 1278/1278 passed on Windows (1277 passed / 1 skipped on Linux; the skip is a Windows-only case that ran on the Windows host).pnpm test src/main/runtime/runtime-registered-remote-worktree-removal.test.ts src/main/ipc/worktrees/removal/worktree-archive-hook.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts— 3 files, 35/35 passed.pnpm tc:node— clean, no diagnostics, on both hosts.oxlinton the 7 changed/existing TypeScript files — 0 warnings, 0 errors.pnpm run check:code-quality:changeddid not complete on the Windows verification host — it stalled past 90s even after raisingdiff.renameLimit, on two separate attempts. Not classified as a code issue:oxlint(the linter that script wraps) passed clean on the same files, and this is the one check I could not independently confirm pass/fail for.pnpm testwas not run (out of scope for this diff);pnpm buildwas not run locally.AI Disclosure
This PR was rebuilt from the reported author's original archive-hook design onto current
main(post-#20153), with implementation and its test suite done via Claude Code (taskrole subagents, TDD red/green per commit), and design review via a separate GPT-based session before implementation began.Review
Prior CodeRabbit/Pullfrog review threads on the earlier head are resolved by this rebase: the branch previously accumulated 20+ commits from unrelated workstreams (Windows CI test fixes, WSL fixtures, rate-limit design docs) and had 6+ outstanding
pnpm tc:nodeTS2304errors from those unrelated commits. The branch has been reset to exactly the two archive-hook commits on top of currentmain; please re-review from a clean diff.Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
#20153's local-removal gate.#20153's failure-blocking/waiver contract.RemoveWorktreeResult's existing optionalarchiveHookOverride/warningfields are populated the same way the local path already populates them.listWorktreesre-list after the hook runs (mirroring the local path's existing re-validation).pnpm test/pnpm buildand CI have not been run for this exact head; please let CI complete before merge.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred) —pnpm tc:nodeclean and focusedpnpm testsuites (38 tests total across both hosts) pass;oxlinton changed files is clean;check:code-quality:changedcould not be completed locally (see Testing); full-repopnpm test/pnpm buildand CI have not run against this head yet.