You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(orchestration): say why a worker's brief went unsubmitted, and never press Enter into a dialog - #47087
When Orca types a task into a worker's terminal and never sees the work start, the message it sends now explains what happened when it pressed Enter. Orca also no longer presses Enter when a dialog is on the worker's screen.
Files
Added
Deleted
Net
Test
1
$\color{#1a7f37}{\Huge{\mathbf{+}}}$74
0
$\color{#1a7f37}{\Huge{\mathbf{+}}}$74
Prod
21
$\color{#1a7f37}{\Huge{\mathbf{+}}}$557
$\color{#cf222e}{\Huge{\mathbf{−}}}$120
$\color{#1a7f37}{\Huge{\mathbf{+}}}$437
What Changed
When a worker start types the brief but never sees the turn begin, the coordinator's "Worker's brief may not have been submitted" message now says what happened at Enter time, so a person (or the coordinator) can tell the three causes apart: the Enter was lost, a dialog took it, or the turn ran but wasn't seen.
Before, after a lost Enter:
Your worker's brief may not have been submitted; check it. Orca typed task … into worker term_…, but never saw its turn start: the brief may still be waiting in its prompt.
If the brief is still in its prompt, submit it with … `terminal send --terminal term_… --enter`.
…
Worker's screen: …
Text waiting in its prompt: [Pasted Content 13457 chars]
After, same forced lost Enter (isolated rig, Codex 0.169):
Your worker's brief may not have been submitted; check it. …
Orca typed the brief 0.0 s after the agent was ready and pressed Enter 1.5 s later once its screen went quiet.
Since the Enter, no turn start has been seen; its last status report was at rest, 1.5 s before the Enter.
If the brief is still in its prompt, submit it with … `terminal send --terminal term_… --enter`.
…
A worker brief is also never submitted into a dialog. If, after the paste, the screen shows a dialog (the existing exact detectTerminalWaitBlockedReason check) or a permission prompt, Orca leaves the brief unsent and the start stays open:
Orca typed the brief 0.0 s after the agent was ready, but did not press Enter: a dialog showed on its screen (agent-interactive-prompt).
An Enter now would answer that dialog: tell the user to answer it in that terminal, then submit the brief with … `terminal send --terminal term_… --enter`.
Worker's screen:
<the dialog>
Before this, the same screen failed the start (agent_prompt_blocked, "Worker lost without reporting", Dispatch closed as failed) with the brief left in the terminal. A dialog the permission state didn't flag got the Enter.
Orca also holds the Enter, and says so, if someone typed into the worker's terminal after the paste (driving input since the paste that is not pointer or focus reports), because Enter would submit their text along with the brief. The check runs twice: once on the caught-up screen, and again after the write guard on the live grid, with no await before the Enter.
A withheld start is stored as stage submit_withheld. If Orca restarts before the alert goes out, the alert still says not to press Enter yet.
A start-blocked prompt seen before the brief went in no longer counts as proof that the turn ran. Before, it marked an unconfirmed start ready and the alert was never sent.
No extra Enter or retry is added.
Mechanism
writeTerminalAgentPrompt records when the paste and the Enter were written and what ended the render wait (quiet / exact draft / cap). These ride on the prompt receipt as an optional submit field.
Only worker-start briefs opt in, through withholdSubmitOnDialog. Before Enter they read the caught-up screen once. Other senders (mailbox pointers, coordinator dispatch, external messages) are unchanged.
At alert time, reportUnconfirmedWorkerStart reads the agent's prompt activity and its last status report (the newer of its hook status and the status it printed into the terminal) once (readTerminalAgentPromptAftermath). It adds the lines above. After a restart there is no delivery record, so the alert is the same as before.
Pre-write guards move into terminal-agent-prompt-guards.ts, and two report-id helpers move next to stopReportId. Both are moves, made to stay within the file-size limit.
Why
A brief left unsent in a worker's prompt can have three causes: the Enter was lost, a dialog took it, or the turn ran but Orca missed it. In each case the alert gave the same advice: press Enter. These facts tell the three apart, and they cost one read at alert time. Pressing Enter into a dialog answers it with its default choice, so for a dialog Orca waits for a person instead. An automatic second Enter was considered and not chosen.
Linked Issue
None.
Compatibility
submit is optional on the receipt, and old readers ignore it. Stored presence reports gain an optional startEvidence, so older stored reports still render.
Testing
I manually tested these changes locally (macOS, isolated rig)
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
dispatch-submit-withhold.test.ts drives the real runtime write path. With a dialog drawn over the paste, no \r is written and the receipt names the dialog. Without one, exactly one Enter is written. The dialog case fails with the change reverted (agent_prompt_blocked).
pnpm tc:node, tc:cli, tc:web, oxlint and oxfmt on the touched files, plus the terminal-input, worker and worker-start suites: all pass.
Live before/after in an isolated orca serve rig with a private profile:
forced lost Enter on a real Codex worker;
a stand-in agent that opens a dialog after the paste. On the after build it received no Enter. Normal Codex starts were still ready / observed in about 2 s.
Perf (see below): one caught-up screen read and one blocked-text scan before Enter, worker starts only. One activity read per unconfirmed alert. In the rig, Enter landed 1.6 s after the paste with the 1.5 s quiet gate.
Visual Proof
N/A for UI: no UI changes. The before and after alert text above is from the live rig.
Performance
None, because the only new work is one caught-up screen read and one blocked-text scan before the Enter of a worker-start brief, once per start, plus one activity read per unconfirmed-start alert. Other prompt senders skip it. In the rig, Enter still landed 1.5 s after the paste, set by the existing 1.5 s quiet wait.
Risk
Level: Low.
A worker start whose screen shows a dialog after the paste now stays open and alerts, where before it failed with agent_prompt_blocked. Revert is a plain revert. Older stored alerts and receipts read as before.
Known limits
Follow-up: the continuation prompt that resumes a terminal worker after a restart is a separate sender and does not use this dialog check yet.
Output that arrives after the final synchronous check is not seen; the write follows that check with no await in between.
Pointer reports (hover, clicks, wheel), focus reports and terminal replies don't count as typing. Anything else sent to the terminal after the paste does: keystrokes, pastes, terminal send, plugins.
The dialog check runs only when the composer shows no draft, so a brief shown inline can't hold itself back because its text reads like a dialog.
A restart in the moment between holding the Enter and recording submit_withheld leaves no record of the withheld Enter, so that alert gives the default advice.
…ver press Enter into a dialog
A start Orca never saw begin now tells the coordinator when the brief and its Enter went in, the agent's last status report, and whether a turn or permission prompt followed. A worker brief whose screen shows a dialog after the paste is left unsent and reported, instead of failing the start.
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.
Terminal prompt delivery now records paste timing, render-wait outcomes, and whether Enter was sent or withheld because of a dialog. Worker-start observation and reporting carry this delivery information and prompt aftermath into terminal stop evidence. Stop wording includes that evidence and gives dialog-specific next steps when Enter was withheld.
Merge Risk: Low · previous review 440ca
When a dialog blocks a worker's brief, the brief is now withheld and the alert explains why. Two small gaps remain: a dialog row that resembles the end of the brief could still receive Enter, and the alert may describe a dialog as current after it was dismissed. Both are edge cases and mergeable with owner awareness.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the two main changes: the unconfirmed-start alert now explains why a worker's brief went unsubmitted, and Orca no longer presses Enter into a dialog. Both match the changeset (withhold…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The description follows the repository template closely. It covers ELI5, What Changed, Why, Testing, Performance, Risk, and Compatibility, with concrete before/after alert text and a mechanism section…
Full details: Title check
Explanation
The title names the two main changes: the unconfirmed-start alert now explains why a worker's brief went unsubmitted, and Orca no longer presses Enter into a dialog. Both match the changeset (withholdSubmitOnDialog, start evidence, and the alert wording). The title is specific and follows conventional commit form. It is 98 characters, which is long, but it stays readable.
Full details: Description check
Explanation
The description follows the repository template closely. It covers ELI5, What Changed, Why, Testing, Performance, Risk, and Compatibility, with concrete before/after alert text and a mechanism section. Several template items are weak or missing: the Linked Issue section says 'None.' even though the template says there should always be one for outside contributors, and the AI Disclosure, Review, Agent skill upstream boundary, and Checklist items are not addressed. The Visual Proof section is N/A with a reason, which is acceptable. The Performance section is filled in. Because the core sections are substantive and the gaps are mainly administrative, the description is mostly complete.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
…t, and hold it for typed input
After the screen read and the write guard, the write checks the live grid, permission state and input someone typed since the paste, synchronously before Enter. A start-blocked prompt seen before the brief no longer confirms the start.
…g a worker's Enter
Codex turns on any-motion mouse tracking and xterm sends its reports as the user's input, so a hover over a worker pane held the brief and told the coordinator someone typed. Only input that can change the program's text now counts. The alert also says Orca has seen no status report, rather than that the agent sent none.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
When Orca types a task into a worker's terminal and never sees the work start, the message it sends now explains what happened when it pressed Enter. Orca also no longer presses Enter when a dialog is on the worker's screen.
What Changed
When a worker start types the brief but never sees the turn begin, the coordinator's "Worker's brief may not have been submitted" message now says what happened at Enter time, so a person (or the coordinator) can tell the three causes apart: the Enter was lost, a dialog took it, or the turn ran but wasn't seen.
Before, after a lost Enter:
After, same forced lost Enter (isolated rig, Codex 0.169):
A worker brief is also never submitted into a dialog. If, after the paste, the screen shows a dialog (the existing exact
detectTerminalWaitBlockedReasoncheck) or a permission prompt, Orca leaves the brief unsent and the start stays open:Before this, the same screen failed the start (
agent_prompt_blocked, "Worker lost without reporting", Dispatch closed as failed) with the brief left in the terminal. A dialog the permission state didn't flag got the Enter.Orca also holds the Enter, and says so, if someone typed into the worker's terminal after the paste (driving input since the paste that is not pointer or focus reports), because Enter would submit their text along with the brief. The check runs twice: once on the caught-up screen, and again after the write guard on the live grid, with no await before the Enter.
A withheld start is stored as stage
submit_withheld. If Orca restarts before the alert goes out, the alert still says not to press Enter yet.A start-blocked prompt seen before the brief went in no longer counts as proof that the turn ran. Before, it marked an unconfirmed start ready and the alert was never sent.
No extra Enter or retry is added.
Mechanism
writeTerminalAgentPromptrecords when the paste and the Enter were written and what ended the render wait (quiet/ exactdraft/cap). These ride on the prompt receipt as an optionalsubmitfield.withholdSubmitOnDialog. Before Enter they read the caught-up screen once. Other senders (mailbox pointers, coordinator dispatch, external messages) are unchanged.reportUnconfirmedWorkerStartreads the agent's prompt activity and its last status report (the newer of its hook status and the status it printed into the terminal) once (readTerminalAgentPromptAftermath). It adds the lines above. After a restart there is no delivery record, so the alert is the same as before.terminal-agent-prompt-guards.ts, and two report-id helpers move next tostopReportId. Both are moves, made to stay within the file-size limit.Why
A brief left unsent in a worker's prompt can have three causes: the Enter was lost, a dialog took it, or the turn ran but Orca missed it. In each case the alert gave the same advice: press Enter. These facts tell the three apart, and they cost one read at alert time. Pressing Enter into a dialog answers it with its default choice, so for a dialog Orca waits for a person instead. An automatic second Enter was considered and not chosen.
Linked Issue
None.
Compatibility
submitis optional on the receipt, and old readers ignore it. Stored presence reports gain an optionalstartEvidence, so older stored reports still render.Testing
I manually tested these changes locally (macOS, isolated rig)
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
dispatch-submit-withhold.test.tsdrives the real runtime write path. With a dialog drawn over the paste, no\ris written and the receipt names the dialog. Without one, exactly one Enter is written. The dialog case fails with the change reverted (agent_prompt_blocked).pnpm tc:node,tc:cli,tc:web, oxlint and oxfmt on the touched files, plus the terminal-input, worker and worker-start suites: all pass.Live before/after in an isolated
orca serverig with a private profile:ready / observedin about 2 s.Perf (see below): one caught-up screen read and one blocked-text scan before Enter, worker starts only. One activity read per unconfirmed alert. In the rig, Enter landed 1.6 s after the paste with the 1.5 s quiet gate.
Visual Proof
N/A for UI: no UI changes. The before and after alert text above is from the live rig.
Performance
None, because the only new work is one caught-up screen read and one blocked-text scan before the Enter of a worker-start brief, once per start, plus one activity read per unconfirmed-start alert. Other prompt senders skip it. In the rig, Enter still landed 1.5 s after the paste, set by the existing 1.5 s quiet wait.
Risk
Level: Low.
A worker start whose screen shows a dialog after the paste now stays open and alerts, where before it failed with
agent_prompt_blocked. Revert is a plain revert. Older stored alerts and receipts read as before.Known limits
Follow-up: the continuation prompt that resumes a terminal worker after a restart is a separate sender and does not use this dialog check yet.
Output that arrives after the final synchronous check is not seen; the write follows that check with no await in between.
Pointer reports (hover, clicks, wheel), focus reports and terminal replies don't count as typing. Anything else sent to the terminal after the paste does: keystrokes, pastes,
terminal send, plugins.The dialog check runs only when the composer shows no draft, so a brief shown inline can't hold itself back because its text reads like a dialog.
A restart in the moment between holding the Enter and recording
submit_withheldleaves no record of the withheld Enter, so that alert gives the default advice.