jackwener/OpenCLI · error · CommandExecutionError

Failed to send Yuanbao prompt

Error message

Failed to send Yuanbao prompt

What it means

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.

Source

Thrown at clis/yuanbao/send.js:48

        if (!prompt) throw new ArgumentError('prompt', 'is required');
        const startFresh = normalizeBooleanFlag(kwargs.new, false);

        await ensureYuanbaoPage(page);
        if (await hasLoginGate(page)) {
            throw authRequired('Yuanbao opened a login gate before sending the prompt.');
        }
        if (startFresh) {
            const action = await startNewYuanbaoChat(page);
            if (action === 'blocked') {
                throw authRequired('Yuanbao opened a login gate while starting a new chat.');
            }
        }
        const send = await sendYuanbaoMessage(page, prompt);
        if (!send?.ok) {
            if (await hasLoginGate(page)) {
                throw authRequired('Yuanbao opened a login gate instead of accepting the prompt.');
            }
            throw new CommandExecutionError(
                send?.reason || 'Failed to send Yuanbao prompt',
                send?.detail
                    ? `Detail: ${send.detail}`
                    : 'Make sure the Yuanbao chat composer is visible and not in a disabled state.',
            );
        }
        return [{ Status: 'sent', Prompt: prompt }];
    },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Re-run the command; transient composer/render races often succeed on retry
  2. Check for a login gate or modal overlay in the automation browser and dismiss/expand it
  3. Re-run with -v to see the `Detail:` line from the error for the concrete send reason
  4. Maximize/resize the browser context so the composer is visible and not in a disabled state
  5. Update the CLI if Yuanbao changed its chat UI markup
Defensive patterns

Strategy: retry

Validate before calling

// No reliable pre-check exposed; ensure composer is visible in the page
const composerVisible = await page.evaluate(`!!document.querySelector('[contenteditable], textarea') && !document.querySelector('[contenteditable], textarea').disabled`);

Try / catch

try {
  await cli.yuanbaoSend(prompt);
} catch (e) {
  if (e.name === 'CommandExecutionError' && /Failed to send Yuanbao prompt/.test(e.message)) {
    await sleep(2000);
    await cli.yuanbaoSend(prompt); // one retry
  } else throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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