{"record":{"id":"25bad5ef7f92577c","repo":"Hmbown/CodeWhale","slug":"fleet-executor-outcome-must-contain-a-terminal-worker-event","errorCode":null,"errorMessage":"Fleet executor outcome must contain a terminal worker event","messagePattern":"Fleet executor outcome must contain a terminal worker event","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/fleet/manager.rs","lineNumber":1699,"sourceCode":"            return Ok(false);\n        }\n\n        let FleetWorkerTerminalEvent {\n            payload,\n            exit_code,\n            tail_payloads,\n            reported_route,\n            final_answer,\n            saved_session_id,\n            requires_reported_route,\n        } = terminal;\n        let (receipt_result, failure_kind, exit_code) = task_receipt_outcome(&payload, exit_code);\n        let terminal_completed = matches!(&payload, FleetWorkerEventPayload::Completed { .. });\n        let expected_terminal_status = match &payload {\n            FleetWorkerEventPayload::Completed { .. } => FleetTaskLedgerStatus::Completed,\n            FleetWorkerEventPayload::Failed { .. } => FleetTaskLedgerStatus::Failed,\n            FleetWorkerEventPayload::Cancelled { .. } => FleetTaskLedgerStatus::Cancelled,\n            _ => bail!(\"Fleet executor outcome must contain a terminal worker event\"),\n        };\n        for tail_payload in tail_payloads {\n            if is_terminal_payload(&tail_payload) {\n                continue;\n            }\n            if self\n                .ledger\n                .append_event_if_leased(\n                    &task.entry.run_id,\n                    &task.worker_id,\n                    &task.entry.task_id,\n                    task.entry.attempts,\n                    &timestamp(),\n                    tail_payload,\n                )?\n                .is_none()\n            {\n                return Ok(false);","sourceCodeStart":1681,"sourceCodeEnd":1717,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/fleet/manager.rs#L1681-L1717","documentation":"Task receipt reconciliation guard: a worker reported a terminal event, but after task_receipt_outcome reconciliation no terminal worker event remains, so the executor outcome is internally inconsistent and is rejected rather than recorded as success or failure.","triggerScenarios":"Thrown at crates/tui/src/fleet/manager.rs:1699 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the worker process/journal for the missing terminal event (crash, kill, lost pipe) and reconcile the run status from what is found.","Restart or fail the worker explicitly so a terminal event is produced and recorded."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}