Skip to content

Include disabled Claude accounts from accounts.json#104

Merged
kargnas merged 1 commit intomainfrom
codex-include-disabled-claude-accounts
Mar 15, 2026
Merged

Include disabled Claude accounts from accounts.json#104
kargnas merged 1 commit intomainfrom
codex-include-disabled-claude-accounts

Conversation

@kargnas
Copy link
Copy Markdown
Member

@kargnas kargnas commented Mar 15, 2026

Summary

This change makes Claude account discovery include entries from opencode-anthropic-auth/accounts.json even when those accounts are marked "enabled": false.

Before this patch, disabled Claude entries were skipped during discovery, so their usage never appeared in OpenCode Bar. That produced an incomplete Claude account list for users who intentionally kept accounts disabled in the auth plugin but still wanted their quota state visible in the app.

The root cause was a hard filter in TokenManager.readClaudeAnthropicAuthFiles(at:) that returned early whenever an account had enabled == false. The fix removes that exclusion while keeping a debug log so the discovery path is visible when disabled Claude accounts are included.

The test suite was updated to lock this behavior in place by asserting that both enabled and disabled accounts from the fixture are parsed and surfaced as Claude auth accounts.

Validation

  • xcodebuild test -project CopilotMonitor/CopilotMonitor.xcodeproj -scheme CopilotMonitor -destination "platform=macOS" -only-testing:CopilotMonitorTests/TokenManagerTests/testReadClaudeAnthropicAuthFilesIncludesDisabledAccounts
  • xcodebuild -project CopilotMonitor/CopilotMonitor.xcodeproj -scheme CopilotMonitor clean build -destination "platform=macOS"
  • Confirmed the new Including disabled Claude account from opencode-anthropic-auth log during the targeted test run

@kargnas kargnas marked this pull request as ready for review March 15, 2026 02:15
@kargnas kargnas merged commit 5fe646b into main Mar 15, 2026
13 checks passed
@kargnas kargnas deleted the codex-include-disabled-claude-accounts branch March 15, 2026 02:15
@op-gg-ai-devops
Copy link
Copy Markdown
Contributor

accounts.json 파일에서 비활성화된 Claude 계정도 건너뛰지 않고 그대로 파싱해서 가져오도록 TokenManager랑 관련 테스트 코드를 다 수정했네.

비활성 계정을 쳐내던 continue를 날리고 영어로 로그를 남긴 처리, 로그 언어 정책도 잘 지켰고 아주 깔끔하게 잘 짰어. 테스트 코드도 계정 2개 다 제대로 물고 오는지 꼼꼼하게 검증해놔서 안심이네. 당장 성능이나 보안 쪽에 문제 될 만한 이슈는 안 보이는데, 다만 이렇게 가져온 비활성화 토큰들이 나중에 괜히 API 찔러봐서 에러를 뱉거나 리프레시 루프 도는 삽질만 안 하게 앱 단에서 잘 핸들링해 주면 완벽할 거다 야.


이건 짧은 요약본 맛보기 리뷰야. 버그 탐지랑 보안 체크까지 싹 다 들어간 한 줄 한 줄 디테일한 코드 리뷰를 받고 싶으면 @op-gg-ai-devops 리뷰해줘라고 댓글을 달거나, 날 @op-gg-ai-devops 리뷰어로 추가해봐 (코드 푸시할 때마다 귀신같이 알아서 리뷰해 줄게).

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