stablyai/orca · error · Error

Unknown argument: ${arg}

Error message

Unknown argument: ${arg}

What it means

Thrown by the apphang repro harness CLI parser when an argument does not match any known flag. The parser iterates argv and falls through to this error for unrecognized tokens.

Source

Thrown at config/scripts/repro-windows-apphang-terminal-activation.mjs:85

        .filter(Boolean)
      if (modes.length === 0 || modes.some((mode) => !['on', 'off', 'auto'].includes(mode))) {
        throw new Error(`Unsupported --gpu=${value}. Use on, off, auto, or a comma-list.`)
      }
      args.gpuModes = modes
      continue
    }
    if (name === '--output-lines') {
      args.outputLines = parsePositiveInt(name, value)
      continue
    }
    if (name === '--report') {
      args.reportPath = value?.trim() || null
      if (!args.reportPath) {
        throw new Error('--report requires a file path.')
      }
      continue
    }
    throw new Error(`Unknown argument: ${arg}`)
  }

  return args
}

function printHelp() {
  console.log(`Usage:
  node config/scripts/repro-windows-apphang-terminal-activation.mjs [options]

Options:
  --expect=none|repro|pass       none prints measurements, repro exits 0 only when hang evidence is observed,
                                 pass exits 1 if hang evidence is observed. Default: none.
  --gpu=on|off|auto[,mode...]    Terminal GPU setting(s) to run. Default: on.
  --cycles=N                     Activation/output cycles per GPU mode. Default: ${defaultCycles}.
  --output-lines=N               Lines emitted by each terminal stress command. Default: ${defaultOutputLines}.
  --report=PATH                  Write full JSON evidence to PATH and print a compact summary to stdout.
  --distro=NAME                  WSL distro to use. Default: first non docker-desktop distro.
  --no-source-control            Do not open Source Control during the stress loop.

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Run with --help to see the complete list of accepted flags.
  2. Remove the unrecognized argument or correct the typo.

Example fix

// before
node config/scripts/repro-windows-apphang-terminal-activation.mjs --verbose
// after
node config/scripts/repro-windows-apphang-terminal-activation.mjs --cycles=20
Defensive patterns

Strategy: validation

Validate before calling

const KNOWN_FLAGS = new Set(['--expect','--gpu','--cycles','--distro','--output-lines','--report','--no-source-control','--no-dead-pty-reactivate','--keep','--help'])
const name = arg.split('=',1)[0]
if (!KNOWN_FLAGS.has(name)) {
  throw new Error(`Unknown argument: ${arg}. Run with --help.`)
}

Type guard

function isKnownFlag(arg) {
  const name = arg.split('=', 1)[0]
  return new Set(['--expect','--gpu','--cycles','--distro','--output-lines','--report','--no-source-control','--no-dead-pty-reactivate','--keep','--help','-h']).has(name)
}

Prevention

When it happens

Trigger: Passing any unrecognized flag like --verbose, --timeout, or a bare positional argument. Known flags are: --expect, --gpu, --cycles, --distro, --output-lines, --report, --no-source-control, --no-dead-pty-reactivate, --keep, --help.

Common situations: A developer passes a flag from a different harness, or a typo like --cyles.

Related errors


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