Skip to content

V41: Say how to price a model when a cost limit can't be enforced - #691

Merged
LinuxDevil merged 1 commit into
mainfrom
v41-price-warning
Oct 20, 2026
Merged

LinuxDevil merged 1 commit into
mainfrom
v41-price-warning

Conversation

@LinuxDevil

Copy link
Copy Markdown
Owner

Fixes audit finding AI-8 (Vercel competitor audit, 2026-10-19).

What was wrong

With a local model (no built-in price) and limits.maxCostUsd set, the run logged a generic once-per-process warning that named neither the model nor the exact fix.

What changed

  • The warning now names the model id, says the limit is NOT enforced for it, gives a registerModel({ id, provider, contextWindow, inputCostPerMTok: 0, outputCostPerMTok: 0 }) example and the docs link (https://lousho.com/models-and-cost#models-and-the-price-table, anchor verified live).
  • Dedupe is now per model id (still once per process, not per step). The run continues as before (no fail-closed).
  • Docs already show the registerModel example, so no docs change.

Tests

  • budget.test.ts: asserts text contains model id, NOT enforced, registerModel( and the docs URL, and is emitted once across 3 steps. ollamaCost.test.ts updated to the new text.
  • tsc, typecheck:tests, lint, test:coverage (one unrelated tracing.test.ts flake under load; passes alone), fallow exit 0.

Changelog: The unknown-price warning for limits.maxCostUsd now names the model and how to register a price.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@LinuxDevil
LinuxDevil merged commit b33c557 into main Oct 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant