tinyhumansai/openhuman · error · Error

unknown option: ${arg}

Error message

unknown option: ${arg}

What it means

The argument parser in goals-live.mjs is a closed switch over the supported flags; any argument that matches no case falls into `default:` and throws `unknown option: <arg>`. This is deliberate fail-fast behavior so misspelled or unsupported flags abort before a core is spawned or any RPC spend happens. Note that `-h`/`--help` print usage and exit 0 via fall-through.

Source

Thrown at scripts/debug/goals-live.mjs:132

      case "--model":
        opts.model = next();
        break;
      case "--show-thoughts":
        opts.showThoughts = true;
        break;
      case "--rpc-timeout-ms":
        opts.rpcTimeoutMs = Number(next());
        break;
      case "--verbose":
        opts.verbose = true;
        break;
      case "-h":
      case "--help":
        console.log(usage());
        process.exit(0);
      // eslint-disable-next-line no-fallthrough
      default:
        throw new Error(`unknown option: ${arg}`);
    }
  }
  if (opts.cases.length === 0) opts.cases = [...ALL_CASES];
  return opts;
}

// ── workspace / token resolution (mirrors harness-cache-audit) ──────────────

function defaultOpenhumanDir() {
  return process.env.OPENHUMAN_APP_ENV === "staging"
    ? path.join(homedir(), ".openhuman-staging")
    : path.join(homedir(), ".openhuman");
}

async function defaultWorkspace() {
  if (process.env.OPENHUMAN_WORKSPACE) return process.env.OPENHUMAN_WORKSPACE;
  const dir = defaultOpenhumanDir();
  try {

View on GitHub (pinned to a221052e0d)

Solutions

  1. Run `node scripts/debug/goals-live.mjs --help` and re-issue the command with only the flags it lists
  2. If you meant harness-cache-audit's flag (e.g. --turns), run scripts/debug/harness-cache-audit.mjs instead
  3. Fix the typo in the flag name
  4. If the flag genuinely should exist, add a case to the switch in parseArgs and to usage()

Example fix

// before
node scripts/debug/goals-live.mjs --turns 4 --case reflect

// after
node scripts/debug/harness-cache-audit.mjs --turns 4
// or, for goals-live, drop the foreign flag:
node scripts/debug/goals-live.mjs --case reflect
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED = new Set([
  "--core-url", "--token", "--workspace", "--case", "--reset", "--context",
  "--model", "--show-thoughts", "--rpc-timeout-ms", "--verbose", "-h", "--help",
]);
const flagLike = /^--?\w/;
const unknown = process.argv.slice(2).filter((a) => flagLike.test(a) && !SUPPORTED.has(a));
if (unknown.length) {
  console.error(`unsupported flags for goals-live: ${unknown.join(" ")}`);
  process.exit(2);
}

Type guard

const isGoalsLiveFlag = (f) =>
  /^--(core-url|token|workspace|case|reset|context|model|show-thoughts|rpc-timeout-ms|verbose|help)$|^(-h)$/.test(f);

Prevention

When it happens

Trigger: Passing a flag from a sibling script that goals-live does not support (e.g. `--turns 4` or `--min-hit-rate`, which belong to harness-cache-audit.mjs), a typo like `--verbos`, or `--token` misspelled. Also any flag listed in harness-cache-audit's usage but absent here (goals-live has --case, harness-cache-audit does not).

Common situations: Copy-pasting a command line between the two debug runners (goals-live vs harness-cache-audit vs agent-prepare-context-audit), which share most flags but not all; stale shell history after a flag rename; forgetting that --case is goals-live-only.

Related errors


AI-assisted analysis of tinyhumansai/openhuman@a221052e0d (2026-08-16). Data as JSON: /api/errors/3269da52c8d38f63. Report an issue: GitHub.