[Bug]: Make provider rate-limit usage resilient across RPC, PTY, and session-log fallbacks
- Dominant language
- TypeScript
- Stars
- 69.7k
- Forks
- 4.5k
- Avg merge
- 15h 28m
- Merged PRs (30d)
- 471
Description
## Summary
Rate-limit status can report empty or stale usage when provider RPC payloads are malformed/missing, when Claude exposes only `context_window`, or when the provider API is unavailable. The owner path should use a safe fallback matrix across provider RPC, PTY, and local session logs without treating missing data as successful zero usage.
## Source PRs
- #11766 — Codex local session-log fallback (credit @YuSoeun)
- #11760 — Claude `context_window` fallback for Vertex/proxy backends (credit @YuSoeun)
- #11662 — malformed Codex rate-limit RPC fallback to PTY (credit @kazu-42)
## Owner requirements
- Preserve provider/backend ordering and never display fabricated zero usage.
- Validate payload shape and own-property presence before accepting RPC data.
- Use bounded, authorized local session-log reads only when the provider fallback is unavailable.
- Cover Codex, Claude, Vertex/proxy, and PTY failure paths with regression tests.
- Preserve SSH/remote-runtime boundaries and avoid launching unsafe background sessions.
This issue intentionally consolidates the bug-fix intent; the submitted branches will be superseded and reimplemented on current main. Contributors are credited above; no contributor action is requested.
Contributor guide
Assessment
This issue has not been assessed yet.