{"record":{"id":"2101fb65a7b39bb7","repo":"Yeachan-Heo/oh-my-codex","slug":"tmux-session-query-unavailable","errorCode":null,"errorMessage":"tmux_session_query_unavailable","messagePattern":"tmux_session_query_unavailable","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/team/runtime.ts","lineNumber":5689,"sourceCode":"    const baseSession = config.tmux_session.split(':')[0];\n    const teamSessions = getTeamTmuxSessions(sanitized);\n    if (!teamSessions.includes(baseSession)) return null;\n  }\n\n  return {\n    teamName: sanitized,\n    sanitizedName: sanitized,\n    sessionName: config.tmux_session,\n    config,\n    cwd,\n  };\n}\n\nasync function findActiveTeams(cwd: string, leaderSessionId: string): Promise<string[]> {\n  const root = teamRuntimeTeamsRoot(cwd);\n  if (!existsSync(root)) return [];\n  const listedSessions = listTeamSessions();\n  if (listedSessions === null) throw new Error('tmux_session_query_unavailable');\n  const sessions = new Set(listedSessions);\n\n  const entries = await readdir(root, { withFileTypes: true });\n  const active: string[] = [];\n  for (const e of entries) {\n    if (!e.isDirectory()) continue;\n    const teamName = e.name;\n    const cfg = await readTeamConfig(teamName, cwd);\n    const manifest = await readTeamManifestV2(teamName, cwd);\n    const governance = resolveGovernancePolicy(manifest?.governance);\n    if (governance.one_team_per_leader_session === false) continue;\n    const workerLaunchMode = cfg?.worker_launch_mode\n      ?? manifest?.policy?.worker_launch_mode\n      ?? 'interactive';\n    const tmuxSession = (manifest?.tmux_session || cfg?.tmux_session || `omx-team-${teamName}`).split(':')[0];\n    if (leaderSessionId) {\n      const ownerSessionId = manifest?.leader?.session_id?.trim() ?? '';\n      if (ownerSessionId && ownerSessionId !== leaderSessionId) continue;","sourceCodeStart":5671,"sourceCodeEnd":5707,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/team/runtime.ts#L5671-L5707","documentation":"Thrown by findActiveTeams when the tmux session listing API returns null, meaning tmux is not installed, not running, or its server cannot be queried.","triggerScenarios":"Calling an API that enumerates active teams (e.g. shutdown/cleanup discovery) when listTeamSessions() fails — tmux binary missing, TMUX socket unreachable, or tmux server not started.","commonSituations":"Running inside a container/CI without tmux, tmux socket permissions issues, or tmux not on PATH.","solutions":["Install tmux and ensure it is on PATH","Start or verify the tmux server (tmux ls) in the target environment","Fix TMUX env vars/socket permissions if using a custom socket"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (listTeamSessions() === null) throw new Error('tmux unavailable — install/start tmux first');","typeGuard":"(s: string[] | null): s is string[] => s !== null","tryCatchPattern":null,"preventionTips":["Install tmux and verify `tmux ls` works in the environment","Ensure TMUX env vars point at a live server"],"tags":["tmux","environment","team-discovery"],"backgroundTag":"tmux-unavailable","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}