Skip to content

fix(antigravity): recognize non-Gemini tui-idle prompts - #21231

Merged
nwparker merged 4 commits into
stablyai:mainfrom
innocarpe:fix/antigravity-tui-idle-prompt
Sep 21, 2026
Merged

nwparker merged 4 commits into
stablyai:mainfrom
innocarpe:fix/antigravity-tui-idle-prompt

Conversation

@innocarpe

Copy link
Copy Markdown
Contributor

Summary

Allow Antigravity tui-idle readiness to resolve for non-Gemini models and logo-prefixed model rows.

  • Use the standalone composer caret after the Antigravity header as the model-independent ready signal.
  • Keep labeled dialog selections out of the ready matcher.
  • Update captured-transcript expectations and add coverage for a non-Gemini ready screen.

Fixes #21110

Validation

  • pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/terminal-wait-detection.test.ts src/main/runtime/antigravity-readiness-transcripts.test.ts
  • pnpm tc:node
  • targeted oxfmt and oxlint

@coderabbitai

coderabbitai Bot commented Sep 17, 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: aa671c5a-8059-41d4-81c0-7dcbef4f8f2e

📥 Commits

Reviewing files that changed from the base of the PR and between 360497d and 9a0ea2f.

📒 Files selected for processing (1)
  • src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-03.spec.ts

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


📝 Walkthrough

Walkthrough

The Antigravity readiness detector now recognizes a standalone > prompt for any model. It rejects that prompt when an active model picker follows the ready screen. Terminal fixtures label dialog selections to distinguish them from the readiness marker. Tests and transcripts now cover non-Gemini models, active pickers, and corrected readiness results. The evidence document reflects the shipped behavior.

Priority: ➖ Normal

