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
AI code review — automated review for reference, author can ignore or act on any point.
Consolidating on tiers and deleting the two parallel legacy paths is the right direction — one pricing mechanism, one fallback rule, and the updated tests now document the new semantics explicitly. A few things worth nailing down before merge:
Silent cost regression for models that only had legacy >200k pricing. After this change, getUsage (packages/opencode/src/session/session.ts, ~lines 380–383) falls back to base cost when no context tier matches. Two sources of models previously covered by the legacy fields:
User configs still containing context_over_200k: with the field gone from ConfigProviderV1.Model (packages/core/src/v1/config/provider.ts), please confirm whether decoding strips it silently or fails validation — a hard error would break existing setups, a silent strip quietly re-prices long-context requests at base rates. If it's the latter, a deprecation warning during config load would soften the landing.
Upstream models.dev data: if any catalog entry still carries only context_over_200k (not tiers), the conversion in packages/core/src/plugin/models-dev.ts now drops it entirely. Worth verifying upstream has fully migrated those entries to tiers before this ships, or accepting the temporary regression knowingly.
Overlay asymmetry between base cost and tiers. The new preservation line (packages/opencode/src/provider/provider.ts, ~line 1514) keeps catalog tiers when user config overlays a model — good for the empty-override case in the new test. But the inverse has no escape hatch: config can replace base input/output yet can neither supply its own tiers nor clear inherited ones. A user pointing a model at a flat-rate proxy ends up with custom base pricing above 200k switching back to catalog tier rates mid-request. Consider allowing tiers in config cost, or an explicit way to reset them.
Test nit (packages/opencode/test/provider/provider.test.ts, "model config preserves catalog cost tiers"): asserting exact tier literals pins the test to today's catalog numbers. More robust: fetch the un-overlaid catalog model first and assert the overlaid one's tiers deep-equal it — same guarantee, zero churn when models.dev updates.
Otherwise the removals are consistent across schemas, conversions, OpenAPI, and SDK types — nice, thorough sweep.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
context_over_200kandexperimentalOver200Kpricing paths from OpenCodeTesting
bun test test/plugin/models-dev.test.ts(packages/core)bun typecheck(packages/core)packages/opencode)bun typecheck(packages/sdk/js)Requested by: @rekram1-node (Aiden via Slack)