Add seven_day_overage_included to RateLimitType#1069
Conversation
The Claude CLI added a per-model weekly usage limit window in 2.1.191 and reports it to the SDK as rateLimitType "seven_day_overage_included". The message parser already passes the value through to RateLimitInfo.rate_limit_type, so only the declared Literal was out of date: exhaustive narrowing on rate_limit_type treated a value the field can really hold as impossible. The TypeScript SDK already includes it. No CHANGELOG entry; CHANGELOG.md is written by the release automation.
There was a problem hiding this comment.
LGTM — trivial one-value addition to the RateLimitType Literal, matching the TypeScript SDK and current CLI behavior.
Extended reasoning...
Overview
This PR makes a single change to src/claude_agent_sdk/types.py: it adds "seven_day_overage_included" to the RateLimitType Literal union (and reformats the union members one-per-line, which ruff format accepts). No runtime logic is touched — message_parser.py already passes rateLimitType through unvalidated, so this only affects what type checkers consider exhaustive for RateLimitInfo.rate_limit_type.
Security risks
None. This is a pure type-annotation change with no executable behavior, no input handling, and no permission/auth implications.
Level of scrutiny
Minimal scrutiny is appropriate. The change is mechanical and self-contained, mirrors the published TypeScript SDK's rateLimitType union, and aligns with the value the bundled CLI (2.1.191+) already emits. The repository's recent history on main contains an identical change (commit titled "Add seven_day_overage_included to RateLimitType"), confirming this is the expected direction.
Other factors
The bug hunting system found no issues, there are no outstanding reviewer comments, and existing rate-limit parsing tests are unaffected since no runtime branches change. The omission of a CHANGELOG entry follows the repo's release-automation convention.
Summary
The Claude CLI added a per-model weekly usage limit window in 2.1.191 and reports it to the SDK as
rateLimitType: "seven_day_overage_included"(mainhere already bundles CLI 2.1.193). This adds that value to theRateLimitTypeLiteral intypes.py.Nothing changes at runtime.
message_parser.pypassesrateLimitTypethrough unvalidated, soRateLimitInfo.rate_limit_typealready carries the value on current CLI versions. TheLiteralis what type checkers see, so exhaustive narrowing onrate_limit_typecurrently treats a value the field can really hold as impossible. The value matches the published TypeScript SDK, whoserateLimitTypeunion already includes'seven_day_overage_included'(sdk.d.ts).No
CHANGELOG.mdentry is included; changelog entries are written by the release automation (docs: update changelog for vX.Y.Z).Test plan
ruff formatis a no-op on the changed file andruff checkpasses.tests/test_message_parser.py::test_parse_rate_limit_eventandtests/test_rate_limit_event_repro.pyis unaffected; CI runs the full lint, mypy, and pytest matrix.