Skip to content

[Bug]: Claude via OpenCode loses usage-limit classification and reset time #29289

Closed

Description

@unsync

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Summary

When Claude's weekly subscription allowance is exhausted, OpenCode's built-in claude-agent provider returns provider.unknown with an explicit ISO reset timestamp in the message. T3's OpenCode adapter maps that error to provider_error and omits resetAt, preventing the failure from using the existing reset-based snooze/resume path.

This report is limited to Claude Code login through OpenCode. ChatGPT through OpenCode is already tracked separately in #26265 / #26264.

Steps to reproduce

Prerequisite: an existing Claude Code login whose weekly subscription allowance is already exhausted.

The provider failure was reproduced live with:

opencode run --format json --model claude-agent/haiku \
  "Reply only QUOTA_PROBE_OK. Do not call tools, read files, delegate work, or make changes."

To verify the corresponding T3 behavior, send a minimal prompt in a T3 thread using OpenCode with claude-agent/haiku, then inspect the failure classification and reset-based actions. This T3 runtime check remains pending; the adapter behavior below is established by source inspection.

Expected behavior

Recognize the quota stop as usage_limit and preserve the reported reset as resetAt, so T3 can offer its existing Snooze until reset and Resume at reset actions and schedule recovery when enabled.

No reset time should be guessed when Claude does not provide one.

Actual behavior and evidence

A real minimal request on 2 November 2026 at 12:38 Europe/Paris failed with exit code 1 and this OpenCode error:

{
  "type": "provider.unknown",
  "message": "You've hit your weekly limit · resets 9pm (Europe/Paris) Resets at 2026-11-02T20:00:00.000Z."
}

The error contained only type and message: no HTTP status, response body, structured reset field, or retry delay. The timestamp corresponds to 2 November at 21:00 Europe/Paris.

In packages/provider-opencode/src/server/v2/adapter.ts, session.execution.failed:

  • Only provider.quota (except HTTP 402) and provider.rate-limit become usage_limit; this provider.unknown failure becomes provider_error.
  • The adapter constructs the failure without passing resetAt, despite the explicit timestamp in the message.

Impact

Affected failures cannot use reset-based recovery and require manual continuation after the allowance resets. The requested behavior is to wait for the reported reset, not bypass the quota.

Versions and environment

  • macOS; T3 Code desktop 0.1.6, installed via Homebrew cask t3-code (confirmed by Homebrew and app metadata).
  • OpenCode 2.2.5, running as a local service.
  • Claude Code 2.1.316; built-in OpenCode provider claude-agent, model claude-agent/haiku.
  • External Claude Code login, not a direct Anthropic API-key connection or OpenCode Go.

Latest-source check

On 2 November 2026, the same classification and missing resetAt forwarding were confirmed in source at:

  • Installed release v0.1.6.
  • Latest published nightly v0.1.7-nightly.20261102.4066.
  • Current main, commit 47f2c8d29e981c7723467efe137ee19e91df924e (linked above).

The nightly was source-inspected, not installed or runtime-tested.

Related reports

Direction before contributing

Would a narrowly scoped T3 adapter fix recognizing this claude-agent quota failure and its explicit ISO reset timestamp be acceptable, or should this wait for structured quota/reset metadata from OpenCode?

The proposed scope is only this Claude failure: validate the explicit timestamp, preserve unrelated errors and billing failures, and add regression coverage using the captured payload. No new settings, scheduler, plugin, or account-usage probing is proposed. No PR has been opened.

Workaround

Check Claude's reported reset time and manually resume the thread afterward.

Activity

  1. added
    bugSomething is broken or behaving incorrectly.
    needs-triageIssue needs maintainer review and initial categorization.
    on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is broken or behaving incorrectly.needs-triageIssue needs maintainer review and initial categorization.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions