Repository navigation
Conversation
A send that wrote bytes into the PTY reported success even when the Enter was swallowed — by a completion popup, or by a TUI that was mid-turn — and the text was left sitting unsubmitted in the composer. Callers could not tell that apart from an agent that received the prompt and started work. Orca owns the PTY and already receives each harness's own turn-lifecycle hook, so it can answer the question directly. A send that carries a submit now arms a watch on the pane's hook stream before writing, and classifies the outcome: - submitted — the harness announced a turn start after the write; - queued — the harness recorded the text as a user message during a running turn, so it acts on it when that turn ends (OpenCode family); - pending — the harness reports turn starts, the pane was idle, and it said nothing inside the bound; - unknown — no trustworthy evidence: no live hook event for the pane, a harness with no turn-start signal at all, or a send into a running turn. Missing or stale evidence is unknown and is never promoted to submitted, which follows the convention already used for explicit agent status. On a pending verdict the submit key is re-sent once, never the text, so a partly accepted line cannot become a doubled message. The verdict rides an optional field on the terminal.send result and an optional request param, so an older host answers without one and an older client ignores it (docs/reference/remote-wire-compatibility.md, Rule 1). Callers must read a missing verdict as unknown.
… was submitted `dispatch --inject` set `injected = true` as soon as the agent-prompt send resolved, which only proves the bytes reached the PTY. When the Enter was swallowed the preamble sat in the worker's composer while the coordinator was told the task had been handed off, and it then waited on work that never started. The inject path now asks for a submit verdict and reports `injected` only for `submitted`. Every other outcome returns the verdict alongside `injected: false`, including the case where an older host answers with no verdict at all. The dispatch context is deliberately left open on an unproven submit: the bytes are in the pane and a queued or unknown send may still become a real turn, so failing it here would discard work that is about to run.
`orca terminal send --text ... --enter` now asks the host for a submit verdict and prints it in both output modes; `--json` carries the whole `send.submitVerdict` object. `--submit-timeout-ms` sets the bound, `--no-submit-retry` turns off the single submit re-send, and `--no-verdict` skips the wait. The client RPC timeout is widened to clear the bound so the transport cap does not fail a call the host is still answering. `orchestration dispatch --inject` prints a warning when the preamble was not confirmed submitted, so a coordinator does not read the dispatch as delivered. The terminal command specs move to their own file; adding the new flags and notes pushed core.ts past the max-lines limit, and splitting is the fix rather than a suppression.
A host older than submit verdicts answers `terminal.send` with no `submitVerdict` field at all. The CLI printed only the byte count in that case, and `dispatch --inject` printed no warning, so an unproven submission read exactly like a completed one — the failure the verdict exists to close. Human output now reports `unknown` whenever this invocation asked for a verdict and the response carries none, and the dispatch warning is gated on `--inject` rather than on the presence of the field. Whether a verdict was requested is a property of the invocation, not of the response, so it is passed to the formatter and the JSON output stays exactly what the host sent. Also from review: - the `terminal send` usage string now advertises `--submit-timeout-ms`, `--no-submit-retry`, and `--no-verdict`, which `allowedFlags` already accepted; - a positive fractional timeout is clamped to at least 1ms. Truncating 0.5 to 0 skipped the evidence wait entirely and answered from the pre-write snapshot, which reads as a real verdict from a wait that never happened.
|
Warning Review limit reached
Next review available in: 23 minutes Limit details: You’ve used all 10 included reviews currently available under your plan. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (23)
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 |
|
thanks for reporting. looking into it |
|
A scope question for the maintainers, found while rebasing this branch — please read before reviewing the diff.
So there is real overlap and a real remainder. I do not think either half is redundant, but which one should own the fact is not my call, and resolving the conflict silently would be me deciding it in a merge editor. Three ways to go:
I would pick 2 — a dispatch caller needs a value it can branch on, not an exception — but I am not the one who should be picking. Tell me which, and I will do the rebase that matches it in the same day. Related, from @Tauri-EPO on #15273: |
The failure this closes
orca terminal send --enterreturned success as soon as the bytes reached the PTY.When the Enter was swallowed — a completion popup ate it, or the TUI was mid-turn —
the text sat unsubmitted in the composer and the caller could not tell that apart
from an agent that received the prompt and started work.
dispatch --injecthad thesame hole: it marked
injected = trueon a bare resolve, so a coordinator waited ona worker whose preamble was still sitting in its composer.
What this does
Orca owns the PTY and already receives each harness's own turn-lifecycle hook, so it
answers the question from that signal rather than from rendered text. A send that
carries a submit arms a watch on the pane's hook stream before writing and reports:
submittedqueuedpendingunknownMissing or stale evidence is
unknownand is never promoted tosubmitted, matchingthe convention already used for explicit agent status and the
lastAgentStatusObservedLivegate on push-on-idle delivery.
Retry rule
On
pending— and onlypending— the submit key is re-sent once. The text is neverre-typed:
pendingmeans the payload is already in the composer, so a second copywould become a doubled message.
queuedandunknownare never retried. Push-on-idlemail delivery uses the same rule.
Surfaces
terminal.sendtakes an optionalsubmitVerdictrequest and returns an optionalsubmitVerdictresult. Old host → no verdict → callers read it asunknown;old client → ignores the field. Rule 1 of
docs/reference/remote-wire-compatibility.md;the cross-version wire harness stays green.
orca terminal send --text ... --enterrequests it by default.--submit-timeout-mssets the bound,
--no-submit-retrydisables the re-send,--no-verdictskips the wait.dispatch --injectreportsinjected: trueonly forsubmitted. The dispatch contextstays open on an unproven submit — the bytes are in the pane and may still become a
turn — but it is not reported as delivered work.
The hook tap is wired once in
src/main/index.tsfromagentHookServer.subscribeEnrichedStatus,which is where local, WSL relay, and SSH relay events all land, so the verdict works on
all three transports and for folder workspaces as well as git worktrees.
Tests
src/shared/agent-submit-signal.test.ts,src/main/runtime/terminal-submit-verdict-tracker.test.ts,src/main/runtime/terminal-send-submit-verdict.test.ts,src/main/runtime/rpc/methods/orchestration-dispatch-submit-verdict.test.ts—submitted, pending, queued, unknown, mid-turn, replayed/restored rows, stale evidence,
the no-retype rule, and the dispatch guard.
tests/e2e/cross-version-wire/cross-version-terminal-wire.unit.test.ts,oxlint, bothcode-quality audits, the max-lines ratchet, and all three tsconfigs are clean. The
terminal command specs move to their own file because the new flags pushed
core.tspast the max-lines limit; splitting is the fix rather than a suppression.
Not in scope
The autonomous coordinator loop (
orchestration/coordinator.ts) still injects withouta verdict. Wiring it means changing
failDispatchcircuit-breaker accounting, whichbelongs in its own change.
Moved from #13763, same commits, same head SHA. That pull request was opened from an organisation-owned fork, and GitHub refuses maintainer pushes on org-owned forks even when
maintainer_can_modifyreportstrue— so a maintainer could not push a fixup to it, only ask or rewrite. This one is on a personal fork, where a maintainer push works.The review history stays readable on #13763: #13763