JuliusBrussee/caveman · error

${label}: no priced region-agnostic rows found

Error message

${label}: no priced region-agnostic rows found

What it means

Thrown by renderCatalogModule() in scripts/generate-agent-catalog.mjs when the selection pass over the parsed catalog yields zero rows. Rows are selected only when they are region-agnostic (`region: global`), priced in USD, and carry list prices for both input and output tokens; every other row is skipped with a recorded reason. An empty selection would generate an empty, useless catalog.ts, so the generator refuses.

Source

Thrown at scripts/generate-agent-catalog.mjs:225

  if (typeof value !== "number" || !Number.isFinite(value) || value < 0) {
    throw new Error(`${label}: ${field} must be a finite non-negative number`);
  }
  return value;
}

function number(value) {
  const text = String(value);
  if (!/^(0|[1-9][0-9]*)(\.[0-9]+)?(e[+-]?[0-9]+)?$/.test(text)) {
    throw new Error(`cannot render ${text} as a stable numeric literal`);
  }
  return text;
}

/** Renders the full public/agent/src/catalog.ts module text. */
export function renderCatalogModule(catalogBytes, label = CATALOG_LABEL) {
  const digest = createHash("sha256").update(catalogBytes).digest("hex");
  const { selected, skipped } = selectRows(parseCatalogYaml(catalogBytes.toString("utf8"), label), label);
  if (selected.length === 0) throw new Error(`${label}: no priced region-agnostic rows found`);
  const entries = selected.map(({ key, price }) => [
    `  ${JSON.stringify(key)}: Object.freeze({`,
    `    inputPerMillion: ${number(price.inputPerMillion)},`,
    `    outputPerMillion: ${number(price.outputPerMillion)},`,
    `    cacheReadPerMillion: ${number(price.cacheReadPerMillion)},`,
    `    cacheWritePerMillion: ${number(price.cacheWritePerMillion)},`,
    `    reasoningPerMillion: ${number(price.reasoningPerMillion)},`,
    `  }),`,
  ].join("\n")).join("\n");
  const skippedLines = skipped.length === 0
    ? "// Every catalog row is represented above.\n"
    : [
      "// Rows deliberately absent above. A regional rate is not a region-free",
      "// rate, so these are omitted rather than borrowed; a run on one of these",
      "// models prices as unpriced (honest zero) instead of plausibly wrong.",
      ...skipped.map(({ key, reason }) => `//   ${key} — ${reason}`),
      "",
    ].join("\n");

View on GitHub (pinned to 27d5a3981a)

Solutions

  1. Ensure at least one row has `region: global`, `currency: USD`, and both `input_per_million` and `output_per_million` set in its pricing block.
  2. Inspect the skipped list the generator prints to see why each row was dropped and fix the intended-to-carry rows.
  3. Re-run `node scripts/generate-agent-catalog.mjs`.

Example fix

# before: all rows regional
- provider: acme
  model: acme-1
  region: us-east
  currency: USD
# after
- provider: acme
  model: acme-1
  region: global
  currency: USD
Defensive patterns

Strategy: validation

Validate before calling

// Assert the catalog will select at least one row before generating.
const selectable = rows.some((r) =>
  r.region === "global" && r.currency === "USD"
  && r.pricing && typeof r.pricing.input_per_million === "number"
  && typeof r.pricing.output_per_million === "number"
);

Prevention

When it happens

Trigger: Every row in current.yaml is regional, non-USD, or missing input/output list prices — e.g. the catalog was temporarily rewritten with regional-only pricing, or a global edit changed `currency` or `region` values across the board.

Common situations: Bulk edits that flip region or currency; provider price sources switching to per-region rows; a truncated or partially merged catalog file.

Related errors


AI-assisted analysis of JuliusBrussee/caveman@27d5a3981a (2026-08-15). Data as JSON: /api/errors/017a1ccd7a22c8db. Report an issue: GitHub.