{"record":{"id":"f4ab1d1a5258fb40","repo":"Yeachan-Heo/oh-my-codex","slug":"dynamic-scaling-is-disabled-set-omx-team-scalin","errorCode":null,"errorMessage":"Dynamic scaling is disabled. Set ${OMX_TEAM_SCALING_ENABLED_ENV}=1 to enable.","messagePattern":"Dynamic scaling is disabled\\. Set (.+?)=1 to enable\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/team/scaling.ts","lineNumber":278,"sourceCode":"    '-c', workerCwd, command,\n  ].map(quoteTmuxCommand).join(' ');\n  const result = spawnSync('tmux', [\n    'if-shell', '-F', '-t', source.paneId, buildScalePaneAuthorityCondition(source), splitCommand, \"display-message -p ''\",\n  ], { encoding: 'utf-8' });\n  if (result.status !== 0) return null;\n  const fields = (result.stdout || '').replace(/\\r?\\n$/, '').split('\\t');\n  if (fields.length !== 6 || fields[5] !== receipt) return null;\n  const [paneId, pidText, sessionName, sessionId, windowId] = fields;\n  const pid = Number(pidText);\n  if (!/^%[0-9]+$/.test(paneId) || !Number.isSafeInteger(pid) || pid <= 0\n    || !sessionName || !sessionId || !/^\\$[0-9]+$/.test(sessionId) || !/^@[0-9]+$/.test(windowId)) return null;\n  return { paneId, pid, sessionName, sessionId, windowId };\n}\n\n\nfunction assertScalingEnabled(env: NodeJS.ProcessEnv = process.env): void {\n  if (!isScalingEnabled(env)) {\n    throw new Error(\n      `Dynamic scaling is disabled. Set ${OMX_TEAM_SCALING_ENABLED_ENV}=1 to enable.`,\n    );\n  }\n}\n\nfunction joinContextSections(...sections: Array<string | undefined>): string | undefined {\n  const present = sections.filter((section): section is string => Boolean(section?.trim()));\n  return present.length > 0 ? present.join('\\n\\n') : undefined;\n}\n\n// ── Result types ──────────────────────────────────────────────────────────────\n\nexport interface ScaleUpResult {\n  ok: true;\n  addedWorkers: WorkerInfo[];\n  newWorkerCount: number;\n  nextWorkerIndex: number;\n}","sourceCodeStart":260,"sourceCodeEnd":296,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/team/scaling.ts#L260-L296","documentation":"Thrown by assertScalingEnabled as a guard on all dynamic scaling APIs: scaling is feature-flagged off unless OMX_TEAM_SCALING_ENABLED=1 in the environment.","triggerScenarios":"Calling scaleUp or scaleDown without OMX_TEAM_SCALING_ENABLED=1 set in process.env (or the value is not '1').","commonSituations":"Using the scaling API in a new environment/CI without exporting the flag, or after an upgrade that introduced the feature flag.","solutions":["Set OMX_TEAM_SCALING_ENABLED=1 in the environment before calling scaleUp/scaleDown","Pass the env explicitly if the API accepts it","For libraries, default the flag off in prod and only enable where scaling is intended"],"exampleFix":"// before\nawait scaleDown({ ... });\n// after\nprocess.env.OMX_TEAM_SCALING_ENABLED = '1';\nawait scaleDown({ ... });","handlingStrategy":"validation","validationCode":"if (process.env.OMX_TEAM_SCALING_ENABLED !== '1') throw new Error('enable OMX_TEAM_SCALING_ENABLED=1 first');","typeGuard":"const isScalingEnabled = (env = process.env) => env.OMX_TEAM_SCALING_ENABLED === '1';","tryCatchPattern":null,"preventionTips":["Set the flag in shell profile/CI env where scaling is used","Document the flag in deployment configs"],"tags":["scaling","feature-flag","env-var"],"backgroundTag":"missing-env-var","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}