mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-12-03 03:29:51 +00:00
fix(models): a Bedrock -v1:0 version is not an Ollama tag (#1463)
Bedrock foundation-model ids end in a -[v]<major>:<minor> version. looksLikeLocalModel read that colon as an Ollama :tag, so an unpriced Bedrock model was classed as free local inference: excluded from models --unpriced, from the unpriced warning and from the pricing-coverage denominator, with metered spend showing $0. The version shape is now exempted before the tag rule. Covers ids without the v (openai.gpt-oss-120b-1:0, cohere.rerank-v3-5:0); Ollama and LM Studio tags are unaffected.
This commit is contained in:
parent
3e9542d63d
commit
9cd7dc5c98
3 changed files with 29 additions and 0 deletions
|
|
@ -24,6 +24,7 @@
|
|||
- **The Capacity Dock card and the popover quota rows no longer print a pace verdict under each window.** The "On pace" / "Lasts until reset" caption from #1314 added a third line to every window cell and made the card read as clutter; the cells are back to percent, label and countdown, up to three windows share one row again with a fourth wrapping to a second, and the pace math still feeds the tooltip and the agent-tab card.
|
||||
|
||||
### Fixed
|
||||
- **An unpriced Bedrock model now reaches the Unpriced list instead of being treated as free local inference.** Claude Code with `CLAUDE_CODE_USE_BEDROCK=1` records Bedrock's foundation-model id, which ends in a `-[v]<major>:<minor>` version (`anthropic.claude-haiku-4-5-20251001-v1:0`, `openai.gpt-oss-120b-1:0`). The local-model heuristic read that colon as an Ollama `:tag`, so a Bedrock model with no pricing row was classed as expected-free: it was excluded from `codeburn models --unpriced`, from the unpriced warning and from the pricing-coverage denominator, and its metered spend showed as $0 with nothing flagging the gap. The version shape is now exempted before the tag rule runs; Ollama and LM Studio tags are unaffected.
|
||||
- **The desktop header lists every provider CodeBurn detected, not only the ones that billed something this period.** `hasUsage: false` means a tool is installed and was idle in the selected window, which is a reason to grey the row, not to hide it: on Today the picker showed Claude alone while `codeburn doctor` listed sixteen. Idle providers now appear after the active ones, greyed, in the header picker and the Settings provider list.
|
||||
- **A partial first paint no longer replaces the finished numbers on screen.** Only persistence checked whether a report was complete; rendering did not. So when the resident serve child re-derived the corpus after the local-day rollover, the partial payloads it served while indexing replaced a complete one: `history.daily` came back with about 27 cost-bearing rows instead of 125, and the streak, month-to-date and the medians computed off that same array were wrong with it. A finished answer is now never given up for an unfinished one, in the switch memo or on screen; the indexing banner reports the partial instead, and the next complete payload replaces it. The resident child's output memo is also keyed by the local date, so `--period today` cannot serve yesterday's window for up to five minutes after midnight.
|
||||
- **The desktop footer no longer reports a refresh that never happened.** The clock read the age of a report snapshot restored from local storage, so a renderer restart made it announce a refresh from the previous day, and the restored payload had no row for today, so the streak pill read 0 beside a heatmap with no gaps. The clock now reports only fetches this run made, says "refreshing" while the first is in flight, and the streak counts from yesterday when today has not started.
|
||||
|
|
|
|||
|
|
@ -1084,6 +1084,12 @@ const warnedUnknownModels = new Set<string>()
|
|||
/// Users still get $0 in cost reports for them (correct — local inference is
|
||||
/// effectively free); the warning was just noise.
|
||||
function looksLikeLocalModel(name: string): boolean {
|
||||
// Bedrock foundation-model ids end in a `-[v]<major>:<minor>` version
|
||||
// (`anthropic.claude-haiku-4-5-20251001-v1:0`, `openai.gpt-oss-120b-1:0`).
|
||||
// That colon is a version, not an Ollama tag: such a model is metered, and
|
||||
// one with no price must reach the unpriced list rather than be treated as
|
||||
// free local inference.
|
||||
if (/-v?\d+:\d+$/.test(name)) return false
|
||||
// Ollama and LM Studio tags include `:tag` (e.g. qwen3.6:35b-a3b-bf16).
|
||||
if (name.includes(':') && !name.startsWith('http')) return true
|
||||
// GGUF / quantized fingerprints commonly seen in local inference.
|
||||
|
|
|
|||
|
|
@ -1138,6 +1138,28 @@ describe('findUnpricedModels', () => {
|
|||
expect(unpriced).toEqual([{ model: 'Sonnet 4.6', calls: 12, tokens: 500_000 }])
|
||||
})
|
||||
|
||||
it('does not mistake a Bedrock `-v1:0` version for an Ollama tag', () => {
|
||||
// Claude Code with CLAUDE_CODE_USE_BEDROCK=1 records Bedrock's foundation-
|
||||
// model id, which ends in `-v<major>:<minor>`. The colon used to read as
|
||||
// a local `:tag`, so an unpriced Bedrock model was classed as free local
|
||||
// inference and never reached the unpriced list. It is metered.
|
||||
expect(isExpectedFreeModel('anthropic.claude-nonexistent-99-v1:0')).toBe(false)
|
||||
expect(findUnpricedModels([
|
||||
{ model: 'anthropic.claude-nonexistent-99-v1:0', calls: 3, cost: 0, tokens: 1000 },
|
||||
])).toEqual([{ model: 'anthropic.claude-nonexistent-99-v1:0', calls: 3, tokens: 1000 }])
|
||||
// A priced Bedrock id is still not "expected free" — its $0 would be a gap.
|
||||
expect(isExpectedFreeModel('anthropic.claude-haiku-4-5-20251001-v1:0')).toBe(false)
|
||||
// Not every Bedrock id spells the `v`: OpenAI and Cohere ids on Bedrock
|
||||
// end in a bare `-<major>:<minor>`, and they are metered all the same.
|
||||
expect(isExpectedFreeModel('openai.gpt-oss-120b-1:0')).toBe(false)
|
||||
expect(isExpectedFreeModel('cohere.rerank-v3-5:0')).toBe(false)
|
||||
expect(isExpectedFreeModel('us-gov-west-1/openai.gpt-oss-20b-1:0')).toBe(false)
|
||||
// Ollama tags keep their treatment; only the version shape is exempted.
|
||||
expect(isExpectedFreeModel('qwen3.6:35b-a3b-bf16')).toBe(true)
|
||||
expect(isExpectedFreeModel('gpt-oss:120b')).toBe(true)
|
||||
expect(isExpectedFreeModel('llama3.1:8b-instruct-q4_K_M')).toBe(true)
|
||||
})
|
||||
|
||||
it('flags zero-rate pricing stubs but not explicit zero-rate user overrides', async () => {
|
||||
// LiteLLM ships [0,0] stubs for models it lists but has no price for;
|
||||
// a stub hit means "unknown price", not "free".
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue