{"record":{"id":"69981500efd2f491","repo":"Hmbown/CodeWhale","slug":"lane-lane-id-is-and-has-no-active-attach-target","errorCode":null,"errorMessage":"lane `{lane_id}` is {} and has no active attach target","messagePattern":"lane `(.+?)` is (.+?) and has no active attach target","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cli/src/lib.rs","lineNumber":950,"sourceCode":"            run_lane_control(ControlOperation::LaneStatus, Some(&lane_id), json)\n        }\n        LaneCommand::Interrupt { lane_id, json } => {\n            run_lane_control(ControlOperation::LaneInterrupt, Some(&lane_id), json)\n        }\n        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\")?;","sourceCodeStart":932,"sourceCodeEnd":968,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/cli/src/lib.rs#L932-L968","documentation":"When resolving the attach command for a lane, the backend returned no attach target (`attach_command` returned None). The code then distinguishes two cases: if the lane's status is not active, it fails with 'lane `<id>` is <status> and has no active attach target'. This tells the user the lane is in a non-runnable state (stopped, finished, failed) so there is nothing to attach to.","triggerScenarios":"`codewhale lane --attach <lane_id>` (or equivalent) on a lane whose `lane.status.is_active()` is false after `backend.reconcile` — e.g. an exited, failed, or never-started lane.","commonSituations":"Attaching to a lane after its agent process finished; a lane that failed at startup; reusing an old lane id from a previous session; environment where reconcile marks the lane inactive (crashed tmux session).","solutions":["Check the lane status (`codewhale lane --status` / `--show <id>`); if it finished, start a new lane instead of attaching.","If the lane should be running, restart/resume it (lane control operation) so its status becomes active, then attach.","Investigate why the lane is inactive (logs, reconcile output) if it was expected to be running."],"exampleFix":"// before\ncodewhale lane attach old-lane-1   # status: finished\n// after\ncodewhale lane new ...             # start a fresh lane, then attach","handlingStrategy":"validation","validationCode":"const lane = await showLane(id);\nif (!ACTIVE_STATUSES.includes(lane.status)) throw new Error(`lane ${id} is ${lane.status}; start a new lane instead of attaching`);","typeGuard":"function isAttachable(lane) { return typeof lane.status === 'string' && ['running','active'].includes(lane.status); }","tryCatchPattern":null,"preventionTips":["Check lane status before attach.","Treat attach as valid only for active lanes; create a new lane after completion."],"tags":["lane","attach","tmux","state"],"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"}