Repository navigation
Conversation
…tion-draft-safety
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the full 51-file diff end to end, spanning the terminal input incarnation fence, worktree-creation payload/arg plumbing, the new creation-draft subsystem, and the focus/activation handoff.
terminal.sendincarnation fence —assertTerminalSendIncarnationwires an optionalexpectedIncarnationIdthroughbeforeWrite/reserveWrite, re-checkingresolveLiveLeafForHandle().ptyIdandgetTerminalProcessIncarnation(handle)immediately before and at the synchronous write reservation, so a rebind mid-send throwsterminal_handle_stalebefore any bytes land.- Draft persistence — a new IndexedDB store (
creation-draft-connection.ts/creation-draft-database.ts) withdurability: 'strict', optimistic revision conflict checks, a 64-draft / 64 KiB capacity, and a zustand session (creation-draft-session.ts) with a write-behind queue and conflict-copy recovery. - Draft delivery —
creation-draft-delivery.ts+creation-draft-submit.tspersist a durable attempt before sending, capture/verify the terminal incarnation, sanitize bracketed paste, and never auto-replay after an uncertain outcome. - Focus/activation ownership —
callerOwnsCompletionmakes the renderer the single activation owner on foreground create,shouldPreserveEditableFocuskeeps the draft (and any editable field) focused across the terminal handoff, andcompleteWorktreeCreationskips terminal focus when a draft has text. - Wire compatibility — two new runtime capabilities gate the new
worktree.create/terminal.sendfields; remote targets fall back to legacy params when the peer lacks the capability.
The incarnation fence, delivery no-replay guarantees, and conflict-copy paths are each backed by focused unit tests that assert exact behavior (refused-before-bytes, accepted/bytesWritten equality, bounded late responses), not just pass/no-pass.
ℹ️ Foreground activation is now renderer-owned for local targets
callerOwnsCompletion: !background (create-requested-worktree.ts:52) forces activate: false on the backend startup for every local, non-web foreground creation — not just draft flows — and relies on executeWorktreeCreation → activateAndRevealWorktree to reproduce the activation. Remote targets are capability-gated (worktree.caller-completion.v1), but the local path is unconditional because renderer and host share one binary, so there is no mixed-version concern to gate on. This collapses what was previously a double activation (backend activate: true plus the renderer reveal) into a single renderer-owned owner. Nothing actionable; noting it because it is a broad behavior change riding under a feature PR, and it is the one spot a future regression would surface first. The foreground activation, background (activate:false + surfaceOwner:false), and folder-workspace paths are all covered by the new runtime-folder-worktree-startup.test.ts and the updated creation-flow tests.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
The single commit since the prior review extends the existing surfaceOwner: false foreground-activation fence to the setup terminal, so the setup script no longer steals surface ownership (and focus) from the creation draft.
- Extended the
surfaceOwner: falsefence to the setup terminal —spawnLocalStartupAndSetupTerminalsnow adds...(sequencedStartup.activate === false ? { surfaceOwner: false } : {})to both the split and new-tab setup spawn paths, mirroring the startup terminal's existing pattern atworktree-remote.ts:466. - Updated the creation-flow tests —
worktrees-local-create-flow.test.tsnow assertssurfaceOwner: falseon both thecreateTerminal(new-tab) andsplitTerminal(split) setup paths understartup: { activate: false }.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the two commits since the prior review, both renderer-side focus-preservation fixes.
- Preserve focus when adopting background terminal splits —
splitManagedPane/openSplitPanenow honor an optionalactivateflag (PaneSplitOptions.activate), skippingsetActivePaneId,terminal.focus(), and the active-pane opacity pass (restoring opacity against the current active pane via the drag callback) whenactivate === false. The flag threads fromSplitTerminalPaneDetailthroughterminal-pane-mount-events.tsand is populated fromshouldActivateinterminal-presentation-ipc-bridge.ts, so a background runtime split no longer steals focus from the creation draft. - Preserve focus while replaying terminal split layouts —
replayTerminalLayoutnow passesactivate: focusInitialPaneinto eachsplitPane, so a layout replay for a workspace whose editable draft holds focus no longer re-activates/focuses each replayed split pane mid-replay; the finalsetActivePaneinrestoreTerminalPaneLayoutstill reconciles the active pane and opacity.
Both changes are additive (callers that omit activate keep the prior always-activate behavior), renderer-only, and each is backed by an exact-assertion test that would fail if the fix regressed: pane-split-close.test.ts and terminal-pane-mount-events-focus.test.ts cover activate across undefined/true/false, and layout-serialization.test.ts covers both focus intents.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
The single commit since the prior review adds one line of test coverage to useIpcEvents-terminal-create-surfacing.test.ts.
- Asserted explicit activation in terminal split events — the
orca-split-terminal-panedispatch assertion for thepresentation: 'focused'split path now pinsactivate: true, matching whatterminal-presentation-ipc-bridge.ts:177already emits (activate: shouldActivate). Because the surrounding assertion usesexpect.objectContaining, dropping or mis-setting that flag would previously still pass; the new exact assertion makes the focused path fail if the flag regresses, complementing theactivate: falsebackground-split coverage already in the same test.
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.
Cold workspace creation leaves users waiting before they can start their prompt. This adds an optional saved prompt editor during creation and keeps the same editor, text, caret, and focus when the terminal appears. Untouched drafts hand focus to the terminal as before.
Drafts persist locally with revision checks. Send requires a durable attempt record, the original terminal incarnation, and a runtime readiness check; uncertain delivery retains the source without replay. Conflicting edits can be saved separately without overwriting another window. Runtime activation changes are capability-gated, with legacy behavior preserved for older peers.
Stacked on #18842 (which is stacked on #18793). Includes the terminal.send incarnation fence. Current head b66ade1 merges main 062db77 (tab minimum width change); the four affected tab tests pass.
Review and validation
Performance evidence
Downloaded signed/notarized Mac trial at b66ade1, fresh isolated profile, two real Create trials: editor visible in 206.5 ms on the first cold Create and 17.5 ms after five seconds of composer preparation. Workspace selection took 5.31 seconds and 647 ms respectively. Typed text and focus survived handoff; screenshot inspected. No backend delay injected and no prompt sent. These small samples verify installer behavior, not universal latency.
Development Electron, browser click capture to animation-frame observation, three samples: editor visible in 55–118 ms. Immediate Create selected the workspace in 5.47 seconds; prepared samples selected it in 492–660 ms. These are not packaged comparisons and do not establish a regression or win against B's earlier controlled 18 ms selection / 105 ms terminal result.
Production renderer in the same development Electron main, two real Create trials without injected backend delay: editor visible in 25.5 and 29.2 ms. Typed text remained visible and focused after handoff (screenshot inspected). Selection took 4.70 seconds on immediate Create and 1.80 seconds after five seconds in the composer. This isolates renderer build mode; it is still not an installer benchmark.
Real typing at 64 stored drafts and near the 64 KiB text limit: p95 input-to-frame 12.8–16 ms, no observed long tasks. The editor makes the cold wait useful; it does not eliminate checkout or guarantee immediate agent readiness.
Remaining user-facing limitations
Merge risk: moderate due to the new persisted delivery lifecycle and incomplete live platform/topology coverage. Native macOS rendered delivery was verified; actual Windows/Linux rendered Send and all remote topology combinations were not. The readiness checklist's mobile-backcompat-review and win-linux-compat-review dependency skills are unavailable locally; no complete formal checklist verdict is claimed. No outstanding candidate finding requires counsel validation after the fixes.
Combined A+B+C trial at b66ade1: https://github.com/stablyai/orca-adhoc/releases/tag/v1.4.198-adhoc.20260905192425 (workflow 33986950377). Mac publishing succeeded. Downloaded Apple Silicon ZIP passed SHA-512/size, archive integrity, deep/strict code signature, notarization staple, and embedded source/version checks. Windows publishing also succeeded; the downloaded installer passed SHA-512/size/version verification. Both release jobs in 33986950377 succeeded. Windows is unsigned. The PR is ready for review; both current-head CI runs and Pullfrog review have completed successfully. The prior published A+B trial does not contain C.