jackwener/OpenCLI · error · EmptyResultError

qwen detail

Error message

qwen detail

What it means

The `qwen detail` command scrapes the visible message bubbles of a conversation. After polling until POLL_INTERVAL_S expires, if getMessageBubbles still returns an empty array it throws EmptyResultError('qwen detail', ...) at clis/qwen/detail.js:50, explaining that the conversation ID may be wrong or the conversation belongs to another device's b-user-id.

Source

Thrown at clis/qwen/detail.js:50

        await page.wait(2);
        await dismissLoginModal(page);

        // Poll for the conversation transcript to load. Qianwen renders the chat
        // page shell before fetching message history, so a fixed wait can race the
        // initial empty render. Cap at ~20s to surface real "no data" cases without
        // hanging on broken IDs.
        let bubbles = [];
        const POLL_DEADLINE_MS = 20_000;
        const POLL_INTERVAL_S = 1;
        const startedAt = Date.now();
        while (Date.now() - startedAt < POLL_DEADLINE_MS) {
            bubbles = await getMessageBubbles(page);
            if (bubbles.length > 0) break;
            await page.wait(POLL_INTERVAL_S);
        }

        if (!bubbles.length) {
            throw new EmptyResultError(
                'qwen detail',
                `No visible messages found for conversation ${sessionId}. Verify the ID is correct and that the session belongs to the current device's b-user-id (or that you are logged in for cross-device sync).`,
            );
        }
        return bubbles.map((b) => ({
            Role: b.role,
            Text: wantMarkdown && b.role === 'Assistant' && b.html
                ? (bubbleHtmlToMarkdown(b.html) || b.text)
                : b.text,
        }));
    },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Verify the sessionId is correct (copy the full conversation ID/URL from qianwen.com).
  2. Log in on the same account/device whose b-user-id owns the conversation, or ensure cross-device sync is enabled.
  3. Run `qwen history` to list valid conversation IDs and pick one from there.
  4. If IDs are valid but it still fails, update the CLI (DOM selector may be stale) and retry.

Example fix

// before
qwen detail <wrong-id>
// after
qwen history            # get a valid Index/Url
qwen detail <id-from-history>
Defensive patterns

Strategy: validation

Validate before calling

// verify the conversation exists before calling detail
const hist = await qwenHistory({ limit: 20 });
if (!hist.some(c => c.id === sessionId)) {
  throw new Error(`Conversation ${sessionId} not in history; pick a valid id via qwen history`);
}

Type guard

function isValidSessionId(id) {
  return typeof id === 'string' && id.trim().length > 0 && /^[-\w]+$/.test(id.trim());
}

Try / catch

try {
  const msgs = await qwenDetail(sessionId);
} catch (e) {
  if (e.code === 'qwen detail' || /No visible messages/.test(e.message)) {
    // fall back to listing history and re-prompt for a valid id
    const hist = await qwenHistory({ limit: 20 });
  } else throw e;
}

Prevention

When it happens

Trigger: getMessageBubbles(page) yields zero bubbles after the full poll window for the given sessionId: nonexistent/deleted conversation ID, conversation owned by a different device's b-user-id without cross-device sync/login, or Qwen DOM change that breaks the bubble selector.

Common situations: Typo or truncated conversation ID; sharing a conversation link from another account/device; not logged in so sync doesn't show the conversation; Qwen frontend redesign changing message bubble markup.

Related errors


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