{"record":{"id":"943c8e7c945ea5af","repo":"Hmbown/CodeWhale","slug":"persistent-service-id-disappeared-during-commit","errorCode":null,"errorMessage":"Persistent service {id} disappeared during commit","messagePattern":"Persistent service (.+?) disappeared during commit","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/tools/shell.rs","lineNumber":3133,"sourceCode":"            }\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());\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)","sourceCodeStart":3115,"sourceCodeEnd":3151,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/tools/shell.rs#L3115-L3151","documentation":"During the removal phase of the commit loop a shell vanished from the process map again — concurrent mutation between validation and removal — so the commit aborts rather than leaving ownership half-released.","triggerScenarios":"Thrown at crates/tui/src/tools/shell.rs:3133 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Treat as a race in the commit loop; inspect whether the service was concurrently removed and retry the commit.","Avoid mutating the shell pool while commit_persistent_services is in progress."],"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"}