Repository navigation
Show OpenCode provider quota failures as usage limits - #31937
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the
Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
a08006e7-7a9d-4ee4-ba14-a92743683bb0
📒 Files selected for processing: 2
src/main/acp/acp-dialects/opencode-dialect.tssrc/main/acp/acp-timeline-opencode-dialect.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
|
OpenCode provider quota errors previously appeared as generic “Internal error” rows because their structured category was lost before shared failure handling. This PR routes those failures to the existing usage warning and eligible desktop Continue action, preserving documented payment and expired-plan instructions as generic errors. Review status: complete; quota-replay evidence accepted. Current head is Verified:
Evidence retained across later commits: The earlier live phone browser setup failed twice before session-route proof. Those attempts remain historical non-passes. Since this PR changes no phone consumer code, the new unchanged-consumer rule replaces the additional live-phone requirement with contract coverage. The queued iOS ticket was released before admission; no simulator pass is claimed. Grok and Antigravity are unchanged dialects; their shared default path is covered by the real OMP control. No additional live controls or waivers are claimed. The automated account-budget suggestion was resolved against the settled category default: that message supplies neither a corrective payment/renewal instruction nor a documented non-reset condition, so it remains usage-category output without an invented reset time. This does not assert that the budget actually resets. Current ACP status/timing loss and the documented unknown-wording limitation remain intentional, as described in the PR body. All test copies and QA tickets are stopped/released. Reports, screenshots, raw captures and cleanup evidence are retained with their original archive hashes. No new phone or provider-trigger evidence is implied by the test-only follow-up. For Brennan's review The judgment points are the documented corrective-message exclusions and dialect classification before shared failure completion. Same quota-payload replay, main versus the QA head
Synthetic reset comparison, billing exclusion, real continuation and upgrade replies
Billing fixture retains its corrective instruction: Quota fixture in an established conversation, followed by a genuine Continue reply: Baseline-created chat after upgrade, with two genuine replies on the QA head: |







Problem
An OpenCode chat that reached its provider usage limit showed a generic “Internal error” instead of the existing usage-limit row and recovery actions. OpenCode returned a structured provider.quota error from its Agent Client Protocol (ACP) prompt request, but Orca treated that category as generic. That category also includes payment and expired-plan failures, so classifying every quota error as a pause would hide corrective instructions on the phone. Tracked in STA-11590.
User-facing change
OpenCode quota and rate-limit failures now use the existing warning usage-limit row, with the existing desktop Continue action when eligible. The phone shows the host's usage-limit sentence and any known reset time; this PR adds no phone Continue control. A reset time appears only when valid structured metadata supplies one; current OpenCode ACP errors supply none.
HTTP 402 and documented payment, empty-balance, overdue-invoice, expired GLM Coding Plan, missing model access and expired enterprise-package failures keep the existing generic error row and full corrective instruction. The separate provider.free-limit category also stays generic, retaining its connect/subscribe/switch-model instruction. No new error wording or controls are introduced.
Implementation and review path
The common pattern interprets a provider's failed reply at a provider-specific normalization boundary before shared failure handling. An optional ACP dialect hook feeds the existing usage-limit failure fact and existing turn/journal handling; other dialects retain their fallback. No saved-field definition, wire operation, transport or launch path changes.
Full review path. The change is small (88 changed production lines across four production files, plus 125 added test lines), but it affects accepted-turn endings, journaled failure facts and existing recovery actions, so the light-path risky-area and local-effect criteria do not hold. History includes the related shared usage-limit work in #30396 and error-detail preservation in #26666. A full plan and independent architecture/correctness review were completed before this review fix. Two review rounds and a fresh final-head comparison/readiness/performance review found no remaining source-proven findings; QA remains incomplete as listed below.
Intended classification differences and transport limits
Validation
d4796e09d9e0e60497b857626227893f20936ddd. Full PR CI and native package/persistence checks passed on this exact head.5fc2afa75f35196b1ec7c3ab423ed36c179271bf, compared with main4dd97f02d5e240ab5d756017a946f8a9617678c6, using installed OpenCode 2.0.21. A baseline-created chat survived the actual restart/upgrade and returned two real replies. OpenCode, registered OpenCode2 and OMP controls returned real replies. OpenCode2 used a QA-home alias to the installed binary and an offered model through existing sign-in; installer detection was not tested.8d4eaf03a9cbfaf4580fe5f89a96f7e709864176added only phone tests. The current head merges main89e93cfa387188ac63b0ec711da4bf02873225bfbecause GitHub reported a conflict. Its sole conflict was in the host test; both main’s shell-result table and the PR’s quota/billing tables were retained. The four production files changed by this PR are unchanged across both commits, preserving the earlier real QA evidence under the test-only and non-overlapping-merge rules.