{"record":{"id":"ea3e6c8ee3aca6dd","repo":"Hmbown/CodeWhale","slug":"compaction-lifecycle-task-ended-before-acknowledge","errorCode":null,"errorMessage":"Compaction lifecycle task ended before acknowledgement","messagePattern":"Compaction lifecycle task ended before acknowledgement","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/runtime_threads.rs","lineNumber":6487,"sourceCode":"                current_thread.allow_shell,\n                current_thread.trust_mode,\n                policy.auto_approve(),\n                policy.permission,\n                configured_sandbox_mode,\n            );\n            let _sender = permit.send(op);\n            touch_lru(&mut active.lru, thread_id);\n            self.spawn_claimed_turn_monitor(\n                turn.clone(),\n                None,\n                engine.clone(),\n                ClaimedTurnKind::Compaction,\n            )\n        };\n\n        acceptance_rx\n            .await\n            .map_err(|_| anyhow!(\"Compaction lifecycle task ended before acknowledgement\"))?\n            .map_err(anyhow::Error::msg)\n    }\n\n    #[cfg(test)]\n    pub fn events_since(\n        &self,\n        thread_id: &str,\n        since_seq: Option<u64>,\n    ) -> Result<Vec<RuntimeEventRecord>> {\n        self.store.events_since(thread_id, since_seq)\n    }\n\n    pub(crate) async fn events_since_async(\n        &self,\n        thread_id: &str,\n        since_seq: Option<u64>,\n    ) -> Result<Vec<RuntimeEventRecord>> {\n        let store = self.store.clone();","sourceCodeStart":6469,"sourceCodeEnd":6505,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/runtime_threads.rs#L6469-L6505","documentation":"Sentinel from acceptance_rx.await.map_err in trigger_compaction: the spawned compaction lifecycle task (permit claim + Op::CompactContext send + spawn_claimed_turn_monitor) exited before writing its acknowledgement to the channel. Receiver-side failure means the producer task died — panic, abort, or shutdown — so the compaction was never dispatched to the engine.","triggerScenarios":"Thrown at crates/tui/src/runtime_threads.rs:6487 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Look for a panic or early return in the compaction dispatch closure in the logs","Confirm the engine op channel is open and the permit machinery is healthy","Re-trigger the compaction after the root cause is fixed; the unacknowledged turn should have been cleaned up"],"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-14T00:17:10.932Z"}