Repository navigation
fix(orchestration): wait for Codex composer render - #14575
Conversation
📝 WalkthroughWalkthroughThe prompt-render gate now supports Claude and Codex terminals. Shared constants control render markers, quiet periods, and hard timeouts. Late render markers reset the settlement window without creating duplicate timers. Runtime tests cover staged redraws, authority callbacks, late Codex markers, and silent Claude fallback. Reliability records include updated assertions, macOS evidence, red-green results, and performance details. Merge Risk: 🔵 Low · up to The PR replaces a fixed submission delay with marker-based rendering and quiescence detection; terminals that do not forward the marker may consistently incur the 8-second fallback delay. The change is mergeable with explicit owner awareness and follow-up validation for Windows/ConPTY behavior. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 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.
🧹 Nitpick comments (1)
src/main/runtime/orca-runtime.ts (1)
17639-17659: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider extracting the repeated clear-then-set timer pattern.
armQuietTimerandarmHardTimerboth clear an existing timer, then set a new one with a different constant and target. This duplication is small, but a shared helper would remove it and make future timer changes (for example, adding a third timer class) less error-prone.♻️ Proposed helper to remove duplication
+ const rearm = ( + current: NodeJS.Timeout | null, + delayMs: number + ): NodeJS.Timeout => { + if (current) { + clearTimeout(current) + } + return setTimeout(finish, delayMs) + } const armQuietTimer = (): void => { - if (quietTimer) { - clearTimeout(quietTimer) - } - quietTimer = setTimeout(finish, AGENT_PROMPT_RENDER_QUIET_MS) + quietTimer = rearm(quietTimer, AGENT_PROMPT_RENDER_QUIET_MS) } const armHardTimer = (): void => { - if (hardTimer) { - clearTimeout(hardTimer) - } - hardTimer = setTimeout(finish, AGENT_PROMPT_RENDER_TIMEOUT_MS) + hardTimer = rearm(hardTimer, AGENT_PROMPT_RENDER_TIMEOUT_MS) }
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: f250a117-d38d-4c1f-af12-84934eef01e0
📒 Files selected for processing (3)
config/reliability-gates.jsoncsrc/main/runtime/orca-runtime.test.tssrc/main/runtime/orca-runtime.ts
|
Physical Windows validation completed on
A deliberately isolated fresh Orca profile was also tried first; Codex correctly stopped at its auth/interactive prerequisite because that profile had no credentials. That attempt never reached prompt injection and is excluded from the 5/5 result. Re-running from the machine's normal authenticated This validates the user-visible post-paste/Enter behavior on physical Windows. It does not distinguish whether a particular run used the render marker or the bounded no-marker fallback because that path is not externally surfaced. Cleanup completed: worker output was archived, worker terminals released, candidate runtimes stopped, temporary pairing environments removed, and the Windows test worktree deleted. |
ELI5
Orca pasted orchestration tasks into Codex or Claude and then pressed Enter after a fixed delay. On a slow TUI—especially Windows ConPTY—the paste could still be rendering, so Enter was swallowed and the task sat in the composer until someone pressed Enter manually. This waits for the agent's rendered composer to settle before submitting.
What Changed
Why
input_acceptedproved only that Orca wrote bytes to the PTY; it did not prove the TUI had accepted Enter as a submitted turn. The prior 500 ms delay (1.5 seconds on Windows) was an open-loop timing guess. Codex and Claude both emitESC[?25hwhile rendering pasted composer content, so PTY-local render observation plus bounded quiescence provides a stronger readiness signal without polling, provider calls, or wire changes.This is an older latent race in the prompt-injection seam, not a recent release regression. PR #14342 added the render gate for Claude after the Codex report was filed; Codex still used the fixed-delay path.
Linked Issue
Fixes #13821
Addresses #14347
Visual Proof
Before: #14347 reports the prompt visible but stranded until manual Enter. The failure is timing-dependent and was reported on Windows, so no synthetic local “before” screenshot is presented as equivalent evidence.
After — exact-build Codex worker receives and starts the injected task without manual Enter:
After — the worker calls
worker_doneand the dispatch settles:Testing
Automated:
pnpm exec vitest run --config config/vitest.config.ts src/shared/agent-prompt-injection.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/orchestration.test.ts src/main/runtime/orchestration/coordinator.test.tspnpm run typecheck:nodepnpm run check:code-quality:changedpnpm run check:max-lines-ratchetpnpm run check:reliability-gatesgit diff --checkManual:
worker_done, and reachedworker: succeeded/stage: settled.Not tested:
Review
Checklist
Author