BigPizzaV3/CodexPlusPlus · error
发送微信回复失败:HTTP
Error message
发送微信回复失败:HTTP {http_status} What it means
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.
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.
Example fix
// before: fire-and-forget send
connector.send_text(text).await?;
// after: handle transient failures with backoff
match connector.send_text(text).await {
Err(e) if e.to_string().contains("HTTP 429") => {
tokio::time::sleep(Duration::from_secs(5)).await;
connector.send_text(text).await?;
}
other => other?,
} Defensive patterns
Strategy: retry
Try / catch
// Rust
match connector.send_text(text).await {
Err(e) if e.to_string().contains("HTTP 5") || e.to_string().contains("HTTP 429") => {
// exponential backoff retry up to N times
}
Err(e) => return Err(e),
Ok(v) => Ok(v),
} Prevention
- 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
When it happens
Trigger: 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).
Common situations: 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.
Understand the failure class
Background: "API error: {status}" and "HTTP 401/403/404/429/5xx" errors: non-2xx HTTP responses explained — this error's family across 27 libraries.
Related errors
AI-assisted analysis of BigPizzaV3/CodexPlusPlus@b1ed92e5e4 (2026-09-19).
Data as JSON: /api/errors/e6d65bdd80768aa6.
Report an issue: GitHub.
Appendix: source
Thrown at crates/codex-plus-core/src/connect/weixin.rs:298
"text_item": { "text": text }
}],
"context_token": context_token
},
"base_info": { "channel_version": CHANNEL_VERSION }
});
let response = self
.client
.post(self.endpoint("ilink/bot/sendmessage")?)
.headers(self.auth_headers()?)
.json(&request_body)
.timeout(Duration::from_secs(15))
.send()
.await
.context("发送微信回复失败")?;
let (http_status, bytes) =
read_response_limited(response, MAX_SMALL_RESPONSE_BYTES, "微信发送响应").await?;
if !http_status.is_success() {
bail!("发送微信回复失败:HTTP {http_status}");
}
if bytes.iter().all(u8::is_ascii_whitespace) {
return Ok(());
}
let result: WeixinSendResponse =
serde_json::from_slice(&bytes).context("微信发送响应格式无效")?;
if result.ret != 0 || result.errcode != 0 {
bail!(
"发送微信回复被拒绝:ret={} errcode={} {}",
result.ret,
result.errcode,
result.errmsg
);
}
Ok(())
}
fn endpoint(&self, path: &str) -> anyhow::Result<reqwest::Url> {View on GitHub (pinned to b1ed92e5e4)