Hmbown/CodeWhale · error · anyhow::Error

turn canceled

Error message

turn canceled

What it means

Sentinel default for a turn that terminated with TurnTerminalStatus::Canceled and no error detail from the runtime. The turn was explicitly canceled (as opposed to failing), and the empty error field means the cancellation reason must come from the caller or logs.

Source

Thrown at crates/app-server/src/lib.rs:1252

                "thread": Value::Null,
                "threads": [],
                "model": Value::Null,
                "model_provider": Value::Null,
                "cwd": Value::Null,
                "approval_policy": Value::Null,
                "sandbox": Value::Null,
                "events": [],
                "data": { "turn_id": turn_id },
            })),
            TurnTerminalStatus::Failed => Err(anyhow!(
                "{}",
                error.unwrap_or_else(|| "turn failed".to_string())
            )),
            TurnTerminalStatus::Interrupted => Err(anyhow!(
                "{}",
                error.unwrap_or_else(|| "turn interrupted".to_string())
            )),
            TurnTerminalStatus::Canceled => Err(anyhow!(
                "{}",
                error.unwrap_or_else(|| "turn canceled".to_string())
            )),
        }
    }

    async fn stream_turn_events<W: AsyncWrite + Unpin>(
        &self,
        thread_id: &str,
        turn_id: &str,
        response_id: &str,
        writer: &mut W,
        since_seq: u64,
    ) -> Result<(u64, TurnTerminalStatus, Option<String>)> {
        let mut response = self
            .authed(self.client.get(format!(
                "{}/v1/threads/{thread_id}/events?since_seq={since_seq}",
                self.base_url

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Confirm whether you or a client intentionally canceled the turn; if so this is expected
  2. If unintended, find which component sent the cancel and stop it
  3. Re-issue the turn once the cancellation source is resolved
  4. Check runtime logs for the cancellation origin
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at crates/app-server/src/lib.rs:1252 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Hmbown/CodeWhale@0c42157ee5 (2026-08-20). Data as JSON: /api/errors/a7012688b03b8cbc. Report an issue: GitHub.