Skip to content

Stop retrying terminal provider billing errors#509

Draft
mrubens wants to merge 1 commit into
developfrom
codex/terminate-provider-billing-retries
Draft

Stop retrying terminal provider billing errors#509
mrubens wants to merge 1 commit into
developfrom
codex/terminate-provider-billing-retries

Conversation

@mrubens

@mrubens mrubens commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • classify provider billing, suspension, and payment-required responses as terminal
  • stop OpenCode retry backoff when a retry status contains a terminal provider error
  • surface the provider message, clear queued prompts, and abort the task
  • preserve existing retry behavior for transient provider failures

Validation

  • focused OpenCode harness tests
  • worker typecheck
  • worker lint
  • formatting checks
  • pre-push checks (oxlint, residual lint, check-types:fast, knip)

@roomote-roomote

roomote-roomote Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

1 issue outstanding. See task

  • apps/worker/src/sandbox-server/lib/harnesses/opencode-server/provider-error-recovery.ts:153 handleSessionStatus calls this classifier with only { message }, so the 402/payment_required fields covered by the new test are unavailable. A retry status whose message is simply Payment required is not matched by the string checks and therefore stays in OpenCode's retry loop, contrary to the stated payment-required behavior. Match that message-only form (and add a retry-status regression test).

Reviewed e66982f

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.

1 participant