stablyai/orca · error · Error

${insideSessionFlag} requires an evidence directory argument

Error message

${insideSessionFlag} requires an evidence directory argument

What it means

The script distinguishes its two modes via process.argv[2] === '--inside-session'. When run in inner-session mode, it requires argv[3] to be the evidence directory path (created by runOuter via mkdtempSync). If the flag is passed without that path, the inner session has nowhere to write logs and would crash later — so it fails fast with this usage error.

Source

Thrown at config/scripts/run-terminal-ibus-hangul-e2e.mjs:300

      stdio: 'inherit'
    }
  )
  if (!sessionProcess.pid) {
    throw new Error('xvfb-run did not return a PID')
  }
  console.error(`[terminal-ime] started isolated X11 session PID ${sessionProcess.pid}`)
  const exitCode = await waitForExit(sessionProcess)
  const remaining = await stopOwnedProcessGroup(sessionProcess.pid)
  if (remaining.length > 0) {
    throw new Error(`Owned X11 session processes survived cleanup: ${remaining.join('; ')}`)
  }
  return exitCode
}

const insideSession = process.argv[2] === insideSessionFlag
try {
  if (insideSession && !process.argv[3]) {
    throw new Error(`${insideSessionFlag} requires an evidence directory argument`)
  }
  process.exitCode = insideSession ? await runInsideSession(process.argv[3]) : await runOuter()
} catch (error) {
  console.error(`[terminal-ime] ${error instanceof Error ? error.message : String(error)}`)
  process.exitCode = 1
}

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Do not invoke --inside-session directly — let runOuter() spawn the inner session (it passes the evidence dir for you).
  2. If you must debug the inner session, pass a writable temp dir: node run-terminal-ibus-hangul-e2e.mjs --inside-session /tmp/orca-evidence-xxx.
  3. Re-read the bottom of the script (lines ~296-305) to confirm the argv contract before re-invoking.

Example fix

// before
node config/scripts/run-terminal-ibus-hangul-e2e.mjs --inside-session
// after
node config/scripts/run-terminal-ibus-hangul-e2e.mjs --inside-session /tmp/orca-terminal-ime-e2e-XXXX
Defensive patterns

Strategy: validation

Validate before calling

const insideSession = process.argv[2] === '--inside-session'
const evidenceDir = process.argv[3]
if (insideSession && !evidenceDir) {
  console.error('Usage: run-terminal-ibus-hangul-e2e.mjs --inside-session <evidence-dir>')
  process.exit(2)
}

Type guard

function hasEvidenceArg(argv: string[]): argv is [string, string, string, string] {
  return argv[2] === '--inside-session' && typeof argv[3] === 'string' && argv[3].length > 0
}

Prevention

When it happens

Trigger: Invoking `node run-terminal-ibus-hangul-e2e.mjs --inside-session` without a trailing evidence directory argument. This should never happen in normal use because runOuter() always supplies argv[3]; it occurs only when the script is invoked manually with the flag.

Common situations: Manual debugging where a developer copies the inner-session invocation but forgets the temp dir; a wrapper script that passes the flag but not the dir; an arg-parsing regression in a fork.

Related errors


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