Repository navigation
Add a Grok usage collector for the agents panel - #6803
Closed
jason-watts wants to merge 1 commit into
Closed
jason-watts wants to merge 1 commit into
jason-watts wants to merge 1 commit into
Conversation
Ship omarchy-agent-usage-grok so the existing agents widget can show Grok the same way it shows Claude, Codex, and Fireworks. Local token stats come from ~/.grok/sessions turn-completed events. Monthly prepaid credit, the on-demand cap, and the plan label come from the cli-chat-proxy endpoints the CLI already uses for /usage. SuperGrok / X Premium+ subscriptions have no prepaid monthly meter, so those tabs show local tokens and the plan name.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Grok usage collection and display support to the agents panel.
Changes:
- Collects local session statistics and xAI billing limits.
- Enables Grok with light/dark icons.
- Adds documentation and scanner tests.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 3 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
bin/omarchy-agent-usage-grok |
Implements Grok usage collection. |
test/shell.d/agent-usage-grok-scanner-test.sh |
Tests collection, billing, authentication, and caching. |
shell/plugins/agents/README.md |
Documents Grok support and configuration. |
shell/plugins/agents/manifest.json |
Enables Grok by default. |
shell/plugins/agents/assets/grok.svg |
Adds the dark-surface icon. |
shell/plugins/agents/assets/grok-light.svg |
Adds the light-surface icon. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Author
|
Agent should have checked for duplicates before writing this. Closig. |
5 of 6 tasks
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.
What
Adds
omarchy-agent-usage-grokso the existingomarchy.agentsbar widget can show Grok usage the same way it already shows Claude, Codex, and Fireworks. The panel does not need a QML change: it already draws any record that lands in~/.local/state/omarchy/agents/usage/.How
~/.grok/sessions(orGROK_HOME). Eachturn_completedevent inupdates.jsonlis one prompt; token buckets are summed per turn, not taken as a running session total./usagecommand uses (/v1/billingand/v1/settings). The collector only reads the OIDC token already stored in~/.grok/auth.json. It never writes credentials and does not refresh them — that stays withgrok login.assets/grok.svgplus a light-surface twin, and enablesgrokin the widget defaults.Tests
./test/shell.d/agent-usage-grok-scanner-test.shcovers empty/unauthenticated records, per-turn summing, idle sessions, monthly/on-demand/balance mapping, expired tokens, and--limits-onlycache reuse.Verified on a live X Premium+ login: the panel gained a Grok tab with today's token totals and the
X Premium+plan line, and no invented monthly meter.