Repository navigation
feat: spend paid provider budgets before falling back to copilot - #28
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
Invalid quota window IDs prevent budget loading, and the compaction model override prevents fallback switching.
2 open issues
What changed in this PR
Prioritizes paid providers before Copilot and adds local budget estimates to quota reporting.
Changes:
- Defaults to Anthropic with OpenAI, Google, and Copilot fallbacks.
- Adds $50 rolling 30-day estimates for paid providers.
- Packages quota configuration and extends routing smoke checks.
| File | Description |
|---|---|
| tests/routing.test.mjs | Checks provider ordering and budgets. |
| scripts/test-router-integration.mjs | Checks plugin loading and quota output. |
| README.md | Documents fallback behavior and budget limits. |
| opencode.jsonc | Configures Anthropic defaults and fallback chain. |
| entrypoint.sh | Copies quota configuration at startup. |
| Dockerfile | Includes quota configuration in the image. |
| config/quota-toast.jsonc | Defines paid-provider budget estimates. |
| .dockerignore | Includes configuration in the build context. |
Review effort: Balanced
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Why
Defaults build and compaction to Claude Opus 5.5 and adds opencode-runtime-fallback 0.3.0, so a capped or failing provider moves on to OpenAI, then Google, then Copilot.
/quotagains a $50 rolling 30-day estimate row for each paid provider fromconfig/quota-toast.jsonc, and opencode-quota goes from 5.0.2 to 5.0.3.Check the smoke test's
quota_statusassertions and that the fallback plugin loads on 2.0.32.Risks
The fallback plugin replaces the native subagent task tool. Budget rows are local estimates; the provider console spend limits are the real caps.