{"record":{"id":"da02a4900012423d","repo":"Hmbown/CodeWhale","slug":"thread-is-not-loaded","errorCode":null,"errorMessage":"Thread is not loaded","messagePattern":"Thread is not loaded","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/runtime_threads.rs","lineNumber":6188,"sourceCode":"                Some(user_item),\n                engine.clone(),\n                ClaimedTurnKind::Message,\n            )\n        };\n\n        acceptance_rx\n            .await\n            .map_err(|_| anyhow!(\"Turn lifecycle task ended before acknowledgement\"))?\n            .map_err(anyhow::Error::msg)\n        })\n        .await\n    }\n\n    pub async fn interrupt_turn(&self, thread_id: &str, turn_id: &str) -> Result<TurnRecord> {\n        {\n            let mut active = self.active.lock().await;\n            let Some(active_thread) = active.engines.get_mut(thread_id) else {\n                bail!(\"Thread is not loaded\");\n            };\n            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            active_turn.interrupt_requested = true;\n            if let Some(compaction_id) = active_turn.compaction_id.as_deref() {\n                active_thread.engine.cancel_compaction(compaction_id)?;\n            } else {\n                active_thread.engine.cancel();\n            }\n            touch_lru(&mut active.lru, thread_id);\n        }\n\n        self.emit_event(\n            thread_id,","sourceCodeStart":6170,"sourceCodeEnd":6206,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/runtime_threads.rs#L6170-L6206","documentation":"interrupt_turn looked the thread up in the active engines map and found no loaded engine. An engine that is not loaded has no running turn to interrupt, so the request is rejected before any turn-id matching.","triggerScenarios":"Thrown at crates/tui/src/runtime_threads.rs:6188 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the thread id","No interruption is needed if the thread is idle"],"exampleFix":null,"handlingStrategy":"type-guard","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-14T00:17:10.932Z"}