{"record":{"id":"a085a03b47b1eced","repo":"jackwener/OpenCLI","slug":"xianyu-reply-did-not-observe-the-sent-message-s","errorCode":null,"errorMessage":"Xianyu reply did not observe the sent message: ${sent?.reason || 'unknown-reason'}","messagePattern":"Xianyu reply did not observe the sent message: (.+?)","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/xianyu/reply.js","lineNumber":61,"sourceCode":"            if (!page.getCurrentUrl || !/https:\\/\\/www\\.goofish\\.com\\/im\\b/.test(await page.getCurrentUrl())) {\n                await page.goto('https://www.goofish.com/im');\n            }\n        }\n        await page.wait(2);\n        if (rank > 0) {\n            requireClickResult(await page.evaluate(buildClickInboxConversationEvaluate(rank - 1)), 'reply rank click');\n            await page.wait(2);\n        }\n        const state = requireEvaluateObject(await page.evaluate(buildExtractChatStateEvaluate()), 'reply');\n        if (state?.requiresAuth) {\n            throw new AuthRequiredError('www.goofish.com', 'Xianyu reply requires a logged-in browser session');\n        }\n        if (!state?.can_input) {\n            throw selectorError('闲鱼聊天输入框', '未找到可用的聊天输入框，请确认该会话页已正确加载');\n        }\n        const sent = requireEvaluateObject(await page.evaluate(buildSendMessageEvaluate(text)), 'reply send');\n        if (!sent?.ok) {\n            throw new CommandExecutionError(`Xianyu reply did not observe the sent message: ${sent?.reason || 'unknown-reason'}`);\n        }\n        await page.wait(1);\n        return [{\n            status: 'sent',\n            peer_name: state.peer_name || '',\n            item_title: state.item_title || '',\n            price: state.price || '',\n            location: state.location || '',\n            message: text,\n            peer_user_id: userId,\n            item_id: itemId,\n            url: url || '',\n            item_url: state.item_url || '',\n        }];\n    },\n});\n\nexport const __test__ = {","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/xianyu/reply.js#L43-L79","documentation":"Reply sent the message via buildSendMessageEvaluate(text), but the injected script returned ok:false, meaning it could not verify the outgoing message appeared in the chat. The message may have partially sent or the DOM verification failed. Thrown as CommandExecutionError with the script's reason at clis/xianyu/reply.js:60-62.","triggerScenarios":"`xianyu reply` where the send evaluate returns {ok:false, reason}: input box filled but send click failed, message blocked/filtered by goofish, chat DOM re-rendered mid-send, or the sent-bubble selector changed so verification never matched.","commonSituations":"Goofish anti-spam silently dropping messages with links or banned keywords; network flakiness during send; front-end update changing the message-list DOM that the verifier checks; conversation window closed by the peer session refreshing.","solutions":["Read `reason` from the message; if it indicates send-click failure, retry the command — sends are frequently transient failures.","Simplify the message text (remove links/sensitive keywords that goofish may filter).","Verify manually at www.goofish.com/im whether the message actually landed before re-sending, to avoid duplicates.","If the DOM changed, update buildSendMessageEvaluate's send/verification selectors."],"exampleFix":"// before: single attempt\nconst sent = await page.evaluate(buildSendMessageEvaluate(text));\n// after: retry once on verification failure\nlet sent = await page.evaluate(buildSendMessageEvaluate(text));\nif (!sent?.ok) { await page.wait(2); sent = await page.evaluate(buildSendMessageEvaluate(text)); }","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  return await reply(kwargs);\n} catch (e) {\n  if (String(e.message).includes('did not observe the sent message')) {\n    // check the conversation manually before resending to avoid duplicates\n    const delivered = await checkLastMessage(kwargs);\n    if (!delivered) return reply(kwargs); // single retry for transient send failures\n  }\n  throw e;\n}","preventionTips":["Avoid links/spam-triggering keywords that goofish may silently filter.","Check goofish.com/im manually before re-sending to prevent duplicate messages.","Retry once on failure — many send-verification failures are transient.","Keep send/verification selectors current after goofish front-end changes."],"tags":["message-send","dom-verification","browser-automation","xianyu"],"backgroundTag":"message-send-unverified","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}