[Bug]: ClaudeAdapterV2 drops resetAt from Z.ai 429 usage-limit errors, disabling "Resume at reset" and auto-resume #49653
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
Steps to reproduce#
- Configure a
claudeAgentprovider instance pointed at Z.ai's Anthropic-compatible endpoint (ANTHROPIC_BASE_URL=https://api.z.ai/api/anthropic, e.g. runningglm-5.4on a Z.ai Coding Plan). - Run turns until the 5-hour quota is exhausted and Z.ai returns HTTP 429 with error code
1308. - Observe the failed thread's usage-limit banner and auto-resume state.
Expected behavior#
T3 Code extracts the reset timestamp from the 429 error text into failure.resetAt, displays the reset time in the usage-limit banner, offers Resume at reset / Snooze until reset, and arms UsageLimitRecoveryWorker when auto-resume is enabled.
Actual behavior#
T3 Code classifies the failure as usage_limit (Usage limit reached / Claude API rate limit reached. Try again later.), but records resetAt: null. As a result:
- The banner shows "Reset time unavailable; retry manually" with no Resume at reset or Snooze until reset actions (
apps/web/src/components/chat/UsageLimitRecoveryBanner.tsx:55-59,113). UsageLimitRecoveryWorker.limitRecoveryCommandreturnsnullbecausethread.usageLimitResetAtis missing (apps/server/src/orchestration-v2/UsageLimitRecoveryWorker.ts:24-33), so auto-resume never arms.
In apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts:5645-5662 (providerFailureFromResult), 429 error-text parsing only matches relative (reset after XhYmZs) durations (as emitted by gateways like CLIProxyAPI) and does not parse Z.ai's [1308][Usage limit reached for ... Your limit will reset at YYYY-MM-DD HH:MM:SS][YYYYMMDDHHMMSS...] format.
Note on the timezone-free timestamp: Z.ai omits an explicit timezone offset on 2026-12-06 07:54:52, but the 14-digit prefix of the request ID in the trailing bracket (20261206040400 → 2026-12-06 04:04:00) is in the same server timezone (UTC+8, ~1.5 s before the UTC receivedAt of 2026-12-05T20:04:01.516Z). Computing the delta resetTimestamp - requestIdTimestamp (3h 50m 52s) relative to receivedAt recovers the exact UTC resetAt without having to hardcode UTC+8.
Impact#
Major degradation or frequent failure
Version or commit#
T3 Code Server 0.1.13 (verified unchanged on main @ be521199aace1a0b446f4db4a1181ef994aaa1e2)
Environment#
Linux x64 (7.2.15-1-omarchy), Claude Code 2.1.337, claudeAgent instance using Z.ai Coding Plan (glm-5.4)
Logs or stack traces#
# Error turn item recorded at 2026-12-05T20:04:01.541Z
title: "Usage limit reached"
text: "Claude API rate limit reached. Try again later."
# Assistant error message recorded at 2026-12-05T20:04:01.516Z
API Error: Request rejected (429) · [1308][Usage limit reached for 5 hour. Your limit will reset at 2026-12-06 07:54:52][2026120604040026a71c6a7dc7455d]
Workaround#
Manually convert Z.ai's UTC+8 reset timestamp from the chat error message and create a one-time scheduled task or manually resume the thread later.
tanstack-source added labelsbug
wonsukchoi(GitHub profile, opens in a new tab) linked this to #49684
Sign in to join this conversation.