Repository navigation
Conversation
A retry scheduled for a rate limit or a 429 quota showed as a provider error while it ran, and only the terminal failure row was classed as a usage limit. Retry rows now share the terminal row's classification, so an out-of-funds 402 quota stays a provider error and the row stays retryable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — OpenCode 2 quota and rate-limit retries now appear as usage-limit warnings using the existing classification rules. Retry behavior and terminal error classification remain unchanged. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Classify retry and execution failures packages/provider-opencode/src/server/v2/adapter.ts |
A shared classifier treats provider.rate-limit errors and provider.quota errors with statuses other than 402 as usage limits. Retry and execution failure handling use this classifier. |
Verify retry and terminal events apps/server/src/orchestration-v2/Adapters/OpenCode2AdapterV2.test.ts |
The test checks the running retry error row, including its retryability and failure class. It also checks the retry and terminal failure classifications. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related issues
- pingdotgg/t3code#29289: This change classifies rate-limit and quota errors as usage limits, but does not cover
provider.unknownmessages orresetAtextraction. - pingdotgg/t3code#28936: This change applies usage-limit classification to OpenCode 2 retries; the Codex retry behavior remains outside its scope.
- pingdotgg/t3code#24885: This change applies the classification to OpenCode 2, but does not cover the Codex capacity case.
- pingdotgg/t3code#27096: This change classifies OpenCode 2 quota and rate-limit errors, but does not cover the Muse tier-limit case.
Suggested reviewers: fixfon
Merge Risk: 
Minimal · up to 278a9
-
The change is mergeable; it updates retry-row presentation without altering recovery or thread error handling.
Pre-merge checks: 
4
-
Full details: Description check
-
Explanation
The description includes complete Problem, Change, Scope and approval, and Verification sections. It explains the behavior change, implementation, scope rationale, test results, manual verification, and limitations.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Usage-based review receipt
- Mode: Continue automatically
- Reviewed files: 2
- Charged: $0.50
- View usage details
Note
This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. View usage-based billing.
|
Note Written by Merged main without rebasing and resolved the OpenCode adapter conflict, preserving main's Claude limit classification and reset timestamp handling. Adjusted the retry assertion for main's At |
|
Note Written by Verified in a real dev environmentpartial verification at
main, terminal quota warning: pr, same prompt and provider, terminal quota warning: pr interaction: real terminal quota failure, model switch, context handoff, and successful codex response. a 15-second idle gap was trimmed; this is not retry-recovery evidence. Not verifiedthe actual changed behavior remains unverified. the real service failed immediately and never scheduled a retry on either revision. there were zero running retry rows, so i could not reproduce the original running-retry bug on main or prove its fix on the pr. i did not replace the provider with a stub or manufacture a 429. passing adapter tests and terminal-warning captures do not prove the running retry path. also unverified: real 402 balance errors, automatic retry recovery, native ios/android clients, and native desktop builds. these require an appropriate real provider condition or native environment. this is a partial runtime check, not a ready-to-merge claim. |


Problem
When OpenCode 2 hits a rate limit or a usage window (HTTP 429), it schedules a retry, and T3 shows a retry row while it waits. That row is always classed as a provider error. If the retries run out, the final row for the same error is classed as a usage limit. So while the retry runs, web shows the row without the usage-limit warning, and mobile shows it with the provider-error alert icon. It only gets the usage-limit look once the turn has failed.
updateRetryin the OpenCode 2 adapter hard-codesclass: "provider_error". The terminalsession.execution.failedcase already classesprovider.rate-limitand non-402provider.quotaerrors asusage_limit.Change
isUsageLimit(type, status), holds the existing terminal rule: a 429 quota or a rate limit is a usage limit, and a 402 quota (an empty balance) is not.updateRetryand the terminal case both use it. The retry row staysretryable: true.Claude retry rows already do this: a 429 retry is
usage_limit. Server-side usage-limit handling (recovery, auto-resume, usage refresh, the thread's last error) reads only failed rows, so a running retry row with this class changes only how the row looks. If the retry succeeds, the row turnscompletedand shows as recovered, as before.Scope and approval
No issue or discussion. This is a very small, focused fix for an obvious bug: the same error gets two classes depending only on whether OpenCode will retry it, and web and mobile already have a usage-limit look for a running retry row. OpenCode v1 has no retry rows.
Verification
apps/server/src/orchestration-v2/Adapters/OpenCode2AdapterV2.test.ts:usage_limit.vp run check:changed: format, lint, knip, typecheck and the changed tests pass.Retry-After: 600, so the real adapter produces a running retry. Before uses main's adapter file; after uses this branch. The stored row readsfailure.class: provider_erroron main andusage_limitwith this PR.Web, main: the running retry row has no warning.
Web, this PR: the same row shows the usage-limit warning.
Desktop, main: the running retry row has no warning.
Desktop, this PR: the same row shows the usage-limit warning.
iOS, main: the rate-limit retry row has the provider-error alert icon.
iOS, this PR: the row has the icon mobile uses for usage limits.
Android, main: the rate-limit retry row has the provider-error alert icon.
Android, this PR: the row has the icon mobile uses for usage limits.
Not checked:
provider.rate-limit.Prior PRs
#18315 by Marker-bit made OpenCode Go quota stops show as usage limits on the final row. This PR applies the same rule to the retry row that comes before it.
Generated with Claude Opus 5.5 and GPT-6.1 Terra in T3 Code Nightly