{"record":{"id":"c4c2220a79d5ac47","repo":"Hmbown/CodeWhale","slug":"steer-receipt-task-ended-before-acknowledgement","errorCode":null,"errorMessage":"Steer receipt task ended before acknowledgement","messagePattern":"Steer receipt task ended before acknowledgement","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/runtime_threads.rs","lineNumber":6319,"sourceCode":"                Err(error) => {\n                    let cleanup = self.store.remove_item(&item.id);\n                    return match cleanup {\n                        Ok(()) => Err(error),\n                        Err(cleanup_error) => Err(anyhow!(\n                            \"Failed to persist steer: {error}; cleanup also failed: {cleanup_error}\"\n                        )),\n                    };\n                }\n            };\n            // The reserved send has no await/failure point. From here the\n            // engine and durable record agree even if the API caller drops.\n            let _sender = permit.send(prompt.clone());\n            touch_lru(&mut active.lru, thread_id);\n            self.spawn_steer_receipts(turn, item, prompt)\n        };\n        receipt_rx\n            .await\n            .map_err(|_| anyhow!(\"Steer receipt task ended before acknowledgement\"))\n    }\n\n    pub async fn compact_thread(\n        &self,\n        thread_id: &str,\n        req: CompactThreadRequest,\n    ) -> Result<TurnRecord> {\n        let thread = self.get_thread(thread_id).await?;\n        let engine = self.ensure_engine_loaded(&thread).await?;\n\n        let client_preflight_required = {\n            let active = self.active.lock().await;\n            let Some(active_thread) = active.engines.get(thread_id) else {\n                bail!(\"Thread engine not loaded\");\n            };\n            if active_thread.active_turn.is_some() {\n                bail!(\"Thread already has an active turn\");\n            }","sourceCodeStart":6301,"sourceCodeEnd":6337,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/runtime_threads.rs#L6301-L6337","documentation":"Sentinel from the steer receipt path: the acknowledgement channel receiver failed because the spawned receipt task ended before sending its ack (task dropped, panicked, or sender dropped during shutdown). The comment above it notes the reserved send has no failure point, so this indicates the lifecycle task itself died rather than a steer delivery failure.","triggerScenarios":"Thrown at crates/tui/src/runtime_threads.rs:6319 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check logs for a panic in the steer receipt lifecycle task","Verify the engine and thread are still alive; a thread shutdown mid-steer produces this","The durable steer record may exist without acknowledgement — reconcile via the turn's steer_count before re-steering"],"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"}