Skip to content

feat(config): support custom cost tiers - #50717

Open
richardsun0713 wants to merge 1 commit into
anomalyco:devfrom
richardsun0713:custom-cost-tiers
Open

richardsun0713 wants to merge 1 commit into
anomalyco:devfrom
richardsun0713:custom-cost-tiers

Conversation

@richardsun0713

@richardsun0713 richardsun0713 commented Sep 22, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #50713

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds cost.tiers to legacy provider model configuration and carries it through v1 migration and both provider paths. Configured tiers replace a matching context boundary while preserving other catalog tiers. Explicit tiers take precedence over the legacy context_over_200k shorthand at the same boundary.

How did you verify your code works?

  • bun test test/config/config.test.ts test/config/provider.test.ts
  • bun test test/provider/provider.test.ts
  • bun typecheck in packages/core and packages/opencode
  • Push hook: repository typecheck

Screenshots / recordings

Not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Sep 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found the following related PRs (excluding PR #50717 itself):

Potential duplicates/related work:

  1. PR refactor(opencode): normalize legacy pricing into tiers #44292 - refactor(opencode): normalize legacy pricing into tiers

    • Directly related: addresses similar tier normalization and legacy pricing concerns
  2. PR fix(session): stop the legacy 200k price from overriding a model's real context tier #44223 - fix(session): stop the legacy 200k price from overriding a model's real context tier

    • Related to the legacy 200K shorthand preservation mentioned in this PR
  3. PR feat(agent): implement model tier selection with variant support for subagents #11377 - feat(agent): implement model tier selection with variant support for subagents

    • Related to cost tier configuration and model selection

Why they're related:

Consider reviewing PR #44292 and #44223 to ensure your changes don't conflict with or duplicate existing work on cost tier configuration.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Sep 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@richardsun0713

richardsun0713 commented Sep 22, 2026 •

Copy link
Copy Markdown
Author

This is not a duplicate of #44223 or #44292. Those changes address runtime handling of catalog tiers; this PR adds the missing cost.tiers config surface for custom provider models and verifies its migration and merge behavior.

This branch has not been deployed

No deployments
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.

[FEATURE]: Support explicit cost tiers for custom provider models

1 participant