{"record":{"id":"825d7b1f78f6f318","repo":"Hmbown/CodeWhale","slug":"persistent-service-id-lost-its-process-id","errorCode":null,"errorMessage":"Persistent service {id} lost its process id","messagePattern":"Persistent service (.+?) lost its process id","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/tools/shell.rs","lineNumber":3138,"sourceCode":"                .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());\n        for id in ids {\n            let mut shell = self\n                .processes\n                .remove(&id)\n                .ok_or_else(|| anyhow!(\"Persistent service {id} disappeared during commit\"))?;\n            let pid = shell\n                .child\n                .as_ref()\n                .and_then(ShellChild::process_id)\n                .ok_or_else(|| anyhow!(\"Persistent service {id} lost its process id\"))?;\n            unregister_pending_persistent_process_group(pid);\n            shell.ownership = ShellOwnership::Released;\n            shell.stdin = None;\n            shell.heavy_permit.take();\n            shell.work_lifecycle = None;\n            receipts.push(PersistentServiceReceipt {\n                task_id: id,\n                pid,\n                process_group_id: pid,\n                ownership: \"external\".to_string(),\n            });\n        }\n        Ok(receipts)\n    }\n\n    /// Kill only services waiting for a successful exec ownership transfer.\n    /// Ordinary background jobs retain their existing manager lifetime.\n    pub fn abort_persistent_services(&mut self) {","sourceCodeStart":3120,"sourceCodeEnd":3156,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/tools/shell.rs#L3120-L3156","documentation":"Final receipt step of the commit: the removed shell's process id became unavailable between validation and receipt generation, so the transfer cannot produce a truthful receipt and fails instead of recording an unowned pid.","triggerScenarios":"Thrown at crates/tui/src/tools/shell.rs:3138 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-read output with a clean cursor; the invariant (pid present at check time, gone at removal) broke under a race.","Retry the ownership transfer for the affected service."],"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"}