jackwener/OpenCLI · error · Error

Timeout waiting for Antigravity reply after ${timeout / 1000

Error message

Timeout waiting for Antigravity reply after ${timeout / 1000}s

What it means

waitForReply polls the Antigravity UI for a reply until the caller-supplied timeout elapses; if no reply is detected it throws with the timeout in seconds. The request was typed and Enter pressed, but the assistant response never appeared (or was never recognized) in time.

Source

Thrown at clis/antigravity/serve.js:338

                reconnectCount++;
                console.error(`[serve] CDP session loss detected (${msg}), attempting to reconnect (${reconnectCount}/2)...`);
                try {
                    page = await opts.reconnect();
                    // Reset stability tracking after reconnect
                    stableCount = 0;
                    lastText = beforeText;
                    continue;
                }
                catch (reconnectErr) {
                    console.error(`[serve] Reconnection failed: ${reconnectErr.message}`);
                    throw err; // Throw original error if reconnection itself fails
                }
            }
            throw err;
        }
        await sleep(pollInterval);
    }
    throw new Error(`Timeout waiting for Antigravity reply after ${timeout / 1000}s`);
}
// ─── Request Handlers ────────────────────────────────────────────────
async function handleMessages(body, page, opts = {}) {
    const { bridge, timeout, reconnect } = opts;
    // Extract the last user message
    const userMessages = body.messages.filter(m => m.role === 'user');
    if (userMessages.length === 0) {
        throw new Error('No user message found in request');
    }
    const lastUserMsg = userMessages[userMessages.length - 1];
    const userText = extractTextContent(lastUserMsg.content);
    if (!userText.trim()) {
        throw new Error('Empty user message');
    }
    // Optimization 1: New conversation if this is the first message in the session
    if (body.messages.length === 1) {
        console.error(`[serve] New session detected (1 message). Starting new conversation in UI.`);
        await startNewConversation(page);

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Increase the timeout option for long-running agent requests
  2. Verify the reply-detection selector still matches the current Antigravity DOM after updates
  3. Check the Antigravity window for UI errors (auth, quota, crashed conversation) and retry
  4. Confirm the message was actually submitted (input box emptied) before waiting
  5. Retry the request; transient slowness often resolves on a second attempt

Example fix

// before
await handleMessages(body, page, { timeout: 30000 });
// after
await handleMessages(body, page, { timeout: 120000 });
Defensive patterns

Strategy: retry

Validate before calling

if (timeout < 60000) console.warn('timeout below 60s may be too short for agent replies');
const editorGone = await page.evaluate(() =>
  document.querySelector('#antigravity.agentSidePanelInputBox [data-lexical-editor="true"]')?.textContent === '');
if (!editorGone) throw new Error('Message may not have been submitted');

Try / catch

try {
  const reply = await waitForReply(page, { timeout: 120000 });
} catch (err) {
  if (err.message.startsWith('Timeout waiting for Antigravity reply')) {
    // check Antigravity UI for errors, then retry with longer timeout
  } else throw err;
}

Prevention

When it happens

Trigger: waitForReply loops polling for the reply DOM/bridge signal; timeout expires and control reaches the final throw.

Common situations: timeout option set too low for a long agent response; Antigravity reply markup changed so the poller's detection selector never matches; Antigravity failed to respond (error shown in UI, rate limit, not signed in); the prompt never actually submitted (silent send failure); machine under heavy load slowing both reply and polling.

Understand the failure class

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/020dbc0b4ea37109. Report an issue: GitHub.