Skip to content

Add a desktop usage widget and Grok account quotas - #44

Open
ascendedent wants to merge 5 commits into
splunk:mainfrom
ascendedent:usage-widget
Open

Add a desktop usage widget and Grok account quotas#44
ascendedent wants to merge 5 commits into
splunk:mainfrom
ascendedent:usage-widget

Conversation

@ascendedent

Copy link
Copy Markdown

Based on #43. Adds a real desktop usage overlay and provider-reported Grok limits, plus a Claude Fable weekly label.

What changed

  • Native usage widget on Linux (separate GTK overlay), Windows (topmost GDI+), and macOS (menu companion panel), with All / Claude / Codex / Cursor / Grok chips from /menubar.
  • After drag, the overlay snaps to the nearer left or right edge of that monitor. Left docks open outward; right docks stay flush using the drawn window width so the tab is not clipped.
  • Grok quotas come from the local CLI sign-in (GROK_HOME / auth.json) and the bounded billing endpoint. Missing windows stay unavailable rather than a fake 0%.
  • Claude weekly_scoped limits keep the provider model name (Fable). The main weekly pool is not duplicated as "Scoped N".
  • Linux tray no longer embeds WebKit; it spawns or quits the overlay process. The in-app dashboard drawer still works at #widget.

Privacy

  • No pasted keys. Credentials stay in existing local files, which remain gitignored.
  • Tokens, refresh tokens, and account emails are not logged or included in this change.
  • Fixture session names in tests are generic.

Merge after #43, or review f3a40f1 for this delta on top of the Grok runtime adapter.

Discover ~/.grok/sessions, read usage.json for tokens and Grok-recorded
cost, and take tools/timing from events.jsonl. Sessions stay listed when
usage is missing. Chat history, generated titles, and prompts are never
projected. Grok sessions are read-only in Token Meter.
Ship a native usage overlay with provider chips, snap it to the nearer
vertical screen edge, and read Grok's provider-reported limits from the
local CLI sign-in. Claude scoped weekly windows keep their model name,
including Fable, instead of a generic Scoped N label.

Local credential files stay gitignored and are never logged.
@bhavsarpratik

Copy link
Copy Markdown
Member

Thanks for the cross-platform usage-widget work.

We reviewed the current head (f3a40f1) and are holding the merge for now. The next revision should:

  • build on a corrected PR Add Grok Build as a local runtime adapter #43 head and a base that includes fail-closed quota redirect handling;
  • implement and test the claimed drag, edge-snap, docking, and multi-monitor behavior on macOS and Windows, or narrow the documented behavior if those platforms are intentionally different;
  • surface Linux GTK/PyGObject dependency failures instead of leaving the widget shown as enabled; and
  • rerun the native, target-host, browser, and staged-runtime gates.

Once the head is updated, we’ll review the refreshed stack and get back to you soon.

— Pratik's agent

Convert costUsdTicks at 1e10 ticks per USD. Zero ticks, costIsPartial,
and usageIsIncomplete stay unavailable instead of a measured free session.
Fail closed on quota HTTP redirects. Snap the Windows and macOS overlays
to the nearer vertical edge after a drag. If the Linux widget process
exits, uncheck Usage widget and print the dependency error instead of
leaving it enabled.
@ascendedent

Copy link
Copy Markdown
Author

Thanks for the stack notes. Head is now 7bf7f82.

  • This branch includes the corrected Add Grok Build as a local runtime adapter #43 cost-scale head (169c5af).
  • Quota HTTP now fails closed on redirects (QuotaUnavailable, no Authorization follow).
  • Windows and macOS overlays snap to the nearer left or right edge of the screen that contains the window after a drag. Linux keeps the existing drawn-width pin.
  • If the Linux widget process exits, Usage widget is unchecked and the GTK/PyGObject failure is printed instead of leaving the item enabled.

Native compile/smoke on macOS and a live Windows form pass were not run on this Linux host; Python unit and source-contract tests for the new paths did pass. Merge after #43.

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.

3 participants