Repository navigation
Conversation
# Conflicts: # src/shared/child-process/process-tree-termination.test.ts
…stant-retained-workspace
…stant-retained-workspace
…stant-retained-workspace
…stant-retained-workspace
…stant-retained-workspace
|
Too many files changed for review (170 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 169-file diff at head 5da5700 (35 commits) implementing retained composer drafts and owner-fenced deferred agent-shell startup.
- Retained composer drafts — the quick composer prepares a real workspace (checkout + shell) in the background; Create adopts it, cancel/edits keep it as a normal workspace.
- Owner-fenced deferred startup — the daemon holds the agent command until
releaseStartupCommand, gated on workspace + PTY incarnation + operation; manual input retires it. - Protocol v36→v38 — new
releaseStartupCommandRPC (capability-gated ≥37) and deferred-state-on-reattach (v38), preserving v37 release for already-held commands. - Runtime/renderer release plumbing —
worktree.background-startup.v1-gated preparation,worktrees:releaseStartup, and crash-safe retry viadeferredStartupRecovery. - Standby checkout pool — bounded, serialized per-window standby with hold/replenish-after-finalize and stale-cleanup rescheduling.
I independently traced the two highest-stakes invariants — exactly-once command release on the daemon, and adoption identity / no-duplicate-create on the renderer — plus the run-process.ts termination-barrier change. All hold: SessionDeferredStartup.release sets state = 'accepted' and nulls submission before writing; SessionStartupInput.deliver re-checks liveness inside the queued closure and clearPendingWrites() drops it on exit; createRetainedWorktreeCreation.take retires on any snapshot/identity divergence and forces ordinary Create; releasePreparedWorktreeStartup binds release to the exact retained incarnationId/operationId.
ℹ️ Nitpicks
viewMode(native-chat vs terminal) is baked into the backendstartupbyresolveBackendDraftStartupat prepare time fromexperimentalNativeChat/openAgentTabsInChatByDefault, but it is not part of the serialized adoption identity inretained-worktree-creation.ts. Toggling either setting between opening the composer and Create adopts the workspace with a stale agent-tab view mode. Cosmetic, draft-prompt launches only.SessionDeferredStartup.release()returns'accepted'even whendeliver()only queues the write behind the shell-ready gate; if the session exits before the flush, the command is silently dropped while release reported success. At-most-once is preserved and this matches the reliability-gate invariant, but'accepted'can overstate delivery (only a throwing write reaches'unverifiable').Session.signal()callsinput.retire(), butretire()only transitionspending → retired; a command alreadyaccepted(queued but unflushed) survives a signal, so a release immediately followed by a signal can still flush into a signaled shell.exit/disposefence correctly; signal does not.
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 (head 5da5700 → 0fad065), a single test-only follow-up commit.
- macOS Crashpad teardown —
cleanupE2ECrashpadenumerates macOS processes and SIGTERMs the test profile's reparented Chrome crash handler so Playwright is not held open; re-reads the PID's command line to confirm ownership before killing, guardspid <= 1, and is macOS-only (no-op elsewhere).
The change is E2E test-harness only — product source is unchanged from the released 2aa499b9412 build. The ownership recheck (ps -p <pid> -o command=) before process.kill correctly fences PID-reuse races, and the unit test covers exact-profile matching, changed-ownership no-signal, and non-macOS no-ops. No product or wire impact.
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 (head 0fad065 → 15b770c), a single daemon fix commit.
- Signal retires a queued accepted command —
SessionStartupInputnow tracks anawaitingDeliveryflag, andSessionDeferredStartup.retire(acceptedButUndelivered)transitionsaccepted → retiredwhen a signal lands after Create authorization but before the queued write flushes; the flush closure re-checks the flag and drops the write, so neither the readiness marker nor its timeout can launch the command.
I traced the state machine end-to-end (session-deferred-startup.ts, session-startup-input.ts, session-shell-ready-barrier.ts, session.ts). deliver() sets awaitingDelivery before enqueueing the write closure and the closure clears it only when it actually writes, so a synchronous signal interleaving cannot misfire. The two new tests assert exact behavior (retire-before-marker/timeout leaves written empty and returns retired on retry; an already-delivered command is neither revoked nor repeated) and both fail against the pre-fix code. This cleanly resolves the prior review's signal-retirement nitpick.
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 (head 15b770c → bb75b4c), a single renderer-only commit.
- Synchronous preloaded-terminal mount —
terminal-component-loader.tsnow caches the resolvedmodule.defaultin a module-levelloadedTerminaland exposes aPreloadedTerminalthat capturesloadedTerminal ?? LazyTerminalonce viauseStateand renders it throughcreateElement.AppWorkspaceShellconsumesPreloadedTerminal as Terminal.
I traced the behavior across both paths. When NewWorkspaceComposerCard has already preloaded the chunk (loadedTerminal set), the first workspace creation paints the real terminal synchronously instead of throwing a Suspense fallback — this is the bug the commit fixes, since React.lazy suspends once even when the module is cached. When the mount is cold, PreloadedTerminal falls back to lazyWithRetry, preserving the existing chunk-recovery semantics, and the useState initializer keeps the component type stable so a mid-flight preload completion cannot remount the terminal and drop unsent input. The new terminal-component-loader.test.tsx asserts exactly these three behaviors (cold suspend-then-paint, input preservation with mounts === 1, and no suspend after warm preload), and the app-startup-routing.test.ts ratchet was updated to match.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

Superseded by #18876, stacked directly on #18793. That approach retains immediate editable prompts while omitting the early real-workspace/deferred-shell lifecycle. This PR is closed; its branch and earlier trial release remain available for comparison.
Problem and behavior
Create currently waits for checkout, shell startup and first terminal rendering. Opening the composer now prepares a real workspace and, on eligible native local hosts, its shell. Create adopts that exact workspace and releases the selected agent command. Canceling or editing preserves the existing draft as an accessible workspace.
Stacked on #18793. Current head:
bb75b4c6a72, containing A and B atop mainaf82126058de.Implementation
Performance evidence
Fresh-profile comparison using the real Create button after preparation, the same signed A+B main process, and a production renderer build with only the preload fix:
15b770c0605controlThe control started its terminal mounting work about 330 ms after Create; the changed renderer started promptly. This is a local controlled renderer comparison, not a benchmark of a newly published installer. No experimental WebGL changes were included. Screenshots were inspected, Codex accepted keyboard input, and terminal readback preserved the unsent draft. Codex's existing update menu was skipped explicitly; no task was submitted.
Cold creation remains variable: an earlier optimized immediate-click trial showed pending feedback in 29 ms, terminal availability in 4.16 seconds, and agent prompt/input in 5.38/5.42 seconds. Checkout dominated that run. These changes do not establish universally near-instant creation or full MCP/tool readiness. SSH, folder, paired-runtime, VM and structured-chat paths do not all receive identical acceleration.
Validation and review
15b770c0605CI and exact-head review passed. All current-head CI checks passed, including packaging, eight unit-test shards and SSH E2E. Exact-head Pullfrog review also found no new issues.Merge risk and negative trade-offs
Merge risk: moderate, due to the broader preparation/retained-session lifecycle and incomplete live coverage across supported topologies. The isolated preload fix is low risk.
Introduced user-facing trade-offs:
No additional negative trade-off was identified for the preload fix.
Trial release
Latest A+B trial at
bb75b4c6a72, including the preload fix. macOS Intel/ARM artifacts are published; the downloaded Apple Silicon ZIP passed SHA-512/size, archive-integrity and deep/strict code-signature verification. Bundled build metadata confirmsbb75b4c6a72d. The macOS notarization staple also validates. Windows is published and its installer passed SHA-512/size verification; Windows builds are unsigned. Both jobs in 33981313200 completed successfully.Earlier lifecycle visual proof