Skip to content

Fix Claude rate-limit handling for mixed account states#103

Merged
kargnas merged 1 commit intomainfrom
codex-fix-claude-rate-limit-rows
Mar 8, 2026
Merged

Fix Claude rate-limit handling for mixed account states#103
kargnas merged 1 commit intomainfrom
codex-fix-claude-rate-limit-rows

Conversation

@kargnas
Copy link
Member

@kargnas kargnas commented Mar 8, 2026

Summary

This change fixes the Claude multi-account menu behavior when one account still has usable quota data but another account is in a rate-limited cooldown window. Users were seeing the entire Claude section collapse into a single Rate limited provider row, which hid both Claude accounts from the dropdown even though one account remained valid and should still have been visible.

The root cause was the provider-level error precedence in the menu renderer. ProviderManager intentionally preserves rate-limit errors during the cooldown interval, even when cached provider results are still available. StatusBarController treated that provider-level rate-limit error as higher priority than the existing multi-account result and replaced the account rows with a single error row. In mixed-account Claude states, that meant an error produced by one account could visually suppress the other account and make the whole provider appear unavailable.

The fix adds a shared display policy for rate-limited rows. Multi-account providers now keep rendering their account rows whenever displayable account data already exists, and the provider-level Rate limited row is only shown when there are no account rows to render. This keeps the existing cooldown behavior for providers that truly have no visible account data, while preserving Claude, Codex, Copilot, and Gemini account rows when cached or current account-level data is still available.

I also added regression coverage for the display policy. The new tests verify that Claude account rows remain visible during a rate-limit cooldown when account data exists, and that single-result providers without account rows still surface the rate-limit error row as before.

Validation

I validated the change with the existing targeted provider regression suite and with a clean local Debug build:

  • xcodebuild test -project CopilotMonitor/CopilotMonitor.xcodeproj -scheme CopilotMonitor -configuration Debug -destination 'platform=macOS' -only-testing:CopilotMonitorTests/ProviderUsageTests
  • xcodebuild -project CopilotMonitor/CopilotMonitor.xcodeproj -scheme CopilotMonitor -configuration Debug -destination 'platform=macOS' clean build

I also restarted the Debug app and confirmed the updated build launched successfully and emitted provider logs. The exact mixed live state was not reproducible at run time because both Claude accounts were returning HTTP 429 during that launch window, so the final user-facing behavior for the mixed state is covered by the new regression tests.

@kargnas kargnas merged commit c85bd34 into main Mar 8, 2026
12 checks passed
@kargnas kargnas deleted the codex-fix-claude-rate-limit-rows branch March 8, 2026 07:18
@op-gg-ai-devops
Copy link
Contributor

Rate Limit 오류가 있어도 표시할 계정 데이터가 있다면 에러 뷰 대신 정보를 우선 보여주도록 ProviderDisplayPolicy를 도입했네.


ProviderDisplayPolicy로 표시 정책 로직을 분리해 StatusBarController가 스파게티 되는 걸 잘 막았어, 구조적으로 아주 칭찬해. 다만 isRateLimitError에서 매직 스트링("rate limited", "http 429")에 의존하는 방식은 API 메시지가 조금만 바껴도 바로 터질 수 있어서 위험해 보여. 가능하다면 명시적인 에러 코드나 타입으로 판단하도록 개선하는 게 좋겠어. 테스트 케이스도 꼼꼼하게 잘 챙겼네.


이건 그냥 짧은 맛보기 리뷰야. 버그부터 보안 이슈까지 탈탈 털어주는 상세 리뷰를 원하면 @op-gg-ai-devops 리뷰해줘라고 댓글을 달거나, **op-gg-ai-devops**를 리뷰어로 추가해줘. (규칙은 AGENTS.md를 따름)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant