Repository navigation
Conversation
Read the 5-hour and weekly quota from `muse serve` (MSP usage/changed, falling back to usage/read) and surface it as a CLI-gated status bar meter next to Claude and Codex. Muse only reports quota after a model reply, so each probe spends one minimal request; the fetcher reuses the last snapshot for 14 minutes and skips probing while the meter is hidden. Refs stablyai#23471 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
+1 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (41)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe change adds Muse subscription-usage parsing and a Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to No identified issue prevents merging the Muse usage meter after normal checks. Pre-merge checks |
|
|
We want this!! |
|
We need this. |
|
Thank you for putting this together, @shadownrx! We've since shipped Muse quota in the status bar in #38907, which covers the same ground, so I'm closing this one in favor of it. It reads |
ELI5
People who code with Muse Code had no way to see, inside Orca, how much of their Muse plan they had used. They only found out when Muse stopped answering. Now the status bar shows a Muse meter next to Claude and Codex, with the 5-hour and the weekly quota and when each one resets.
What Changed
museCLI is installed, a "Muse Usage" meter appears in the status bar and in the Usage panel (5h + weekly bars, reset countdown). You can turn it on or off from the status bar menu and from Settings → Appearance.How it works:
muse-usage-fetcher.tsstartsmuse serve --no-session-logand talks to it over its JSON-RPC protocol (MSP):initialize→session/start→ one tinyturn/start→ reads the quota from theusage/changednotification, or callsusage/readif that notification does not arrive.muse-usage-response.tschecks the payload and maps it to the sharedProviderRateLimitsshape. Values above 100% (over quota) are clamped to the 0–100 meter.museis added to the status bar item enum, the defaults, the one-time "default-on" migration and the CLI-detection gating.Why
Muse only reports quota after a model reply. There is no read-only quota endpoint, and the local session files hold only token counts, not plan limits. So each real probe spends one minimal request (
Reply with exactly: ok, reasoning effortnone). To keep this cheap:Reusing
muse serve(the CLI's own protocol) instead of reading Muse credentials keeps Orca out of Muse's login lifecycle: the user stays signed in throughmuse login.Open question for maintainers: the meter is default-on when
museis detected, like the other CLI meters. Because each refresh spends a small amount of the user's quota, you may prefer default-off. That is a one-line change inui-slice-hydration-status-bar-items.ts/status-bar-defaults.ts.Linked Issue
Fixes #23471
Visual Proof
Before (released Orca 1.4.220, Muse missing) and after (this branch, Muse row + status bar meter): screenshots attached below.
Testing
pnpm dev, Muse Code 1.4.4): the Usage panel and the status bar show Muse with real values (5h 2%, weekly 2%).muse-usage-fetcher.test.ts: payload parsing, mapping and clamping, and the fullmuse servehandshake against a fake child (pushed usage,usage/readfallback, failed turn).museprocess or spend a request._museStatusBarDefaultAddedmigration flag.pnpm typecheck,oxlint,oxfmt --check, and the localization / max-lines / RPC catalog / reliability checks pass. Vitest onsrc/main/rate-limits,src/main/startup,src/renderer/src/store/slices,src/renderer/src/components/{status-bar,settings}andsrc/shared: 19,534 passed.AI Disclosure
Written with Claude Code (Claude Opus 5.5) and reviewed by the author.
Review
spawnProcessand the CLI path comes fromresolveExecutableCommand, with no shell and no hard-coded paths, so Windows.cmdshims are handled by the shared helpers.muselogin. Quota belongs to the account, not to the host.museprovider. The other providers do not change, apart from the test mocks.muse serverun at most every 14 minutes, only while the meter is visible. Concurrent refreshes share one in-flight probe. A 90 s timeout and abort signal kill the child process.--no-session-logkeeps the probe out of the user's Muse history.Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Cross-platform behavior goes through the shared process helpers (see Review). Older persisted UI state gets the new item once through the existing one-shot default migration.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)🤖 Generated with Claude Code