{"record":{"id":"92e7fe8c8105069a","repo":"Hmbown/CodeWhale","slug":"persistent-service-id-exited-before-ownership-tr","errorCode":null,"errorMessage":"Persistent service {id} exited before ownership transfer (status {:?}, exit code {:?})","messagePattern":"Persistent service (.+?) exited before ownership transfer \\(status (.+?), exit code (.+?)\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/tools/shell.rs","lineNumber":3110,"sourceCode":"    /// enclosing turn has completed successfully.\n    #[cfg(unix)]\n    pub fn commit_persistent_services(&mut self) -> Result<Vec<PersistentServiceReceipt>> {\n        let mut ids = self\n            .processes\n            .iter()\n            .filter(|(_, shell)| shell.ownership == ShellOwnership::PersistPending)\n            .map(|(id, _)| id.clone())\n            .collect::<Vec<_>>();\n        ids.sort();\n\n        for id in &ids {\n            let shell = self\n                .processes\n                .get_mut(id)\n                .ok_or_else(|| anyhow!(\"Persistent service {id} disappeared before commit\"))?;\n            shell.poll();\n            if shell.status != ShellStatus::Running {\n                return Err(anyhow!(\n                    \"Persistent service {id} exited before ownership transfer (status {:?}, exit code {:?})\",\n                    shell.status,\n                    shell.exit_code\n                ));\n            }\n            if shell\n                .child\n                .as_ref()\n                .and_then(ShellChild::process_id)\n                .is_none()\n            {\n                return Err(anyhow!(\n                    \"Persistent service {id} has no releasable process id\"\n                ));\n            }\n        }\n\n        let mut receipts = Vec::with_capacity(ids.len());","sourceCodeStart":3092,"sourceCodeEnd":3128,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/tools/shell.rs#L3092-L3128","documentation":"Ownership transfer precondition: a PersistPending service is no longer Running at commit time; the error reports the observed status and exit code so the operator knows the service died before it could be handed over.","triggerScenarios":"Thrown at crates/tui/src/tools/shell.rs:3110 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Accept that the service is gone; nothing is transferred for it.","Restart the service by other means if it was expected to survive — check its logs for why it exited before the turn completed."],"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"}