{"record":{"id":"035254b6f61de298","repo":"Yeachan-Heo/oh-my-codex","slug":"startup-cleanup-pane-pid-missing-cleanuppane-pan","errorCode":null,"errorMessage":"startup_cleanup_pane_pid_missing:${cleanupPane.pane_id}","messagePattern":"startup_cleanup_pane_pid_missing:(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/team/runtime.ts","lineNumber":402,"sourceCode":"  if (!teamPaneOwnerId) throw new Error('startup_cleanup_pane_owner_unavailable:missing_team_owner_id');\n\n  const resolvedPaneIds = new Set<string>();\n  const expectedPanePids: Record<string, number> = {};\n  for (const cleanupPane of cleanupPanes) {\n    if (cleanupPane.pane_id === config.leader_pane_id || cleanupPane.pane_id === config.hud_pane_id) {\n      throw new Error(`startup_cleanup_pane_target_invalid:${cleanupPane.pane_id}`);\n    }\n    const proof = readExactPaneProofSync(cleanupPane.pane_id);\n    if (proof.status === 'gone') {\n      resolvedPaneIds.add(cleanupPane.pane_id);\n      continue;\n    }\n    if (proof.status === 'unavailable') {\n      assertPaneTeardownProofsAvailable('startup_cleanup', [proof]);\n      continue;\n    }\n    if (cleanupPane.pid === null) {\n      throw new Error(`startup_cleanup_pane_pid_missing:${cleanupPane.pane_id}`);\n    }\n    if (proof.pid !== cleanupPane.pid) {\n      throw new Error(`startup_cleanup_pane_identity_changed:${cleanupPane.pane_id}`);\n    }\n    const owner = readPaneTeamOwnerTagResult(cleanupPane.pane_id);\n    if (owner.status === 'error') {\n      throw new Error(`startup_cleanup_pane_owner_unavailable:${cleanupPane.pane_id}:${owner.error}`);\n    }\n    if (owner.status !== 'value' || owner.value !== teamPaneOwnerId) {\n      throw new Error(`startup_cleanup_pane_owner_changed:${cleanupPane.pane_id}`);\n    }\n    expectedPanePids[cleanupPane.pane_id] = cleanupPane.pid;\n  }\n\n  const livePaneIds = Object.keys(expectedPanePids);\n  if (livePaneIds.length > 0) {\n    const teardown = await teardownWorkerPanes(livePaneIds, {\n      leaderPaneId: config.leader_pane_id,","sourceCodeStart":384,"sourceCodeEnd":420,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/team/runtime.ts#L384-L420","documentation":"For a cleanup pane that still exists (tmux proof is live), the code compares the pane's current pid to the pid recorded when the pane was registered. If the recorded pid is null, there is no expected identity to compare against, so ownership cannot be proven and the reconcile throws with the pane id.","triggerScenarios":"A startup_cleanup_panes entry with pid: null for a pane that tmux reports as still alive — configs written by older versions that did not persist pids, or partial writes.","commonSituations":"Version upgrades adding pid tracking to existing state; race where the pane was registered before pid capture was implemented.","solutions":["Remove the pid-less entry (and its pane, if safe) or manually kill that tmux pane","Delete startup_cleanup_panes from the config and let a fresh start rebuild it","Upgrade state by restarting the team under the current version"],"exampleFix":"// before\n{ startup_cleanup_panes: [{pane_id: '%7', pid: null}] }\n// after\ntmux kill-pane -t %7   # then start team; cleanup list rebuilt with pids","handlingStrategy":"validation","validationCode":"const unprovable = (config.startup_cleanup_panes ?? []).filter(p => p.pid === null);\nif (unprovable.length) { /* clear entries or kill panes manually first */ }","typeGuard":null,"tryCatchPattern":"try { await reconcileStartupCleanupPanes(config, cwd); } catch (e) { if (e instanceof Error && e.message.startsWith('startup_cleanup_pane_pid_missing:')) { /* kill that pane manually, drop the entry */ } throw e; }","preventionTips":["Ensure state written by the current version (pids persisted)","Treat pid:null entries as unverifiable and handle before startup"],"tags":["team-runtime","tmux","pid-tracking","stale-state"],"backgroundTag":"ownership-proof-missing","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}