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

  1. Read the forwarded message, it is the server-side reason such as quota, auth, or provider error
  2. Re-authenticate with codex login when the text mentions auth or token
  3. Retry the turn after a short backoff for transient provider errors
  4. 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

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


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@f2074595a2 (2026-08-23). Data as JSON: /api/errors/7c031741d7ab33c8. Report an issue: GitHub.