anomalyco / anomalyco/opencode

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

Abierto
#49,653 0 comentarios 0 reacciones 1 asignado Ver en GitHub

@jlongster ya está trabajando en esto.

Desde el 18/9/2026.

Lenguaje dominante
TypeScript
Estrellas
209k
Forks
27.5k
Métricas de merge de PR
Métricas de PR pendientes

Descripción

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)

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.