stablyai/orca · error · Error

Invalid scenario: ${options.scenario}

Error message

Invalid scenario: ${options.scenario}

What it means

Thrown by the Codex validation harness after parsing completes when --scenario is not one of {mixed, managed-only, codex-lb}. The VALID_SCENARIOS set is checked post-parse, so the scenario flag must have a value and that value must be in the set.

Source

Thrown at config/scripts/run-codex-real-account-validation.mjs:312

      options.keep = true
    } else if (arg === '--lane-aware-containment') {
      // Why: on Windows the system-default real-home lane cannot be env-sandboxed
      // (native codex ignores USERPROFILE), so strict zero-event containment is
      // structurally unreachable there. This mode records codex's designed
      // volatile churn without aborting while every other real-home write stays
      // a hard failure. The absolute zero-event claim is carried by macOS runs.
      options.laneAwareContainment = true
    } else if (arg === '--help') {
      console.log(
        'Usage: node config/scripts/run-codex-real-account-validation.mjs [--scenario mixed|managed-only|codex-lb] [--config-template <path>] [--temp-parent <dir>] [--skip-build] [--dry-run] [--close-after-launch] [--keep] [--lane-aware-containment] [--report <path>]'
      )
      process.exit(0)
    } else {
      throw new Error(`Unknown argument: ${arg}`)
    }
  }
  if (!VALID_SCENARIOS.has(options.scenario)) {
    throw new Error(`Invalid scenario: ${options.scenario}`)
  }
  if (options.scenario === 'codex-lb' && !options.configTemplate) {
    throw new Error('The codex-lb scenario requires --config-template outside primary ~/.codex')
  }
  return options
}

// Why: `npx` resolves to a .cmd shim on Windows that execFileSync cannot launch
// (ENOENT), so the harness could not build its own app there. Run the
// repository-local electron-vite JS entry with the current Node binary instead;
// process.execPath + a resolved .js path behaves identically on macOS, Linux,
// and Windows without a shell.
export function resolveElectronViteBuildCommand(repoRoot) {
  const electronViteEntry = path.join(
    repoRoot,
    'node_modules',
    'electron-vite',
    'bin',

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Use one of the three valid scenarios: --scenario mixed, --scenario managed-only, or --scenario codex-lb.
  2. Omit --scenario to use the default 'mixed'.

Example fix

// before
node config/scripts/run-codex-real-account-validation.mjs --scenario experimental
// after
node config/scripts/run-codex-real-account-validation.mjs --scenario managed-only
Defensive patterns

Strategy: validation

Validate before calling

const VALID_SCENARIOS = new Set(['mixed', 'managed-only', 'codex-lb'])
if (!VALID_SCENARIOS.has(options.scenario)) {
  throw new Error(`Invalid scenario: ${options.scenario}. Use ${[...VALID_SCENARIOS].join(', ')}.`)
}

Type guard

function isValidScenario(value) {
  return typeof value === 'string' && new Set(['mixed','managed-only','codex-lb']).has(value)
}

Prevention

When it happens

Trigger: Passing --scenario=experimental, --scenario=prod, or any value not in the three allowed scenarios. The default is 'mixed' (which is valid), so this only fires when an explicit invalid value is given.

Common situations: A developer guesses a scenario name or uses one that was removed/renamed in a refactor.

Related errors


AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12). Data as JSON: /api/errors/ab03f8209de987e3. Report an issue: GitHub.