{"record":{"id":"0aff0d2c5a7808ec","repo":"Hmbown/CodeWhale","slug":"running-tmux-lane-lacks-pinned-socket-session","errorCode":null,"errorMessage":"running tmux lane `{}` lacks pinned socket/session metadata; refusing unsafe reconciliation","messagePattern":"running tmux lane `(.+?)` lacks pinned socket/session metadata; refusing unsafe reconciliation","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/lane/src/runtime.rs","lineNumber":905,"sourceCode":"        let (lane_status, exit_code, reason) = if let Some(receipt) = receipt {\n            (\n                if receipt.exit_code == 0 {\n                    LaneStatus::Completed\n                } else {\n                    LaneStatus::Failed\n                },\n                Some(receipt.exit_code),\n                \"process_exit_receipt\",\n            )\n        } else {\n            if std::env::var_os(\"CODEWHALE_LANE_TMUX_DRY_RUN\").is_some() {\n                return Ok(false);\n            }\n            let (Some(socket), Some(session)) = (\n                record.tmux_socket.as_deref(),\n                record.tmux_session.as_deref(),\n            ) else {\n                bail!(\n                    \"running tmux lane `{}` lacks pinned socket/session metadata; refusing unsafe reconciliation\",\n                    record.id\n                );\n            };\n            match tmux_session_state(socket, session)? {\n                TmuxSessionState::Present => return Ok(false),\n                TmuxSessionState::Absent => {}\n            }\n            (\n                LaneStatus::Failed,\n                None,\n                \"tmux_session_missing_without_exit_receipt\",\n            )\n        };\n\n        if registry.mark_terminal_if_active(record, lane_status)? {\n            append_log_event(\n                &record.log_path,","sourceCodeStart":887,"sourceCodeEnd":923,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/lane/src/runtime.rs#L887-L923","documentation":"`reconcile` compares a lane record's pinned tmux session against reality to decide whether a Running lane is actually alive. When the record claims Running but lacks both pinned tmux_socket and tmux_session, reconcile cannot safely probe the session — guessing would either leak a live session or falsely mark a lane dead — so it bails instead of making an unsafe decision.","triggerScenarios":"Running `reconcile` over a registry containing a Running tmux lane record whose tmux_socket/tmux_session fields are missing or null — records from a pre-pinning schema version, a crashed start that persisted Running before the pins, or corrupted/hand-edited registry files.","commonSituations":"Version-upgraded workspaces where old lane records lack the pin fields; a crash between the Running transition and metadata persistence; registry JSON edited manually or truncated by a failed write.","solutions":["Repair the record: fill in the correct tmux_socket/tmux_session for the live session, or mark the lane stopped if the session is gone.","Run the registry schema migration if upgrading from a version without pinned tmux metadata.","If no tmux session exists, verify with `tmux ls` / `tmux -S <socket> has-session` and then clean up the stale record so reconcile skips it.","Avoid hand-editing registry records; let start/stop/reconcile maintain the pinned metadata."],"exampleFix":"// before\n{ \"id\": \"lane-42\", \"status\": \"Running\", \"tmux_socket\": null, \"tmux_session\": null }\n\n// after (session verified live on /tmp/lane.sock)\n{ \"id\": \"lane-42\", \"status\": \"Running\", \"tmux_socket\": \"/tmp/lane.sock\", \"tmux_session\": \"lane-42\" }","handlingStrategy":"validation","validationCode":"fn reconcilable(rec: &LaneRecord) -> bool {\n    rec.status != LaneStatus::Running\n        || (rec.tmux_socket.is_some() && rec.tmux_session.is_some())\n}","typeGuard":"fn has_pinned_tmux(rec: &LaneRecord) -> bool {\n    rec.tmux_socket.is_some() && rec.tmux_session.is_some()\n}","tryCatchPattern":null,"preventionTips":["Run schema migrations after version upgrades so all Running records carry pins.","Back up and validate registry JSON; never edit pins by hand.","Reconcile only records that pass the pinned-metadata guard."],"tags":["tmux","reconciliation","metadata"],"backgroundTag":"internal-invariant-violation","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"}