{"record":{"id":"f0611409a740d15d","repo":"Yeachan-Heo/oh-my-codex","slug":"shutdown-shared-session-topology-unavailable-sha","errorCode":null,"errorMessage":"shutdown_shared_session_topology_unavailable:${sharedSessionTopology.detail}","messagePattern":"shutdown_shared_session_topology_unavailable:(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/team/runtime.ts","lineNumber":4999,"sourceCode":"        : `allowed=${gate.allowed} total=${gate.total} pending=${gate.pending} blocked=${gate.blocked} in_progress=${gate.in_progress} completed=${gate.completed} failed=${gate.failed} cleanup_requires_all_workers_inactive=${governance.cleanup_requires_all_workers_inactive} dirty_workers=${dirtyWorkers.join('|') || 'none'} confirm_issues=${confirmIssues} clean_fast_path=${useCleanFastPath}`,\n    },\n    cwd,\n  ).catch(() => {});\n\n  if (force) {\n    // Explicit force means teardown now. Do not spend the graceful ack window\n    // waiting for interactive panes or prompt workers that will be killed below.\n    skipWorkerAcks = true;\n  } else {\n    skipWorkerAcks = useCleanFastPath;\n  }\n\n  const sessionName = config.tmux_session;\n  const sharedSessionTopology = config.worker_launch_mode === 'interactive' && sessionName.includes(':')\n    ? resolveSharedSessionShutdownTopology(sessionName, config.leader_pane_id, sanitized)\n    : null;\n  if (sharedSessionTopology?.status === 'unavailable') {\n    throw new Error(`shutdown_shared_session_topology_unavailable:${sharedSessionTopology.detail}`);\n  }\n  if (typeof config.hud_pane_id === 'string' && /^%[0-9]+$/.test(config.hud_pane_id)\n    && typeof config.hud_pane_pid === 'number' && Number.isSafeInteger(config.hud_pane_pid) && config.hud_pane_pid > 0) {\n    const persistedHudProof = readExactPaneProofSync(config.hud_pane_id);\n    if (persistedHudProof.status === 'live' && persistedHudProof.pid !== config.hud_pane_pid) {\n      throw new Error(`shutdown_shared_session_HUD_pane_identity_changed:${config.hud_pane_id}`);\n    }\n  }\n  const dispatchPolicy = resolveDispatchPolicy(manifest?.policy, config.worker_launch_mode);\n  const shutdownRequestTimes = new Map<string, string>();\n\n  if (!skipWorkerAcks) {\n    // 1. Send shutdown inbox to each worker\n    for (const w of config.workers) {\n      try {\n        const requestedAt = new Date().toISOString();\n        await writeShutdownRequest(sanitized, w.name, 'leader-fixed', cwd);\n        shutdownRequestTimes.set(w.name, requestedAt);","sourceCodeStart":4981,"sourceCodeEnd":5017,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/team/runtime.ts#L4981-L5017","documentation":"In interactive worker_launch_mode with a shared tmux session name (containing ':'), shutdown resolves a shared-session topology; if that resolution returns status 'unavailable' the shutdown aborts, embedding the detail reason.","triggerScenarios":"Shutting down a team in interactive/shared-session mode where resolveSharedSessionShutdownTopology cannot resolve the topology — e.g. the tmux session/pane structure does not match the recorded leader pane, or the session no longer exists in the expected form.","commonSituations":"tmux session renamed or destroyed out-of-band; leader pane ID recorded in config no longer present; shared-session naming convention violated by manual tmux edits.","solutions":["Verify the tmux session exists and its panes match the team config (list-panes) before shutdown","Repair the recorded leader_pane_id / session name in team config to match reality, then retry","If the session is already gone, clean up residual team state manually or recreate the team"],"exampleFix":"# before\nomx team shutdown myteam\n\n# after\ntmux list-panes -t 'myteam:0' -F '#{pane_id}'\nomx team shutdown myteam","handlingStrategy":"validation","validationCode":"const topology = resolveSharedSessionShutdownTopology(config.tmux_session, config.leader_pane_id, teamName);\nif (topology?.status === 'unavailable') throw new Error(topology.detail);","typeGuard":null,"tryCatchPattern":"try { await shutdownTeam(t, cwd, {}); } catch (e) { if (/^shutdown_shared_session_topology_unavailable:/.test((e as Error).message)) { await repairSessionTopology(t); await shutdownTeam(t, cwd, {}); } else throw e; }","preventionTips":["Do not rename or restructure team tmux sessions manually","Verify session and leader pane exist before shutdown","Keep config.tmux_session / leader_pane_id in sync with reality"],"tags":["shutdown","tmux","shared-session"],"backgroundTag":"tmux-session-unavailable","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}