Skip to content

fix(runtime): accept the Antigravity 1.1.17 composer-banner ready prompt - #15852

Closed
yzxcj797 wants to merge 1 commit into
stablyai:mainfrom
yzxcj797:fix/antigravity-117-ready-prompt-15838
Closed

yzxcj797 wants to merge 1 commit into
stablyai:mainfrom
yzxcj797:fix/antigravity-117-ready-prompt-15838

Conversation

@yzxcj797

Copy link
Copy Markdown
Contributor

Summary

What

findAntigravityReadyPromptIndex now accepts the idle composer line in either shape: the older bare > line, or CLI 1.1.17's mode banner (> Accept-edits mode: file edits auto-approved (shift+tab to cycle)). The shortcuts-hint line (? for shortcuts) remains non-idle. The model-line requirement (a line beginning with Gemini after the header) is unchanged.

Why

#15838 — the matcher required a prompt line whose trimmed content was exactly > (trimmedEnd - trimmedStart === 1 && charCode === 62). Antigravity CLI 1.1.17 renders its idle composer as a mode banner instead of a bare >, so a signed-in, fully input-capable terminal never satisfied tui-idle: orca orchestration worker-start --agent antigravity timed out in agent_readiness after 60s, left the Dispatch unassigned (assignee_handle: null, capability_hash: null), and the residual terminal accepted and executed a task perfectly when driven manually — exactly the reporter's reproduction, twice.

The acceptance rule keeps the prompt shape anchored on the composer's leading > (not a substring match), and the one known non-idle >-adjacent line — the shortcuts question — is explicitly excluded, so an interactive question below the composer still refuses readiness.

Testing (orca-runtime.test.ts — 1185/1185, ~39s):

  • New fixture antigravityComposerBannerReadyScreen reproducing the reporter's exact 1.1.17 screen (header, account, Gemini 3.7 Flash (High), working directory, mode-banner composer, shortcuts hint), and a new tui-idle resolution test over it. Verified to fail on the pre-change matcher (times out) and pass with the fix.
  • All 1184 existing tests unchanged, including the older bare-> Antigravity fixture (antigravityReadyScreen) and the pre-model-ready screen, which pin the old shape and the not-yet-ready refusal.
  • pnpm run typecheck clean.

Fixes #15838

