stablyai/orca · warning

agent-status-types.ts no longer defines ${name}; re-sync thi

Error message

agent-status-types.ts no longer defines ${name}; re-sync this benchmark.

What it means

Thrown by the agent-hook-normalizer benchmark's readMirroredConstant when a numeric constant (currently AGENT_STATUS_ASSISTANT_MESSAGE_MAX_LENGTH) is no longer declared in src/shared/agent-status-types.ts with the pattern NAME = <number>. The benchmark mirrors that constant so its claimed field cap stays accurate; if the constant was renamed, removed, or changed shape, the mirror is stale and the benchmark would silently measure the wrong cap.

Source

Thrown at config/scripts/agent-hook-normalizer-roundtrip-benchmark.mjs:32

// trip is O(input) — and the input is bounded only by the 1 MB hook request
// limit, since tool_response text is passed through uncapped for most sources.
//
// Amplifier this models in the second table: resolveToolState stores the raw
// value in lastToolByPaneKey and inherits it until a turn reset, so one large
// tool result is re-serialized and re-scanned on every later event of the turn.
import { readFileSync } from 'node:fs'
import { performance } from 'node:perf_hooks'
import { fileURLToPath } from 'node:url'

const TYPES_SOURCE = readFileSync(
  fileURLToPath(new URL('../../src/shared/agent-status-types.ts', import.meta.url)),
  'utf8'
)

function readMirroredConstant(name) {
  const match = TYPES_SOURCE.match(new RegExp(`${name}\\s*=\\s*([0-9_]+)`))
  if (!match) {
    throw new Error(`agent-status-types.ts no longer defines ${name}; re-sync this benchmark.`)
  }
  return Number(match[1].replaceAll('_', ''))
}

// Read the cap the direct path clamps at, so a drifted value fails loudly here
// instead of quietly changing what this benchmark claims.
const ASSISTANT_MESSAGE_CAP = readMirroredConstant('AGENT_STATUS_ASSISTANT_MESSAGE_MAX_LENGTH')

const ITERATIONS = Number.parseInt(process.env.ORCA_HOOK_NORM_BENCH_ITERATIONS ?? '400', 10)
const WARMUP = Number.parseInt(process.env.ORCA_HOOK_NORM_BENCH_WARMUP ?? '200', 10)

for (const [name, value] of [
  ['ORCA_HOOK_NORM_BENCH_ITERATIONS', ITERATIONS],
  ['ORCA_HOOK_NORM_BENCH_WARMUP', WARMUP]
]) {
  if (!Number.isInteger(value) || value <= 0) {
    throw new Error(`${name} must be a positive integer, received ${value}`)
  }

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Find the renamed/moved constant in src/shared/agent-status-types.ts and update readMirroredConstant's call site (or its regex) to match the new declaration.
  2. If the value moved files, point TYPES_SOURCE at the new file path.
  3. If the constant was removed entirely, replace the mirrored read with an explicit literal in the benchmark and add a comment naming the now-removed constant.
  4. Add a test that fails when agent-status-types.ts constants change without the benchmark being updated.

Example fix

// before — constant renamed upstream
// -> 'agent-status-types.ts no longer defines AGENT_STATUS_ASSISTANT_MESSAGE_MAX_LENGTH; re-sync this benchmark.'

// after — update the mirrored constant name
// const ASSISTANT_MESSAGE_CAP = readMirroredConstant('AGENT_STATUS_MESSAGE_MAX_LENGTH')
Defensive patterns

Strategy: validation

Validate before calling

function assertConstantDeclared(source, name) {
  if (!new RegExp(`${name}\\s*=\\s*[0-9_]+`).test(source)) {
    throw new Error(`${name} no longer declared in agent-status-types.ts — update the benchmark.`)
  }
}
// assertConstantDeclared(TYPES_SOURCE, 'AGENT_STATUS_ASSISTANT_MESSAGE_MAX_LENGTH') at benchmark start

Prevention

When it happens

Trigger: agent-status-types.ts was refactored: the constant was renamed (e.g. to AGENT_STATUS_MESSAGE_MAX_CHARS), moved into an enum, exported from a different file, or its value stopped being a plain numeric literal.

Common situations: Cleanup of agent-status constants consolidates them under a new name; the cap was extracted into a config file; the value became a computed expression rather than a literal.

Related errors


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