{"record":{"id":"6947d8407f8cbb4a","repo":"stablyai/orca","slug":"agent-status-types-ts-no-longer-defines-name-r","errorCode":null,"errorMessage":"agent-status-types.ts no longer defines ${name}; re-sync this benchmark.","messagePattern":"agent-status-types\\.ts no longer defines (.+?); re-sync this benchmark\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"config/scripts/agent-hook-normalizer-roundtrip-benchmark.mjs","lineNumber":32,"sourceCode":"// trip is O(input) — and the input is bounded only by the 1 MB hook request\n// limit, since tool_response text is passed through uncapped for most sources.\n//\n// Amplifier this models in the second table: resolveToolState stores the raw\n// value in lastToolByPaneKey and inherits it until a turn reset, so one large\n// tool result is re-serialized and re-scanned on every later event of the turn.\nimport { readFileSync } from 'node:fs'\nimport { performance } from 'node:perf_hooks'\nimport { fileURLToPath } from 'node:url'\n\nconst TYPES_SOURCE = readFileSync(\n  fileURLToPath(new URL('../../src/shared/agent-status-types.ts', import.meta.url)),\n  'utf8'\n)\n\nfunction readMirroredConstant(name) {\n  const match = TYPES_SOURCE.match(new RegExp(`${name}\\\\s*=\\\\s*([0-9_]+)`))\n  if (!match) {\n    throw new Error(`agent-status-types.ts no longer defines ${name}; re-sync this benchmark.`)\n  }\n  return Number(match[1].replaceAll('_', ''))\n}\n\n// Read the cap the direct path clamps at, so a drifted value fails loudly here\n// instead of quietly changing what this benchmark claims.\nconst ASSISTANT_MESSAGE_CAP = readMirroredConstant('AGENT_STATUS_ASSISTANT_MESSAGE_MAX_LENGTH')\n\nconst ITERATIONS = Number.parseInt(process.env.ORCA_HOOK_NORM_BENCH_ITERATIONS ?? '400', 10)\nconst WARMUP = Number.parseInt(process.env.ORCA_HOOK_NORM_BENCH_WARMUP ?? '200', 10)\n\nfor (const [name, value] of [\n  ['ORCA_HOOK_NORM_BENCH_ITERATIONS', ITERATIONS],\n  ['ORCA_HOOK_NORM_BENCH_WARMUP', WARMUP]\n]) {\n  if (!Number.isInteger(value) || value <= 0) {\n    throw new Error(`${name} must be a positive integer, received ${value}`)\n  }","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/agent-hook-normalizer-roundtrip-benchmark.mjs#L14-L50","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["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.","If the value moved files, point TYPES_SOURCE at the new file path.","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.","Add a test that fails when agent-status-types.ts constants change without the benchmark being updated."],"exampleFix":"// before — constant renamed upstream\n// -> 'agent-status-types.ts no longer defines AGENT_STATUS_ASSISTANT_MESSAGE_MAX_LENGTH; re-sync this benchmark.'\n\n// after — update the mirrored constant name\n// const ASSISTANT_MESSAGE_CAP = readMirroredConstant('AGENT_STATUS_MESSAGE_MAX_LENGTH')","handlingStrategy":"validation","validationCode":"function assertConstantDeclared(source, name) {\n  if (!new RegExp(`${name}\\\\s*=\\\\s*[0-9_]+`).test(source)) {\n    throw new Error(`${name} no longer declared in agent-status-types.ts — update the benchmark.`)\n  }\n}\n// assertConstantDeclared(TYPES_SOURCE, 'AGENT_STATUS_ASSISTANT_MESSAGE_MAX_LENGTH') at benchmark start","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When renaming/removing agent-status constants, grep for benchmark mirrors and update them in the same change.","Add a comment block at the top of agent-status-types.ts listing benchmarks that mirror its constants.","Pin benchmark-mirrored constants with a unit test in the production suite that fails if the constant disappears."],"tags":["benchmark","drift-guard","agent-status","maintenance","constants"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}