stablyai/orca · error · Error

ORCA_PTY_BENCH_INGRESS_CHARS must be positive, received ${IN

Error message

ORCA_PTY_BENCH_INGRESS_CHARS must be positive, received ${INGRESS_CHUNK_CHARS}

What it means

Thrown by config/scripts/pty-batch-flush-benchmark.mjs when ORCA_PTY_BENCH_INGRESS_CHARS fails `!Number.isInteger(INGRESS_CHUNK_CHARS) || INGRESS_CHUNK_CHARS <= 0`. INGRESS_CHUNK_CHARS (default 65536) is the character size of each ingress chunk that the batched-flush benchmark feeds in. The guard at line 32-33 rejects non-positive sizes before the data-generation loop.

Source

Thrown at config/scripts/pty-batch-flush-benchmark.mjs:33

const MAX_TAIL_CHARS = 256 * 1024
const MAX_TAIL_PARTIAL_CHARS = 4000
const OSC_TITLE_RE = /\x1b\]([012]);([^\x07\x1b]*?)(?:\x07|\x1b\\)/g
const URL_CANDIDATE_PATTERN = /\bhttps?:\/\/[^\s<>"'`]+/gi

if (!Number.isInteger(PTY_COUNT) || PTY_COUNT <= 0) {
  throw new Error(`ORCA_PTY_BENCH_PTY_COUNT must be positive, received ${PTY_COUNT}`)
}
if (!Number.isInteger(PAYLOAD_CHARS) || PAYLOAD_CHARS <= 0) {
  throw new Error(`ORCA_PTY_BENCH_PAYLOAD_CHARS must be positive, received ${PAYLOAD_CHARS}`)
}
if (!Number.isInteger(RUNS) || RUNS <= 0) {
  throw new Error(`ORCA_PTY_BENCH_RUNS must be positive, received ${RUNS}`)
}
if (!Number.isInteger(INGRESS_CHUNKS) || INGRESS_CHUNKS <= 0) {
  throw new Error(`ORCA_PTY_BENCH_INGRESS_CHUNKS must be positive, received ${INGRESS_CHUNKS}`)
}
if (!Number.isInteger(INGRESS_CHUNK_CHARS) || INGRESS_CHUNK_CHARS <= 0) {
  throw new Error(`ORCA_PTY_BENCH_INGRESS_CHARS must be positive, received ${INGRESS_CHUNK_CHARS}`)
}

function makePendingData() {
  const pending = new Map()
  for (let index = 0; index < PTY_COUNT; index++) {
    pending.set(`pty-${index}`, `${index}:`.padEnd(PAYLOAD_CHARS, 'x'))
  }
  return pending
}

function simulateWebContentsSend(id, data) {
  return v8.serialize({ channel: 'pty:data', payload: { id, data } }).byteLength
}

function flushLegacy(pending) {
  let bytes = 0
  const start = performance.now()
  for (const [id, data] of pending) {

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Set ORCA_PTY_BENCH_INGRESS_CHARS to a positive integer (default 65536).
  2. Unset it to accept the default.
  3. Confirm you used INGRESS_CHARS (env name) and not INGRESS_CHUNKS.

Example fix

// before
ORCA_PTY_BENCH_INGRESS_CHARS=0 node config/scripts/pty-batch-flush-benchmark.mjs

// after
ORCA_PTY_BENCH_INGRESS_CHARS=65536 node config/scripts/pty-batch-flush-benchmark.mjs
Defensive patterns

Strategy: validation

Validate before calling

const raw = process.env.ORCA_PTY_BENCH_INGRESS_CHARS
if (raw !== undefined && (!Number.isInteger(Number(raw)) || Number(raw) <= 0)) {
  throw new Error(`ORCA_PTY_BENCH_INGRESS_CHARS='${raw}' must be a positive integer`)
}

Type guard

function isPositiveInt(value) {
  const n = Number(value)
  return Number.isInteger(n) && n > 0
}

Prevention

When it happens

Trigger: Run the benchmark with ORCA_PTY_BENCH_INGRESS_CHARS set to `0`, a negative number, empty string, or non-numeric token. parseInt at line 10 returns NaN for garbage, and the line-32 guard throws.

Common situations: A developer confuses INGRESS_CHARS with INGRESS_CHUNKS and sets the per-chunk character size to zero, or forwards a blank value from a templated benchmark matrix. Note the env var name is ORCA_PTY_BENCH_INGRESS_CHARS while the constant is INGRESS_CHUNK_CHARS — a frequent mismatch.

Related errors


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