Skip to content

fix(runtime): agent-neutral wait-blocked reasons - #19749

Merged
nwparker merged 3 commits into
mainfrom
fix/agent-neutral-wait-blocked-reason
Sep 11, 2026
Merged

nwparker merged 3 commits into
mainfrom
fix/agent-neutral-wait-blocked-reason

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Sep 9, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 10 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​467 $\color{#cf222e}{\Huge{\mathbf{−}}}$​26 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​441
Prod 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​72 $\color{#cf222e}{\Huge{\mathbf{−}}}$​13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​59

What

Two bugs reported by a user (fishtvlvoe, report not captured, Orca 1.4.198, via the in-app help menu, written in Traditional Chinese):

"--agent antigravity can start a terminal, but readiness detection misjudges it and gets stuck at the trust prompt (the error message is even mislabelled codex-trust-workspace), and dispatch --inject returns agent_prompt_blocked, so you cannot track an Antigravity worker's completion status through orchestration."

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=false for 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 to ready=true on nothing more than a narration line containing an @ and a .. It was strictly worse than merge-base in both directions.

The third claim — that antigravity is missing from the orchestration agent list — is refuted: it has been a first-class TuiAgent all along (src/shared/tui-agent.ts:14, tui-agent-config.ts:166 with detectCmd: 'agy'), passes worker-start validation, 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 workspace and 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:226 and federation.ts:225 (worker receipt lastError), plus two automation surfaces nobody had checked (runtime-terminal-run-observer.ts:130, main-process-automations.ts:82) — and raw to CLI users via terminal-format.ts. Same defect class for codex-interactive-prompt, codex-update-prompt, codex-cwd-prompt. All now agent-neutral.

Also in this half: hooks need review now publishes agent-hooks-review-prompt (the last agent-agnostic codex-* emission), and a single describeTerminalWaitBlockedReason() 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 findAntigravityReadyPromptIndex requires the model line to literally start with gemini, so any non-Gemini session never registers as ready. Real agy transcripts have since been captured (six fixtures, live PTY, escapes intact, in #19983), and they show the gap is both wider and two-directional:

  • Every Antigravity session wedges, not just non-Gemini ones. The TUI paints a block-glyph logo down the left margin, and the identity, model and path rows are printed on the same physical lines as the logo. The derived line is ▀▀▀▀▀▀▀▀ 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.txt and antigravity-ready-account-info-hidden.txt, both of which the shipped detector refuses.
  • And it reads ready while a live dialog owns the screen. /model prints its options one per line, at line start, and those lines do begin with Gemini; 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 /model picker → true. The logo — decoration, and suppressible with AGY_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 headerIndex anchor entirely and decides on position instead: the caret row ends the tail, directly under the composer's rule. All four pinned KNOWN DEFECT cases in antigravity-readiness-transcripts.test.ts convert to real passing assertions there.

Verification (D1 and the rename work)

command result
pnpm test across affected suites 1446 passed | 1 skipped, 12 files
pnpm tc:node / tc:cli / tc:web clean (run one at a time)
oxlint, oxfmt --check clean
pnpm run check:code-quality:changed 0 new findings across 16 files

Mutation-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.

  1. 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.

  2. 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

  • Wire compatibility handled additively — per docs/reference/remote-wire-compatibility.md. RuntimeTerminalWaitBlockedReason is published by the host to independently-versioned clients, so nothing was renamed or removed: the four neutral spellings are purely additive union members, and the codex-* members are permanent, exactly like reserved opcode numbers. A legacy-alias module maps an older host's codex-* 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 against agent-approval-prompt, both on a locally-computed reason, never one off the wire).
  • User-visible string change. blockedReason now reads e.g. agent-trust-workspace instead of codex-trust-workspace in 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.
  • Deliberately still Codex-labelled: codex-model-migration-prompt and codex-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.
  • Known residual, pre-existing at HEAD and not a regression: a silent startup modal — one whose wording falls entirely outside the blocked-signal vocabulary — drawn over a complete ready chrome can still read as ready. Ordering cannot help, because there is no signal to order against. Documented rather than papered over.
  • Known residual: the worker-observation CLI printer interpolates wait.reason with no legacy alias, so an older host's codex-* token still reaches a non-Codex user on that one surface.
  • Process defect found and worth acting on separately: config/vitest.config.ts includes only *.test.ts, so pnpm test src/main/runtime/orca-runtime-tests/<x>.spec.ts silently runs nothing and still prints a green summary. Those fragments execute only through the orca-runtime.test.ts aggregator — 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:

  • Loop 1 confirmed D1 reaches both production paths and fixed a Codex-substring misattribution, but "fixed" D2's false-ready hole with a blacklist on the model line.
  • Loop 2 broke that blacklist in minutes: four realistic live dialogs (trust question, update banner, folder-on-own-line, permission request) all read ready: true, blocked: null where HEAD correctly read false — 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).
  • Loop 3 found loops 1 and 2 had only probed dialogs whose wording is in the blocked-signal vocabulary, so ordering had saved them. It probed the complement — five silent startup dialogs (update banner, sign-in, model picker, privacy notice, onboarding) that print a workspace path row — and all five read ready on loop 2's tree. Added a positive account-row requirement.
  • Loop 4 verified every prior claim by mutation rather than by reading, and found two pieces of work that were real but unproven: the entire terminal-format.ts alias 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: agentNeutralTerminalWaitBlockedReason resolved keys through Object.prototype, so an unvalidated wire value of constructor/toString returned a function instead of null.

Addresses the user report attached to not captured (Slack 1788893806.126719).

…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.
@coderabbitai

coderabbitai Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: dd055372-0ba7-416f-a606-ffc11a12195e

📥 Commits

Reviewing files that changed from the base of the PR and between adab622 and e99fc62.

📒 Files selected for processing (11)
  • src/cli/terminal-format.test.ts
  • src/cli/terminal-format.ts
  • src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts
  • src/main/runtime/rpc/methods/orchestration/federation/federation.ts
  • src/main/runtime/rpc/methods/orchestration/worker/composed-workers.test.ts
  • src/main/runtime/rpc/methods/orchestration/worker/local-worker-start.ts
  • src/main/runtime/terminal-wait-detection.test.ts
  • src/main/runtime/terminal-wait-detection.ts
  • src/shared/runtime-terminal-contracts.ts
  • src/shared/terminal-wait-blocked-reason-legacy-alias.test.ts
  • src/shared/terminal-wait-blocked-reason-legacy-alias.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The change adds agent-neutral terminal wait reasons while retaining legacy codex-* values for compatibility. Shared helpers map and format legacy reasons. Terminal wait detection emits neutral reasons and restores Antigravity readiness scanning. CLI, federation, and worker errors display compatible reason text. Tests cover detection, readiness, formatting, aliases, and updated runtime expectations.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to e99fc

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)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 46.15% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 18 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning 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 Fixes # l… Add the required template sections. Provide a linked issue using Fixes #<number>, add Visual Proof with attachments or exactly N/A plus a reason, and complete Review, Agent skill upstream boundary, Notes, and Checklist items. Retain the…
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely identifies the main change: replacing Codex-specific wait-blocked reason labels with agent-neutral labels.
Full details: Description check

Explanation

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 Fixes # linked issue, no Visual Proof section or N/A explanation, and omits the Review, Agent skill upstream boundary, Notes, and Checklist sections.

Resolution

Add the required template sections. Provide a linked issue using Fixes #&lt;number&gt;, add Visual Proof with attachments or exactly N/A plus a reason, and complete Review, Agent skill upstream boundary, Notes, and Checklist items. Retain the existing technical explanation and testing evidence.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 7a6fed56-7da7-4010-aa5b-5605c5bafd77

📥 Commits

Reviewing files that changed from the base of the PR and between b94bcdc and adab622.

📒 Files selected for processing (15)
  • src/cli/terminal-format.test.ts
  • src/cli/terminal-format.ts
  • src/main/runtime/antigravity-ready-prompt-index.ts
  • src/main/runtime/orca-runtime-tail-wait-memo.test.ts
  • src/main/runtime/orca-runtime-tests/agent-status-and-waits.spec.ts
  • src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts
  • src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts
  • src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts
  • src/main/runtime/terminal-interactive-wait-visibility.test.ts
  • src/main/runtime/terminal-tail-sentinel-index.test.ts
  • src/main/runtime/terminal-wait-detection.test.ts
  • src/main/runtime/terminal-wait-detection.ts
  • src/shared/runtime-terminal-contracts.ts
  • src/shared/terminal-wait-blocked-reason-legacy-alias.test.ts
  • src/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))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 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.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Agent-neutral blocked reasons — detectTerminalWaitBlockedReason now publishes agent-trust-workspace, agent-update-prompt, agent-cwd-prompt, and agent-interactive-prompt instead of the codex-* spellings, since the matchers never inspect the pane agent.
  • Non-Gemini Antigravity readiness — findAntigravityReadyPromptIndex was extracted to src/main/runtime/antigravity-ready-prompt-index.ts and rebuilt as a structural scan (header, caret, then Gemini model or plain row above a workspace path paired with an account row), removing the gemini-prefix requirement.
  • Wire-compatible reason surface — the codex-* members stay as additive union members, and a Map-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.ts cases 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 `@`?

