Skip to content

Add Muse usage collector for agents panel - #12048

Closed
yehudacohen wants to merge 1 commit into
omacom:quattrofrom
yehudacohen:muse-usage-collector
Closed

yehudacohen wants to merge 1 commit into
omacom:quattrofrom
yehudacohen:muse-usage-collector

Conversation

@yehudacohen

@yehudacohen yehudacohen commented Sep 16, 2026 •

Copy link
Copy Markdown

Adds bin/omarchy-agent-usage-muse so the agents bar widget and panel pick up Muse Code subscriptions.

  • Local stats (prompts, sessions, tokens by day and model) scanned from $XDG_DATA_HOME/muse/sessions logs. Each model response is logged twice (record.quantity + model/usage lines), so only lines carrying both a model name and a usage payload are counted; string and object model shapes are merged.
  • Limits stay empty, and this is now proven structural rather than just undiscovered: driving MSP end to end (serve -> initialize -> session/start -> one minimal turn) yields a live usage/changed notification plus usage/read snapshot (tier, 300-min window percent + resetsAtMs, weekly percent + resetsAtMs) matching the TUI's /usage exactly — but a fresh host answers {} until live model traffic flows through it, and nothing persists the windows (session logs, view journals/snapshots, index DB all checked). A polling collector therefore cannot fill limits without spending a model call per refresh, which costs tokens and perturbs the meter. That needs a Muse-side change (persist last-observed usage) to unlock.
  • Includes test/shell.d/agent-usage-muse-scanner-test.sh and a README collector-table row.
  • Verified: new scanner test passes, plus bin-style, test/cli, and all existing agent-usage scanner tests.

@omarchybot omarchybot added the enhancement New feature or request label Sep 27, 2026
@dhh

dhh commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Thanks! Muse is coming in through #14040 (from #10610, which also reads the real 5-hour and weekly limits). Closing in favor of that.

@dhh dhh closed this Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants