{"record":{"id":"364a3f0f8ea5d1eb","repo":"Hmbown/CodeWhale","slug":"failed-to-steer-turn-error","errorCode":null,"errorMessage":"Failed to steer turn: {error}","messagePattern":"Failed to steer turn: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/runtime_threads.rs","lineNumber":6252,"sourceCode":"                let Some(active_turn) = active_thread.active_turn.as_mut() else {\n                    bail!(\"No active turn on thread {thread_id}\");\n                };\n                if active_turn.turn_id != turn_id {\n                    bail!(\"Turn {turn_id} is not active on thread {thread_id}\");\n                }\n                if active_turn.interrupt_requested {\n                    bail!(\"Turn {turn_id} is stopping and cannot be steered\");\n                }\n                active_thread.engine.clone()\n            };\n            touch_lru(&mut active.lru, thread_id);\n            engine\n        };\n\n        let permit = engine\n            .reserve_steer()\n            .await\n            .map_err(|error| anyhow!(\"Failed to steer turn: {error}\"))?;\n\n        let now = Utc::now();\n        let item = TurnItemRecord {\n            schema_version: CURRENT_RUNTIME_SCHEMA_VERSION,\n            id: format!(\"item_{}\", &Uuid::new_v4().to_string()[..8]),\n            turn_id: turn_id.to_string(),\n            kind: TurnItemKind::UserMessage,\n            status: TurnItemLifecycleStatus::Completed,\n            summary: summarize_text(&prompt, SUMMARY_LIMIT),\n            detail: Some(prompt.clone()),\n            metadata: None,\n            artifact_refs: Vec::new(),\n            started_at: Some(now),\n            ended_at: Some(now),\n        };\n        let receipt_rx = {\n            let mut active = self.active.lock().await;\n            let Some(active_thread) = active.engines.get(thread_id) else {","sourceCodeStart":6234,"sourceCodeEnd":6270,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/runtime_threads.rs#L6234-L6270","documentation":"Wrapper error from steer_turn: the inner {error} is one of the bail! guards on the active-thread state (no active turn on the thread, turn_id mismatch, or interrupt already requested) or a failure sending/applying the steer operation to the engine. The message itself only labels the operation; the cause string identifies which precondition failed.","triggerScenarios":"Thrown at crates/tui/src/runtime_threads.rs:6252 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the inner error: 'No active turn', 'not active on thread', or 'stopping and cannot be steered' each mean the steer raced with turn completion or interruption — wait for the turn to finish or restart it","Confirm the turn_id passed matches the turn currently running on that thread","If the engine op failed, check engine logs and retry the steer once the turn state is consistent"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}