Severity of issue fixed: Medium

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the main behavior change, implementation approach, linked issue, and validation commands. It omits most required template sections, including ELI5, Why, Visual Proof, Testing … Rewrite the description using the repository template. Add the missing required sections and complete the testing, visual-proof, cross-platform, review, checklist, and AI-disclosure information. Preserve the existing summary, linked issue, …
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: Antigravity now recognizes non-Gemini tui-idle prompts.
Linked Issues check ✅ Passed The changes satisfy the coding requirements in [#21110]. findAntigravityReadyPromptIndex accepts a standalone column-0 composer caret without a Gemini model requirement. This supports non-Gemini mod…
Out of Scope Changes check ✅ Passed The changes stay within [#21110]. They modify Antigravity readiness detection, related automated tests, runtime expectations, readiness fixtures, and supporting readiness evidence. No unrelated produc…
Full details: Description check

Explanation

The description explains the main behavior change, implementation approach, linked issue, and validation commands. It omits most required template sections, including ELI5, Why, Visual Proof, Testing checkboxes and platforms, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist.

Resolution

Rewrite the description using the repository template. Add the missing required sections and complete the testing, visual-proof, cross-platform, review, checklist, and AI-disclosure information. Preserve the existing summary, linked issue, and validation details.

  • Fix all pre-merge checks with AI

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: 8a51c5ee-8a56-4016-9c02-fd01b2fa9824

📥 Commits

Reviewing files that changed from the base of the PR and between 0d23ea6 and 649c89cff613adc0e67a9822a7af4d1c1814e37d.

📒 Files selected for processing (3)
  • src/main/runtime/antigravity-readiness-transcripts.test.ts
  • src/main/runtime/terminal-wait-detection.test.ts
  • src/main/runtime/terminal-wait-detection.ts

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

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

ℹ️ Minor suggestions only — the detector change fixes the reported wedge. A couple of stale pins and one coverage gap are worth a look.

Reviewed changes

  • Antigravity readiness is now model-independent — findAntigravityReadyPromptIndex drops the gemini-prefix requirement and resolves on any lone > after the last antigravity cli. This matches the repo's own "attempt six" recommendation in the evidence doc.
  • Transcript expectations flipped — the API-key and hidden-account ready captures and the dismissed-picker capture lose their knownDefect; the constructed non-Gemini test now asserts ready.
  • Dialog fixtures relabeled — terminal-wait-detection.test.ts startup dialogs now carry > Label selection rows, matching the captured trust/model-picker/palette dialogs.

I re-ran the two changed suites (62 passed, 10 skipped) and traced the derived wait text for the captured transcripts. The fix does what the issue asks, and no captured case regresses: command palette, mid-turn, and trust stay refused. Two follow-ups:

ℹ️ The model-picker pin now explains the wrong cause

The picker is still read as ready, which is correctly pinned, but the knownDefect string at antigravity-readiness-transcripts.test.ts:88 still says its Gemini rows satisfy "the model rule" — a rule this PR deletes. On the derived tail it is a retained composer caret, not a model row, that keeps the picker ready (I measured one lone > in the picker's wait text, resolving ready with no blocked reason). The file header at lines 9-10 is stale the same way: it claims "four cases are pinned" and that the detector "refuses the ready screen", but only two pins remain and the ready screens are now accepted. These strings are what the next maintainer reads to understand the residual defect.

Technical details
# Residual false-ready cause is now the retained caret

## Affected sites
- src/main/runtime/antigravity-readiness-transcripts.test.ts:9-10 — header says four pins / refuses ready screens
- src/main/runtime/antigravity-readiness-transcripts.test.ts:88 — knownDefect cites the removed model rule

## Required outcome
- Update the header count and wording, and describe the picker pin as "accepted via a retained composer caret from before the picker opened".

## Evidence
- Derived wait text for `antigravity-dialog-model-picker.txt` has exactly one lone `>` and `isKnownReadyPromptPreview` returns true with `detectTerminalWaitBlockedReason` null.
- `docs/reference/antigravity-readiness-evidence.md:93-96` already documents the stale-composer co-occurrence for this dialog.

ℹ️ Evidence doc still documents the retired model rule as shipped

docs/reference/antigravity-readiness-evidence.md:71 and its Attempt-1 table still state the detector requires normalized.startsWith('gemini', trimmedStart). That is no longer the shipped behavior, and the transcript suite imports this file as the checklist, so it is the place a future reader will look. Recording that attempt six shipped — and that the sign-in/theme/privacy/update dialogs remain uncaptured — keeps it authoritative.

Technical details
# Stale reference in the evidence doc

## Affected sites
- docs/reference/antigravity-readiness-evidence.md:71 — presents the gemini rule as current
- docs/reference/antigravity-readiness-evidence.md:236-263 — § "Can attempt six be written?" now reads as a proposal rather than shipped

## Required outcome
- Mark the retired rule and note attempt six as shipped, keeping the doc's own caveat that the uncaptured dialogs still need transcripts.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@innocarpe
innocarpe force-pushed the fix/antigravity-tui-idle-prompt branch from 649c89c to f335bad Compare September 18, 2026 01:25
@innocarpe

Copy link
Copy Markdown
Contributor Author

Sync update (f335bad4d)

Address review: reject the stale composer caret while Antigravity's model picker is active, update transcript expectations, and refresh the readiness evidence.

@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

  • Model picker now vetoes the stale caret — isKnownReadyPromptPreview refuses readiness when a Switch Model surface sits after the ready caret, and resumes once Exited /model command appears (terminal-wait-detection.ts:53-61, :173-179).
  • Picker transcript unpinned — antigravity-dialog-model-picker now asserts expectReady: false with no knownDefect, dropping the file header from four pins to one.
  • New discriminating test — a constructed stale-caret-plus-picker fixture that fails without the guard (terminal-wait-detection.test.ts:371-382).
  • Evidence doc retitled "Attempt six is shipped" — the retired model rule is marked as such and the picker veto recorded as shipped behavior.

I re-ran both changed suites (63 passed, 10 skipped) and pnpm tc:node (clean). The esc-dismissed capture's metadata confirms the exit marker is emitted on the only captured dismissal path, so the veto does not wedge a legitimate ready screen. Both prior review threads are addressed and resolved.

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

@nwparker

Copy link
Copy Markdown
Contributor

I tested the detector at f335bad4dd5af8020e865f7e427e4214166c7d4c against the raw antigravity-composer-multiline-unsent.txt recording from #20027 (41cad20), replayed through @xterm/headless at its recorded 120×40 size. The visible-screen matcher returns true despite an unsent draft:

────────────────────────────────────────
> abc
  >
────────────────────────────────────────
                         Gemini 3.7 Flash · low

Expected: false. Actual: true. The same visible-screen check is also unsafe on current main; this PR does not resolve that case. startTuiIdleVisibleReadProbe calls isKnownReadyPromptPreview on rendered rows, so this is a production input surface, not just a hypothetical string.

ELI5: The user has started writing a message but has not sent it. Orca sees the > on its next line and thinks the box is empty. Delivering a worker task there would mix the task into the user's draft.

Please include this captured draft in the regression set and distinguish an empty composer from a continuation row before treating this as ready for merge. The model-picker exception alone does not cover it. I am investigating the broader Antigravity migration and have preserved a regression for this visible-screen path locally. No successful end-to-end worker delivery is claimed by this check.

@nwparker

Copy link
Copy Markdown
Contributor

Fresh evidence from the installed agy (banner 1.2.7, --version reports 1.2.1): empty plan and accept-edits composers do not have a bare > row. They display:

> Plan mode: research & plan only (shift+tab to cycle)
> Accept-edits mode: file edits auto-approved (shift+tab to cycle)

I captured both, and a separate session where the exact plan hint was typed as an unsent draft. The placeholder and typed row have the same text and styling. Their footer differs: ? for shortcuts is present for the empty composer and absent for the draft; the captured working screen says esc to cancel instead.

Raw recordings, metadata, and passing replay tests are in draft #21613. That PR fixes only Orca's adopted-terminal visible-screen fallback. The regular output-stream path remains open, so it is not a replacement for the full readiness work here or a claim of successful worker delivery.

ELI5: both an empty input box and a half-written message can display the same sentence. Looking for that sentence—or only for >—cannot distinguish them.

An unsent composer can show `> draft` then an indented `>`. That continuation is not an empty input box, so tui-idle must stay false.
@innocarpe
innocarpe force-pushed the fix/antigravity-tui-idle-prompt branch from f335bad to 360497d Compare September 19, 2026 10:54
@innocarpe

Copy link
Copy Markdown
Contributor Author

Thanks for the 120x40 replay of the unsent composer.

The stream matcher no longer treats an indented wrap > under a > draft line as an empty box, so that screen is not ready. Regression: rejects a visible unsent draft whose wrap continuation is a bare caret.

Plan / accept-edits empty composers (placeholder text plus ? for shortcuts) stay with the visible-screen work in #21613. This PR still only covers the output-stream caret path, not a claim of end-to-end worker delivery.

@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

  • Wrap-continuation caret no longer reads ready — findAntigravityReadyPromptIndex now requires the lone > to sit at column 0 and vetoes it when the previous non-empty line is a longer > draft, so the continuation line of an unsent wrapped draft cannot satisfy tui-idle (terminal-wait-detection.ts:146-174).
  • Regression test added — a > abc / indented > screen asserts isKnownReadyPromptPreview is false (terminal-wait-detection.test.ts:411-423); it fails on the previous revision.

I re-ran both changed suites (64 passed, 10 skipped): the captured ready, dismissed and picker transcripts are unaffected, and the single remaining KNOWN DEFECT pin is unchanged.

ℹ️ Evidence doc does not record the caret-position refinement

The transcript suite treats docs/reference/antigravity-readiness-evidence.md as its checklist, but the shipped-rule summary there still describes the marker as a line whose entire trimmed content is > with no mention of the column-0 requirement or the wrapped-draft veto. The wrap-continuation case is a constructed fixture rather than a captured screen, and the "what is still unknown" list does not name it.

Technical details
# Evidence doc trails the new caret rule

## Affected sites
- docs/reference/antigravity-readiness-evidence.md:244-247 — describes the marker as a trimmed lone `>` with no column-0/draft condition
- docs/reference/antigravity-readiness-evidence.md:259-262 — "still unknown" list omits the wrapped-draft case

## Required outcome
- Note the column-0 requirement and the wrapped-draft veto, and flag the wrap case as constructed rather than captured.

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

@nwparker

Copy link
Copy Markdown
Contributor

Independent verification update:

  • Installed agy 1.2.7 responded with exact sentinel AGY_TUI_IDLE_LIVE_OK.
  • Focused readiness/transcript suites: 64 passed, 10 skipped.
  • pnpm tc:node passed.
  • Changed-code quality passed with 0 new findings across the 3 changed files.

Scoped verdict: Approve the model-independent POSIX/readiness matcher, with the issue’s Windows shell-process/agent-leaf problem remaining outside this PR. That Windows process-tree behavior needs a separate change and validation.

@nwparker

Copy link
Copy Markdown
Contributor

Verification update (2026-09-20):

  • Focused readiness/transcript tests: 64 passed, 10 skipped across 2 files.
  • pnpm tc:node: passed.
  • Changed-code quality gate: 0 new findings across 3 changed files.
  • The available PR check is Pullfrog success; a normal full CI run is not present in the current rollup.

Merge verdict: Approve the matcher change after normal full CI. The standalone composer-caret signal is model-independent and the captured transcript regressions pass. This verifies readiness detection only; authenticated generation, rendered Orca reconnect behavior, and Windows/WSL/SSH execution remain outside this PR.

@nwparker

Copy link
Copy Markdown
Contributor

Review update after inspecting the complete patch: the matcher now uses the captured bare composer caret, rejects an active Switch Model picker that would otherwise reuse the stale caret, and rejects wrapped unsent drafts. The transcript fixtures and ratchets align with those rules; I found no reintroduced model-picker or draft false positive.

Verification remains 64 readiness/transcript tests passed with 10 documented skips, pnpm tc:node passed, and changed-code quality reported 0 findings. Pullfrog is green. The repository's normal full CI has not run on this PR yet, so my merge verdict remains approve matcher scope after normal full CI. This does not claim Windows/WSL/SSH runtime coverage.

@nwparker

Copy link
Copy Markdown
Contributor

Fresh awin evidence complements this matcher: a real agy 1.2.7 TUI authenticated with the refreshed machine-level key, rendered Gemini API key, accepted a prompt, returned AGY_TUI_OK, and settled on a bare > composer caret. This is runtime evidence for the ready-screen shape; normal full CI is still the remaining PR gate.

@nwparker

Copy link
Copy Markdown
Contributor

I reran the repository PR Checks workflow; it is currently queued. The PR test LoC workflow is also being rerun. If GitHub keeps both behind fork-workflow approval, a maintainer approval is the only remaining CI unblock. Local tests, typecheck, quality, and real awin TUI verification are already recorded above.

@nwparker

Copy link
Copy Markdown
Contributor

Full CI rerun 35438649044 completed with one actionable regression:

  • Node 24 shard 8 failed src/main/runtime/orca-runtime.test.ts → rejects a later Antigravity header with a prompt but no model line.
  • The fixture appends a later Antigravity header followed by a bare > and still expects isTerminalRunningAgent() to be false; the new bare-caret matcher returns true.
  • The other test shards, packages, static analysis, and PR test-LoC checks passed. The typecheck job was canceled after the failing shard, so it is not an independent compiler failure.

This is a real stale characterization test/contract mismatch that must be resolved before merge. My verdict is now do not merge pending an explicit fixture/contract fix; the real awin TUI evidence supports the new bare-caret behavior, so the likely fix is to update the stale test to represent a non-ready later screen rather than revert the matcher.

@nwparker

Copy link
Copy Markdown
Contributor

I pushed commit 9a0ea2f8fe2 to the PR branch. It updates the stale runtime characterization test to match the new bare-caret contract (renames the case and expects true).

Local validation on the PR head: src/main/runtime/orca-runtime.test.ts — 1,287 passed, 1 skipped; git diff --check clean. The PR head is now 9a0ea2f8fe2 and fresh checks are starting. The matcher behavior itself is unchanged.

@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

  • Stale spec expectation aligned — the terminal-handles-and-agent-status-part-03 test that pinned rejection of a later Antigravity header with a prompt but no model line is renamed and now asserts recognition, matching the model-independent detector shipped in 424a9f6981. It remains discriminating: with the pre-PR detector the later header has no gemini line after it, so findAntigravityReadyPromptIndex would return null and the flipped assertion would fail.

I re-ran the target test (recognizes a later Antigravity header with a prompt but no model line) — it passes. This delta is a single test-expectation alignment with no production behavioral surface.

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

@nwparker

Copy link
Copy Markdown
Contributor

The corrective commit 9a0ea2f8fe2 is now fully verified. Fresh CI 35530753647 is green across static analysis, typecheck, all eight Node 24 shards, Linux/Windows packages, relay integration, and verify. Local focused runtime coverage is 1,287 passed / 1 skipped, and the real awin TUI evidence remains recorded above.

The stale characterization test now explicitly matches the shipped bare-caret contract. Merge verdict: approve matcher scope in stack order. Windows/WSL/SSH/remote supervised-worker behavior remains outside this PR.

@nwparker

Copy link
Copy Markdown
Contributor

Review-bot follow-up

The automated review reported description-template/docstring-coverage warnings, but no actionable code defect. The PR now has the requested ELI5, scope, platform limits, and verification evidence in the discussion. The changed functions are small predicate/scheduling paths covered by focused tests; adding boilerplate docstrings would not change behavior or improve the contract. CI, typecheck, static analysis, and the relevant runtime tests are green.

The remaining manual/remote scenarios are explicitly documented as out of scope for this PR.

@nwparker
nwparker merged commit 30f2bc6 into stablyai:main Sep 21, 2026
56 of 58 checks passed
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.

[Bug]: tui-idle never resolves for Antigravity CLI (agy) terminals, so orchestration worker-start cannot hand work to them

2 participants