Repository navigation
Agent status C3: distinguish ready from merely visible - #21055
brennanb2025 wants to merge 15 commits into
Conversation
…atus-c3-readiness
…atus-c3-readiness
…atus-c3-readiness
Review and validation handoff — 2026-09-16Draft / not merge-ready. Published at the user's request before review/QA completion. Published head: What has been doneMultiple independent reviews and correction rounds were performed. At current head, the adversarial reviewer reproduced the real runtime emulator/parser/capture/matcher/wait failure described below. A focused 50-test run, node typecheck and changed-code quality passed separately; passing tests did not disprove the bug. Earlier hidden Electron testing covered real provider transitions at 47ba36d, NOT this head. These are recorded worker/reviewer results from the stated revisions, not a fresh coordinator rerun, CI result, or blanket approval of today's PR head. Recovery/review workers used GPT-5.6 Sol xhigh; provider interruptions prevented some follow-up stages from finishing. What still needs to be doneKNOWN HIGH-SEVERITY BUG: retained ready text can satisfy terminal.wait after a Working fact expires and unrelated escape/title bytes advance output sequence. Replace recency-as-readiness with verified semantic readiness or bounded unknown; do not add another clock/sequence guard. The new correction worker stopped on a provider disconnect before producing a correction. Vendor transcript proof, fresh-auth cases, paired/SSH/mixed-version coverage, independent re-review and fresh exact-head Electron QA remain. Before marking ready: address proven findings, reconcile current main and cross-batch overlap, complete independent review of the final diff, rerun relevant tests/typechecks/quality, and perform fresh manual Electron QA against that exact head. Use background/hidden CDP validation; unavailable auth/platform scenarios remain explicitly unverified. No successful final-head review or QA should be inferred from old report filenames or task completion labels. Related batch PRsC1: #21053 · C10: #21054 · C2: #21056 · C3: #21055 · C4: #21057 · C5: #21058 · C6: #21059 · C7: #21060 The remaining full-batch work stays open; opening this draft does not mark those requirements complete. |
|
Conflict/description update: head remains GitHub reports this PR mergeable, and a local merge-tree check was clean, so there were no conflict files or resolution commits; I did not add another merge from main. I rewrote the title/body in plain language, linked all verified C3 records, separated partially implemented behavior from routed/still-open work, and kept the reproduced stale-screen readiness false positive prominent. Fresh checks: four focused readiness/receipt files (50 tests), node typecheck, changed-file quality (0 new findings across 60 changed files), |
Readiness evidence must be provider-initiated. A first-party status frame and an OSC title are bytes the provider chose to emit; a screen capture is a read Orca chose to perform, so it can re-read a pre-turn screen but can never show that the provider left the turn. hasEvidenceAfterFirstPartyStatus compared a capture's outputSequence against the working frame's, so after the status aged out any unrelated byte (a cursor move, a title repaint) plus a fresh capture of the SAME retained ready prompt scored as a new ready transition, and `terminal wait --for tui-idle` settled into a busy agent. Drop that branch: only a later provider fact clears an unfinished turn, and a title does not vouch for retained screen text either. A done frame replaces the row outright, so the normal turn end is unaffected. Ageing out now loses the evidence that a turn was open rather than supplying evidence that it closed, so the result is an honest unknown. Also fix the initial synchronous tui-idle read, which passed an evidence cursor derived from the same record it was testing. hasEvidenceAfter requires strictly-newer, so that read demanded a transition that had already happened and an already-idle terminal could never satisfy it; the wait then ran to timeout and deadlocked orchestration mail delivery to an idle recipient. The fence still guards every deferred decision, where it belongs. The screen-recapture test asserted the defect under a name claiming the opposite; invert it and cover the done-frame and title-does-not-unlock cases.
…atus-c3-readiness
…e waits This branch added `does not let a retained explicit title satisfy a new wait operation`, which fenced the initial synchronous tui-idle read against the operation performing it. That fence broke a contract that predates the branch: `notifyMessageArrived` to an already-idle recipient (#12536) must push without waiting for another agent-status transition. An idle, silent agent emits nothing new, so the wait never settled and mail delivery deadlocked. The intent behind the added test is right — a retained idle title must not settle a wait an automation just started — but transport recency is the wrong instrument for it, and it is the same read-versus-transition conflation the screen branch had. The protection now comes from the provider: once a turn is open and unretracted, a retained idle title cannot clear it, which is exactly the case the fence was defending. Replace the test with the two halves it was conflating: an already-idle terminal settles, and a retained idle title does not settle while a provider turn is still unfinished.
|
Closing this draft from the September 14 agent-status plan. That plan was re-examined against current main and replaced. This branch conflicts with main, and its central work duplicated contracts that had already merged (the canonical status store and the child-work contract landed on 15–16 September). The replacement work is being done as smaller root-cause PRs, each planned, challenged and reviewed first. |
Orca should not call an agent ready just because its terminal is quiet or still shows an old prompt. This draft separates four different facts: the agent can accept input, Orca wrote the prompt, the provider started the requested turn, and that turn finished.
The branch improves startup recovery and makes unsupported evidence explicit, but it is not safe to merge yet. The current head still has a reproduced high-severity false positive: after a real Working report becomes old, an unrelated terminal byte can make a newly captured copy of the same old ready screen count as fresh readiness.
User-facing before / after
Before this PR: a quiet screen, a matching title, or a successful terminal write could be used as proof of several different events. Slow startup could be reported as failure even while the agent kept running; a prompt sitting unsubmitted in a composer could look delivered; and an unsupported provider could be treated as ready.
After this PR, where the new paths are correct: readiness is reported as ready, busy, unsupported, or unknown; prompt acceptance is separate from provider turn start; uncertain local and paired-worker startup keeps the live terminal and recovery commands instead of discarding control; and automation completion waits for a new observed start before accepting a later finish.
Still broken at this head: terminal screen capture order is still being used as proof of a provider state change. A retained ready screen can therefore satisfy
terminal wait --for tui-idleafter Working expires even though no new ready transition occurred. This can submit the next action while the agent is still busy. Passing unit tests do not disprove this reproduced case.Issue records
No issue is fully closed by this draft.
Partially addressed by the implemented startup, receipt, and recovery changes:
Still open or assigned to dependent work:
Why this mechanism
A terminal write can succeed without the agent consuming it, and a visible prompt can be old while the agent is working elsewhere. The design therefore keeps readiness, input acceptance, provider turn start, pending interaction, and completion as separate observations tied to the same live terminal process. When the provider cannot prove one of them, the result is unknown and the user keeps the ability to inspect, type, cancel, or explicitly abandon the worker.
The alternatives considered were title-only detection, quiet-time detection, process presence, and treating every fresh screen capture as fresh readiness. The first three answer the wrong question. The fourth is the remaining defect in this branch: transport activity only proves that Orca read another frame, not that the provider became ready. The required correction is a provider-owned ready/turn transition for the specific operation, or an honest unknown result when no such signal exists—not another clock or sequence guard around stale text.
Scope, dependencies, and remaining work
origin/mainat383c543e0f6651a6c2d99ecca5ab43fbedd1bee8. A final merge simulation was also clean after the shared fetched ref advanced to descendant36cdb34097a7075718abe41c29d559101841166a; no unnecessary merge commit was added.Validation at this revision
Freshly run at
21b8a14d03a4a42b2c7fb2af94b609745090e032:git diff --check, and conflict-marker checks against the fetched baseline — clean.Earlier hidden/background Electron QA was run at
47ba36daffcd73dad12010491088bc011370dd94, not at this head. No fresh Electron or mobile QA was run here, and the stale-screen counterexample at the current head remains the controlling result. These checks establish only that the covered paths still pass; they are not independent review or acceptance.Draft status
Draft / not merge-ready. Keep the reproduced semantic-readiness false positive, red hosted checks, missing provider/remote evidence, and lack of current-head independent review/QA visible. Conflict resolution did not fix any of those blockers.