{"record":{"id":"628ca1fbf2f63d00","repo":"Yeachan-Heo/oh-my-codex","slug":"team-shutdown-sanitized-resizehookwarning","errorCode":null,"errorMessage":"[team shutdown] ${sanitized}: ${resizeHookWarning}; continuing teardown","messagePattern":"\\[team shutdown\\] (.+?): (.+?); continuing teardown","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/team/runtime.ts","lineNumber":5453,"sourceCode":"        );\n      }\n    }\n\n    let resizeHookWarning: string | null = null;\n    if (config.resize_hook_name && config.resize_hook_target) {\n      const resizeHookName = config.resize_hook_name;\n      const unregistered = unregisterResizeHook(config.resize_hook_target, resizeHookName);\n      if (!unregistered && isTmuxAvailable()) {\n        const baseSession = sessionName.split(':')[0];\n        const teamSessions = listTeamSessions();\n        if (teamSessions === null || teamSessions.includes(baseSession)) {\n          resizeHookWarning = `failed to unregister resize hook ${resizeHookName}`;\n        }\n      }\n\n    }\n    if (resizeHookWarning) {\n      console.warn(`[team shutdown] ${sanitized}: ${resizeHookWarning}; continuing teardown`);\n    }\n    const workerTeardown = await teardownWorkerPanes(\n      shutdownPaneIds.filter((paneId) => !prekillResolvedWorkerPaneIds.has(paneId)),\n      {\n        leaderPaneId: effectiveLeaderPaneId,\n        hudPaneId: restoredHudPaneId ?? effectiveHudPaneId,\n        expectedPanePids: {\n          ...Object.fromEntries(expectedSharedWorkerPanePids),\n          ...Object.fromEntries(config.workers\n            .filter((worker) => typeof worker.pane_id === 'string' && typeof worker.pid === 'number')\n            .map((worker) => [worker.pane_id as string, worker.pid as number])),\n        },\n        authorizePaneKill: sharedSessionTopology\n          ? (paneId) => {\n            const expectedOwner = frozenSharedWorkerOwnerIds.get(paneId);\n            if (expectedOwner === undefined) return false;\n            const currentOwner = readPaneTeamOwnerTagResult(paneId);\n            return currentOwner.status === 'value'","sourceCodeStart":5435,"sourceCodeEnd":5471,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/team/runtime.ts#L5435-L5471","documentation":"During team shutdown, a resize hook registered for a pane could not be unregistered (e.g. the unregister call returned a failure), so the runtime emits a warning prefixed with the sanitized pane/team identifier and continues teardown. It is non-fatal: the remaining panes are still torn down via teardownWorkerPanes. The message includes the specific reason stored in resizeHookWarning.","triggerScenarios":"Calling the team runtime's shutdown path after a pane resize hook (named via resizeHookName) fails to unregister — e.g. the hook was already removed, the terminal/pane is gone, or the unregister API returned an error while the hook name was recorded.","commonSituations":"Shutting down a team session where a pane or its resize hook was already cleaned up by another code path, or a plugin/host API version change made unregisterResizeHook return failure. Often seen in tests that force-kill panes before shutdown.","solutions":["Inspect the preceding resizeHookWarning value ('failed to unregister resize hook <name>') to identify which hook failed.","Verify the hook was not already unregistered earlier in the same shutdown flow (double-unregister).","If the host API changed, update the unregister call/signature used at the assignment site above src/team/runtime.ts:5453.","No action needed if teardown otherwise completes — the warning is informational and teardown continues."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Best-effort: capture console.warn during shutdown if you need to assert on it\nconst warnings: string[] = [];\nconst origWarn = console.warn;\nconsole.warn = (...args: unknown[]) => warnings.push(args.join(' '));\ntry {\n  await shutdownTeam();\n} finally {\n  console.warn = origWarn;\n}\nif (warnings.some(w => w.includes('failed to unregister resize hook'))) {\n  // log/track hook cleanup issue; teardown still completed\n}","preventionTips":["Unregister resize hooks as soon as a pane is destroyed instead of deferring to team shutdown.","Avoid force-killing panes out-of-band before calling team shutdown.","Track registered hook names so shutdown only unregisters hooks it still owns."],"tags":["team-shutdown","resize-hook","lifecycle","non-fatal"],"backgroundTag":"resource-cleanup-warning","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}