{"record":{"id":"dd000e96e6595963","repo":"Hmbown/CodeWhale","slug":"turn-interrupted","errorCode":null,"errorMessage":"turn interrupted","messagePattern":"turn interrupted","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/app-server/src/lib.rs","lineNumber":1888,"sourceCode":"        match status {\n            TurnTerminalStatus::Completed => Ok(json!({\n                \"thread_id\": thread_id,\n                \"status\": \"accepted\",\n                \"thread\": Value::Null,\n                \"threads\": [],\n                \"model\": Value::Null,\n                \"model_provider\": Value::Null,\n                \"cwd\": Value::Null,\n                \"approval_policy\": Value::Null,\n                \"sandbox\": Value::Null,\n                \"events\": [],\n                \"data\": { \"turn_id\": turn_id },\n            })),\n            TurnTerminalStatus::Failed => Err(anyhow!(\n                \"{}\",\n                error.unwrap_or_else(|| \"turn failed\".to_string())\n            )),\n            TurnTerminalStatus::Interrupted => Err(anyhow!(\n                \"{}\",\n                error.unwrap_or_else(|| \"turn interrupted\".to_string())\n            )),\n            TurnTerminalStatus::Canceled => Err(anyhow!(\n                \"{}\",\n                error.unwrap_or_else(|| \"turn canceled\".to_string())\n            )),\n        }\n    }\n\n    async fn stream_turn_events<W: AsyncWrite + Unpin>(\n        &self,\n        thread_id: &str,\n        turn_id: &str,\n        response_id: &str,\n        writer: &mut W,\n        since_seq: u64,\n        mut transcript: Option<&mut TurnTranscript>,","sourceCodeStart":1870,"sourceCodeEnd":1906,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/app-server/src/lib.rs#L1870-L1906","documentation":"Raised when a runtime API turn reaches `TurnTerminalStatus::Interrupted`. The handler converts the terminal event into an error, preferring the error message from the turn event and falling back to the literal \"turn interrupted\" string when none is provided. It signals the turn stopped mid-run due to an interruption rather than completing or failing outright.","triggerScenarios":"A turn ends with the Interrupted terminal status — e.g. an interrupt request was issued to the runtime while the turn was still executing.","commonSituations":"User or system issues a cancel/interrupt (Esc key, client shutdown, timeout watchdog) during a long-running turn; runtime-enforced limits cutting a turn short.","solutions":["Determine what issued the interrupt (user action, watchdog, runtime limit) from session logs.","If the interrupt was unintended, re-issue the turn without sending the interrupt signal.","If interrupts are expected, treat this status as a non-error outcome in the caller and branch on it rather than surfacing it as a failure.","Increase any client-side watchdog timeout if it is cutting long turns short."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match run_turn(...).await {\n    Err(e) if e.to_string().contains(\"turn interrupted\") => { /* treat as expected interrupt, not failure */ }\n    other => other?,\n}","preventionTips":["Avoid sending interrupts unintentionally (watchdogs, dropped futures)","Size watchdog timeouts above expected turn duration","Treat Interrupted as a distinct outcome in application logic"],"tags":["turn","interrupted","runtime-api"],"backgroundTag":"operation-interrupted","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}