{"record":{"id":"c76d6d47232e9898","repo":"Hmbown/CodeWhale","slug":"detail-c76d6d","errorCode":null,"errorMessage":"{}: {detail}","messagePattern":"\\{\\}: \\{detail\\}","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/lib.rs","lineNumber":2908,"sourceCode":"\n    fn print_inspection(inspection: &FleetWorkerInspection) {\n        println!(\"{}\", fleet_control::render_inspection(inspection));\n    }\n\n    fn print_artifacts(inspection: &FleetWorkerInspection) {\n        println!(\"{}\", fleet_control::render_artifacts(inspection));\n    }\n\n    /// Print one shared control receipt on the CLI surface.\n    fn emit_fleet_receipt(receipt: &codewhale_lane::ControlReceipt) -> Result<()> {\n        if receipt.is_error() {\n            eprintln!(\"{}\", receipt.render());\n            let detail = receipt\n                .failure\n                .as_ref()\n                .map(ToString::to_string)\n                .unwrap_or_else(|| receipt.outcome.as_str().to_string());\n            bail!(\"{}: {detail}\", receipt.operation_id);\n        }\n        println!(\"{}\", receipt.render());\n        Ok(())\n    }\n\n    fn print_logs(workspace: &Path, inspection: &FleetWorkerInspection) -> Result<()> {\n        let mut printed = false;\n        for artifact in inspection\n            .artifacts\n            .iter()\n            .filter(|artifact| matches!(artifact.kind, FleetArtifactKind::Log))\n        {\n            let path = workspace.join(&artifact.path);\n            println!(\"== {} ==\", artifact.path.display());\n            let contents = std::fs::read_to_string(&path)\n                .with_context(|| format!(\"reading fleet log {}\", path.display()))?;\n            let preview: String = contents.chars().take(16 * 1024).collect();\n            // Worker logs can contain captured terminal bytes (a child TUI's","sourceCodeStart":2890,"sourceCodeEnd":2926,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/lib.rs#L2890-L2926","documentation":"emit_fleet_receipt is the single exit point for fleet control operations on the CLI. When the shared ControlReceipt comes back marked error (is_error), the receipt is rendered to stderr and the command bails with '<operation_id>: <detail>', where detail is the receipt's failure text or its outcome string. A worker-side failure therefore becomes a non-zero CLI exit while preserving the operation id for correlation.","triggerScenarios":"Any fleet control operation whose receipt reports error: the fleet worker not running or unreachable in that workspace, the control payload rejected, or the operation failing on the remote side. The bail carries the operation_id and the receipt's failure/outcome detail.","commonSituations":"Remote control scripts hitting a stopped or crashed worker; fleet operations against stale workspaces; CI steps that issue control commands without first verifying worker health.","solutions":["Note the operation_id and the detail text; re-run the fleet inspection/logs step to see worker-side artifacts for that operation","Verify the fleet worker is running and reachable in the target workspace before issuing control","Fix the underlying failure named in the detail, then re-run the same control operation","Script defensively: check worker status first and treat this bail as an actionable failure, not a retryable transient"],"exampleFix":"# before\ncodewhale fleet <control-cmd>    # op-1234: worker unreachable\n\n# after\n# 1) inspect fleet artifacts/logs for op-1234\n# 2) start/repair the worker, then re-run the same control command","handlingStrategy":"try-catch","validationCode":"# Verify worker health before issuing control operations\ncodewhale fleet status >/dev/null 2>&1 || { echo 'fleet worker not healthy'; exit 2; }","typeGuard":null,"tryCatchPattern":"if ! out=$(codewhale fleet <control-cmd> 2>&1); then\n  op_id=$(printf '%s' \"$out\" | head -1 | cut -d: -f1)\n  echo \"control operation $op_id failed; inspect fleet logs/artifacts\" >&2\n  exit 1\nfi","preventionTips":["Check fleet worker status before each control batch","Correlate failures by the operation_id printed in the bail","Do not blind-retry; the receipt's failure detail names the cause"],"tags":["fleet","control-receipt","cli","operations"],"backgroundTag":"remote-command-failed","analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}