Yeachan-Heo/oh-my-codex · warning

[team shutdown] ${sanitized}: ${resizeHookWarning}; continui

Error message

[team shutdown] ${sanitized}: ${resizeHookWarning}; continuing teardown

What it means

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.

Source

Thrown at src/team/runtime.ts:5453

        );
      }
    }

    let resizeHookWarning: string | null = null;
    if (config.resize_hook_name && config.resize_hook_target) {
      const resizeHookName = config.resize_hook_name;
      const unregistered = unregisterResizeHook(config.resize_hook_target, resizeHookName);
      if (!unregistered && isTmuxAvailable()) {
        const baseSession = sessionName.split(':')[0];
        const teamSessions = listTeamSessions();
        if (teamSessions === null || teamSessions.includes(baseSession)) {
          resizeHookWarning = `failed to unregister resize hook ${resizeHookName}`;
        }
      }

    }
    if (resizeHookWarning) {
      console.warn(`[team shutdown] ${sanitized}: ${resizeHookWarning}; continuing teardown`);
    }
    const workerTeardown = await teardownWorkerPanes(
      shutdownPaneIds.filter((paneId) => !prekillResolvedWorkerPaneIds.has(paneId)),
      {
        leaderPaneId: effectiveLeaderPaneId,
        hudPaneId: restoredHudPaneId ?? effectiveHudPaneId,
        expectedPanePids: {
          ...Object.fromEntries(expectedSharedWorkerPanePids),
          ...Object.fromEntries(config.workers
            .filter((worker) => typeof worker.pane_id === 'string' && typeof worker.pid === 'number')
            .map((worker) => [worker.pane_id as string, worker.pid as number])),
        },
        authorizePaneKill: sharedSessionTopology
          ? (paneId) => {
            const expectedOwner = frozenSharedWorkerOwnerIds.get(paneId);
            if (expectedOwner === undefined) return false;
            const currentOwner = readPaneTeamOwnerTagResult(paneId);
            return currentOwner.status === 'value'

View on GitHub (pinned to 3ad79a8a6f)

Solutions

  1. Inspect the preceding resizeHookWarning value ('failed to unregister resize hook <name>') to identify which hook failed.
  2. Verify the hook was not already unregistered earlier in the same shutdown flow (double-unregister).
  3. If the host API changed, update the unregister call/signature used at the assignment site above src/team/runtime.ts:5453.
  4. No action needed if teardown otherwise completes — the warning is informational and teardown continues.
Defensive patterns

Strategy: try-catch

Try / catch

// Best-effort: capture console.warn during shutdown if you need to assert on it
const warnings: string[] = [];
const origWarn = console.warn;
console.warn = (...args: unknown[]) => warnings.push(args.join(' '));
try {
  await shutdownTeam();
} finally {
  console.warn = origWarn;
}
if (warnings.some(w => w.includes('failed to unregister resize hook'))) {
  // log/track hook cleanup issue; teardown still completed
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of Yeachan-Heo/oh-my-codex@3ad79a8a6f (2026-08-27). Data as JSON: /api/errors/628ca1fbf2f63d00. Report an issue: GitHub.