Pullfrog  | View workflow run | Using 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.
@nwparker nwparker changed the title fix(runtime): agent-neutral wait-blocked reasons and non-Gemini Antigravity readiness fix(runtime): agent-neutral wait-blocked reasons Sep 11, 2026
@nwparker

Copy link
Copy Markdown
Contributor

Scope change: Antigravity readiness detector reverted

Following 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 antigravity-ready-prompt-index.ts is deleted. Title updated to match.

Why

Both builds were executed against constructed tails rather than reasoned about:

  • All five SILENT_STARTUP_DIALOGS fixtures flipped to ready=true under the proposed detector — and they flip with no account row at all, on nothing more than a narration line such as contact [email protected] for help. Merge-base returns ready=false for all of them. Readiness gates local-worker-start typing the task prompt into the pane, so this was a new false-ready against a live sign-in dialog.
  • With no account row and a non-Gemini model — a personal/API-key user, the reported case — the detector still returned ready=false. The detector did not reliably fix the wedge it was written to fix.

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 here

This repo derives cursor-agent rules from real captures (src/main/runtime/__fixtures__/cursor-agent-*.txt, raw PTY with escapes intact). Antigravity has no equivalent — only a hand-written 5-line fixture in a .spec.ts. All five attempts to date were tuned against that fixture. Ground truth is required before a sixth.

