{"record":{"id":"c24fc10f97f0e748","repo":"Yeachan-Heo/oh-my-codex","slug":"unsupported-session-kind","errorCode":"unsupported_session_kind","errorMessage":"unsupported_session_kind:invalid_tmux_pane_binding:${tmuxSessionName}","messagePattern":"unsupported_session_kind:invalid_tmux_pane_binding:(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/mcp/hermes-bridge.ts","lineNumber":207,"sourceCode":"    encoding: \"utf-8\",\n    stdio: [\"ignore\", \"pipe\", \"pipe\"],\n    windowsHide: process.platform === \"win32\",\n  });\n}\n\nasync function sendPromptToBoundTmuxSession(\n  cwd: string,\n  sessionId: string,\n  prompt: string,\n  deps: HermesBridgeDeps,\n): Promise<HermesTmuxPromptResult | null> {\n  const rawSession = await readSessionState(cwd);\n  if (!rawSession || !sessionMatchesRequested(rawSession, sessionId)) return null;\n  const tmuxSessionName = optionalString(rawSession.tmux_session_name);\n  const tmuxPaneId = optionalString(rawSession.tmux_pane_id);\n  if (!tmuxSessionName || !tmuxPaneId) return null;\n  if (!isTmuxPaneId(tmuxPaneId)) {\n    throw new Error(`unsupported_session_kind:invalid_tmux_pane_binding:${tmuxSessionName}`);\n  }\n\n  const execTmux = deps.execTmuxFileSync ?? defaultExecTmuxFileSync;\n  try {\n    execTmux([\"has-session\", \"-t\", tmuxSessionName]);\n    const instanceId = String(execTmux([\"show-options\", \"-qv\", \"-t\", tmuxSessionName, OMX_INSTANCE_OPTION]) ?? \"\").trim();\n    if (instanceId !== rawSession.session_id) {\n      throw new Error(`tmux_instance_mismatch:${tmuxSessionName}:${instanceId || \"missing\"}`);\n    }\n    const paneSession = String(execTmux([\"display-message\", \"-p\", \"-t\", tmuxPaneId, \"#{session_name}\"]) ?? \"\").trim();\n    if (paneSession !== tmuxSessionName) {\n      throw new Error(`pane_session_mismatch:${tmuxPaneId}:${paneSession || \"missing\"}`);\n    }\n    for (const argv of buildSendPaneArgvs(tmuxPaneId, prompt, true)) {\n      execTmux(argv);\n    }\n  } catch (error) {\n    const message = errorMessage(error);","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/mcp/hermes-bridge.ts#L189-L225","documentation":"The Hermes bridge can deliver prompts to a session bound to a tmux pane, but only if the recorded tmux_pane_id is a syntactically valid pane id. If the stored binding fails isTmuxPaneId, delivery is refused with this unsupported_session_kind error rather than sending keys to an arbitrary target.","triggerScenarios":"sendPromptToBoundTmuxSession reads session state with tmux_session_name set but tmux_pane_id not matching the pane-id format (e.g. '%0x' garbage, an empty-ish string, or a window id like '@3').","commonSituations":"Session state written by an older version or corrupted, manual edits to the state file, or a tmux binding recorded from a non-pane target.","solutions":["Inspect the session state file's tmux_pane_id and fix it to a real pane id like %3","Restart the session so it rebinds to a fresh tmux pane","Delete stale session state for dead sessions"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const PANE = /^%\\d+$/; // typical tmux pane id shape\nif (state.tmux_session_name && !PANE.test(state.tmux_pane_id ?? '')) { /* rebind session before sending */ }","typeGuard":"function hasValidPaneBinding(s: SessionState): boolean { return typeof s.tmux_session_name === 'string' && /^%\\d+$/.test(s.tmux_pane_id ?? ''); }","tryCatchPattern":"catch (e) { if ((e as Error).message.startsWith('unsupported_session_kind:invalid_tmux_pane_binding')) { /* restart/rebind session */ } }","preventionTips":["Don't hand-edit session state files","Recreate sessions instead of reusing stale bindings","Validate bindings before prompt delivery"],"tags":["mcp","hermes-bridge","tmux","session-binding"],"backgroundTag":"invalid-tmux-pane-id","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}