{"record":{"id":"beb378a84eb1872d","repo":"Hmbown/CodeWhale","slug":"exec-turn-ended-with-status-status","errorCode":null,"errorMessage":"exec turn ended with status {status}","messagePattern":"exec turn ended with status (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/lib.rs","lineNumber":12302,"sourceCode":"        // after all in-session retries are exhausted) from genuine task\n        // failures so supervisors and bench harnesses can tell them apart at\n        // the process level without parsing the stream. Genuine failures\n        // keep the historical `bail!` → exit 1 path.\n        let exit_code = exec_failure_exit_code(summary.error_category.as_deref());\n        if exit_code != 1 {\n            eprintln!(\"Error: exec turn failed: {error}\");\n            let _ = io::stdout().flush();\n            std::process::exit(exit_code);\n        }\n        bail!(\"exec turn failed: {error}\");\n    }\n\n    if matches!(\n        summary.status.as_deref(),\n        Some(\"failed\" | \"canceled\" | \"interrupted\")\n    ) {\n        let status = summary.status.as_deref().unwrap_or(\"unknown\");\n        bail!(\"exec turn ended with status {status}\");\n    }\n\n    Ok(())\n}\n\n#[cfg(test)]\nmod serve_bind_host_tests {\n    use super::*;\n\n    #[test]\n    fn http_defaults_to_loopback() {\n        assert_eq!(\n            resolve_serve_bind_host(false, None),\n            ServeBindHost {\n                host: \"127.0.0.1\".to_string(),\n                mobile_rebound_to_lan: false,\n            }\n        );","sourceCodeStart":12284,"sourceCodeEnd":12320,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/lib.rs#L12284-L12320","documentation":"`codewhale exec` reports that the turn ended with an explicit terminal status (e.g. cancelled or errored) rather than completing. The status string is included so harnesses can distinguish a finished run from one that stopped mid-flight.","triggerScenarios":"Thrown at crates/tui/src/lib.rs:12302 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect {status} to see why the turn stopped","Re-run the turn if the cause was transient"],"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"}