You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Malformed cost.tiers still crashes the turn (TypeError, not DecimalError) #43254
cost() in provider/provider.ts copies tier: item.tier straight from the models.dev / plugin payload with no guard of its own — unlike input/output/cache. So a malformed tiers still throws from getUsage and takes the turn with it. Same symptom as #43098 (fatal under opencode acp), different error:
cost.tiers
error on dev
[{ input, output, cache }] (no tier key)
TypeError: undefined is not an object (evaluating 'item.tier.type')
[null]
TypeError: null is not an object (evaluating 'item.tier')
{} (not an array)
TypeError: input.model.cost?.tiers?.filter is not a function
Note a non-numeric tier.size must not be coerced to 0 when fixing this — that would make the tier match every context instead of none.
OpenCode version
Reproduces on current dev (9b0dd36 — i.e. with #43248 already in).
Steps to reproduce
Call getUsage with a model whose cost.tiers is any of the three shapes above. Three failing unit tests in the PR that follows.
Activity
github-actions commentedon Oct 18, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.