Include disabled Claude accounts from accounts.json#104
Merged
Conversation
Contributor
|
비활성 계정을 쳐내던 이건 짧은 요약본 맛보기 리뷰야. 버그 탐지랑 보안 체크까지 싹 다 들어간 한 줄 한 줄 디테일한 코드 리뷰를 받고 싶으면 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This change makes Claude account discovery include entries from
opencode-anthropic-auth/accounts.jsoneven 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 hadenabled == 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/testReadClaudeAnthropicAuthFilesIncludesDisabledAccountsxcodebuild -project CopilotMonitor/CopilotMonitor.xcodeproj -scheme CopilotMonitor clean build -destination "platform=macOS"Including disabled Claude account from opencode-anthropic-authlog during the targeted test run