jackwener/OpenCLI · warning · EmptyResultError

qwen history

qwen history

Error message

No Qianwen conversations found.

What it means

If the Qianwen history API call succeeds (ok, or non-401/403 with data check passed) but the returned session list is empty, the command throws EmptyResultError with code 'qwen history' and message 'No Qianwen conversations found.' (clis/qwen/history.js:52). This is a normal empty state, not a failure of the request itself.

Source

Thrown at clis/qwen/history.js:52

        const limit = Number(kwargs.limit ?? 20);
        if (!Number.isInteger(limit) || limit <= 0) {
            throw new ArgumentError('limit must be a positive integer');
        }
        if (limit > 100) {
            throw new ArgumentError('limit must be <= 100');
        }
        await ensureOnQianwen(page);
        await dismissLoginModal(page);
        await page.wait(1);
        const result = await getSessionListFromApi(page, limit);
        if (!result.ok) {
            if (result.status === 401 || result.status === 403) throw authRequired();
            if (!result.sessions.length) {
                throw new CommandExecutionError(`Qianwen history API failed (status=${result.status}) ${result.error || ''}`.trim());
            }
        }
        if (!result.sessions.length) {
            throw new EmptyResultError('qwen history', 'No Qianwen conversations found.');
        }
        return result.sessions.slice(0, limit).map((s, i) => ({
            Index: i + 1,
            Title: s.title || '(untitled)',
            Updated: formatDate(s.updated_at),
            Url: `https://www.qianwen.com/chat/${s.id}`,
        }));
    },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Confirm the account actually has conversations by opening https://www.qianwen.com in the browser.
  2. Re-login with the intended account (`qwen auth login`) if you may be on the wrong one.
  3. If you expected history, create a conversation first, then rerun `qwen history`.
  4. Handle the empty state in scripts: catch EmptyResultError / code 'qwen history' and proceed with an empty list.

Example fix

// before
qwen history  # EmptyResultError on fresh account
// after
// create a chat at qianwen.com, then
qwen history
Defensive patterns

Strategy: fallback

Try / catch

let sessions = [];
try {
  sessions = await qwenHistory({ limit: 20 });
} catch (e) {
  if (e.code === 'qwen history' || /No Qianwen conversations found/.test(e.message)) {
    sessions = []; // legitimate empty state — proceed with empty list
  } else throw e;
}

Prevention

When it happens

Trigger: result.sessions.length === 0 after a successful getSessionListFromApi call: the logged-in account genuinely has no conversations, or filters/limit=... yield none.

Common situations: Brand-new Qianwen account with no chats; logged into a different account than expected; conversations all deleted; region/account switch (qianwen.com vs chat.qwen.ai identities).

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


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