{"record":{"id":"7aebceaa43ad8d3b","repo":"jackwener/OpenCLI","slug":"failed-to-send-message-to-chatgpt-7aebce","errorCode":null,"errorMessage":"Failed to send message to ChatGPT","messagePattern":"Failed to send message to ChatGPT","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/chatgpt/send.js","lineNumber":64,"sourceCode":"            );\n        }\n\n        if (kwargs.conversation) {\n            await openChatGPTConversation(page, kwargs.conversation);\n        } else if (kwargs.project) {\n            await navigateToProject(page, kwargs.project);\n        } else if (normalizeBooleanFlag(kwargs.new)) {\n            await startNewChat(page);\n        } else {\n            await ensureOnChatGPT(page);\n        }\n        // startNewChat / ensureOnChatGPT now wait for the composer selector\n        // after navigating, so the previous standalone 2 s settle is redundant.\n        await ensureChatGPTComposer(page, 'ChatGPT send requires a logged-in ChatGPT session with a visible composer.');\n\n        const sent = await sendChatGPTMessage(page, prompt);\n        if (!sent) {\n            throw new CommandExecutionError('Failed to send message to ChatGPT', `Open ${CHATGPT_URL} and verify the composer is ready.`);\n        }\n        return [{ Status: 'Success', InjectedText: prompt }];\n    },\n});\n","sourceCodeStart":46,"sourceCodeEnd":69,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/chatgpt/send.js#L46-L69","documentation":"CommandExecutionError thrown by `chatgpt send` when `sendChatGPTMessage(page, prompt)` resolves falsy — the automation could not inject/submit the prompt into the composer even though the composer was present.","triggerScenarios":"After ensureChatGPTComposer succeeds, sendChatGPTMessage returns false/undefined: the send button click or Enter injection didn't register, or message injection failed silently.","commonSituations":"ChatGPT UI redesign moved the send button/composer internals; composer disabled mid-flight (rate limit or moderation); page lost focus; slow network delayed the submit; temporary ChatGPT service issue.","solutions":["Retry the command after confirming the composer is ready at chatgpt.com.","Open chatgpt.com in the browser and try sending manually to check for rate limits or moderation blocks.","Verify the page still has focus and no modal/dialog intercepted the click.","Update the CLI's send automation selectors if the ChatGPT DOM changed."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Confirm composer is interactive before sending\nconst composer = await page.$('[contenteditable=\"true\"], textarea[data-id=\"root\"]');\nif (!composer || !(await composer.isEnabled())) {\n  throw new Error('Composer not ready; wait for page load and login');\n}","typeGuard":"function sendSucceeded(s) { return s === true || (s !== null && typeof s === 'object' && Boolean(s.ok)); }","tryCatchPattern":"try {\n  await run(['chatgpt', 'send', prompt]);\n} catch (err) {\n  if (String(err.message).includes('Failed to send message to ChatGPT')) {\n    await new Promise(r => setTimeout(r, 5000));\n    await run(['chatgpt', 'send', prompt]); // one retry after composer settles\n  }\n}","preventionTips":["Wait for the composer selector to be visible and enabled before sending.","Retry with backoff — transient focus/rate-limit issues often resolve.","Check the browser session for moderation or rate-limit banners.","Keep send automation selectors current with the ChatGPT DOM."],"tags":["chatgpt","browser-automation","send-message","command-execution"],"backgroundTag":"automation-action-failed","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}