Repository navigation
Conversation
b09175b to
8c0e7ec
Compare
# Conflicts: # src/shared/child-process/process-tree-termination.test.ts
|
Too many files changed for review (169 files, 100 file limit). Bypass the limit by tagging |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the full head (14a6530) against base nwparker/worktree-create-technical — 169 files across the daemon control protocol, the PTY runtime/ipc spawn paths, the local/remote worktree-create flows, and the renderer composer. Substantive changes:
- Daemon deferred-startup hold/release — a new
deferredStartupOperationIdflows throughcreateOrAttach;SessionDeferredStartupholds the agent submission and only releases it on areleaseStartupCommandmatching the exact session, PTY incarnation, and operation.deferStartupCommandsuppresses argv delivery inshell-launch-plan.ts. - Protocol versioning —
PROTOCOL_VERSION36→38, split intoDEFERRED_STARTUP_DAEMON_PROTOCOL_VERSION=37(release) andDEFERRED_STARTUP_STATE_DAEMON_PROTOCOL_VERSION=38(reattach state), keeping v37 release compatible so an upgrade never strands a held command. - Owner-fenced release — the runtime controller and the renderer
worktrees:releaseStartuphandler both re-derive the exact pty/incarnation/operation (and Claude account-switch) before releasing; unknown local ids returnunavailablerather than falling through, and retries never type a fallback into an uncertain terminal. - Retained composer drafts —
useRetainedComposerCreationreserves one frozen, execution-identity-keyed workspace+terminal per composer revision; Create joins the pending creation and releases the held command, while cancel/edit leaves it as a normal workspace. - Standby checkout preparation — a per-window
WorktreeCreateStandbyOwnerwith a serialized queue plusholdPreparation/completePreparationClaimin the preparation pool, replenished only after successful finalization. - Startup-effect deferral —
agent_startedtelemetry,markClaudePtySpawned, and Command-Code detection are withheld until accepted release in both the ipc and runtime spawn paths, with trust preflight (markCodexProjectTrustedawaited, non-interactiveinspectHooksTrust) ordered before release. - Child-process hardening —
resolveSpawnextracted to a pure module;hasExitedPosixProcessGroupshortens the POSIX termination barrier only when the whole group is provably gone (ESRCH).
The owner-fencing invariant is genuinely load-bearing and I traced it end-to-end: release claims 'accepted' before writing, a reentrant release is a no-op, a throwing write yields 'unverifiable' and is never replayed, and exit/dispose/termination retire the command and block queued delivery. Protocol v37/v38 boundaries, the OptionalPlainString change to preserve empty-string startupCommand, and the schema/wire additions are all consistently gated and tested. The only remaining limitations (non-durable telemetry acknowledgement across main-process crash, no SSH/folder/VM release parity, unverified cross-platform rendered deferral) are disclosed in the PR body and gated experimental — none are defects in this change.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
…stant-retained-workspace
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the delta since the prior Pullfrog review (14a6530): the technical base advanced one commit and was merged into this branch, so the net change is a single commit.
- Malformed remote-base short-circuit —
resolveRemoteTrackingBasenow returnsnullfor bases whose remote/branch separator is missing, leading, or trailing (e.g.main,/main,origin/,refs/remotes//main), skipping thegit remoteprobe entirely instead of spawning a subprocess that then fails to match.
The change is behavior-preserving for every valid remote-tracking base, and every newly-rejected form already resolved to null under the old code — but only after a wasted git remote spawn. The expanded it.each cases plus the not.toHaveBeenCalled() assertion make the no-launch guarantee fail if Git is ever invoked for these inputs, so the coverage is real rather than cosmetic.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the delta since the prior Pullfrog review (a7d1aef437), which nets to a single performance commit plus the technical-base merge.
- Codex preflight module decoupling —
agent-hooks.tsnow importsprepareManagedCodexHomeBeforeShellLaunchdirectly fromcodex/managed-home-shell-preflight(its existing service home) instead of routing it through the all-agentmanaged-agent-hook-controlsregistry, so a managed-home Codex shell launch no longer drags the full managed-agent-hook registry into its module graph. - Lazy-loaded all-agent hook controls —
applyAgentStatusHooksEnabledandgetManagedAgentHookStatusesare nowawait imported only inside thestatus/on/offcommand paths, keeping them off the preflight's load path.
The split is behavior-preserving: managed-agent-hook-controls.ts still re-exports the preflight function so existing consumers are unchanged, and the new dynamic imports use the same .js-suffixed await import convention already used across the CLI. The test mocks were updated to match the two import sites, and the nine existing command tests continue to exercise the functional paths. No correctness, coverage, or elegance concerns.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
…stant-retained-workspace
…stant-retained-workspace
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the delta since the prior Pullfrog review (net of 2aa499b9412..27e4727d00, the changed-spec E2E race fix pulled in from the stacked technical base).
- Wait for pane re-binding before lease-recovery input — the
keeps one reattachable lease per panespec now captures the pre-kill PTY id at the top of each generation loop and, after the relay is killed and the transport reportsconnected, activelypolls until the active pane reports a different PTY id before typing the generation marker. This replaces a comment that only stated the intent and closes the race where the marker was sent before the replacement relay was ready.
The fix mirrors the identical .poll(...).catch(() => previousPtyId).not.toBe(...) pattern already used by the preceding verdict spec, so the timing and the swallow-into-retry semantics are consistent with the surrounding suite. It adds a real assertion (the pane must actually re-bind under a new lease) rather than weakening an existing one, so the test is more strict, not less.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
27e4727
into
nwparker/worktree-create-technical

Latest follow-up
Current heads: A
80c93771548, B5da57004e9f. Product source is unchanged from the released2aa499b9412build. The test-only follow-ups fix the relay-restart test's stale-binding wait and strengthen its oracle: the expected marker must be generated by the shell, and the sole durable reattachable lease must belong to the active PTY. All five restart cycles passed locally in 39.4 seconds, but worker teardown timed out at 120 seconds; the overall local command did not pass. Scoped review/elegance and lint/format passed. Fresh current-head CI is pending. The preceding B unit shard failed before tests during pnpm installation (ECONNRESETfrom npm); its workflow was still running when GitHub rejected a job retry.Codex preflight imports its existing service directly and loads all-agent hook controls only for status/on/off. Isolated CLI comparison: 482 → 351 modules; median about 102 → 85 ms. Bundled output under the same signed Electron runtime: 126 → 110 ms (installation excluded; storage layouts differ). Nine command tests, full CLI + electron-vite build, runtime-import closure verification, lint/format and independent readiness/elegance review passed. Packaging CI found the initially missing direct-import entry; its fix subsequently passed Windows/Linux packaging. No additional user-facing negative trade-off identified.
ELI5
Opening the composer can prepare a real workspace and its shell while the user fills out the form. Create adopts that exact workspace and releases the selected agent command. Canceling keeps the draft available as a normal workspace.
Stacked on #18793. Both branches include main
af82126058deand are non-draft. The integrated14a65301892passed CI, scoped readiness/elegance review, rendered creation, and forced app-process crash recovery. Latera7d1aef437ealso passed CI and Pullfrog review. These historical passes do not replace current-head CI; see the follow-up above.What Changed
Why
Move checkout and shell-profile work ahead of Create without launching the selected agent before submission. Preserve user-created/profile output and terminal ownership through cancellation and reattachment.
Linked Issue
User-requested performance work; no linked issue supplied.
Measured Behavior
Single native macOS development-build trials at
14a65301892with real Codex:MCP servers were still initializing. The two trials above disabled Codex's update check only in isolated test settings; product defaults are unchanged. A further trial on
14a65301892with normal update-check behavior selected the workspace in 228 ms but displayed Codex's update-choice screen instead of a task prompt throughout the 15-second observation. This existing agent prompt is not introduced by B. These measurements establish neither full tool readiness nor consistently near-instant creation.Additional optimized-renderer comparison on the same commit and isolated profile (local Electron, production-bundled renderer with store instrumentation; not an installed-release benchmark):
Validation scope: early optimized local trials had a missing
out/cli/index.js. A later instrumented launch did not call that launcher, and an existing retained test shell reported noCODEX_HOMEorORCA_CODEX_LAUNCH_PREFLIGHT; therefore the missing file alone does not establish that those UI trials skipped preflight work they would otherwise perform. The separate preflight benchmarks measure the managed-home launch command, not a demonstrated cost in this fixture.With the CLI built, two later prepared trials on the same running
14a65301892app selected the workspace in 100/88 ms, rendered the Codex prompt/model in 597/530 ms, and displayed real keyboard input in 649/566 ms. Each included one 56–57 ms renderer long task. Screenshots inspected; no task submitted. MCP readiness remains excluded; update checks were disabled only for each trial and restored afterwards. These are local optimized-build measurements, not installed-release benchmarks. The instrumented launcher was restored after the final trial.An additional instrumented warm trial isolated the prepared-command release: 28.7 ms after Create to enter the release IPC, 2.2 ms for that call to settle, workspace visible at 91 ms, Codex banner at 180 ms, prompt at 531 ms, and real typed input at 582 ms. CDP logpoints were removed afterwards. The running app remains the optimized
14a65301892build (release-path source unchanged); update checks were disabled for this trial and restored, and MCP readiness is excluded. This rules out substantial release-IPC overhead in this sample, not across every topology.Visual Proof
The earlier normal-restart images below are supplemented by
14a65301892creation screenshots and a forced app-process crash check. The daemon remained running in both restart scenarios.Composer open, with the real workspace prepared without changing the active workspace:

The canceled draft reopened after a normal app-process restart on its original terminal. A shell command rendered successfully, and releasing the original agent operation returned

retiredafter manual use:Draft at

14a65301892after SIGKILL of the isolated app process and relaunch: original terminal restored, manual command rendered, original held-agent release returnedretired:Testing
pnpm tcpassed.14a65301892) CI checks passed, including all eight test shards, packaging, typecheck, wire compatibility, and native smoke checks.14a65301892preserved the original draft terminal with no premature agent execution.unavailable. All owned processes exited. The daemon bundle was built at the earlier tested14a65301892baseline; daemon sources are unchanged through current head. This does not prove UI restoration or the unacknowledged release/crash window.DaemonClientrejected with connection loss. Reconnect/retry on the surviving daemon remained one execution; lost acknowledgement followed by daemon replacement returnedunavailableand remained one execution. All owned processes exited. Execution completed before intentional SIGKILL, so arbitrary internal crash windows and UI/SSH recovery remain unproven.Review and Merge Risk
Earlier reductions completed Fable review/fix and elegance passes. Native reviews covered the subsequent runtime and composer integration; the review-found restart metadata gap was fixed and tested. Final independent review and CI passed for
14a65301892; the two-file follow-up passed independent review and current-head Pullfrog re-review. CI passed at those earlier revisions, including the additional end-to-end jobs; latest-head CI remains pending. Current A re-review used Pullfrog, not Fable; later integration reviews used native subagents as requested.Merge risk: moderate. This changes workspace lifecycle, background resource use, and daemon startup ownership. No known release-blocking defect remains; the breadth of the lifecycle change and the live topology gaps keep this above low risk.
User-facing Negative Trade-offs
Remaining limitations:
Release
Refreshed release from exact commit
2aa499b9412fa37d8fcb9f644b513f3e0a8207e2, containing A+B product changes atop mainaf82126058de. Build run. Signed/notarized Apple Silicon and Intel macOS installers are published; downloaded Apple Silicon ZIP matches the updater SHA-512 and passes archive integrity verification. Windows packaging and publication also succeeded; the downloaded 181,968,744-byte installer matches its updater SHA-512. This build predates only the E2E test follow-ups at current head; product source is identical. Fresh CI remains pending, so this is a trial build rather than a claim of final readiness.Agent skill upstream boundary: not applicable.