{"record":{"id":"5c677f7a514b0ff0","repo":"JuliusBrussee/caveman","slug":"cave-provider-usage-unpriced","errorCode":null,"errorMessage":"cave_provider_usage_unpriced","messagePattern":"cave_provider_usage_unpriced","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/agent/src/execution-kernel.ts","lineNumber":162,"sourceCode":"  ];\n  const disjointTotal = evidence.inputTokens + evidence.outputTokens +\n    evidence.cacheReadTokens + evidence.cacheWriteTokens;\n  if (values.some((value) => !Number.isSafeInteger(value) || value < 0) ||\n      evidence.totalTokens <= 0 || evidence.totalTokens !== disjointTotal ||\n      evidence.reasoningTokens > evidence.outputTokens) {\n    throw new Error(\"cave_provider_usage_incomplete\");\n  }\n  const priced = catalogCost({\n    provider: evidence.provider,\n    model: evidence.model,\n    inputTokens: evidence.inputTokens,\n    outputTokens: evidence.outputTokens,\n    cacheReadTokens: evidence.cacheReadTokens,\n    cacheWriteTokens: evidence.cacheWriteTokens,\n    reasoningTokens: evidence.reasoningTokens,\n  });\n  if (!priced.priced && options.requirePriced === true) {\n    throw new Error(\"cave_provider_usage_unpriced\");\n  }\n  if (options.reportedCostUsd !== undefined &&\n      (!priced.priced || !Number.isFinite(options.reportedCostUsd) ||\n        options.reportedCostUsd < 0 ||\n        Math.abs(options.reportedCostUsd - priced.usd) > 1e-12)) {\n    throw new Error(\"cave_provider_cost_mismatch\");\n  }\n  return Object.freeze({\n    ...evidence,\n    priced: priced.priced,\n    catalogCostUsd: priced.priced ? priced.usd : 0,\n  });\n}\n","sourceCodeStart":144,"sourceCodeEnd":176,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/packages/agent/src/execution-kernel.ts#L144-L176","documentation":"Thrown by validateProviderUsage (packages/agent/src/execution-kernel.ts:162): the (provider, model) pair is not present in the generated pricing catalog and options.requirePriced is true. Budgeted runs must fail closed when the catalog cannot price a model — an unpriced model may not silently consume $0 of budget.","triggerScenarios":"Running with requirePriced: true (budget/token-metered reserved runs do this) using a model that has no global row in the generated catalog — e.g. a brand-new model, a regional-only catalog row, a private/finetuned deployment id, or a typo'd model string.","commonSituations":"Provider ships a new model before the catalog is regenerated; model id spelling differs from the catalog key; using an alias or gateway-rewritten id that is not a catalog entry; regional-only pricing rows deliberately omitted from the region-agnostic catalog.","solutions":["Use a model that the current catalog prices (check the generated catalog for exact ids).","Update the catalog source (public/shared/provider-catalog/catalog/current.yaml) and re-run scripts/generate-agent-catalog.mjs so the new model is priced, then rebuild.","Remove the typo/alias and pass the exact catalog model id."],"exampleFix":"# before\nagent({ model: \"anthropic/claude-sonnet-4-6-alias\" }); # not in catalog, budgeted run\n\n# after\nagent({ model: \"anthropic/claude-sonnet-4-5\" }); # exact catalog id","handlingStrategy":"validation","validationCode":"import { catalogCost } from \"@caveman-ai/agent\";\nconst probe = catalogCost({ provider, model, inputTokens: 1, outputTokens: 1, cacheReadTokens: 0, cacheWriteTokens: 0, reasoningTokens: 0 });\nif (!probe.priced) throw new Error(`model '${provider}/${model}' has no catalog price; pick a cataloged model or update the catalog`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Restrict budgeted (requirePriced) runs to models present in the generated catalog.","Regenerate the catalog (scripts/generate-agent-catalog.mjs) after catalog updates and rebuild.","Validate model ids against catalog keys at configuration load time."],"tags":["pricing","catalog","budget","usage"],"backgroundTag":null,"analyzedSha":"27d5a3981a347890211bb1bf2439e5c821a63bc9","analyzedAt":"2026-08-15T09:26:11.751Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}