Skip to content

Keep creation drafts responsive without early workspace shells - #18876

Draft
nwparker wants to merge 15 commits into
mainfrom
nwparker/instant-create-without-early-shells
Draft

nwparker wants to merge 15 commits into
mainfrom
nwparker/instant-create-without-early-shells

Conversation

@nwparker

@nwparker nwparker commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • Product-verified head 7de154a7d93ebfeebbef9872040ef05ab21c84c2 is integrated onto main d7767fb1960. 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).
  • The new credential-free E2E executes real Git/PTY creation with a setup split, verifies unchanged editor DOM/text/caret/focus, and recovers saved text after renderer reload. It holds the request boundary to exercise pending creation; this is a correctness test, not a timing benchmark. Linux execution passed (1 test, 29.8 seconds; 42.9 seconds total) in current-head CI.
  • Focused checks cover durable saves, conflicts, copy, delivery, terminal ownership/incarnation, startup activation, setup splits, and local/remote/folder creation. Previous integrated revision passed full CI. A passed full CI, including the broad SSH suite, before merging.
  • Background Electron checks exercised cancel, immediate typing, untouched-editor removal, setup tabs/both split directions, cross-window draft discovery, and reload recovery. Review/fix and final elegance passes found no outstanding proven regression; mobile-backcompat and Windows/Linux reviews found no proven compatibility issue.
  • Current combined installer, source 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:

  • Earlier installer: editor visible in 16.5 ms, workspace in 2.1 seconds, maximum observed frame gap 38.2 ms. Text/caret/focus survived handoff. Composer preparation had already begun; this is not a cold benchmark. Previous packaged samples showed the editor in 18–22 ms.
  • Workspace ready in approximately 717/790 ms in prepared samples, and 15.3 seconds during concurrent SSH E2E load. A separate development cold-ish sample took 5.8 seconds.
  • Near-instant typing is demonstrated. These limited measurements do not prove universally near-instant cold checkout or agent readiness.

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:

  • Cold checkout can still take seconds.
  • Inherited anonymous preparation consumes CPU/disk even if the composer is canceled.
  • Remote, paired-web, and startup paths without a verified native-local terminal handle require Copy draft.
  • Readiness may refuse Send; uncertain delivery requires terminal inspection before another attempt.
  • Storage is limited to 64 drafts and 64 KiB per draft; delivered drafts remain until discarded.
  • Cross-window edits require reload/conflict handling rather than live text replacement.
  • Storage failure requires keeping the window open or copying the text.

Current PR head 06fe718b813 adds 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.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Creation draft editor surface — CreationDraftSurface/CreationDraftEditor render an editable prompt immediately during workspace creation, mounted in AppWorkspaceShell.
  • 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.send gains an optional expectedIncarnationId; 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.create gains startupActivate/awaitTerminalProvisioning, gated by the new worktree.caller-completion.v1 capability; background startup/setup terminals now carry explicit activate/surfaceOwner so they don't steal focus.
  • Focus preservation on layout restore — restoreTerminalPaneLayout and 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.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • SSH recovery input observation helper — a new tests/e2e/helpers/ssh-recovery-input-observation.ts snapshots the terminal.list result, pane topology (window.__paneManagers), SSH connection state, and active worktree into a testInfo.attach JSON blob with a 1s timeout fallback.
  • Wired into the frozen-host recovery spec — ssh-docker-transport-drop-recovery.spec.ts now attaches before-freeze / after-write / failure-before-cleanup observations and adds a STALL_BEFORE marker 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.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@nwparker
nwparker force-pushed the nwparker/instant-create-without-early-shells branch from b6a576d to 7424e1a Compare September 5, 2026 22:11
@greptile-apps

greptile-apps Bot commented Sep 5, 2026

Copy link
Copy Markdown

Too many files changed for review (149 files, 100 file limit).

Bypass the limit by tagging @greptile-apps to review.

@nwparker
nwparker changed the base branch from nwparker/worktree-create-technical to main September 5, 2026 22:12

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Headful E2E draft-handoff test — tests/e2e/workspace-creation-draft-handoff.spec.ts drives 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.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@coderabbitai

coderabbitai Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The 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 9a31f

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)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 7.14% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 56 functions across 51 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning 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 Link… Reformat the description using the repository template. Add a Linked Issue section with the applicable Fixes #... reference, add Visual Proof with before/after attachments or exactly N/A with a reason, and include the required Testi…
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR satisfies the relevant superseded objective for issue #18842: it provides an immediately editable and durable creation draft while avoiding an early real workspace, shell, setup hook, or agent …
Out of Scope Changes check ✅ Passed The code changes support the stated creation-draft flow, including persistence, safe delivery, terminal incarnation checks, activation handling, focus behavior, local and remote creation paths, locali…
Title check ✅ Passed The title clearly identifies the primary change: keeping creation drafts responsive without creating early workspace shells.
Full details: Description check

Explanation

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 Fixes #... entry, the required Visual Proof section or an explicit N/A explanation, and the required checklist sections.

Resolution

Reformat the description using the repository template. Add a Linked Issue section with the applicable Fixes #... reference, add Visual Proof with before/after attachments or exactly N/A with a reason, and include the required Testing, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist sections with completed or explicitly justified items.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 6edc081e-4e36-4aa3-87af-f6a4cac0e718

📥 Commits

Reviewing files that changed from the base of the PR and between 9faa27c and 7de154a.

