{"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":"anyhow::Error","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/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/lane/src/runtime.rs#L887-L923","documentation":"During reconciliation of a Running tmux lane with no exit receipt on disk, the runtime must query the pinned tmux session — but the record lacks tmux_socket/tmux_session (and CODEWHALE_LANE_TMUX_DRY_RUN is unset, which would short-circuit). It bails rather than guessing, so a metadata-less Running lane surfaces loudly instead of being silently misclassified.","triggerScenarios":"Reconciliation (status refresh/recovery after a crash) hitting a Running lane record whose tmux_socket or tmux_session is None. Same root causes as the stop-side refusal: legacy records, edited state, partial migrations.","commonSituations":"Restarting the parent process after an upgrade while old Running lanes exist in the registry; restoring a registry from backup; tools that create Running records without going through TmuxRuntime::start.","solutions":["Determine the lane's actual tmux session manually and repair the record's tmux_socket/tmux_session, then reconcile again","If the session is gone, kill leftovers and transition the lane to a terminal state through supported APIs","Prevent recurrence: always start tmux lanes via the current runtime so metadata is pinned at creation"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"fn lane_reconcilable(record: &LaneRecord) -> bool {\n    record.status != LaneStatus::Running\n        || record.tmux_socket.is_some() && record.tmux_session.is_some()\n}","typeGuard":"fn lane_has_pinned_session(record: &LaneRecord) -> bool {\n    record.tmux_socket.is_some() && record.tmux_session.is_some()\n}","tryCatchPattern":null,"preventionTips":["Back up and inspect registry records before upgrades touching lane state","Repair missing tmux_socket/tmux_session on Running records before running reconciliation","Keep CODEWHALE_LANE_TMUX_DRY_RUN out of production so reconciliation is exercised honestly"],"tags":["rust","lane","tmux","reconciliation","metadata","safety-guard"],"backgroundTag":"missing-metadata-refusal","analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","schemaVersion":2},"datasetVersion":"2026-08-22T04:17:13.399Z"}