Conversation
…ider) New HTTP-based provider querying https://api.opencode.ai/v1/credits. Shows credit usage as a quota bar (used / total) with DisplayAsFraction. Complements the existing CLI-based OpenCodeZenProvider which shows cost, sessions, messages, models, and tools. Auth discovery: - OPENCODE_API_KEY environment variable - opencode auth.json (key field under "opencode" root) - Searches: ~/.local/share/opencode/, %APPDATA%/opencode/, etc. Handles edge cases: non-JSON "Not Found" body with HTTP 200 (observed in opencode-bar), missing data field, zero credits, full consumption. 9 tests covering: valid response, full/zero usage, missing key, unauthorized, non-JSON body, missing data, computed remaining, metadata. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…roviders ScanForKeysAsync iterated ALL discovered providers and added them to the config file even when no API key was found. This created ghost entries (e.g. DeepSeek) that the user never configured. Now skips providers without keys — only providers with actual credentials get persisted. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 tests using a real ConfigService with temp directory (not mocks): 1. NeverPersistsProvidersWithoutKeys — after scan with no auth sources, no configs should exist in providers.json 2. DoesNotGrowConfigFileWithKeylessProviders — the file should not balloon with skeleton entries for every known provider 3. AllPersistedConfigsHaveKeys — fresh reload from disk confirms every entry has an actual API key These would have caught the bug where ScanForKeysAsync persisted empty configs for DeepSeek, Antigravity, etc. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…OpenCode" - HTTP API provider (api.opencode.ai/v1/credits): id="opencode-go", display="OpenCode Go" - CLI provider (opencode stats): id="opencode-zen", display="OpenCode" - Removed "opencode-go" alias from Zen since it's now the HTTP provider's ID Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The API returns HTTP 200 with "Not Found" text for account types that don't support the credits endpoint. Instead of showing an error card, return empty so the provider doesn't clutter the UI. Customers with supported accounts will see the credits bar as expected. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Instead of string-matching "Not Found" in the response body, check the Content-Type header. The API returns text/plain for unsupported accounts and application/json for valid credits responses. More robust and doesn't depend on the exact error text. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
feat: add OpenCode credits API provider (usage bar)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
Bumps version to
2.3.4-beta.26.Changes since beta.25
🤖 Generated with Claude Code