Skip to content

ACP Registry agents classify quota errors as provider_error instead of usage_limit #38940

Open

Description

@Kietnehi

What happened

When an ACP Registry agent (such as the qodercn Qoder CLI ACP instance) exhausts plan quota or hits rate limits, the turn failure is classified as generic provider_error instead of usage_limit. The thread surfaces a generic "Provider error" instead of the "Limited" state, omits reset timestamps, and permanently prevents thread resumption.

Expected behavior

Per docs/internals/adding-a-provider.md, quota and rate-limit errors must classify as usage_limit with resetAt when available, allowing the thread to display the "Limited" badge and remain resumable manually or automatically.

Actual behavior

Errors from ACP agents pass through acpRegistryPromptFailure, which maps all agents except mistral-vibe to class: "provider_error". The UI displays "Provider error", no resetAt is recorded, and resume attempts are rejected.

Evidence from the codebase

  • packages/provider-acp-registry/src/server/adapter.ts: acpRegistryPromptFailure restricts class: "usage_limit" strictly to agentId === "mistral-vibe" and cause.code === MISTRAL_VIBE_RATE_LIMITED. All other agents default to provider_error.
  • packages/provider-acp/src/server/adapter.ts: idleErrorFailure and finalizeTurn default unhandled errors to class: "provider_error".
  • packages/provider-core/src/server/failure.ts: makeProviderFailureTurnItem renders "Provider error" instead of "Usage limit reached" unless class is usage_limit.
  • apps/server/src/orchestration-v2/Orchestrator.ts: manualContinuationOfRunId allows resuming failed runs only when limited?.class === "usage_limit". Under provider_error, resumption fails with "This thread can no longer be resumed from that run."
  • packages/provider-core/src/server/snapshot.ts: ManagedServerProvider exposes applyUsageLimits, but ACP Registry does not translate quota errors into usage limits.

Steps to reproduce

  1. Configure an ACP Registry agent instance for qodercn.
  2. Run turns until plan quota is exhausted.
  3. Inspect thread status in the sidebar and attempt to resume.

Impact

ACP agents hitting quota display confusing provider failure errors rather than quota limits. Users lose reset time visibility and cannot resume the thread once quota refills.

Environment

  • Repository: pingdotgg/t3code (shallow clone of main at 2026-11-19)
  • OS: Linux

Labels: bug, provider-acp

Activity

  1. catnaut commented on Nov 19, 2026

    @catnaut

    Same root cause, and it also hits the official Claude adapter. claude-agent-acp (registry id claude-acp, checked 0.107.0 and 0.108.1) already sends a structured usage-limit error, and T3 drops it.

    When Claude Code reports a usage limit, the adapter fails the turn with code -32603 and this data (turnErrorData in its src/result-end.ts):

    { "errorKind": "rate_limit", "rateLimit": { "status": "rejected", "rateLimitType": "five_hour", "resetsAt": <unix seconds> } }

    On ACP v2, which T3 negotiates, this arrives as the error of the idle state_update. idleErrorFailure (packages/provider-acp/src/server/adapter.ts:5314) wraps it in an AcpRequestError with data intact and calls flavor.promptFailure. On v1 it is the session/prompt error and reaches the same hook at :9185. Both end in acpRegistryPromptFailure (packages/provider-acp-registry/src/server/adapter.ts:123), which only matches agentId === "mistral-vibe" && code === -31001. Every other agent gets provider_error and resetAt: null.

    This does more than mislabel the error. UsageLimitRecoveryWorker only picks up threads with lastErrorClass === "usage_limit" and a usageLimitResetAt (apps/server/src/orchestration-v2/UsageLimitRecoveryWorker.ts:25-27). So with autoResumeLimitedThreads on, ACP threads never resume after the reset. Native Claude and Codex threads do.

    Data from my install (0.1.11-nightly.20261118.4864, macOS arm64), using a Claude Code-based ACP agent: 30 error items over five limit windows (11-16 to 11-18). They show messages like "You've hit your 5-hour limit · resets 7am (UTC)". All 30 are stored as class: "provider_error", resetAt: null, with autoResumeLimitedThreads: true. That agent uses its own shape (-32003 with the limit info under a vendor data key). It will switch to the claude-agent-acp shape if T3 reads that one.

    Suggested fix, not tied to agentId: in acpRegistryPromptFailure, when data.errorKind === "rate_limit" and data.rateLimit.status === "rejected", return usage_limit with resetAt taken from data.rateLimit.resetsAt. Convert it the same way claudeUsageLimitResetAt does in ClaudeAdapterV2. If resetsAt is missing, keep usage_limit and use resetAt: null. That covers claude-acp today. ACP has no standard field for this, so it also gives other registry agents a single shape to copy.

    Line numbers are from main 5db8cca (2026-11-18). I traced this from the code and stored failures. I did not run claude-acp itself against an exhausted account.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions