{"record":{"id":"a431db5cacdcabe8","repo":"jackwener/OpenCLI","slug":"qwen-detail","errorCode":null,"errorMessage":"qwen detail","messagePattern":"qwen detail","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"error","filePath":"clis/qwen/detail.js","lineNumber":50,"sourceCode":"        await page.wait(2);\n        await dismissLoginModal(page);\n\n        // Poll for the conversation transcript to load. Qianwen renders the chat\n        // page shell before fetching message history, so a fixed wait can race the\n        // initial empty render. Cap at ~20s to surface real \"no data\" cases without\n        // hanging on broken IDs.\n        let bubbles = [];\n        const POLL_DEADLINE_MS = 20_000;\n        const POLL_INTERVAL_S = 1;\n        const startedAt = Date.now();\n        while (Date.now() - startedAt < POLL_DEADLINE_MS) {\n            bubbles = await getMessageBubbles(page);\n            if (bubbles.length > 0) break;\n            await page.wait(POLL_INTERVAL_S);\n        }\n\n        if (!bubbles.length) {\n            throw new EmptyResultError(\n                'qwen detail',\n                `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).`,\n            );\n        }\n        return bubbles.map((b) => ({\n            Role: b.role,\n            Text: wantMarkdown && b.role === 'Assistant' && b.html\n                ? (bubbleHtmlToMarkdown(b.html) || b.text)\n                : b.text,\n        }));\n    },\n});\n","sourceCodeStart":32,"sourceCodeEnd":63,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/qwen/detail.js#L32-L63","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify the sessionId is correct (copy the full conversation ID/URL from qianwen.com).","Log in on the same account/device whose b-user-id owns the conversation, or ensure cross-device sync is enabled.","Run `qwen history` to list valid conversation IDs and pick one from there.","If IDs are valid but it still fails, update the CLI (DOM selector may be stale) and retry."],"exampleFix":"// before\nqwen detail <wrong-id>\n// after\nqwen history            # get a valid Index/Url\nqwen detail <id-from-history>","handlingStrategy":"validation","validationCode":"// verify the conversation exists before calling detail\nconst hist = await qwenHistory({ limit: 20 });\nif (!hist.some(c => c.id === sessionId)) {\n  throw new Error(`Conversation ${sessionId} not in history; pick a valid id via qwen history`);\n}","typeGuard":"function isValidSessionId(id) {\n  return typeof id === 'string' && id.trim().length > 0 && /^[-\\w]+$/.test(id.trim());\n}","tryCatchPattern":"try {\n  const msgs = await qwenDetail(sessionId);\n} catch (e) {\n  if (e.code === 'qwen detail' || /No visible messages/.test(e.message)) {\n    // fall back to listing history and re-prompt for a valid id\n    const hist = await qwenHistory({ limit: 20 });\n  } else throw e;\n}","preventionTips":["Copy conversation IDs directly from `qwen history` output rather than typing them.","Ensure you're logged in on the account/device that owns the conversation (b-user-id match).","Check cross-device sync is on if accessing conversations from another device.","Update the CLI if Qwen's DOM changed and every valid ID returns empty."],"tags":["scraping","empty-result","qwen","dom"],"backgroundTag":"empty-scrape-result","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}