{"record":{"id":"72100043a481f5c4","repo":"jackwener/OpenCLI","slug":"could-not-find-antigravity-input-box","errorCode":null,"errorMessage":"Could not find Antigravity input box","messagePattern":"Could not find Antigravity input box","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"clis/antigravity/send.js","lineNumber":24,"sourceCode":"    description: 'Send a message to Antigravity AI via the internal Lexical editor',\n    domain: 'localhost',\n    strategy: Strategy.UI,\n    browser: true,\n    args: [\n        { name: 'message', help: 'The message text to send', required: true, positional: true }\n    ],\n    columns: ['Status', 'Message'],\n    func: async (page, kwargs) => {\n        const text = kwargs.message;\n        // We use evaluate to focus and insert text because Lexical editors maintain\n        // absolute control over their DOM and don't respond to raw node.textContent.\n        // document.execCommand simulates a native paste/typing action perfectly.\n        await page.evaluate(`\n      async () => {\n        const container = document.getElementById('antigravity.agentSidePanelInputBox');\n        if (!container) throw new Error('Could not find antigravity.agentSidePanelInputBox');\n        const editor = container.querySelector('[data-lexical-editor=\"true\"]');\n        if (!editor) throw new Error('Could not find Antigravity input box');\n        \n        editor.focus();\n        document.execCommand('insertText', false, ${JSON.stringify(text)});\n      }\n    `);\n        // Wait for the React/Lexical state to flush the new input\n        await page.wait(0.5);\n        // Press Enter to submit the message\n        await page.pressKey('Enter');\n        return [{ Status: 'Sent successfully', Message: text }];\n    },\n});\n","sourceCodeStart":6,"sourceCodeEnd":37,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/antigravity/send.js#L6-L37","documentation":"Thrown inside an in-page evaluate() when the DOM element with id 'antigravity.agentSidePanelInputBox' exists but contains no Lexical rich-text editor child ([data-lexical-editor=\"true\"]). The CLI types prompts into Antigravity's sidebar input via document.execCommand, which requires the actual Lexical editor node, not just its container.","triggerScenarios":"page.evaluate in clis/antigravity/send.js runs, the #antigravity.agentSidePanelInputBox container is present (so the first check passed) but querySelector('[data-lexical-editor=\"true\"]') returns null.","commonSituations":"Antigravity UI version changed the input implementation (no longer Lexical); the panel rendered but the editor is lazy-mounted and not yet initialized; the container exists as a hidden/skeleton placeholder during panel loading; the send was attempted immediately after opening the side panel before React finished mounting the editor.","solutions":["Add a wait/poll for the [data-lexical-editor=\"true\"] element before typing (e.g. waitForSelector('#antigravity.agentSidePanelInputBox [data-lexical-editor=\"true\"]'))","Retake or reopen the Antigravity side panel so the editor mounts, then retry","Update the selector to match the current Antigravity DOM if the editor no longer uses data-lexical-editor","Retry send with a short backoff to allow async editor initialization"],"exampleFix":"// before\nconst editor = container.querySelector('[data-lexical-editor=\"true\"]');\nif (!editor) throw new Error('Could not find Antigravity input box');\n// after\nconst editor = await page.waitForSelector('#antigravity.agentSidePanelInputBox [data-lexical-editor=\"true\"]', { timeout: 10000 });","handlingStrategy":"retry","validationCode":"const ok = await page.evaluate(() => !!document.querySelector('#antigravity.agentSidePanelInputBox [data-lexical-editor=\"true\"]'));\nif (!ok) throw new Error('Antigravity Lexical editor not mounted yet');","typeGuard":"function hasLexicalEditor(el) {\n  return el instanceof Element && el.querySelector('[data-lexical-editor=\"true\"]') !== null;\n}","tryCatchPattern":"try {\n  await sendPrompt(page, text);\n} catch (err) {\n  if (err.message.includes('Could not find Antigravity input box')) {\n    await sleep(1500);\n    await sendPrompt(page, text); // retry once after editor mounts\n  } else throw err;\n}","preventionTips":["Wait for the editor selector instead of querying immediately","Reopen/refresh the Antigravity panel before each send","Re-verify selectors after every Antigravity update","Add a bounded retry with backoff around UI typing"],"tags":["dom","selector","automation","antigravity"],"backgroundTag":"dom-element-not-found","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}