{"record":{"id":"c5812283d6cb5b1c","repo":"Yeachan-Heo/oh-my-codex","slug":"failed-to-initialize-team-config","errorCode":null,"errorMessage":"failed to initialize team config","messagePattern":"failed to initialize team config","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"src/team/runtime.ts","lineNumber":3603,"sourceCode":"      {\n        ...launchEnv,\n        OMX_SESSION_ID: leaderSessionId,\n        OMX_TEAM_DISPLAY_MODE: displayMode,\n        OMX_TEAM_WORKER_LAUNCH_MODE: workerLaunchMode,\n      },\n      {\n        leader_cwd: leaderCwd,\n        team_state_root: teamStateRoot,\n        workspace_mode: workspaceMode,\n        display_name: displayName,\n        requested_name: displayName,\n        identity_source: identityScope.source,\n        worktree_mode: effectiveWorktreeMode,\n      },\n      'default',\n    );\n    if (!config) {\n      throw new Error('failed to initialize team config');\n    }\n    config.leader_cwd = leaderCwd;\n    config.team_state_root = teamStateRoot;\n    config.workspace_mode = workspaceMode;\n    config.display_name = displayName;\n    config.requested_name = displayName;\n    config.identity_source = identityScope.source;\n    config.worktree_mode = effectiveWorktreeMode;\n    await writePersistedApprovedTeamExecutionBinding(\n      sanitized,\n      leaderCwd,\n      approvedExecution,\n      teamStateRoot,\n    );\n    await writePersistedTeamUltragoalContext(\n      sanitized,\n      leaderCwd,\n      ultragoalContext,","sourceCodeStart":3585,"sourceCodeEnd":3621,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/team/runtime.ts#L3585-L3621","documentation":"Thrown when the call to initialize the team configuration (with identity scope, worktree mode, etc.) returns a falsy config. This is an internal invariant failure: the config factory (persisted under key 'default') failed to produce a configuration object, so startup cannot continue.","triggerScenarios":"Calling team startup when the underlying config initialization (createTeamConfig with the sanitized name and 'default' profile) returns null/undefined — typically a corrupted or unreadable team config store, invalid identity source resolution, or a write failure in the config directory.","commonSituations":"Corrupted team state files in the repo's team state root; permission errors on the config directory; disk full; partially cleaned-up stale team state; version change altering the config schema making deserialization fail.","solutions":["Clean stale team state (the detectAndCleanStaleTeam path or manual removal of the team state root) and retry","Check write permissions and disk space for the leader cwd / team state root directory","Inspect logs from the config initialization call to see why it returned null","Upgrade/downgrade to a matching version if the config schema changed"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Verify the team state root is writable before starting\nimport { access, constants } from 'node:fs/promises';\nawait access(teamStateRoot, constants.W_OK);","typeGuard":null,"tryCatchPattern":"try {\n  await startTeam(opts);\n} catch (e) {\n  if (e instanceof Error && e.message === 'failed to initialize team config') {\n    // clean state root and retry once\n    await cleanupTeamState(leaderCwd);\n    return startTeam(opts);\n  }\n  throw e;\n}","preventionTips":["Keep the team state root clean; remove stale state before starting","Ensure write permissions and disk space on the config directory","Run only one leader at a time per team name"],"tags":["team-mode","config","initialization","internal-invariant"],"backgroundTag":"config-initialization-failed","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}