{"record":{"id":"dfb95f050ca9a1bd","repo":"jackwener/OpenCLI","slug":"app-qianwen-com-dfb95f","errorCode":null,"errorMessage":"请在浏览器里用千问 APP 扫码登录 qianwen.com 后再重试。","messagePattern":"请在浏览器里用千问 APP 扫码登录 qianwen\\.com 后再重试。","errorType":"exception","errorClass":"AuthRequiredError","httpStatus":null,"severity":"error","filePath":"clis/qwen/send.js","lineNumber":50,"sourceCode":"    func: async (page, kwargs) => {\n        const prompt = String(kwargs.prompt || '').trim();\n        if (!prompt) throw new ArgumentError('prompt is required');\n        const startFresh = normalizeBooleanFlag(kwargs.new, false);\n        const useThink = normalizeBooleanFlag(kwargs.think, false);\n        const useResearch = normalizeBooleanFlag(kwargs.research, false);\n\n        await ensureOnQianwen(page);\n        await dismissLoginModal(page);\n        if (startFresh) {\n            await startNewChat(page);\n            await dismissLoginModal(page);\n        }\n        if (useThink) await setFeatureToggle(page, 'think', true);\n        if (useResearch) await setFeatureToggle(page, 'research', true);\n\n        const send = await sendMessage(page, prompt);\n        if (!send?.ok) {\n            if (await hasLoginGate(page)) throw authRequired();\n            throw new CommandExecutionError(send?.reason || 'Failed to send Qianwen prompt');\n        }\n        return [{ Status: 'sent', Prompt: prompt }];\n    },\n});\n","sourceCodeStart":32,"sourceCodeEnd":56,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/qwen/send.js#L32-L56","documentation":"AuthRequiredError thrown by `qwen send` when the prompt cannot be delivered because a login gate is present on qianwen.com. `send` only dispatches the message, so this is the earliest and most direct auth failure path: sendMessage fails and hasLoginGate(page) confirms an unauthenticated session, producing the QR-scan instruction via authRequired().","triggerScenarios":"`qwen send` (with optional think/research toggles) calls sendMessage(page, prompt); send.ok is falsy and hasLoginGate(page) detects a login wall/modal, so authRequired() is thrown before any message is submitted.","commonSituations":"Running send in a fresh browser profile that never logged in; cookies expired since last use; qianwen.com showing its login modal on load for the region/IP; VPN or IP change invalidating the session.","solutions":["Scan the QR code with the Qianwen APP to log into qianwen.com in the automation browser, then rerun `qwen send`","Persist the browser user-data directory so login survives across commands (send->ask sequences share the session)","Check hasLoginGate selectors if you believe you are logged in — a UI change can cause false auth detection","Avoid switching IPs/VPNs between login and send, as Qianwen may invalidate the session"],"exampleFix":"// before\nawait qwenSend(prompt); // fails with AUTH_REQUIRED in fresh profile\n// after\nawait ensureQianwenSession(browser); // QR-login once with persisted profile\nawait qwenSend(prompt);","handlingStrategy":"validation","validationCode":"async function requireQianwenLogin(page) {\n  await ensureOnQianwen(page);\n  if (await hasLoginGate(page)) throw new Error('Login to qianwen.com (QR via APP) before sending');\n}\nawait requireQianwenLogin(page); // run before qwenSend","typeGuard":null,"tryCatchPattern":"try {\n  await qwenSend(prompt);\n} catch (e) {\n  if (isAuthError(e)) { await qrLoginThenPersistProfile(); return qwenSend(prompt); }\n  throw e;\n}","preventionTips":["Check for the login gate at script start, before composing/sending","Use one long-lived browser profile for the whole send->ask workflow","Keep IP/VPN stable between login and send","Update hasLoginGate selectors if false positives appear after qianwen.com changes"],"tags":["auth","login-required","qianwen"],"backgroundTag":"login-required","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}