{"record":{"id":"e6d65bdd80768aa6","repo":"BigPizzaV3/CodexPlusPlus","slug":"http-http-status-e6d65b","errorCode":null,"errorMessage":"发送微信回复失败：HTTP {http_status}","messagePattern":"发送微信回复失败：HTTP (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/connect/weixin.rs","lineNumber":298,"sourceCode":"                    \"text_item\": { \"text\": text }\n                }],\n                \"context_token\": context_token\n            },\n            \"base_info\": { \"channel_version\": CHANNEL_VERSION }\n        });\n        let response = self\n            .client\n            .post(self.endpoint(\"ilink/bot/sendmessage\")?)\n            .headers(self.auth_headers()?)\n            .json(&request_body)\n            .timeout(Duration::from_secs(15))\n            .send()\n            .await\n            .context(\"发送微信回复失败\")?;\n        let (http_status, bytes) =\n            read_response_limited(response, MAX_SMALL_RESPONSE_BYTES, \"微信发送响应\").await?;\n        if !http_status.is_success() {\n            bail!(\"发送微信回复失败：HTTP {http_status}\");\n        }\n        if bytes.iter().all(u8::is_ascii_whitespace) {\n            return Ok(());\n        }\n        let result: WeixinSendResponse =\n            serde_json::from_slice(&bytes).context(\"微信发送响应格式无效\")?;\n        if result.ret != 0 || result.errcode != 0 {\n            bail!(\n                \"发送微信回复被拒绝：ret={} errcode={} {}\",\n                result.ret,\n                result.errcode,\n                result.errmsg\n            );\n        }\n        Ok(())\n    }\n\n    fn endpoint(&self, path: &str) -> anyhow::Result<reqwest::Url> {","sourceCodeStart":280,"sourceCodeEnd":316,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6/crates/codex-plus-core/src/connect/weixin.rs#L280-L316","documentation":"send_text in the WeChat connector bails with this error when the WeChat HTTP endpoint responded with a non-2xx status code. The HTTP request itself completed and the body was read safely, but the server rejected the send. The status code (e.g. 401, 429, 500) is embedded in the message for diagnosis.","triggerScenarios":"send_text (via send_text_chunks) posts a reply to the WeChat API and read_response_limited returns an http_status where http_status.is_success() is false (any status outside 200-299).","commonSituations":"Expired or invalid WeChat access token (401/403), WeChat rate limiting (429), WeChat server-side errors (5xx), or a misconfigured relay/base URL pointing at a wrong endpoint.","solutions":["Read the HTTP status in the message: 401/4001x means refresh or fix the WeChat credentials/token; 429 means slow down retries; 5xx means retry later or check WeChat service status.","Verify the WeChat webhook/relay URL configured in the connect profile is correct and reachable.","Re-authenticate the WeChat connection (re-import QR/login) if the session token expired.","Check proxy/firewall settings if a proxy is returning 4xx/5xx instead of WeChat."],"exampleFix":"// before: fire-and-forget send\nconnector.send_text(text).await?;\n// after: handle transient failures with backoff\nmatch connector.send_text(text).await {\n    Err(e) if e.to_string().contains(\"HTTP 429\") => {\n        tokio::time::sleep(Duration::from_secs(5)).await;\n        connector.send_text(text).await?;\n    }\n    other => other?,\n}","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Rust\nmatch connector.send_text(text).await {\n    Err(e) if e.to_string().contains(\"HTTP 5\") || e.to_string().contains(\"HTTP 429\") => {\n        // exponential backoff retry up to N times\n    }\n    Err(e) => return Err(e),\n    Ok(v) => Ok(v),\n}","preventionTips":["Refresh WeChat tokens on a schedule before they expire","Implement exponential backoff for all WeChat sends","Alert on repeated 4xx statuses to catch credential/config drift early"],"tags":["network","http","weixin","api-error"],"backgroundTag":"http-error-response","analyzedSha":"b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6","analyzedAt":"2026-09-19T23:35:21.129Z","contentChangedAt":"2026-09-19T23:35:21.129Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}