fix(antigravity): do not treat a wrap continuation caret as ready

An unsent composer can show `> draft` then an indented `>`. That continuation is not an empty input box, so tui-idle must stay false.
This commit is contained in:
Wooseong Kim
2026-09-19 19:53:52 +09:00
parent d28774a54f
commit 360497d39d
2 changed files with 27 additions and 2 deletions
@@ -408,6 +408,20 @@ describe('Antigravity readiness does not absorb its own startup dialog', () => {
expect(isKnownReadyPromptPreview(waitText)).toBe(true)
})
it('rejects a visible unsent draft whose wrap continuation is a bare caret', () => {
const waitText = waitTextFor([
'Antigravity CLI 1.2.1',
'Gemini 3.7 Flash (Low)',
'────────────────────────────────────────',
'> abc',
' >',
'────────────────────────────────────────',
'Gemini 3.7 Flash · low'
])
expect(isKnownReadyPromptPreview(waitText)).toBe(false)
})
// Ratchet: these dialogs must remain unready because their selection row is not a bare caret.
const SILENT_STARTUP_DIALOGS: { name: string; lines: string[] }[] = [
{
+13 -2
View File
@@ -143,8 +143,9 @@ function findAntigravityReadyPromptIndex(normalized: string): number | null {
}
let lineStart = headerIndex
let promptIndex: number | null = null
let previousNonEmpty: { start: number; end: number } | null = null
// Why: logo glyphs can prefix any model, while the standalone composer caret is the stable ready marker across model choices.
// Why: a column-0 caret is ready; an indented `>` under `> draft` is a wrap, not an empty box.
for (let cursor = headerIndex; cursor <= normalized.length; cursor += 1) {
if (cursor < normalized.length && normalized.charCodeAt(cursor) !== 10) {
continue
@@ -158,9 +159,19 @@ function findAntigravityReadyPromptIndex(normalized: string): number | null {
trimmedEnd -= 1
}
if (lineStart > headerIndex && trimmedStart < trimmedEnd) {
if (trimmedEnd - trimmedStart === 1 && normalized.charCodeAt(trimmedStart) === 62) {
if (
trimmedEnd - trimmedStart === 1 &&
normalized.charCodeAt(trimmedStart) === 62 &&
trimmedStart === lineStart &&
!(
previousNonEmpty !== null &&
normalized.charCodeAt(previousNonEmpty.start) === 62 &&
previousNonEmpty.end - previousNonEmpty.start > 1
)
) {
promptIndex = trimmedStart
}
previousNonEmpty = { start: trimmedStart, end: trimmedEnd }
}
lineStart = cursor + 1
}