The Antigravity ready matcher required a prompt line whose trimmed
content was exactly '>' after the CLI header and Gemini model line.
CLI 1.1.17 renders its idle composer as a mode banner instead —
'> Accept-edits mode: file edits auto-approved (shift+tab to cycle)' —
so a signed-in, input-capable terminal never satisfied tui-idle:
orchestration worker-start timed out in agent_readiness after 60s and
left the Dispatch unassigned while the residual terminal worked
perfectly (stablyai#15838).

The prompt line now accepts any line whose first non-space character is
'>' (the composer prompt) except the shortcuts-hint question line, which
stays non-idle. The bare-'>' shape from older builds still matches.
@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Antigravity composer detection now accepts non-empty > lines that do not contain shortcut questions or mode-selection prompts. A helper classifies non-idle composer lines. Tests add an Antigravity 1.1.17 composer-banner fixture and verify that waitForTerminal resolves tui-idle with a running terminal.

Merge Risk: 🔵 Low · up to 890ac

The matcher now recognizes Antigravity 1.1.17’s composer banner while preserving the existing bare prompt behavior, which should restore readiness for affected terminals. The change is mergeable with owner awareness to add a negative regression test confirming that the shortcuts hint alone cannot signal an idle prompt.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the Antigravity 1.1.17 composer-banner readiness fix.
Description check ✅ Passed The description explains the problem, solution, linked issue, regression test, and typecheck results, but omits several template sections.
Linked Issues check ✅ Passed The changes address issue #15838 by recognizing the 1.1.17 banner, preserving bare prompts, excluding shortcut questions, and adding regression coverage.
Out of Scope Changes check ✅ Passed The changes are limited to Antigravity prompt detection and focused regression coverage, with no unrelated modifications identified.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (2 skipped: 2 too large.)

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

🧹 Nitpick comments (1)
src/main/runtime/orca-runtime.ts (1)

39980-39992: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove the redundant .includes check.

isAntigravityComposerNonIdleLine returns /\?\s*(for shortcuts|$)/.test(line) || line.includes('? for shortcuts'). The regex is unanchored, so if the literal substring ? for shortcuts appears anywhere in line, the regex alone already matches it at that position (via the for shortcuts alternative). The || line.includes(...) clause is unreachable given the regex.

Simplify to just the regex test.

♻️ Proposed simplification
 function isAntigravityComposerNonIdleLine(
   normalized: string,
   start: number,
   end: number
 ): boolean {
   const line = normalized.slice(start + 1, end)
-  return /\?\s*(for shortcuts|$)/.test(line) || line.includes('? for shortcuts')
+  return /\?\s*(for shortcuts|$)/.test(line)
 }

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d56047dd-d397-4394-b2c7-7a0c55448fb7

📥 Commits

Reviewing files that changed from the base of the PR and between a157f4c and 890acdf.

📒 Files selected for processing (2)
  • src/main/runtime/orca-runtime.test.ts
  • src/main/runtime/orca-runtime.ts

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

Comment on lines +16425 to +16466
it('resolves tui-idle from the Antigravity 1.1.17 composer-banner prompt (#15838)', async () => {
const runtime = new OrcaRuntimeService(store)
runtime.attachWindow(1)
runtime.setPtyController({
spawn: vi.fn().mockResolvedValue({ id: 'pty-agy117' }),
write: () => true,
kill: () => true,
getForegroundProcess: async () => null
})
const { handle } = await runtime.createTerminal(`path:${TEST_WORKTREE_PATH}`)
runtime.syncWindowGraph(1, {
tabs: [
{
tabId: 'tab-1',
worktreeId: TEST_WORKTREE_ID,
title: 'Terminal',
activeLeafId: 'pane:1',
layout: null
}
],
leaves: [
{
tabId: 'tab-1',
worktreeId: TEST_WORKTREE_ID,
leafId: 'pane:1',
paneRuntimeId: 1,
ptyId: 'pty-agy117',
paneTitle: null
}
]
})
runtime.onPtyData('pty-agy117', antigravityComposerBannerReadyScreen(), Date.now())
const [terminal] = (await runtime.listTerminals()).terminals

await expect(
runtime.waitForTerminal(terminal.handle, { condition: 'tui-idle', timeoutMs: 1_000 })
).resolves.toMatchObject({
handle: terminal.handle,
condition: 'tui-idle',
status: 'running'
})
})

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Add a negative regression case for the shortcuts hint.

This test includes both the new composer banner and ? for shortcuts. It can pass even if the matcher incorrectly treats ? for shortcuts as an idle prompt. Add a separate screen with only the shortcuts hint and assert that waitForTerminal does not resolve tui-idle.

@nwparker

Copy link
Copy Markdown
Contributor

Thanks @yzxcj797 for the detailed repro and fixture! This is already fixed on main by #21705 (eb92222). The Antigravity idle-composer check now accepts either a bare > or a > <name> mode: ... caret row such as > Accept-edits mode: file edits auto-approved (shift+tab to cycle), and still rejects other >-prefixed menu rows. Since #24348 that rule lives in agent-state-rules/antigravity.json and antigravity-text-composer.ts, and there's a captured accept-edits ready fixture covering it. If worker-start --agent antigravity still times out in agent_readiness on the latest build, please comment or reopen.

@nwparker nwparker closed this Oct 26, 2026
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]: Antigravity CLI 1.1.17 ready prompt no longer matches tui-idle, causing worker-start agent_readiness timeout

2 participants