Repository navigation
feat: Go usage meter — TUI sidebar + go_usage tool (#1) - #2
Merged
Merged
Conversation
…ds under opencode #1
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.
Description
OpenCode Go usage meter, modelled on
four-opencode-deepseek-meter, plus an agent-callable tool.Closes #1
Changes
go_usagetool:available: yes|no|unknown+ 5-hour / weekly / monthly meters with reset times; never throws, key redacted from any upstream messageGO 5h 30% · wk 12% · mo 40%(green / yellow ≥80 % / red)auth.jsonopencode-go(data → state dir) →~/.secrets/opencode-go-key→OPENCODE_GO_API_KEY→OPENCODE_API_KEYGET https://opencode.ai/inference/go/v1/usage(opencode.ai/docs/go)Testing
bun run buildpassesbunx tsc --noEmit0 errorsbun test31 passapi_key_expired(handled:INVALID KEY)Review
Local code review 88 % → findings 1/2/4/5 fixed (key redaction, unrounded availability check, unknown status ≠ ok, tool-path never-throw tests), 3 documented (state-dir fallback is TUI-only).
🤖 Generated with Claude Code