BigPizzaV3/CodexPlusPlus · error · anyhow::Error
{error}
Error message
{error} What it means
While the turn was streaming, the app-server pushed a JSON-RPC notification with method error; run_turn extracts params.message or params.error and bails with that text, falling back to a generic unknown-error string when neither field is present. This is a mid-turn failure from the Codex side, surfaced to the caller as the turn error.
Source
Thrown at crates/codex-plus-core/src/connect/app_server.rs:192
usage = reported_usage;
}
match message.get("method").and_then(Value::as_str) {
Some("item/completed") => {
if let Some(text) = extract_completed_agent_text(&message) {
if !reply_parts.iter().any(|part| part == &text) {
reply_parts.push(text);
}
}
}
Some("turn/completed") => turn_completed = true,
Some("thread/status/changed") if thread_status_is_idle(&message) => {
turn_completed = true;
}
Some("error") => {
let error = deep_string(message.get("params"), &["message", "error"])
.unwrap_or_else(|| "Codex app-server 返回未知错误".to_string());
bail!("{error}");
}
_ => {}
}
}
Ok(AppServerTurnResult {
reply: reply_parts.join("\n\n"),
model,
usage,
})
}
pub async fn close(&mut self) {
self.running = false;
let _ = self.stdin.shutdown().await;
let _ = self.child.start_kill();
let _ = self.child.wait().await;
}
View on GitHub (pinned to f2074595a2)
Solutions
- Read the forwarded message, it is the server-side reason such as quota, auth, or provider error
- Re-authenticate with codex login when the text mentions auth or token
- Retry the turn after a short backoff for transient provider errors
- Check relay profile quota and model availability when using a relay
Defensive patterns
Strategy: retry
Try / catch
let reply = match server.run_turn(&thread_id, prompt).await {
Ok(r) => r,
Err(e) => {
log_error(&e);
tokio::time::sleep(Duration::from_secs(3)).await;
server.run_turn(&thread_id, prompt).await?
}
}; Prevention
- Monitor provider quota and relay limits before they hit mid-turn
- Keep codex auth fresh, re-login on any auth-worded error
- Cap retry count so a persistent server error surfaces to the user
When it happens
Trigger: run_turn receives an error notification before turn/completed: upstream model provider failure, rate limit, expired codex auth, or an app-server internal error.
Common situations: Quota exhausted mid-generation on the provider or relay; codex login token expired during a long turn; transient provider 5xx.
Related errors
- 等待 Codex 回复超时
- Codex turn/start 失败:{error}
- Codex turn/start 未返回 turn id
- No injectable Codex page target found
- Codex app-server {method} 请求超时
AI-assisted analysis of BigPizzaV3/CodexPlusPlus@f2074595a2 (2026-08-23).
Data as JSON: /api/errors/7c031741d7ab33c8.
Report an issue: GitHub.