jackwener/OpenCLI · error · CommandExecutionError

${label} click failed

Error message

${label} click failed

What it means

CommandExecutionError is thrown when the in-page script that clicks the last 'Good response'/'Bad response' button reports `ok: false` (or returns nothing usable after unwrapEvaluateResult). The fallback message `${label} click failed` is used when the page-side script did not supply a `reason`. This means the argument was valid but the DOM interaction failed — the button was not found or the click could not be performed.

Source

Thrown at clis/antigravity/audit-extras.js:85

// -------- react --------
cli({
    site: 'antigravity',
    name: 'react',
    access: 'write',
    description: 'Click "Good response" or "Bad response" on the LAST assistant message.',
    domain: '127.0.0.1',
    strategy: Strategy.UI,
    browser: true,
    args: [
        { name: 'kind', positional: true, required: true, help: 'good or bad' },
    ],
    columns: ['Status', 'Reaction'],
    func: async (page, kwargs) => {
        const kind = String(kwargs?.kind || '').trim().toLowerCase();
        if (kind !== 'good' && kind !== 'bad') throw new ArgumentError('kind', 'must be "good" or "bad"');
        const label = kind === 'good' ? 'Good response' : 'Bad response';
        const res = unwrapEvaluateResult(await page.evaluate(clickLastScript([`button[aria-label="${label}"]`])));
        if (!res?.ok) throw new CommandExecutionError(res?.reason || `${label} click failed`, '');
        return [{ Status: 'clicked', Reaction: kind }];
    },
});

// -------- copy-message --------
cli({
    site: 'antigravity',
    name: 'copy-message',
    access: 'write',
    description: 'Return the text of the last assistant message (best-effort: walks up from the last visible Copy button).',
    domain: '127.0.0.1',
    strategy: Strategy.UI,
    browser: true,
    args: [
        { name: 'click-button', type: 'boolean', default: false, help: 'Also click the in-UI Copy button' },
    ],
    columns: ['Field', 'Value'],
    func: async (page, kwargs) => {

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Ensure an assistant reply is visible in the Antigravity window before running the command.
  2. Re-run after the page fully loads, or add a wait before invoking the command.
  3. Inspect the current aria-label on the reaction buttons and update the selector if the UI changed.
  4. Check for iframe/embedded-document structures that page.evaluate cannot reach, and target the right frame.
  5. Retry once — transient re-renders can unmount the button between selector resolution and click.

Example fix

// before
await runCmd('antigravity react good');

// after
await page.wait(1.0); // let the assistant reply render
await runCmd('antigravity react good');
Defensive patterns

Strategy: retry

Validate before calling

// Best-effort pre-check: ensure a reaction button exists before invoking
const hasButton = await page.evaluate(
  "!!document.querySelector('button[aria-label=\"Good response\"], button[aria-label=\"Bad response\"]')"
);
if (!hasButton) throw new Error('No reaction buttons rendered — wait for the assistant reply.');

Type guard

function isClickOk(res) {
  return res != null && typeof res === 'object' && res.ok === true && typeof res.sel === 'string';
}

Try / catch

try {
  await runCmd('antigravity react good');
} catch (e) {
  if (e.code === 'EXEC' && /click failed/i.test(e.message)) {
    await sleep(1500);
    await runCmd('antigravity react good'); // one retry after re-render
  } else throw e;
}

Prevention

When it happens

Trigger: page.evaluate(clickLastScript(['button[aria-label="Good response"]'])) returns { ok: false } or null: no button with that exact aria-label exists, the button is disabled/hidden, the page is still loading, or the evaluate was interrupted by navigation.

Common situations: Antigravity UI updated and the aria-label changed; no assistant reply is on screen yet so no reaction buttons were rendered; the chat is inside an iframe the script cannot reach; slow network leaves the reply unrendered when the command runs.

Related errors


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