{"record":{"id":"3801e1430d4c12c4","repo":"Hmbown/CodeWhale","slug":"lane-lane-id-runtime-has-no-attach-target","errorCode":null,"errorMessage":"lane `{lane_id}` runtime `{}` has no attach target","messagePattern":"lane `(.+?)` runtime `(.+?)` has no attach target","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cli/src/lib.rs","lineNumber":955,"sourceCode":"        LaneCommand::Restart { lane_id, json } => {\n            run_lane_control(ControlOperation::LaneRestart, Some(&lane_id), json)\n        }\n        LaneCommand::Resume { lane_id, json } => {\n            run_lane_control(ControlOperation::LaneResume, Some(&lane_id), json)\n        }\n        LaneCommand::Attach { lane_id, print } => {\n            let reg = LaneRegistry::open_default()?;\n            let mut lane = reg.load(&lane_id)?;\n            let backend = backend_for(&lane);\n            backend.reconcile(&reg, &mut lane)?;\n            let Some(attach) = backend.attach_command(&lane) else {\n                if !lane.status.is_active() {\n                    bail!(\n                        \"lane `{lane_id}` is {} and has no active attach target\",\n                        lane.status.as_str()\n                    );\n                }\n                bail!(\n                    \"lane `{lane_id}` runtime `{}` has no attach target\",\n                    lane.runtime.as_str()\n                );\n            };\n            if print {\n                println!(\"{attach}\");\n                return Ok(());\n            }\n            if let Some(session) = lane.tmux_session.as_deref() {\n                let socket = lane\n                    .tmux_socket\n                    .as_deref()\n                    .context(\"tmux lane is missing its pinned server socket\")?;\n                let status = Command::new(\"tmux\")\n                    .arg(\"-S\")\n                    .arg(socket)\n                    .args([\"attach\", \"-t\", session])\n                    .status();","sourceCodeStart":937,"sourceCodeEnd":973,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/cli/src/lib.rs#L937-L973","documentation":"The sibling case of the attach resolution: the lane's status IS active, but the backend still could not produce an attach command, so the failure names the lane's runtime instead — 'lane `<id>` runtime `<runtime>` has no attach target'. This means the lane claims to be running but its runtime backend cannot expose an attachable session (e.g. the underlying tmux session or process handle is gone).","triggerScenarios":"Attaching to an active-status lane whose `backend.attach_command` returns None — typically the runtime's session vanished (tmux server died, session killed externally) while lane state still says active, or a runtime kind that does not support attach.","commonSituations":"tmux session killed outside codewhale; machine reboot leaving stale lane state marked active; attaching to a lane using a runtime that lacks attach support.","solutions":["Reconcile the lane (`backend.reconcile` runs on attach already, but run `codewhale lane --status`) to refresh state, then retry attach.","If the runtime session is truly gone, restart the lane and attach to the new one.","Check the lane's `runtime` value — if the runtime type doesn't support attach, use the appropriate runtime (tmux) for interactive attach."],"exampleFix":"// before: lane marked active but tmux session gone\ncodewhale lane attach lane-7\n// after\ncodewhale lane control restart lane-7\ncodewhale lane attach lane-7","handlingStrategy":"retry","validationCode":"const lane = await showLane(id);\nif (lane.status === 'active') verifyRuntimeSession(lane.runtime); // e.g. `tmux -S <socket> has -t <session>`","typeGuard":null,"tryCatchPattern":"for (let i = 0; i < 2; i++) {\n  try { return attach(id); }\n  catch (e) { if (!/no attach target/.test(e.message)) throw e; restartLane(id); }\n}","preventionTips":["Reconcile lanes after machine restarts or external tmux kills.","Verify the runtime session exists before attach."],"tags":["lane","attach","runtime","stale-state"],"backgroundTag":"resource-not-found","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"}