Repository navigation
fix(runtime): agent-neutral wait-blocked reasons - #19749
Conversation
…ravity readiness Reported by a user via the in-app help menu (report "not captured", 1.4.198). The trust/interactive/update/cwd prompt matchers are agent-agnostic - they match on dialog wording and never inspect the pane's agent - yet emitted hardcoded codex-* reasons. Those reached users verbatim in worker receipts (local-worker-start, federation), two automation surfaces, and raw CLI output, so an Antigravity user was told they had a Codex problem. findAntigravityReadyPromptIndex also required the model line to start with the literal "gemini". Antigravity CLI is not Gemini-only, so a non-Gemini session never registered as ready, stale trust text was never superseded, and the pane stayed blocked - which is why dispatch --inject answered agent_prompt_blocked. Add agent-neutral reasons additively (codex-* members kept on the wire per docs/reference/remote-wire-compatibility.md, with a legacy alias for older hosts) and decide Antigravity readiness structurally: header, then model/account rows, then the prompt caret. codex-model-migration-prompt and codex-hooks-review-prompt stay Codex-named - both key on Codex's own wording.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (11)
Included review availability: Your plan provides up to 10 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughThe change adds agent-neutral terminal wait reasons while retaining legacy Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to The conservative readiness behavior avoids treating startup dialogs as terminal-ready. No merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description provides substantial technical context, rationale, scope, compatibility details, and test results. However, it does not follow several required template sections: it has no Resolution Add the required template sections. Provide a linked issue using
✨ Finishing Touches 💡 1📝 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.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 7a6fed56-7da7-4010-aa5b-5605c5bafd77
📒 Files selected for processing (15)
src/cli/terminal-format.test.tssrc/cli/terminal-format.tssrc/main/runtime/antigravity-ready-prompt-index.tssrc/main/runtime/orca-runtime-tail-wait-memo.test.tssrc/main/runtime/orca-runtime-tests/agent-status-and-waits.spec.tssrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.tssrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.tssrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.tssrc/main/runtime/terminal-interactive-wait-visibility.test.tssrc/main/runtime/terminal-tail-sentinel-index.test.tssrc/main/runtime/terminal-wait-detection.test.tssrc/main/runtime/terminal-wait-detection.tssrc/shared/runtime-terminal-contracts.tssrc/shared/terminal-wait-blocked-reason-legacy-alias.test.tssrc/shared/terminal-wait-blocked-reason-legacy-alias.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.
| pairedModelFound: boolean, | ||
| accountFound: boolean | ||
| ): boolean { | ||
| return promptFound && (geminiModelFound || (pairedModelFound && accountFound)) |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Reject silent startup dialogs before reporting Antigravity ready. A full-chrome screen can set promptFound, pairedModelFound, and accountFound from separate lines, so isAntigravityReady returns true even when a silent dialog appears before the caret. The blocked-signal scan returns null for such wording, so isKnownReadyPromptPreview reports the dialog as ready. Reject modal content before the caret, including numbered-choice rows and startup Press enter to ... prompts. Add the account row to a SILENT_STARTUP_DIALOGS fixture to cover the full-chrome case.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Agent-neutral blocked reasons —
detectTerminalWaitBlockedReasonnow publishesagent-trust-workspace,agent-update-prompt,agent-cwd-prompt, andagent-interactive-promptinstead of thecodex-*spellings, since the matchers never inspect the pane agent. - Non-Gemini Antigravity readiness —
findAntigravityReadyPromptIndexwas extracted tosrc/main/runtime/antigravity-ready-prompt-index.tsand rebuilt as a structural scan (header, caret, then Gemini model or plain row above a workspace path paired with an account row), removing thegemini-prefix requirement. - Wire-compatible reason surface — the
codex-*members stay as additive union members, and aMap-based legacy alias (terminal-wait-blocked-reason-legacy-alias.ts) lets the CLI name the neutral spelling beside an older host's token. - Test coverage — new
terminal-wait-detection.test.tscases for non-Codex dialogs, silent startup dialogs, and trust-over-chrome ordering, plus spec-fragment additions modelling the user wedge.
I confirmed the two load-bearing claims myself rather than taking them on faith: the only production equality comparisons on a reason literal are the two agent-approval-prompt checks (orca-runtime-resolve-authoritative-terminal-wait-permission.ts, runtime-terminal-agent-status-query.ts), both computed locally from detectTerminalWaitBlockedReason(terminal.waitText) and never a reason read off the wire, so the rename is safe; and the renderer's only consumer (active-agent-note-send.ts) reads wait.blockedReason as a truthiness check with no literal mapping. The extraction left isTerminalWaitWhitespace imported correctly and no other caller of the old return-value semantics (max(modelIndex, promptIndex) → headerIndex) exists.
ℹ️ Non-Gemini readiness rests on a synthetic screen shape, never a real capture
The D2 fix flips isAntigravityReady for non-Gemini sessions only when three things co-occur: an email-shaped account row (@ then ., and not a path/prompt line), a "plain" row directly above a workspace-path row, and a lone > caret. The user report arrived with no captured terminal output, so that shape is validated only against fixtures this PR authors — there is no recording of a real non-Gemini Antigravity ready screen in evidence. If the real screen omits the account row (an SSO display name with no email) or orders the rows differently, the pane now fails closed to a timeout and the reported wedge survives in the field. That is strictly better than the status quo and cannot type into a dialog, so it is not a blocker — but one manual confirm against a real --agent antigravity session with a non-Gemini model would settle whether the account-row requirement matches production layout or is an over-strict proxy.
Technical details
# Confirm the Antigravity ready-screen structural assumption
## Affected sites
- src/main/runtime/antigravity-ready-prompt-index.ts — `isAccountLine` (email `@`+`.`), `pairedModelFound` (plain row above a path row), and `isAntigravityReady`'s `promptFound && (geminiModelFound || (pairedModelFound && accountFound))`.
## Required outcome
- Capture one real non-Gemini Antigravity CLI ready screen and check it satisfies `accountFound` and `pairedModelFound`; if not, the non-Gemini path still hangs in the field.
## Open questions for the human
- Does Antigravity always print an email-shaped signed-in account row above the model/path chrome for non-Gemini models, or can it render an SSO display name without `@`?DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
… readiness rewrite Review follow-up on this branch. Splits the two halves of the original commit: the reason rename lands, the Antigravity readiness detector goes back to merge-base until someone captures a real transcript. Rename half: - 'hooks need review' + 'press enter to confirm' inspects no agent, so it now publishes agent-hooks-review-prompt. That was the last agent-agnostic codex-* emission left, and it is the one the original report was about: a Claude Code user hitting a hooks dialog still read "codex-hooks-review-prompt". - The legacy alias is applied at all three surfaces that render a raw reason, not just the CLI. describeTerminalWaitBlockedReason() is the single formatter; the worker and federation "Agent startup blocked:" receipts use it too. Kept one-directional: nothing consumes agent-* -> codex-*, since an old client renders with its own shipped code. - Restores the compat note deleted at the permission-choices site. The Rule 1 citation is correct - remote-wire-compatibility.md names this enum by name. Antigravity half, reverted: findAntigravityReadyPromptIndex goes back to merge-base (header + a 'gemini' model line + a lone '>' caret) and antigravity-ready-prompt-index.ts is removed. Executing both builds against constructed tails, the rewrite read a live startup dialog as ready. Adding the account row from this repo's own ready-screen fixture to five silent startup dialogs (sign-in, model picker, theme picker, privacy notice, update banner) flipped all five from unready to ready; so did any narration line containing an email address, with no account row at all. Readiness is what gates typing the task prompt into the pane, so that path types a task prompt into a live authentication dialog. Merge-base returns unready for all ten. The rewrite also did not reliably fix the wedge it targeted: with no account row and a non-Gemini model - a personal or API-key user - it still returns unready. No real Antigravity transcript exists in this repo. The cursor-agent rules are derived from captures under src/main/runtime/__fixtures__; Antigravity has no equivalent, and every attempt so far has been tuned against a hand-written 5-line fixture. A false negative (the agent waits) is safer than a false positive (we type into an auth dialog), so this ships the known behaviour. Reverting restores a pre-existing gap, not a regression: a non-Gemini Antigravity session wedges on merge-base too. Closing it needs a captured ready screen and a captured dismissed-dialog screen, for a personal/API-key account as well as a Business one. Tests: - Ten ratchet fixtures pin the shapes any replacement detector must refuse - the five silent dialogs with an account row, and each with a narrated email. All ten fail against the reverted rewrite. - Vacuous tests rewritten so they fail without the code they cover: the CLI alias tests asserted only the absence of a suffix, and the worker receipt test asserted the raw token. Tests that are characterization rather than a guard now say so on the line above.
Scope change: Antigravity readiness detector revertedFollowing a readiness review, this PR has been split. The agent-neutral wait-blocked reason work is kept; the Antigravity readiness detector is reverted to merge-base and WhyBoth builds were executed against constructed tails rather than reasoned about:
Net: the detector half was strictly worse than merge-base. Reverting restores a pre-existing gap, not a regression — non-Gemini Antigravity wedges on merge-base too. Why not attempt a sixth fix hereThis repo derives cursor-agent rules from real captures ( What a real capture needsRaw PTY transcripts, escapes intact, saved alongside the cursor-agent fixtures:
Also in this push
|
There was a problem hiding this comment.
Important
The revert of the non-Gemini readiness rewrite is the right call — but the PR title and description still advertise it as fixed, so they need updating before merge.
Reviewed changes
- Completed the agent-neutral rename — the
hooks need reviewmatcher now publishesagent-hooks-review-promptinstead ofcodex-hooks-review-prompt(its wording is not Codex-specific, and a Claude Code fixture now exercises it), finishing the rename started inadab622. - Reverted the non-Gemini Antigravity readiness rewrite —
antigravity-ready-prompt-index.tsis deleted andfindAntigravityReadyPromptIndexis restored to thegemini-prefix scan. The wedge is now pinned as a characterization test plus a ratchet of startup-dialog fixtures rather than a fix, which fails closed (timeout) instead of typing into a live dialog. - Consolidated blocked-reason rendering into
describeTerminalWaitBlockedReason— the worker and federationAgent startup blocked:receipts now alias a legacy token beside its neutral spelling, matching the CLI, instead of the CLI-only aliasing inadab622.
⚠️ Title and description no longer describe the change
Commit e99fc62 reverted the non-Gemini Antigravity readiness fix, but the title (…and non-Gemini Antigravity readiness) and the description's "What", "D2 — the Antigravity wedge", "Trade-offs", and "ELI5" sections still claim both bugs are fixed. The user report that motivates this PR is the Antigravity wedge, so the headline promises a fix that no longer exists. Merging as-is records a false "fixed D2" in the commit message and any changelog derived from it, and misleads anyone skimming the description into thinking --agent antigravity on a non-Gemini model is unblocked.
Technical details
# Align the PR title and description with the reverted D2 scope
## Affected sites
- PR #19749 title — still claims "non-Gemini Antigravity readiness".
- PR description — "Two are real bugs, both fixed here", the "D2" section, the "Trade-offs" structural-scan bullets, and the ELI5 point 2 all describe the reverted `findAntigravityReadyPromptIndex` rewrite.
## Required outcome
- Retitle to reflect the actual scope (agent-neutral wait-blocked reasons, plus neutral-spelling rendering for worker/federation receipts).
- Rewrite the description to state D2 was investigated and reverted (fail-closed, documented as a known wedge with a ratchet), and note the follow-up that needs a captured non-Gemini transcript.DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Merged
origin/main— commit9957fcfabrought the branch up to date with main; none of the PR's 16 files changed as a result, so the code under review is unchanged since the prior review. - Retitled and rewrote the description — the title now reads
fix(runtime): agent-neutral wait-blocked reasons, and the description now leads with a "Scope changed after review" note marking D2 (non-Gemini Antigravity readiness) as investigated and reverted to a fail-closed known wedge, resolving the prior⚠️finding about the stale title/description.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
…prefilter honest Adversarial probing against screens the corpus does not contain -- non-English output, agents with unusual chrome, records rather than requests -- found both directions wrong. False positives, all with the auth phrase mid-row in a line whose subject is something else: a `git log --oneline` ending on `feat(auth): sign in with GitHub`, a changelog bullet, a checklist item, `Root cause: authentication required from the vercel CLI`, and any `Waiting for you to ...` row once anything above it mentioned login. Localized narration was worse: NARRATION_ROW_RE knew only ASCII sentence punctuation, so a Chinese or German summary of auth work had no way to read as prose while still embedding English auth wording. An action phrase now has to LEAD its row, `waiting for you to` carries an auth continuation, and narration includes CJK sentence punctuation. False negative, and the one that matters: the live Antigravity sign-in menu already fixtured in terminal-wait-detection.test.ts -- the dialog #19749 was filed for -- was NOT detected. `2. Paste an API key` is a prompt to the index because end-of-row is a terminator, but the cheap sentinel only accepted a noun followed by punctuation, so the tail was dropped before it was ever parsed. The sentinel's doc comment calls itself a superset of the index; it was not, and the test asserting so only ran over screens we already expected to block. It now runs over both corpora against the index's own verdict, which is what found this. Also: sudo translates its prompt but not its `[sudo]` tag, the common api-key ask names the env var it fills, and a boxed dialog ends its rows with a frame glyph the sentinel counted as "not a terminator". The env-var vendor slot belongs in the prefix rules, not the noun alternation: spelled `(?:[a-z0-9]+_)?api[ _-]?key` it is quadratic, 30ms on one 5.5k-char line, in a regex that runs per retained tail line at streaming rate. Pinned with a budget.
Mining 16,206 distinct credential-vocabulary lines out of this repo's own tracked files and placing each one row above a real agent composer caret produced **100 refusals across 25 distinct lines**, on Codex, Claude Code and OpenCode. The corpus had `rg` hits and diffs, which carry their own chrome, but no plain formatted source -- and that is the category that leaked. 24 of the 25 are one shape. `AUTH_QUESTION_ROW_RE` rests on "prose never starts with a bare `?`", which is true and irrelevant: oxfmt puts a ternary's consequent on its own row as `? someValue`, and **5,666 tracked files have one**. `sawAuthQuestion` then returns unconditionally, with no position requirement, so a composer caret directly below could not clear it. Nine matched only because `\b(?:log[ -]?in)\b` reads `user.login` as the auth verb. The 25th is the other rule: `CREDENTIAL_ASK_PREFIX_RE` was unanchored, so an ask verb anywhere in a row made a row-final credential noun a prompt -- `// Why: a merely missing or expired bundle must not enter the credential` is a real wrapped comment in this repo, and terminal wrapping makes ending on a noun routine. Three fixes, the same position discipline the flow rule already uses: - the ask verb must LEAD its row, modulo decoration and a menu number, so `2. Paste an API key` still reads as a prompt and 60 characters of prose before `enter the` does not; - `.login` is a property access, not an auth verb; - a known composer caret on the bottom row suppresses the question-row rule, because an agent sitting at its own prompt is not asking anyone anything. The caret set deliberately includes a bare `>`. It suppresses only the question-row rule, and the #19749 sign-in dialog -- whose own bottom row is `>` -- matches through `isCredentialPromptLine`, which returns first. Verified: that dialog and the auth-method menu both still refuse. Mined-corpus refusals 100 -> 0, with the mined lines added as a corpus category so the next widening has to refuse them. Sentinel budget unchanged.
… decoration Two more false positives of the same family as the ternary one, found by crossing the detector's own vocabulary against the shapes a term takes when it is output rather than a prompt. `candidate.credential` set the credential-noun flag: only the auth-verb regex had been taught that a dot means a property access. That flag corroborates an otherwise-inert bottom row, so an identifier alone could refuse a screen that was only printing source. Excluded `.` and `.` only -- `\w` would break the env-var ask (`OPENAI_API_KEY`), which is a real prompt. ` // Sign in with the provider console to continue` read as a dialog leading its row, because the decoration run before the action phrase accepted a comment marker. A dialog decorates its instruction with box rules, bullets, carets and menu numbers, never with `//` or `*`. Both pinned, and the #19749 sign-in dialog and auth-method menu still refuse.
… rule they never had Rebasing onto main picked up #19749's test changes, which the old base branch predated. Its production change was reverted; its constructed screens landed and are on main, and one of them fails against attempt six. The screen asserts ready for: Antigravity CLI 1.0.3 / [email protected] / Gemini 3.5 Flash (High) / > There is no composer rule in it. Every one of the fifteen captured ready screens has one directly above the caret, across two agy versions — the composer is a framed box, and this screen is one agy cannot print. It passed before only because the old detector keyed on the `gemini` model line, which is the exact rule the captures refuted. Adds the rule to the two hand-written screens that assert readiness, and leaves every dialog untouched: a dialog's caret is its selected row with dialog text above it, not a rule, which is what keeps refusing them. The test's intent is unchanged and is independently proven by a real capture — `antigravity-dialog-dismissed.txt` is a dismissed dialog above a redrawn composer. Two neighbouring comments had also become false and are corrected rather than left to mislead the next reader: - The non-Gemini screen was a characterization test recording a wedge as unfixed. The detector reads no model text at all now, so with a realistic screen it reads ready. Flipped to assert that, because it is the user-visible point of the rewrite. - The five-dialog ratchet no longer passes "because none prints a gemini model line". It passes because each one's last line is a dialog row. Same ratchet, accurate reason.
Mining 16,206 distinct credential-vocabulary lines out of this repo's own tracked files and placing each one row above a real agent composer caret produced **100 refusals across 25 distinct lines**, on Codex, Claude Code and OpenCode. The corpus had `rg` hits and diffs, which carry their own chrome, but no plain formatted source -- and that is the category that leaked. 24 of the 25 are the same shape. `AUTH_QUESTION_ROW_RE` rests on "prose never starts with a bare `?`", which is true and irrelevant: oxfmt puts a ternary's consequent on its own row as `? someValue`, and **5,666 tracked files have one**. `sawAuthQuestion` then returns unconditionally, with no position requirement, so a composer caret directly below could not clear it. Nine of those matched only because `\b(?:log[ -]?in)\b` reads `user.login` as the auth verb. The 25th is the other rule: `CREDENTIAL_ASK_PREFIX_RE` was unanchored, so an ask verb anywhere in a row made a row-final credential noun a prompt -- `// Why: a merely missing or expired bundle must not enter the credential` is a real wrapped comment in this repo, and terminal wrapping makes ending on a noun routine. Three fixes, same discipline as the flow rule already uses: - the ask verb must LEAD its row, modulo decoration and a menu number, so `2. Paste an API key` still reads as a prompt and 60 characters of prose before `enter the` does not; - `.login` is a property access, not an auth verb; - a known composer caret on the bottom row suppresses the question-row rule, because an agent sitting at its own prompt is not asking anyone anything. The caret set deliberately includes a bare `>`. It only suppresses the question-row rule, and the #19749 sign-in dialog -- whose own bottom row is `>` -- matches through `isCredentialPromptLine`, which returns first. Verified: that dialog and the auth-method menu both still refuse. Mined-corpus refusals 100 -> 0, with the mined lines added as a new corpus category so the next widening has to refuse them. Sentinel budget unchanged at 16.2ms/500ms.
…m questions Re-verification found the last fix incomplete: 18 refusals survived, all one root cause. `COMPOSER_CARET_ROW_RE` suppressed only when the caret was the literal bottom row, and no agent draws it there -- Codex puts a model footer under it, OpenCode a status bar, droid a key-hint row, Command Code and grok their own chrome. FP-A survived for Codex and OpenCode, both gating agents. cursor-agent and antigravity passed only because four chrome rows pushed the trigger outside the window, which is luck, not a defence. My own `AGENT_COMPOSER_TAILS` caused this: I hand-wrote idealised tails ending on the caret while the real forms were already sitting in the corpus modules. That is the exact failure this file exists to prevent -- invented screens share the blind spots of whoever invented them. The tails now come from the captured chrome, and droid, cursor, command-code, grok, antigravity, crush and aider are added. Two fixes, because position alone cannot separate these: `? How would you like to authenticate?` above its two option rows and `? prevAssignees.filter(...)` above a caret and a status bar sit at the SAME offset from the bottom. - Suppression scans the last three non-blank rows for a caret, not the bottom row. - A `?` row that is code-shaped (quotes, braces, brackets, `=>`, `!==`, a `foo.bar` access) is not a question. Parentheses stay legal -- real prompts write `(Use arrow keys)`. The third vacuous probe, predicted and now fixed: `asPropertyAccess` collapsed spaces, so `access token` became `accesstoken`, which the vocabulary never matches -- 19 of 24 terms proved nothing about the lookbehind they claimed to exercise. Identifiers keep their separator, and the suite asserts how many terms are actually live rather than trusting the loop ran. Making it live immediately exposed a real gap: `candidate.personal_access_token` still corroborated, because the dot precedes `personal`, not `access_token`. The noun lookbehind now spans the identifier to its opening dot. Still only `.` -- `OPENAI_API_KEY` has none and is a real ask. Mined-corpus refusals: 16,297 lines x 13 real tails = 211,861 screens, 0 refusals. All ten controls hold, including the #19749 sign-in menu, the auth-method menu and the device-code dialog. Sentinel budget 16.8ms/500ms.
Mining 16,206 distinct credential-vocabulary lines out of this repo's own tracked files and placing each one row above a real agent composer caret produced **100 refusals across 25 distinct lines**, on Codex, Claude Code and OpenCode. The corpus had `rg` hits and diffs, which carry their own chrome, but no plain formatted source -- and that is the category that leaked. 24 of the 25 are the same shape. `AUTH_QUESTION_ROW_RE` rests on "prose never starts with a bare `?`", which is true and irrelevant: oxfmt puts a ternary's consequent on its own row as `? someValue`, and **5,666 tracked files have one**. `sawAuthQuestion` then returns unconditionally, with no position requirement, so a composer caret directly below could not clear it. Nine of those matched only because `\b(?:log[ -]?in)\b` reads `user.login` as the auth verb. The 25th is the other rule: `CREDENTIAL_ASK_PREFIX_RE` was unanchored, so an ask verb anywhere in a row made a row-final credential noun a prompt -- `// Why: a merely missing or expired bundle must not enter the credential` is a real wrapped comment in this repo, and terminal wrapping makes ending on a noun routine. Three fixes, same discipline as the flow rule already uses: - the ask verb must LEAD its row, modulo decoration and a menu number, so `2. Paste an API key` still reads as a prompt and 60 characters of prose before `enter the` does not; - `.login` is a property access, not an auth verb; - a known composer caret on the bottom row suppresses the question-row rule, because an agent sitting at its own prompt is not asking anyone anything. The caret set deliberately includes a bare `>`. It only suppresses the question-row rule, and the #19749 sign-in dialog -- whose own bottom row is `>` -- matches through `isCredentialPromptLine`, which returns first. Verified: that dialog and the auth-method menu both still refuse. Mined-corpus refusals 100 -> 0, with the mined lines added as a new corpus category so the next widening has to refuse them. Sentinel budget unchanged at 16.2ms/500ms.
…m questions Re-verification found the last fix incomplete: 18 refusals survived, all one root cause. `COMPOSER_CARET_ROW_RE` suppressed only when the caret was the literal bottom row, and no agent draws it there -- Codex puts a model footer under it, OpenCode a status bar, droid a key-hint row, Command Code and grok their own chrome. FP-A survived for Codex and OpenCode, both gating agents. cursor-agent and antigravity passed only because four chrome rows pushed the trigger outside the window, which is luck, not a defence. My own `AGENT_COMPOSER_TAILS` caused this: I hand-wrote idealised tails ending on the caret while the real forms were already sitting in the corpus modules. That is the exact failure this file exists to prevent -- invented screens share the blind spots of whoever invented them. The tails now come from the captured chrome, and droid, cursor, command-code, grok, antigravity, crush and aider are added. Two fixes, because position alone cannot separate these: `? How would you like to authenticate?` above its two option rows and `? prevAssignees.filter(...)` above a caret and a status bar sit at the SAME offset from the bottom. - Suppression scans the last three non-blank rows for a caret, not the bottom row. - A `?` row that is code-shaped (quotes, braces, brackets, `=>`, `!==`, a `foo.bar` access) is not a question. Parentheses stay legal -- real prompts write `(Use arrow keys)`. The third vacuous probe, predicted and now fixed: `asPropertyAccess` collapsed spaces, so `access token` became `accesstoken`, which the vocabulary never matches -- 19 of 24 terms proved nothing about the lookbehind they claimed to exercise. Identifiers keep their separator, and the suite asserts how many terms are actually live rather than trusting the loop ran. Making it live immediately exposed a real gap: `candidate.personal_access_token` still corroborated, because the dot precedes `personal`, not `access_token`. The noun lookbehind now spans the identifier to its opening dot. Still only `.` -- `OPENAI_API_KEY` has none and is a real ask. Mined-corpus refusals: 16,297 lines x 13 real tails = 211,861 screens, 0 refusals. All ten controls hold, including the #19749 sign-in menu, the auth-method menu and the device-code dialog. Sentinel budget 16.8ms/500ms.

What
Two bugs reported by a user (
fishtvlvoe, reportnot captured, Orca 1.4.198, via the in-app help menu, written in Traditional Chinese):All three claims were verified against the source.
Scope changed after review — read this before the sections below. This PR originally fixed both real bugs. The Antigravity readiness half (D2) has since been reverted; only the agent-neutral label fix (D1) ships here. See the scope-change comment for the full evidence. The short version: executing both builds against constructed tails showed the proposed detector returned
ready=falsefor a personal/API-key user on a non-Gemini model — i.e. it never fixed the reported wedge — while flipping all five silent startup dialogs toready=trueon nothing more than a narration line containing an@and a.. It was strictly worse than merge-base in both directions.The third claim — that
antigravityis missing from the orchestration agent list — is refuted: it has been a first-classTuiAgentall along (src/shared/tui-agent.ts:14,tui-agent-config.ts:166withdetectCmd: 'agy'), passesworker-startvalidation, and is enabled by default.Fix evidence
D1 — the codex-prefixed label leak. FIXED, ships here. The trust-prompt matcher is entirely agent-agnostic (it matches
do you trust/trust this/trusted workspaceand never inspects which agent the pane runs), yet pushed a hardcoded'codex-trust-workspace'. That token reached users verbatim at four production sites —local-worker-start.ts:226andfederation.ts:225(worker receiptlastError), plus two automation surfaces nobody had checked (runtime-terminal-run-observer.ts:130,main-process-automations.ts:82) — and raw to CLI users viaterminal-format.ts. Same defect class forcodex-interactive-prompt,codex-update-prompt,codex-cwd-prompt. All now agent-neutral.Also in this half:
hooks need reviewnow publishesagent-hooks-review-prompt(the last agent-agnosticcodex-*emission), and a singledescribeTerminalWaitBlockedReason()formatter is applied at all four render sites.D2 — the Antigravity wedge. ATTEMPTED AND REVERTED. Still unfixed on this branch, and worse than this section originally claimed.
The original diagnosis was that
findAntigravityReadyPromptIndexrequires the model line to literally start withgemini, so any non-Gemini session never registers as ready. Realagytranscripts have since been captured (six fixtures, live PTY, escapes intact, in #19983), and they show the gap is both wider and two-directional:▀▀▀▀▀▀▀▀ Gemini 3.7 Flash (Low)— it starts with▀.startsWith('gemini', trimmedStart)therefore never matches on any account and any model, including a Gemini one. It is a line-start problem, not a model-name problem. Evidence:src/main/runtime/__fixtures__/antigravity-ready-api-key-gemini-model.txtandantigravity-ready-account-info-hidden.txt, both of which the shipped detector refuses.readywhile a live dialog owns the screen./modelprints its options one per line, at line start, and those lines do begin withGemini; the composer's bare>is still on screen above the in-place picker, so both halves of the rule are satisfied by the dialog itself. Evidence:antigravity-dialog-model-picker.txt. This is the dangerous direction — a prompt typed into an open picker, not a stalled wait.Measured three ways on the real ready screen: real screen →
false; same screen with the logo glyphs stripped →true; real screen followed by the live/modelpicker →true. The logo — decoration, and suppressible withAGY_CLI_HIDE_LOGO— is what decides readiness today.None of that is a regression introduced here; it is pre-existing on merge-base and was simply mis-scoped in this PR's original write-up. The characterization test wording ("does not yet recognize a non-Gemini ready screen (known wedge)") understates it for the same reason.
Why the fix was withdrawn rather than iterated: this detector has now been written five times, every attempt tuned against a hand-written five-line fixture, and each of the first three was found worse than the bug it replaced. Attempt five failed the same way — "executing both builds" looked like real verification, but the input being executed was the hand-written fixture, which disagrees with the real screen on the model row, the path row and the account row.
Fixed in #20027, the evidence-based attempt six, stacked on #19983. It drops the model row, the account row and the
headerIndexanchor entirely and decides on position instead: the caret row ends the tail, directly under the composer's rule. All four pinned KNOWN DEFECT cases inantigravity-readiness-transcripts.test.tsconvert to real passing assertions there.Verification (D1 and the rename work)
pnpm testacross affected suitespnpm tc:node/tc:cli/tc:weboxlint,oxfmt --checkpnpm run check:code-quality:changedMutation-checked, not inspected: hooks rename → 6 tests fail; worker receipt alias → 2 fail; alias formatter → 8 fail across 3 files; re-applying the reverted D2 detector → all 10 new ratchet fixtures fail.
Nine tests that passed with the fix reverted (i.e. structurally incapable of failing) were rewritten or explicitly labelled as characterization coverage.
Third claim —
agent_prompt_blocked— is correct-by-design and deliberately unchanged. Refusing to paste a prompt into a live permission dialog is the right behaviour. Hardening that refusal further is #19978 / #20004.ELI5
Orca watches a terminal and decides "is this AI agent ready for a prompt, or is it stuck on a dialog?" The user reported two problems with that. This PR ships the fix for one of them and deliberately abandons the fix for the other — the sections above were written before that decision and describe both as fixed.
Wrong name on the error — fixed. The code that spots a "do you trust the files in this folder?" dialog works for any agent; it just looks for that wording and never checks which agent is running. But whoever wrote it hardcoded the label
codex-trust-workspace. So an Antigravity user got told their problem was a Codex problem. Confusing, and it made the bug much harder to report. Those labels are now agent-neutral, with the old spellings kept forever so an older host talking to a newer client still renders correctly.The stuck pane — not fixed, on purpose. To decide Antigravity had finished starting, Orca looks for a line beginning with the word
gemini, because Antigravity only ran Gemini models when that was written. Run any other model and Orca never marks the pane ready, and the orchestrator refuses to send it work. A fix was written and then reverted: testing showed it still didn't unwedge the reported user, and it made things worse — it would call a pane ready while a live sign-in dialog owned the screen, which means typing the task prompt into an authentication box. That is strictly worse than timing out.The wedge is now recorded as a test that documents the broken behaviour rather than hiding it, and #19983 builds the tooling to capture what Antigravity really prints, so the next attempt is based on evidence instead of a fixture typed from memory.
Trade-offs
docs/reference/remote-wire-compatibility.md.RuntimeTerminalWaitBlockedReasonis published by the host to independently-versioned clients, so nothing was renamed or removed: the four neutral spellings are purely additive union members, and thecodex-*members are permanent, exactly like reserved opcode numbers. A legacy-alias module maps an older host'scodex-*token to a neutral label for display, so a new client paired with an old host still shows the right thing. Verified no zod enum validates the value and only two equality comparisons exist anywhere (both againstagent-approval-prompt, both on a locally-computed reason, never one off the wire).blockedReasonnow reads e.g.agent-trust-workspaceinstead ofcodex-trust-workspacein worker receipts and CLI output. That is the point of the fix, but anything scripting against the old literal on a new host will need updating.codex-model-migration-promptandcodex-hooks-review-prompt, because both key on Codex's own wording (e.g. "codex just got an upgrade"). Renaming those would be wrong, not merely unnecessary.wait.reasonwith no legacy alias, so an older host'scodex-*token still reaches a non-Codex user on that one surface.config/vitest.config.tsincludes only*.test.ts, sopnpm test src/main/runtime/orca-runtime-tests/<x>.spec.tssilently runs nothing and still prints a green summary. Those fragments execute only through theorca-runtime.test.tsaggregator — which was run here (1260 passed).Adversarial review
4 loops to clean — the most contested track of this scan. Each of the first three loops found that its predecessor's readiness fix was worse than the bug it fixed, in a new way. Worth reading as a record of why this was capped rather than shipped early:
ready: true, blocked: nullwhere HEAD correctly readfalse— meaning the orchestrator would type a prompt straight into a live trust dialog. Replaced the blacklist with a structural ordering defence (header index, like the Codex and Cursor siblings).terminal-format.tsalias change had zero test coverage (reverting it left every CLI test green), and loop 2's ordering defence was effectively untested. Both pinned. Declared clean.Also fixed along the way:
agentNeutralTerminalWaitBlockedReasonresolved keys throughObject.prototype, so an unvalidated wire value ofconstructor/toStringreturned a function instead ofnull.Addresses the user report attached to
not captured(Slack1788893806.126719).