Yeachan-Heo/oh-my-codex · error · Error

cleanupErrors.join(' | ')

Error message

cleanupErrors.join(' | ')

What it means

Thrown at the end of team shutdown/cleanup when one or more cleanup steps (state sync, artifact removal, etc.) failed; the message is the joined list of individual cleanup errors.

Source

Thrown at src/team/runtime.ts:5612

    } catch (err) {
      cleanupErrors.push(`rollbackProvisionedWorktrees: ${String(err)}`);
    }
  }

  // 7. Cleanup state
  let teamStateCleaned = false;
  try {
    await cleanupTeamState(sanitized, cwd);
    teamStateCleaned = true;
  } catch (err) {
    cleanupErrors.push(`cleanupTeamState: ${String(err)}`);
  }
  if (teamStateCleaned) {
    await syncTeamModeStateOnShutdown(sanitized, cwd, leaderSessionId);
  }

  if (cleanupErrors.length > 0) {
    throw new Error(cleanupErrors.join(' | '));
  }

  return { commitHygieneArtifacts }
}

/**
 * Resume monitoring an existing team.
 */
export async function resumeTeam(teamName: string, cwd: string): Promise<TeamRuntime | null> {
  const sanitized = resolveTeamNameForCurrentContext(teamName, cwd);
  const config = await readTeamConfig(sanitized, cwd);
  if (!config) return null;
  config.lifecycle_profile = 'default';
  const leaderCwd = config.leader_cwd ?? cwd;
  const approvedExecutionState = await resolvePersistedApprovedTeamExecutionContinuityState(
    sanitized,
    leaderCwd,
    config.team_state_root ?? resolveCanonicalTeamStateRoot(leaderCwd),

View on GitHub (pinned to 3ad79a8a6f)

Solutions

  1. Read the joined messages to identify which cleanup step failed
  2. Fix the underlying filesystem/permission issue on the team state root
  3. Rerun shutdown; if state is already partially gone, remove the state dir manually
Defensive patterns

Strategy: try-catch

Try / catch

try { await shutdown(...) } catch (e) { const parts = String(e).split(' | '); /* handle each cleanup error individually */ }

Prevention

When it happens

Trigger: Any cleanupError accumulated during shutdown finalization, e.g. failing to sync team mode state (syncTeamModeStateOnShutdown prerequisites missing) or write/remove state files.

Common situations: Read-only or missing team state root, partial deletion of the state directory, or disk/permission problems during shutdown.

Related errors


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