{"record":{"id":"365deabfe8bfeb20","repo":"Yeachan-Heo/oh-my-codex","slug":"startup-cleanup-pane-owner-changed-cleanuppane-p","errorCode":null,"errorMessage":"startup_cleanup_pane_owner_changed:${cleanupPane.pane_id}","messagePattern":"startup_cleanup_pane_owner_changed:(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/team/runtime.ts","lineNumber":412,"sourceCode":"      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,\n      hudPaneId: config.hud_pane_id,\n      expectedPanePids,\n      authorizePaneKill: (paneId, proof) => {\n        if (expectedPanePids[paneId] !== proof.pid) return false;\n        const owner = readPaneTeamOwnerTagResult(paneId);\n        return owner.status === 'value' && owner.value === teamPaneOwnerId;\n      },\n    });\n    assertPaneTeardownProofsAvailable('startup_cleanup', teardown.proofUnavailable);\n    for (const paneId of teardown.killedPaneIds) resolvedPaneIds.add(paneId);","sourceCodeStart":394,"sourceCodeEnd":430,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/team/runtime.ts#L394-L430","documentation":"The pane's owner tag was read successfully but its value does not match the team's tmux_pane_owner_id (or is absent). The pane was expected to be owned by this team but is tagged otherwise (or untagged), so killing it could destroy another team's pane and the reconcile aborts.","triggerScenarios":"Two teams sharing a tmux session with overlapping pane expectations; a pane re-tagged by a different team; panes whose user option was never set because they predate tagging.","commonSituations":"Multiple concurrent teams in one tmux session; resume-after-crash where pane tags were lost; manual tmux option edits.","solutions":["Inspect the pane's owner tag (`tmux show-options -p -t <pane> @team-owner` style) and determine which team owns it","Kill the pane manually if you confirm it is leftover, then remove it from startup_cleanup_panes","Avoid running multiple teams against the same tmux session unless the runtime supports it"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const owner = readPaneTeamOwnerTagResult(paneId);\nif (owner.status === 'value' && owner.value !== teamPaneOwnerId) { /* foreign pane: exclude from cleanup */ }","typeGuard":null,"tryCatchPattern":"try { await reconcileStartupCleanupPanes(config, cwd); } catch (e) { if (e instanceof Error && e.message.startsWith('startup_cleanup_pane_owner_changed:')) { /* inspect @team-owner option; exclude or kill manually */ } throw e; }","preventionTips":["Don't run multiple teams in one tmux session","Don't manually edit tmux user options on team panes"],"tags":["team-runtime","tmux","pane-ownership","multi-tenant"],"backgroundTag":"ownership-proof-mismatch","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}