Conversation
Greptile SummaryThis PR fixes the
Confidence Score: 4/5Safe to merge — the change is a targeted one-line swap to a narrower beta-header constant, and the new constant correctly drops the 1M-context beta flag that is irrelevant for a minimal quota-probe request. Both changed files are small and focused. The new constant value is a strict subset of the existing ClaudeCodeBetaHeader, the omitted feature (context-1m-2025-08-07) has no bearing on a 1-token probe request, and the checker logic itself is unchanged. The only gap is a missing doc comment on the new constant. No files require special attention; constants.go warrants a glance only for the missing comment on ClaudeCodeQuotaCheckHeader. Important Files Changed
Sequence DiagramsequenceDiagram
participant C as ClaudeCodeQuotaChecker
participant A as Anthropic API
C->>A: "POST /v1/messages<br/>anthropic-beta: ClaudeCodeQuotaCheckHeader<br/>(no context-1m-2025-08-07)<br/>model: claude-haiku-4-5, max_tokens: 1"
A-->>C: HTTP 200 + rate-limit headers
C->>C: "parseResponse(headers)<br/>read Anthropic-Ratelimit-Unified-* headers"
C-->>C: "return QuotaData{Status, Limits, ...}"
Reviews (1): Last reviewed commit: "fix(llm): claude code quota check header" | Re-trigger Greptile |
| // ClaudeCodeQuotaCheckModel is the model used for quota checking requests. | ||
| ClaudeCodeQuotaCheckModel = "claude-haiku-4-5" | ||
| ClaudeCodeQuotaCheckModel = "claude-haiku-4-5" | ||
| ClaudeCodeQuotaCheckHeader = "claude-code-20250219,interleaved-thinking-2025-05-14,redact-thinking-2026-02-12,context-management-2025-06-27,prompt-caching-scope-2026-01-05,mid-conversation-system-2026-04-07,effort-2025-11-24" |
There was a problem hiding this comment.
The new constant has no doc comment, unlike every other constant in this block. Future readers won't know which beta features were intentionally excluded from quota-check requests or why (here,
context-1m-2025-08-07 is omitted because it's irrelevant for a 1-token quota probe).
| ClaudeCodeQuotaCheckHeader = "claude-code-20250219,interleaved-thinking-2025-05-14,redact-thinking-2026-02-12,context-management-2025-06-27,prompt-caching-scope-2026-01-05,mid-conversation-system-2026-04-07,effort-2025-11-24" | |
| // ClaudeCodeQuotaCheckHeader contains beta feature identifiers for quota-check requests. | |
| // Intentionally omits context-1m-2025-08-07, which is not needed for minimal probe requests. | |
| ClaudeCodeQuotaCheckHeader = "claude-code-20250219,interleaved-thinking-2025-05-14,redact-thinking-2026-02-12,context-management-2025-06-27,prompt-caching-scope-2026-01-05,mid-conversation-system-2026-04-07,effort-2025-11-24" |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Uh oh!
There was an error while loading. Please reload this page.