{"record":{"id":"a4e567a69bdac2e8","repo":"Hmbown/CodeWhale","slug":"inline-lane-cannot-be-stopped-safely-from-ano","errorCode":null,"errorMessage":"inline lane `{}` cannot be stopped safely from another process","messagePattern":"inline lane `(.+?)` cannot be stopped safely from another process","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/lane/src/runtime.rs","lineNumber":1064,"sourceCode":"    }\n\n    fn attach_command(&self, _record: &LaneRecord) -> Option<String> {\n        None\n    }\n\n    fn stop(\n        &self,\n        registry: &LaneRegistry,\n        record: &mut LaneRecord,\n        fence: Option<u64>,\n    ) -> Result<TerminalTransition> {\n        let transition = registry.mark_terminal_if_active_fenced(\n            record,\n            LaneStatus::Stopped,\n            fence,\n            |current| {\n                if current.status == LaneStatus::Running {\n                    bail!(\n                        \"inline lane `{}` cannot be stopped safely from another process\",\n                        current.id\n                    );\n                }\n                Ok(())\n            },\n        )?;\n        if transition.transitioned() {\n            self.cleanup_worktree(record)?;\n        }\n        Ok(transition)\n    }\n}\n\n/// Placeholder for remote VM / CI backends (surface only in Phase 1).\n#[derive(Debug)]\nstruct StubRuntime {\n    kind: RuntimeBackendKind,","sourceCodeStart":1046,"sourceCodeEnd":1082,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/lane/src/runtime.rs#L1046-L1082","documentation":"Raised by the inline lane runtime's `stop` in crates/lane/src/runtime.rs. Inline lanes run as a plain child of the creating process, so another process cannot safely kill or reap them; the fenced terminal-transition guard (`mark_terminal_if_active_fenced`) invokes a validation closure that rejects the stop when the lane is currently Running and the stop originates from a different process.","triggerScenarios":"Calling `stop` on a Running inline lane from a process other than the one that spawned it (e.g. a second CLI invocation or a watchdog), via `registry.mark_terminal_if_active_fenced(record, LaneStatus::Stopped, fence, ...)` where the fence indicates a foreign process.","commonSituations":"A management script or TUI restarts and tries to stop a lane left running by a previous session; a tmux test harness stops an inline lane from a sibling process; cleanup tooling sweeping lanes it does not own.","solutions":["Stop the lane from the process that started it (send a request to that process instead of calling stop directly).","Kill the owning process first; the lane record's status can then transition safely.","If the lane is orphaned (owner gone), manually mark it Stopped in the registry / clean up the record rather than using the fenced stop."],"exampleFix":"// before: foreign-process stop\nregistry.stop(id)?; // panics into this error for inline lanes\n// after: ask the owner process to stop it\nowner_handle.request_stop(id)?;","handlingStrategy":"validation","validationCode":"// Only the owner process may stop an inline lane\nif !is_owner_process(&record) {\n    return Err(anyhow!(\"delegate stop to owner process of lane {}\", record.id));\n}","typeGuard":"fn can_stop_from_here(record: &LaneRecord) -> bool {\n    record.runtime != \"inline\" || is_owner_process(record)\n}","tryCatchPattern":null,"preventionTips":["Route stop requests for inline lanes through the process that spawned them (IPC/socket).","Persist the owning PID in the lane record and check it before stopping.","Treat foreign-process stops of inline lanes as unsupported in tooling."],"tags":["lane","process-ownership","inline-runtime"],"backgroundTag":"invalid-state-transition","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"}