{"record":{"id":"e65084d93cb49caf","repo":"jackwener/OpenCLI","slug":"failed-to-send-qianwen-prompt-e65084","errorCode":null,"errorMessage":"Failed to send Qianwen prompt","messagePattern":"Failed to send Qianwen prompt","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/qwen/send.js","lineNumber":51,"sourceCode":"        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":33,"sourceCodeEnd":56,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/qwen/send.js#L33-L56","documentation":"clis/qwen/send.js calls sendMessage(page, prompt) after applying think/research toggles; if send?.ok is falsy it checks hasLoginGate (throwing an auth error if present), otherwise throws CommandExecutionError(send?.reason || 'Failed to send Qianwen prompt'). The text prompt was not delivered to the chat.","triggerScenarios":"The composer input or send button was not found (DOM change, page still loading); the session is logged out but the gate check misses it; DeepThink/DeepResearch toggle interaction left the composer disabled; send timed out silently giving no reason.","commonSituations":"Slow page load so sendMessage runs before the composer renders; expired login cookies; site update renaming the send button selector; toggling research mode on an account where the feature is unavailable.","solutions":["Confirm login state in the automation browser and retry (a visible login gate means re-authenticate)","Retry after a slightly longer initial wait so the composer is fully rendered","Disable --think/--research toggles to isolate whether a toggle breaks the send","If persistent, the sendMessage selectors likely need updating after a Qianwen UI change"],"exampleFix":"// before\nclis qwen send --prompt 'hi' --research true   # fails: feature/composer unavailable\n// after\nclis qwen send --prompt 'hi'   # send without toggles, add toggles back incrementally","handlingStrategy":"try-catch","validationCode":"null","typeGuard":"null","tryCatchPattern":"try {\n  await runQianwenSend({ prompt, think, research });\n} catch (e) {\n  if (/Failed to send Qianwen prompt/.test(e.message)) {\n    if (think || research) {\n      return runQianwenSend({ prompt });   // retry without feature toggles\n    }\n    await ensureLoggedIn(page);\n    await sleep(2000);\n    return runQianwenSend({ prompt });     // retry once\n  } else throw e;\n}","preventionTips":["Wait for the page/composer to fully render before sending","Keep an active qianwen.com login in the automation browser","Add --think/--research toggles incrementally to isolate breakage","Track Qianwen UI changes that affect the composer/send-button selectors"],"tags":["browser-automation","dom","send-failure"],"backgroundTag":"message-send-failed","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}