What a real capture needs

Raw PTY transcripts, escapes intact, saved alongside the cursor-agent fixtures:

  1. Ready screen, Business account, non-Gemini model — does the account row print at all?
  2. Ready screen, personal/API-key account, non-Gemini model — the decisive one. If there is no account row here, any rule requiring one can never fix the reported wedge.
  3. Each startup dialog live (sign-in, model picker, theme picker, privacy notice, update banner) — what the caret and chrome look like while a dialog owns the screen, which is what all five attempts guessed at.
  4. A dialog immediately after dismissal — settles whether the banner is reprinted, deciding headerIndex vs max(model, caret).

Also in this push

  • hooks need review now publishes agent-hooks-review-prompt, removing the last agent-agnostic codex-* emission.
  • Single describeTerminalWaitBlockedReason() formatter applied at all four render sites (both CLI sites plus the worker and federation Agent startup blocked: receipts).
  • Nine tests that passed with the fix reverted are now discriminating or explicitly labelled characterization.
  • Restored the deleted mixed-version compat note. The Rule 1 citation is correct as-is and was left alone — docs/reference/remote-wire-compatibility.md:179-180 names RuntimeTerminalWaitBlockedReason as an explicit Rule 1 exception.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 review matcher now publishes agent-hooks-review-prompt instead of codex-hooks-review-prompt (its wording is not Codex-specific, and a Claude Code fixture now exercises it), finishing the rename started in adab622.
  • Reverted the non-Gemini Antigravity readiness rewrite — antigravity-ready-prompt-index.ts is deleted and findAntigravityReadyPromptIndex is restored to the gemini-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 federation Agent startup blocked: receipts now alias a legacy token beside its neutral spelling, matching the CLI, instead of the CLI-only aliasing in adab622.

⚠️ 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.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Merged origin/main — commit 9957fcfa brought 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.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@nwparker
nwparker merged commit b3e0a33 into main Sep 11, 2026
33 checks passed
nwparker added a commit that referenced this pull request Sep 11, 2026
…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.
nwparker added a commit that referenced this pull request Sep 11, 2026
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.
nwparker added a commit that referenced this pull request Sep 11, 2026
… 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.
nwparker added a commit that referenced this pull request Sep 11, 2026
… 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.
nwparker added a commit that referenced this pull request Sep 11, 2026
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.
nwparker added a commit that referenced this pull request Sep 11, 2026
…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.
nwparker added a commit that referenced this pull request Sep 11, 2026
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.
nwparker added a commit that referenced this pull request Sep 11, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants