Repository navigation
Conversation
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Creation draft editor surface —
CreationDraftSurface/CreationDraftEditorrender an editable prompt immediately during workspace creation, mounted inAppWorkspaceShell. - Durable draft storage + session — a new
workspace-creation-drafts/module with IndexedDB persistence, zod-validated records, revisioned conflict detection, capacity/byte limits, and a zustand session with coalesced flushes and cross-window refresh reconciliation. - Native-local Send with incarnation fence —
terminal.sendgains an optionalexpectedIncarnationId; delivery verifies execution ownership, terminal handle/incarnation, host capability, and input readiness, and never auto-replays an uncertain send. - Caller-owned completion / activation intent —
worktree.creategainsstartupActivate/awaitTerminalProvisioning, gated by the newworktree.caller-completion.v1capability; background startup/setup terminals now carry explicitactivate/surfaceOwnerso they don't steal focus. - Focus preservation on layout restore —
restoreTerminalPaneLayoutand split-pane creation honor editable-element focus, keeping the draft editor focused when the workspace appears. - Wire/protocol — two additive runtime capabilities and optional request fields, negotiated per-target so legacy hosts/clients keep their existing behavior.
I verified the incarnation fence's format consistency against getTerminalProcessIncarnation (its legacy ${runtimeId}:${ptyId}:${ptyGeneration} fallback can never satisfy the two-segment comparison, but the delivery path gates on a real incarnationId from terminal.list first, so legacy providers simply never reach Send), the persist-before-send ordering and refused-clears-delivery handling, and the remote capability negotiation in create-worktree.ts. The PR body's stated merge risk (pending installer validation for the terminal-activation changes) is the only thing I'd flag, and it's already called out there.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- SSH recovery input observation helper — a new
tests/e2e/helpers/ssh-recovery-input-observation.tssnapshots theterminal.listresult, pane topology (window.__paneManagers), SSH connection state, and active worktree into atestInfo.attachJSON blob with a 1s timeout fallback. - Wired into the frozen-host recovery spec —
ssh-docker-transport-drop-recovery.spec.tsnow attaches before-freeze / after-write / failure-before-cleanup observations and adds aSTALL_BEFOREmarker so the test proves the terminal accepts input prior to the freeze.
The delta since the prior review (bebc3d9) is test-only — two commits (9df55c8 and a base-branch merge) touching 2 files with no production behavioral surface. The helper reuses the established window.__store / window.__paneManagers globals, the terminal.list RPC ({ limit, includeVisualLayouts }, worktree optional), and existing pane fields (getPanes(), leafId, container.dataset.ptyId); all imports resolve and the catch block rethrows to preserve test semantics.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
b6a576d to
7424e1a
Compare
|
Too many files changed for review (149 files, 100 file limit). Bypass the limit by tagging |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Headful E2E draft-handoff test —
tests/e2e/workspace-creation-draft-handoff.spec.tsdrives the durable creation-draft flow through a real checkout and setup split, asserting the editor stays mounted, focused, and caret-preserved across handoff, that the draft is never auto-submitted to the agent, and that the saved draft restores after reload.
I verified the test's assumptions against the codebase: store.getState().createWorktree is a real slice action, activePendingCreationId and GOLDEN_STUB_AGENT_SUBMITTED (emitted by the fixture script tests/e2e/fixtures/golden-stub-agent/golden-stub-agent.js, not the helper) exist as referenced, and the evaluateHandle gate correctly holds only the request boundary before releasing the original creation flow. No production behavioral surface.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
📝 WalkthroughWalkthroughThe change adds background worktree startup behavior, caller-owned completion, terminal incarnation validation, and activation-aware pane splitting. It introduces persistent workspace creation drafts with IndexedDB storage, conflict handling, guarded terminal delivery, submission state, editor controls, localization, and draft restoration. Tests cover runtime startup paths, terminal fencing, pane focus, draft persistence, delivery, submission, and end-to-end handoff. Merge Risk: 🔵 Low · up to Draft preservation and replay prevention remain covered, but the uncertain-delivery guidance is inconsistent with the disabled Send control, and a teardown failure can hang or destabilize the E2E run. These are low-risk, bounded fixes. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description gives detailed scope, rationale, implementation behavior, testing evidence, risks, and known limitations. However, it does not follow the required template and omits the mandatory Linked Issue section with a Resolution Reformat the description using the repository template. Add a
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: 6edc081e-4e36-4aa3-87af-f6a4cac0e718
📒 Files selected for processing (67)
src/main/ipc/worktree-remote.tssrc/main/ipc/worktrees-local-create-flow.test.tssrc/main/runtime/managed-worktree-create-execution-host.test.tssrc/main/runtime/orca-runtime-create-managed-worktree.tssrc/main/runtime/orca-runtime-split-pty-backed-terminal.tssrc/main/runtime/orca-runtime-split-terminal.tssrc/main/runtime/orca-runtime-terminal-split-authority.test.tssrc/main/runtime/rpc/methods/terminal/terminal-input-delivery.tssrc/main/runtime/rpc/methods/terminal/terminal-send-method.tssrc/main/runtime/rpc/methods/worktree-create-args.test.tssrc/main/runtime/rpc/methods/worktree-create-args.tssrc/main/runtime/rpc/methods/worktree-create-schemas.tssrc/main/runtime/rpc/terminal-send-incarnation.test.tssrc/main/runtime/runtime-folder-worktree-create.tssrc/main/runtime/runtime-folder-worktree-startup.test.tssrc/main/runtime/runtime-local-worktree-terminal-startup.tssrc/main/runtime/runtime-managed-worktree-create-types.tssrc/main/runtime/runtime-remote-managed-worktree-create.tssrc/main/runtime/runtime-worktree-background-startup.test.tssrc/main/runtime/runtime-worktree-terminal-provisioning.tssrc/renderer/src/app-shell/AppWorkspaceShell.tsxsrc/renderer/src/components/terminal-pane/layout-serialization.test.tssrc/renderer/src/components/terminal-pane/layout-serialization.tssrc/renderer/src/components/terminal-pane/pane-helpers.tssrc/renderer/src/components/terminal-pane/terminal-pane-layout-restore-focus.test.tssrc/renderer/src/components/terminal-pane/terminal-pane-layout-restore.tssrc/renderer/src/components/terminal-pane/terminal-pane-mount-events-focus.test.tssrc/renderer/src/components/terminal-pane/terminal-pane-mount-events.tssrc/renderer/src/components/worktree-creation/CreationDraftEditor.tsxsrc/renderer/src/components/worktree-creation/CreationDraftSurface.tsxsrc/renderer/src/constants/terminal.tssrc/renderer/src/hooks/ipc-events/terminal-presentation-ipc-bridge.tssrc/renderer/src/hooks/useIpcEvents-terminal-create-surfacing.test.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/lib/pane-manager/pane-manager-types.tssrc/renderer/src/lib/pane-manager/pane-split-close.test.tssrc/renderer/src/lib/pane-manager/pane-split-close.tssrc/renderer/src/lib/workspace-creation-drafts/creation-draft-connection.tssrc/renderer/src/lib/workspace-creation-drafts/creation-draft-copy.test.tssrc/renderer/src/lib/workspace-creation-drafts/creation-draft-database.tssrc/renderer/src/lib/workspace-creation-drafts/creation-draft-delivery.test.tssrc/renderer/src/lib/workspace-creation-drafts/creation-draft-delivery.tssrc/renderer/src/lib/workspace-creation-drafts/creation-draft-readiness.test.tssrc/renderer/src/lib/workspace-creation-drafts/creation-draft-readiness.tssrc/renderer/src/lib/workspace-creation-drafts/creation-draft-record.test.tssrc/renderer/src/lib/workspace-creation-drafts/creation-draft-record.tssrc/renderer/src/lib/workspace-creation-drafts/creation-draft-session.test.tssrc/renderer/src/lib/workspace-creation-drafts/creation-draft-session.tssrc/renderer/src/lib/workspace-creation-drafts/creation-draft-submit.test.tssrc/renderer/src/lib/workspace-creation-drafts/creation-draft-submit.tssrc/renderer/src/lib/worktree-creation-completion.tssrc/renderer/src/lib/worktree-creation-draft-handoff.test.tssrc/renderer/src/lib/worktree-creation-flow-execute.tssrc/renderer/src/lib/worktree-creation-flow.test.tssrc/renderer/src/lib/worktree-creation-flow.tssrc/renderer/src/store/slices/worktrees-remote-runtime-create.test.tssrc/renderer/src/store/slices/worktrees/create/create-worktree.tssrc/renderer/src/store/slices/worktrees/create/worktree-create-payload.test.tssrc/renderer/src/store/slices/worktrees/create/worktree-create-payload.tssrc/shared/protocol-version.tssrc/shared/worktree/launch-types.tstests/e2e/workspace-creation-draft-handoff.spec.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 1 remains after this review.
| : translate( | ||
| 'creationDraft.uncertain', | ||
| 'Delivery is unconfirmed. Check the terminal before sending again. Your draft is kept here.' | ||
| )} |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Correct the uncertain-delivery text, because Send cannot be used again.
The message tells the user to check the terminal "before sending again". Send cannot run again for this draft. Line 120 keeps delivery for any state other than delivered, Line 208 disables Send while buffer.delivery is set, and creation-draft-submit.ts (Line 41) returns already-attempted for a draft that carries a delivery fence. So an uncertain outcome disables Send permanently, even after further edits.
Reword the message to point to Copy draft. Update the same key in the locale files.
✏️ Proposed wording change
: translate(
'creationDraft.uncertain',
- 'Delivery is unconfirmed. Check the terminal before sending again. Your draft is kept here.'
+ 'Delivery is unconfirmed. Check the terminal. If the prompt did not arrive, use Copy draft. Your draft is kept here.'
)}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| : translate( | |
| 'creationDraft.uncertain', | |
| 'Delivery is unconfirmed. Check the terminal before sending again. Your draft is kept here.' | |
| )} | |
| : translate( | |
| 'creationDraft.uncertain', | |
| 'Delivery is unconfirmed. Check the terminal. If the prompt did not arrive, use Copy draft. Your draft is kept here.' | |
| )} |
There was a problem hiding this comment.
🧹 Nitpick comments (3)
tests/e2e/workspace-creation-draft-interruption.spec.ts (3)
17-48: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExtract the duplicated repo and terminal-output helpers into a shared module.
createDraftTestRepoandreadActiveTabOutputare duplicated verbatim intests/e2e/workspace-creation-draft-handoff.spec.ts. Both specs are added by this PR, so the copies will drift. Move both functions to a shared helper, for exampletests/e2e/helpers/creation-draft.ts, and import them in both specs.
165-170: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winGuard the teardown so the IPC handler is always restored and disposed.
Line 166 tolerates a failure of the creation gate, but line 168 does not. If
interruption.evaluate((gate) => gate.restore())rejects,interruption.dispose()never runs, the replacedruntime:callhandler stays installed, and thegatepromise stays unresolved. The pendingterminal.waitinvoke then blocks until shutdown.♻️ Proposed teardown fix
} finally { await creation.evaluate((gate) => gate.release()).catch(() => undefined) await creation.dispose() - await interruption.evaluate((gate) => gate.restore()) + await interruption.evaluate((gate) => gate.restore()).catch(() => undefined) await interruption.dispose() }
149-150: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueAssert the final write count with a literal.
Line 164 compares against the
writesvalue captured at line 149. The assertion still re-readsstate(), so it is not tautological, but the intent of the check is "no input was ever written". A literal states that directly and survives a future change to line 150.♻️ Proposed clarification
- expect(await interruption.evaluate((gate) => gate.state())).toEqual({ writes, waits: 1 }) + expect(await interruption.evaluate((gate) => gate.state())).toEqual({ writes: 0, waits: 1 })Also applies to: 164-164
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: 764168d9-fc54-4a6f-9116-45a24e0c873a
📒 Files selected for processing (1)
tests/e2e/workspace-creation-draft-interruption.spec.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 0 remain after this review.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
The delta since the prior review (7de154a) is a single new @headful Electron regression test.
- Interrupted-draft recovery test —
tests/e2e/workspace-creation-draft-interruption.spec.tsholdsterminal.waitreadiness in the main process after the durablesendingcommit, reloads the renderer, and asserts the draft text recovers, the "Delivery is unconfirmed" notice shows, Send is disabled, Copy stays enabled, and no second readiness request or input write is issued.
I traced the assertions against the production flow: submit() persists delivery: { state: 'sending' } before sendCreationDraft reaches the first isCreationDraftInputReady gate, so the held terminal.wait (waits === 1) blocks before any terminal.send (writes === 0). On reload the persisted sending state renders the unconfirmed notice (any non-delivered delivery does, in CreationDraftEditor.tsx), disables Send via Boolean(buffer.delivery), and leaves Copy enabled; the per-renderer attempts map plus the disabled Send button mean nothing replays, which the final { writes, waits: 1 } assertion pins. The test is a meaningful regression guard, not theatre.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
The delta since the prior review (9a31ff3) is test-only: a second interruption scenario plus a small fixture extension.
- "Lost reply after accepted bytes" case — the interruption spec now loops over
afterSubmission ∈ {false, true}. The newtruecase lets the realterminal.sendwrite the bracketed paste and enter to the stub, then blocks only the enter's IPC reply, so the bytes are accepted but the acknowledgement never reaches the renderer before reload. --idle-titlefixture mode —golden-stub-agent.jsgains an--idle-titleflag that emits theCodex readyOSC title, satisfying thetui-idlereadiness gate so the "after submission" case can reach delivery.
I verified the mechanics against production: --idle-title maps to a title that EXPLICIT_IDLE_TITLE_RE in terminal-wait-detection.ts recognizes as explicit idle, so both isCreationDraftInputReady calls pass and sendCreationDraft reaches send; the writes === 4 assertion matches iterateAgentDraftPasteContentChunks yielding exactly start + content + end frames plus the enter; the enter reply is held after original already wrote it, so the stub prints [GOLDEN_STUB_AGENT_SUBMITTED] ${prompt} while the renderer still sees delivery.state === 'sending'; and the reload then recovers the unconfirmed state with Send disabled and Copy enabled, pinned by the state() unchanged check. This is a meaningful regression guard against double-send on lost acknowledgement, not theatre.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
The delta since the prior review (d44c3d3) is a single test-fixture fix.
- Golden stub agent repaints on terminal resize —
golden-stub-agent.jsregistersprocess.stdout.on('resize', render)so that a restored terminal which fits to a smaller grid (the 120×40 snapshot the renderer refitted to 79×48 in the reported Linux failure) re-emits the[GOLDEN_STUB_AGENT_READY]/[GOLDEN_STUB_AGENT_SUBMITTED]markers instead of leaving them scrolled out of the visible frame.
render() already homes the cursor and clears the alternate screen (\x1b[H\x1b[2J…), so the resize handler is an idempotent repaint that cannot corrupt output; it is a credential-free protocol fixture change with no production readiness/send surface.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

Workspace creation can take seconds before the terminal is usable. This makes a prompt editor available immediately after Create and preserves its text, caret, and focus when the workspace appears. An untouched editor disappears and focuses the terminal. Agents still launch only after Create.
Targets main, which already contains technical improvements from #18793. This replaces the closed #18842/#18872 approach. Opening or canceling the composer adds no real workspace, shell, profile, setup hook, or agent launch; anonymous checkout preparation already present on main remains.
The draft is saved locally before input delivery. Native-local Send verifies execution ownership, the original terminal handle/incarnation, host capability, and readiness. An uncertain delivery is never automatically replayed. Setup tabs and splits preserve activation intent so they do not steal editor focus. Cross-window discovery refreshes saved drafts without overwriting an existing editor revision.
Validation:
7de154a7d93ebfeebbef9872040ef05ab21c84c2is integrated onto maind7767fb1960. Its tree matches the expected three-way integration. Full typecheck and a fresh local handoff E2E build/run passed (18.1 seconds test, 36.9 seconds total).7de154a7d93, passed ARM ZIP/DMG checksums, app signature/notarization, bundled-source/version, and DMG/ZIP app-archive identity checks. The actual downloaded app passed composer cancel, immediate typing, text/caret/focus handoff, real Codex Send, reload recovery with delivered/disabled state, and untouched-editor removal/terminal focus. Both owned trial workspaces were clean and removed; the test app was stopped. Both release build jobs passed; Windows installer checksum passed, but Windows UI remains untested and the installer is unsigned.Performance evidence using a 23,608-file fixture:
Merge risk: low-to-moderate after interruption recovery validation and green current-head CI; no outstanding proven product regression. Product-verified revision full CI passed, including Linux handoff, all eight unit-test shards, typecheck, static analysis, wire compatibility, and Windows/main packaging. Live Windows/WSL/SSH/paired-client draft journeys are not all proven; static and unit coverage do not replace those checks.
Remaining user-facing negative trade-offs:
Current PR head
06fe718b813adds only test coverage and fixture behavior since the verified installer. Two real Electron interruption cases passed locally (33.8 seconds total): reload before input, and reload after the stub accepted the exact prompt but before its final IPC reply. Both retain exact text, show unconfirmed delivery, disable Send, enable Copy, and issue no additional readiness requests or input writes. The optional fixture mode emits recognized idle OSC through the PTY; production readiness and sending remain unchanged. This is a credential-free protocol fixture, not real Codex.The previous Linux failure was reproduced locally: an original 120×40 alternate-screen snapshot contained the READY marker, while the renderer fitted to79×48 and intentionally skipped the wider frame. The host retained the text; the fixture lacked resize repaint handling. Adding a stdout resize listener made the identical delayed-attach reproduction pass (16.0 seconds), without changing product code or weakening assertions. Temporary diagnostics were archived and removed from the PR diff. Existing golden agent launch/multiline and exit/live-shell tests also passed (33.5 seconds total). Format and lint passed. Full current-head CI passed, including Linux changed E2E, all eight test shards, static analysis, typecheck, wire compatibility, and Windows/main packaging. No additional merge is authorized.
A bounded attempt at simultaneous actual Send used two native renderers sharing the same session/preload/origin. The synthetic second main window failed to expose a valid draft editor, so neither Send ran. This is not duplicate-delivery evidence; simultaneous actual Send remains unverified. Existing real Chromium concurrent storage CAS evidence is narrower.
Combined trial: v1.4.198-adhoc.20260906011314, source
3a62d2f5179694693d931a631074683acd4d0f12, includes A on main, B, cancellation, and background stale reclamation. Combined source passed typecheck, 94 focused tests, and three Electron handoff/interruption tests. Both platform build jobs passed.Downloaded ARM64 DMG passed SHA512/size, extraction identity, exact source/version, signature, and notarization checks. Background packaged validation passed text/caret/focus handoff, actual Codex Send with the expected reply, persisted sent-draft recovery without replay, cancellation without another workspace/terminal, and untouched-editor handoff. Test workspaces were clean and removed; terminal inventory was zero before stopping the owned app. Windows EXE checksum and size passed; unsigned ad hoc artifact, runtime untested.
First Create in a fresh profile and empty workspace root against 23,608 tracked files: editor 19.5 ms, workspace selection 7.69 s, maximum frame gap 42.1 ms. One sample with potentially warm OS caches, not a comparative speedup claim. Trace attributes 7.39 s to Git reset materializing files. Immediate typing is demonstrated; universally instant cold checkout is not. Simultaneous actual Send and live Windows/WSL interruption/concurrent cleanup remain validation gaps.