{"record":{"id":"d3c8ec205e4ad8cd","repo":"jackwener/OpenCLI","slug":"failed-to-send-yuanbao-prompt","errorCode":null,"errorMessage":"Failed to send Yuanbao prompt","messagePattern":"Failed to send Yuanbao prompt","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/yuanbao/send.js","lineNumber":48,"sourceCode":"        if (!prompt) throw new ArgumentError('prompt', 'is required');\n        const startFresh = normalizeBooleanFlag(kwargs.new, false);\n\n        await ensureYuanbaoPage(page);\n        if (await hasLoginGate(page)) {\n            throw authRequired('Yuanbao opened a login gate before sending the prompt.');\n        }\n        if (startFresh) {\n            const action = await startNewYuanbaoChat(page);\n            if (action === 'blocked') {\n                throw authRequired('Yuanbao opened a login gate while starting a new chat.');\n            }\n        }\n        const send = await sendYuanbaoMessage(page, prompt);\n        if (!send?.ok) {\n            if (await hasLoginGate(page)) {\n                throw authRequired('Yuanbao opened a login gate instead of accepting the prompt.');\n            }\n            throw new CommandExecutionError(\n                send?.reason || 'Failed to send Yuanbao prompt',\n                send?.detail\n                    ? `Detail: ${send.detail}`\n                    : 'Make sure the Yuanbao chat composer is visible and not in a disabled state.',\n            );\n        }\n        return [{ Status: 'sent', Prompt: prompt }];\n    },\n});\n","sourceCodeStart":30,"sourceCodeEnd":58,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/yuanbao/send.js#L30-L58","documentation":"The prompt was accepted as input but sendYuanbaoMessage failed to actually deliver it to the chat composer. The library checks the login gate once more (throwing a clearer auth error if present) and otherwise raises CommandExecutionError with send.reason plus a hint that the composer must be visible and enabled.","triggerScenarios":"sendYuanbaoMessage returns {ok:false} — composer selector not found or disabled, page re-rendered mid-send, network/submit failure inside the evaluate, or an overlay covering the input box.","commonSituations":"Yuanbao A/B UI change breaking composer selectors; a modal (rate-limit notice, upgrade banner) disabling the input; browser window too small hiding the composer; transient network hiccup during submit.","solutions":["Re-run the command; transient composer/render races often succeed on retry","Check for a login gate or modal overlay in the automation browser and dismiss/expand it","Re-run with -v to see the `Detail:` line from the error for the concrete send reason","Maximize/resize the browser context so the composer is visible and not in a disabled state","Update the CLI if Yuanbao changed its chat UI markup"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// No reliable pre-check exposed; ensure composer is visible in the page\nconst composerVisible = await page.evaluate(`!!document.querySelector('[contenteditable], textarea') && !document.querySelector('[contenteditable], textarea').disabled`);","typeGuard":null,"tryCatchPattern":"try {\n  await cli.yuanbaoSend(prompt);\n} catch (e) {\n  if (e.name === 'CommandExecutionError' && /Failed to send Yuanbao prompt/.test(e.message)) {\n    await sleep(2000);\n    await cli.yuanbaoSend(prompt); // one retry\n  } else throw e;\n}","preventionTips":["Dismiss modal overlays (upgrade banners, rate-limit notices) before sending","Keep the browser viewport large enough that the composer stays visible","Retry once with a delay — many failures are transient render races","Run with -v to capture the send.reason/Detail for persistent failures","Update the CLI after Yuanbao UI changes"],"tags":["dom-scraping","command-execution","network"],"backgroundTag":"composer-send-failed","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}