anomalyco / anomalyco/opencode

fix(llm): unified rate-limit utilization and status headers are dropped

Đang mở
#49,653 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

@jlongster đang làm issue này rồi.

Từ ngày 18/9/2026.

Ngôn ngữ chính
TypeScript
Star
209k
Fork
27.5k
Chỉ số merge pull request
Chỉ số pull request đang chờ

Mô tả

Description

On an Anthropic subscription account, the rate-limit details parsed out of a response keep
anthropic-ratelimit-unified-5h-reset but drop anthropic-ratelimit-unified-5h-utilization and
anthropic-ratelimit-unified-status, which arrive in the same response.

rateLimitDetails in packages/llm/src/route/executor.ts matches
/^anthropic-ratelimit-(.+)-(limit|remaining|reset)$/. The unified windows report a spent
fraction instead of a remaining count, so -utilization matches nothing and is discarded, and
-status has no branch at all. A rate-limited account is therefore told when its window clears
and never how full it is.

If a response carries only unified headers, limit/remaining/reset all stay empty and the
emptiness check returns undefined, so there are no details at all.

OpenCode version

1.18.31 (dev)

Steps to reproduce
  1. Use an Anthropic subscription (OAuth) account, not an API key.
  2. Make a request that comes back with the unified headers:
    anthropic-ratelimit-unified-5h-utilization, anthropic-ratelimit-unified-5h-reset,
    anthropic-ratelimit-unified-status.
  3. Inspect the parsed HttpRateLimitDetails — the reset is present, the utilization and status are gone.
Operating System

macOS 26.0 (arm64)

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.