Repository navigation
perf: report an unknown model once, not once per priced record (#99) - #120
Conversation
…eCodeUsage#99) `getModelPricing` is called for every usage record, and a model missing from the table printed its fallback warning on every call. On a live history with a model newer than the table (`claude-opus-5-5`) that was ~91k console lines for one full index build and ~27k for a refresh that re-read a few large files. In the extension host the console write is the expensive part: in a CPU profile of refreshes it cost more than the pricing lookup itself. The fallback is deterministic per model name, so the first line says everything the repeats did. A runtime override that later adds the model is checked before the fallback is reached, so nothing needs resetting. Test: `an unknown model is reported once, not once per priced record` — fails on the parent commit (6 warnings instead of 2). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🤖 Automated first-pass review TL;DR Analysis
Suggested next step(s)
🤖 Generated by DeepSeek as an automated first pass — not a maintainer decision. |
Carl723000
left a comment
There was a problem hiding this comment.
Reviewed warning de-duplication independently from pricing resolution. Runtime overrides are still checked on every query and continue to take precedence; repeated unknown records no longer flood the console. The combined Node suite and required CI checks pass. No blocking finding.
🤖 Generated with OpenAI Codex
|
Merged. Thank you @rsyuzyov for isolating the unknown-model warning flood and proving the change with a focused regression. The fix keeps runtime pricing overrides authoritative while avoiding repeated console writes for the same missing model. This is merged into main; it is not yet a published extension update. 🤖 Generated with OpenAI Codex |
getModelPricingis called for every usage record, and a model missing fromthe table printed its fallback warning on every call. On a live history with a
model newer than the table (
claude-opus-5-5) that was ~91k console lines forone full index build and ~27k for a refresh that re-read a few large files. In
the extension host the console write is the expensive part: in a CPU profile of
refreshes it cost more than the pricing lookup itself.
The fallback is deterministic per model name, so the first line says everything
the repeats did. A runtime override that later adds the model is checked before
the fallback is reached, so nothing needs resetting.
Test:
an unknown model is reported once, not once per priced record— fails onthe parent commit (6 warnings instead of 2).
Independent of #119; found in the same profiling for #99.
🤖 Generated with Claude Code