{"record":{"id":"dd92965079951d86","repo":"jackwener/OpenCLI","slug":"qwen-history","errorCode":"qwen history","errorMessage":"No Qianwen conversations found.","messagePattern":"No Qianwen conversations found\\.","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/qwen/history.js","lineNumber":52,"sourceCode":"        const limit = Number(kwargs.limit ?? 20);\n        if (!Number.isInteger(limit) || limit <= 0) {\n            throw new ArgumentError('limit must be a positive integer');\n        }\n        if (limit > 100) {\n            throw new ArgumentError('limit must be <= 100');\n        }\n        await ensureOnQianwen(page);\n        await dismissLoginModal(page);\n        await page.wait(1);\n        const result = await getSessionListFromApi(page, limit);\n        if (!result.ok) {\n            if (result.status === 401 || result.status === 403) throw authRequired();\n            if (!result.sessions.length) {\n                throw new CommandExecutionError(`Qianwen history API failed (status=${result.status}) ${result.error || ''}`.trim());\n            }\n        }\n        if (!result.sessions.length) {\n            throw new EmptyResultError('qwen history', 'No Qianwen conversations found.');\n        }\n        return result.sessions.slice(0, limit).map((s, i) => ({\n            Index: i + 1,\n            Title: s.title || '(untitled)',\n            Updated: formatDate(s.updated_at),\n            Url: `https://www.qianwen.com/chat/${s.id}`,\n        }));\n    },\n});\n","sourceCodeStart":34,"sourceCodeEnd":62,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/qwen/history.js#L34-L62","documentation":"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.","triggerScenarios":"result.sessions.length === 0 after a successful getSessionListFromApi call: the logged-in account genuinely has no conversations, or filters/limit=... yield none.","commonSituations":"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).","solutions":["Confirm the account actually has conversations by opening https://www.qianwen.com in the browser.","Re-login with the intended account (`qwen auth login`) if you may be on the wrong one.","If you expected history, create a conversation first, then rerun `qwen history`.","Handle the empty state in scripts: catch EmptyResultError / code 'qwen history' and proceed with an empty list."],"exampleFix":"// before\nqwen history  # EmptyResultError on fresh account\n// after\n// create a chat at qianwen.com, then\nqwen history","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"let sessions = [];\ntry {\n  sessions = await qwenHistory({ limit: 20 });\n} catch (e) {\n  if (e.code === 'qwen history' || /No Qianwen conversations found/.test(e.message)) {\n    sessions = []; // legitimate empty state — proceed with empty list\n  } else throw e;\n}","preventionTips":["Treat this as a normal empty state, not a failure, in automation.","Confirm which account is logged in before assuming data is lost.","On fresh accounts, create a conversation at qianwen.com before listing history.","Match on the code 'qwen history' rather than the message string when handling."],"tags":["empty-result","qwen","cli","no-data"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}