jackwener/OpenCLI · error · CommandExecutionError

COMMAND_EXEC

COMMAND_EXEC

Error message

${reason || 'Unknown Yuanbao send failure.'}${detail ? ` Detail: ${detail}` : ''}

What it means

Generic send-failure error: sendYuanbaoMessage reported !ok but no login gate was detected, so the CLI surfaces the send reason (or 'Unknown Yuanbao send failure.') plus optional detail as a COMMAND_EXEC error. It is the catch-all for non-auth send problems.

Source

Thrown at clis/yuanbao/ask.js:339

        if (!Number.isInteger(timeout) || timeout < 1) {
            throw new ArgumentError('--timeout must be a positive integer (seconds)');
        }
        const useSearch = normalizeBooleanFlag(kwargs.search, true);
        const useThink = normalizeBooleanFlag(kwargs.think, false);
        await ensureYuanbaoPage(page);
        if (await hasLoginGate(page)) {
            throw authRequired('Yuanbao opened a login gate before sending the prompt.');
        }
        await setYuanbaoInternetSearch(page, useSearch);
        await setYuanbaoDeepThink(page, useThink);
        const beforeAssistantMessages = await getYuanbaoAssistantMessages(page);
        const beforeLines = await getYuanbaoTranscriptLines(page);
        const sendResult = await sendYuanbaoMessage(page, prompt);
        if (!sendResult?.ok) {
            if (await hasLoginGate(page)) {
                throw authRequired('Yuanbao opened a login gate instead of accepting the prompt.');
            }
            throw sendFailure(sendResult?.reason, sendResult?.detail);
        }
        const response = await waitForYuanbaoResponse(page, beforeAssistantMessages.length, beforeLines, prompt, timeout);
        if (response === 'blocked') {
            throw authRequired('Yuanbao opened a login gate instead of returning a chat response.');
        }
        if (!response) {
            throw new TimeoutError('yuanbao ask', timeout, 'No Yuanbao response was observed before the timeout. Retry with --timeout, and verify the current browser session is still interactive.');
        }
        return [
            { Role: 'User', Text: prompt },
            { Role: 'Assistant', Text: response },
        ];
    },
});
export const __test__ = {
    collectYuanbaoTranscriptAdditions,
    convertYuanbaoHtmlToMarkdown,
    isOnYuanbao,

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Re-run the command — transient load timing is the most common cause
  2. Increase page settle/wait time so the composer is fully interactive before sending
  3. Update sendYuanbaoMessage selectors if the Yuanbao UI recently changed
  4. Capture a page screenshot/DOM dump on failure to identify the actual reason in detail

Example fix

// before: opaque generic failure
throw sendFailure(sendResult?.reason, sendResult?.detail);
// after: retry once before surfacing
if (!sendResult?.ok) {
  await page.wait(3);
  sendResult = await sendYuanbaoMessage(page, prompt);
  if (!sendResult?.ok) throw sendFailure(sendResult?.reason, sendResult?.detail);
}
Defensive patterns

Strategy: retry

Validate before calling

// ensure composer exists before sending
await page.waitForSelector(YUANBAO_INPUT_SELECTOR, { visible: true, timeout: 10000 });

Type guard

function hasSendDetail(r) {
  return r != null && typeof r === 'object' && ('reason' in r || 'detail' in r);
}

Try / catch

try {
  return await yuanbaoAsk(page, prompt, { timeout: 60 });
} catch (e) {
  if (e.code === 'COMMAND_EXEC' && /Yuanbao send failure/.test(e.message)) {
    await sleep(3000);
    return yuanbaoAsk(page, prompt, { timeout: 60 }); // one retry
  }
  throw e;
}

Prevention

When it happens

Trigger: sendYuanbaoMessage returns {ok:false, reason, detail} while hasLoginGate(page) is false — e.g. the input box was not found, the send button was disabled, or the DOM changed.

Common situations: Yuanbao frontend markup changed so selectors miss the composer; page still loading so the input wasn't interactive; rate limiting or CAPTCHA replacing the composer; network hiccup during send.

Related errors


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