📒 Files selected for processing (67)
  • src/main/ipc/worktree-remote.ts
  • src/main/ipc/worktrees-local-create-flow.test.ts
  • src/main/runtime/managed-worktree-create-execution-host.test.ts
  • src/main/runtime/orca-runtime-create-managed-worktree.ts
  • src/main/runtime/orca-runtime-split-pty-backed-terminal.ts
  • src/main/runtime/orca-runtime-split-terminal.ts
  • src/main/runtime/orca-runtime-terminal-split-authority.test.ts
  • src/main/runtime/rpc/methods/terminal/terminal-input-delivery.ts
  • src/main/runtime/rpc/methods/terminal/terminal-send-method.ts
  • src/main/runtime/rpc/methods/worktree-create-args.test.ts
  • src/main/runtime/rpc/methods/worktree-create-args.ts
  • src/main/runtime/rpc/methods/worktree-create-schemas.ts
  • src/main/runtime/rpc/terminal-send-incarnation.test.ts
  • src/main/runtime/runtime-folder-worktree-create.ts
  • src/main/runtime/runtime-folder-worktree-startup.test.ts
  • src/main/runtime/runtime-local-worktree-terminal-startup.ts
  • src/main/runtime/runtime-managed-worktree-create-types.ts
  • src/main/runtime/runtime-remote-managed-worktree-create.ts
  • src/main/runtime/runtime-worktree-background-startup.test.ts
  • src/main/runtime/runtime-worktree-terminal-provisioning.ts
  • src/renderer/src/app-shell/AppWorkspaceShell.tsx
  • src/renderer/src/components/terminal-pane/layout-serialization.test.ts
  • src/renderer/src/components/terminal-pane/layout-serialization.ts
  • src/renderer/src/components/terminal-pane/pane-helpers.ts
  • src/renderer/src/components/terminal-pane/terminal-pane-layout-restore-focus.test.ts
  • src/renderer/src/components/terminal-pane/terminal-pane-layout-restore.ts
  • src/renderer/src/components/terminal-pane/terminal-pane-mount-events-focus.test.ts
  • src/renderer/src/components/terminal-pane/terminal-pane-mount-events.ts
  • src/renderer/src/components/worktree-creation/CreationDraftEditor.tsx
  • src/renderer/src/components/worktree-creation/CreationDraftSurface.tsx
  • src/renderer/src/constants/terminal.ts
  • src/renderer/src/hooks/ipc-events/terminal-presentation-ipc-bridge.ts
  • src/renderer/src/hooks/useIpcEvents-terminal-create-surfacing.test.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/lib/pane-manager/pane-manager-types.ts
  • src/renderer/src/lib/pane-manager/pane-split-close.test.ts
  • src/renderer/src/lib/pane-manager/pane-split-close.ts
  • src/renderer/src/lib/workspace-creation-drafts/creation-draft-connection.ts
  • src/renderer/src/lib/workspace-creation-drafts/creation-draft-copy.test.ts
  • src/renderer/src/lib/workspace-creation-drafts/creation-draft-database.ts
  • src/renderer/src/lib/workspace-creation-drafts/creation-draft-delivery.test.ts
  • src/renderer/src/lib/workspace-creation-drafts/creation-draft-delivery.ts
  • src/renderer/src/lib/workspace-creation-drafts/creation-draft-readiness.test.ts
  • src/renderer/src/lib/workspace-creation-drafts/creation-draft-readiness.ts
  • src/renderer/src/lib/workspace-creation-drafts/creation-draft-record.test.ts
  • src/renderer/src/lib/workspace-creation-drafts/creation-draft-record.ts
  • src/renderer/src/lib/workspace-creation-drafts/creation-draft-session.test.ts
  • src/renderer/src/lib/workspace-creation-drafts/creation-draft-session.ts
  • src/renderer/src/lib/workspace-creation-drafts/creation-draft-submit.test.ts
  • src/renderer/src/lib/workspace-creation-drafts/creation-draft-submit.ts
  • src/renderer/src/lib/worktree-creation-completion.ts
  • src/renderer/src/lib/worktree-creation-draft-handoff.test.ts
  • src/renderer/src/lib/worktree-creation-flow-execute.ts
  • src/renderer/src/lib/worktree-creation-flow.test.ts
  • src/renderer/src/lib/worktree-creation-flow.ts
  • src/renderer/src/store/slices/worktrees-remote-runtime-create.test.ts
  • src/renderer/src/store/slices/worktrees/create/create-worktree.ts
  • src/renderer/src/store/slices/worktrees/create/worktree-create-payload.test.ts
  • src/renderer/src/store/slices/worktrees/create/worktree-create-payload.ts
  • src/shared/protocol-version.ts
  • src/shared/worktree/launch-types.ts
  • tests/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.

Comment on lines +139 to +142
: translate(
'creationDraft.uncertain',
'Delivery is unconfirmed. Check the terminal before sending again. Your draft is kept here.'
)}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 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.

Suggested change
: 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.'
)}

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (3)
tests/e2e/workspace-creation-draft-interruption.spec.ts (3)

17-48: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Extract the duplicated repo and terminal-output helpers into a shared module.

createDraftTestRepo and readActiveTabOutput are duplicated verbatim in tests/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 example tests/e2e/helpers/creation-draft.ts, and import them in both specs.


165-170: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Guard 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 replaced runtime:call handler stays installed, and the gate promise stays unresolved. The pending terminal.wait invoke 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 value

Assert the final write count with a literal.

Line 164 compares against the writes value captured at line 149. The assertion still re-reads state(), 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

📥 Commits

Reviewing files that changed from the base of the PR and between 7de154a and 9a31ff3.

📒 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.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.ts holds terminal.wait readiness in the main process after the durable sending commit, 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.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 new true case lets the real terminal.send write 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-title fixture mode — golden-stub-agent.js gains an --idle-title flag that emits the Codex ready OSC title, satisfying the tui-idle readiness 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.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.js registers process.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.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant