You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(usage): show Muse quota without model probes - #34232
Muse users can see their subscription quota and reset times in Orca's footer and Usage menu. When Muse reports no allowance, Orca shows "Usage unavailable" instead of inventing a percentage.
What Changed
Extend the existing rate-limit service and generic provider UI with Muse session and weekly quota.
Read muse usage --json with automatic updates disabled, bounded execution, cancellation, and a command-support check. Never fall back to a model request.
Add visibility controls, default migration, localization, and documentation.
Classify only explicit signed-out CLI diagnostics as missing credentials; unrelated catalog, design-input, and proxy-auth errors remain transient failures.
Preserve execution-host ownership and compatibility with older host snapshots and preference schemas.
Historical token accounting stays separate from subscription quota. Authentication stays with Muse.
Matched before/after captures of the existing Usage menu, with Muse added after the change. All data is synthetic.
Theme
Before
After
Light
Dark
Sixteen headless captures cover actual footer/menu/chip/roster components in both themes, including missing allowance. They establish component presentation; full Electron and live quota UI acceptance remain unperformed. Images are attached, not committed.
Testing
I manually tested these changes locally in the full Electron app
Automated tests added/updated
Latest documentation alignment, after integrating upstream 9e9b545248:
Documentation delta gate: pnpm check:changed --base=a027f676f1bae77329a73ffdf54a1c3ee6de2ec1 --maxWorkers=2 passed both selected checks. This checks the one-file documentation change after the upstream integration commit; it is not a new full-feature gate result.
The independent docs/site package passed all 19 tests, lint (5 warnings in unchanged components), TypeScript, and the production build, generating all 121 static pages.
Application pnpm tc passed. Focused backend/UI verification passed 14 suites / 265 tests, covering Muse, upstream Claude and Antigravity behavior, visibility, remote ownership, web compatibility, and hydration.
Both commits passed pre-commit checks, and the contribution diff passes git diff --check.
The documentation now follows the upstream page's headings and provider list, with one short Muse paragraph. The mobile paragraph describes Claude/Codex account usage without a separate Muse exception section.
The previous full contribution gate at 7558a247 against upstream b29ae01912 passed 25/26 checks: 5,003 related files passed, 15 skipped, and one unchanged SQLite fixture file had two Bun read-only WAL failures. A built-in-only reproduction confirmed that error on Bun1.4.4 and succeeded on Node24.20; terminal-wire tests passed in that run. That is historical validation, not a full-gate pass for this documentation refresh. The unrelated diagnostic infrastructure patch remains excluded.
Sixteen earlier headless component captures use synthetic state in both themes. Earlier full lint/typecheck/build runs predate these upstream integrations; the full native build required a verified temporary Swift6.3.3 toolchain and SDK26.5. Its native products are compile-only evidence and are not committed or suitable for release; CI must rebuild with its supported Apple toolchain.
Full Electron live acceptance and live Windows/Linux/SSH testing remain unperformed. Upstream CI still needs maintainer approval.
AI Disclosure
OpenAI Codex implemented and independently reviewed the change. Muse Code investigated the installed CLI quota contract. A Grok review attempt did not start because of a workspace-trust prompt and is not counted as review.
Review
Cross-platform: existing process wrappers, host PATH, neutral-cwd lookup/execution, bounded output/deadlines, and cancellation.
Remote/backward compatibility: owner-host quota, missing-field normalization, and filtering unsupported Muse preference fields on older hosts.
Agents/integrations: compared Muse with Kimi, MiniMax, ZCode, Cursor, and Antigravity. Acquisition normalizes into the existing result contract; the shared service owns polling, stale policy, cancellation, and publication. Muse uses its official quota CLI and CLI-owned authentication rather than duplicating credential storage.
Performance: shared polling and activation retry gates, hidden-meter gating, sibling failure isolation, and shutdown cancellation are covered. Muse does not add a separate poller or dedicated exponential retry loop.
Security: no copied credentials or model probes; errors use fixed messages instead of raw CLI diagnostics.
UI: existing components/tokens, both themes, and truthful unavailable/zero states.
Mobile/folder workspaces: mobile retains its Claude/Codex account UI. Quota is account-level and requires no Git worktree.
Agent skill upstream boundary
Not applicable; no upstream skill-installer material is copied or mechanically translated.
No actionable comments were generated in the recent review.
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 8d07111e-0f91-4c84-8489-b917ddf773b1
Commits
Reviewing files that changed from the base of the PR and between 7558a24 and 213a35c.
Files selected for processing: 8
docs/site/content/docs/agents/usage-tracking.mdx
src/renderer/src/i18n/locales/en.json
src/renderer/src/i18n/locales/ja.json
src/renderer/src/i18n/locales/zh.json
src/renderer/src/web/preload-api/web-ui-api.ts
src/shared/constants.ts
src/shared/persisted-ui-state-types.ts
src/shared/wsl-move/wsl-move-ui-dispositions.ts
Files skipped from review as they are similar to previous changes: 4
docs/site/content/docs/agents/usage-tracking.mdx
src/renderer/src/i18n/locales/en.json
src/renderer/src/i18n/locales/zh.json
src/renderer/src/i18n/locales/ja.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Walkthrough
The changes add Muse quota retrieval through the Muse CLI and parse session and weekly allowance data. The rate-limit service now tracks Muse readings and supports enabling or disabling Muse polling. The status bar and settings include Muse usage, with handling for unavailable allowances and remote-host snapshots. UI preference hydration and web-host synchronization now account for the Muse status-bar item. The usage-tracking documentation describes Muse quota data and its availability.
Priority: Normal
Merge Risk: Moderate · up to 213a3
Muse can be ambiguous in one usage display mode, and a slow Muse refresh can leave other provider usage indicators stale until the command settles. Resolve these user-visible issues before merging.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Out of Scope Changes check
The PR scope is Muse quota retrieval, rate-limit integration, UI visibility, compatibility, tests, and documentation. The whole-PR summary also reports an expression-only rewrite of `performNativePast…
Revert the unrelated performNativePaste rewrite, or provide a concrete Muse quota compatibility requirement that requires this change.
Passed checks: 4 passed
Check name
Status
Explanation
Title check
The title "feat(usage): show Muse quota without model probes" states the main change: Muse subscription quota is now shown in Orca's usage UI, read via the quota CLI command rather than a model-turn p…
Description check
The description follows the repository template closely. It includes ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Chec…
Linked Issues check
[#23471] The PR adds Muse quota retrieval through muse usage --json and maps session and weekly allowances to the existing rate-limit state. The footer and Usage menu display current usage, limits, …
Docstring Coverage
Docstring coverage is inconclusive: files from earlier reviews still need to be rechecked within the check's analysis limits. Not blocking.
Full details: Title check
Explanation
The title "feat(usage): show Muse quota without model probes" states the main change: Muse subscription quota is now shown in Orca's usage UI, read via the quota CLI command rather than a model-turn probe. It matches the changeset, which adds Muse usage fetching, parsing, status-bar/menu display, and related tests and docs. It is specific and follows a conventional-commit style.
Full details: Description check
Explanation
The description follows the repository template closely. It includes ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist. It explains the user-facing before/after behavior, the mechanism (muse usage --json with bounded execution and no model turn), and the overlap with PR #26938. It links issue #23471 and includes before/after images in a table. Gaps remain. The manual Electron testing box is unchecked, and the author states full Electron live acceptance and live Windows/Linux/SSH testing were not performed. The Checklist's final gate item is unchecked, and the Testing section mixes historical and upstream-integration validation with unclear status. The Why section does not clearly explain why this approach beats the alternatives beyond overlap with #26938. Overall the description is mostly complete, with the required sections present and filled in.
Full details: Linked Issues check
Explanation
[#23471] The PR adds Muse quota retrieval through muse usage --json and maps session and weekly allowances to the existing rate-limit state. The footer and Usage menu display current usage, limits, reset data, and the Usage unavailable state. The shared service, provider types, visibility controls, and compatibility paths include Muse. Parser, fetcher, service, and UI tests cover the implementation. Threshold alerts are optional in #23471 and are not required.
Full details: Out of Scope Changes check
Explanation
The PR scope is Muse quota retrieval, rate-limit integration, UI visibility, compatibility, tests, and documentation. The whole-PR summary also reports an expression-only rewrite of performNativePaste in src/renderer/src/web/preload-api/web-ui-api.ts, with the same document.execCommand('paste') behavior. This change has no demonstrated connection to Muse quota work.
Resolution
Revert the unrelated performNativePaste rewrite, or provide a concrete Muse quota compatibility requirement that requires this change.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
nl -ba src/renderer/src/components/status-bar/StatusBarProviderSegment.tsx | sed -n '70,95p;168,195p'
Repository: stablyai/orca
Length of output: 2050
Script executed:
nl -ba src/renderer/src/components/status-bar/StatusBarProviderSegment.tsx | sed -n '190,215p'
Repository: stablyai/orca
Length of output: 986
Use a distinct letter for Muse.
ProviderLetterBadge renders the provider letter directly. Both minimax and muse currently render as M, so their compact badges are identical when both providers are visible.
Proposed fix
--- "a/src/renderer/src/components/status-bar/StatusBarProviderSegment.tsx"+++ "b/src/renderer/src/components/status-bar/StatusBarProviderSegment.tsx"@@ -183,9 +183,10 @@
return 'K'
case 'antigravity':
return 'A'
case 'minimax':
- case 'muse':
return 'M'
+ case 'muse':+ return 'S'
case 'grok':
return 'R'
case 'cursor':
Files skipped from review as they are similar to previous changes: 3
src/renderer/src/i18n/locales/ja.json
src/renderer/src/i18n/locales/zh.json
src/renderer/src/i18n/locales/en.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Stability & Availability · Quick win
Supported by static analysis
Script executed:
sed -n '170,285p' src/main/rate-limits/service/service-full-cycle-application.ts
sed -n '110,225p' src/main/rate-limits/service/service-full-cycle-preparation.ts
rg -n 'timeout|Timeout|signal|help' src/main/rate-limits/muse-usage-fetcher.ts
git diff b29ae01912337fb628da28be08719b9759b0caf3 7558a247624aa6145a966da2a26c008f55b29011 -- src/main/rate-limits/service/service-full-cycle-application.ts
Repository: stablyai/orca
Length of output: 13273
Script executed:
set -o pipefail
printf'%s\n''--- application owner and callers ---'
sed -n '1,285p' src/main/rate-limits/service/service-full-cycle-application.ts
printf'%s\n''--- preparation method boundaries ---'
sed -n '1,190p' src/main/rate-limits/service/service-full-cycle-preparation.ts
printf'%s\n''--- service cycle orchestration and cancellation ---'
rg -n -F --glob '*.ts' -e 'runFetchAllCycle' -e 'fetchAll(' -e 'waitForFetchIdle' -e 'AbortController' src/main/rate-limits
printf'%s\n''--- relevant tests and contract wording ---'
rg -n -F --glob '*.{ts,tsx,md}' -e 'service-full-cycle' -e 'Promise.all' -e 'full cycle' -e 'muse' src/main/rate-limits | head -240
printf'%s\n''--- current and base application diff ---'
git diff b29ae01912337fb628da28be08719b9759b0caf3 7558a247624aa6145a966da2a26c008f55b29011 -- src/main/rate-limits/service/service-full-cycle-application.ts src/main/rate-limits/service/service-full-cycle-preparation.ts src/main/rate-limits/muse-usage-fetcher.ts
Repository: stablyai/orca
Length of output: 42227
Script executed:
set -o pipefail
printf'%s\n''--- fetch-all orchestration ---'
rg -n -F --glob '*.ts' -e 'async fetchAll' -e 'fetchAll()' -e 'fetchAll(' -e 'runFetchAllCycle' -e 'waitForFetchIdle' -e 'isFetching' -e 'fullFetchQueued' src/main/rate-limits
printf'%s\n''--- service definitions around orchestration ---'
rg -n -F --glob 'service.ts' -e 'fetchAll' -e 'runFetchAllCycle' -e 'AbortController' -e 'waitForFetchIdle' src/main/rate-limits
printf'%s\n''--- sibling settlement helper ---'
cat src/main/rate-limits/service/service-sibling-provider-result.ts
printf'%s\n''--- orchestration test complete relevant blocks ---'
sed -n '1,330p' src/main/rate-limits/service-refresh-orchestration.test.ts
printf'%s\n''--- Muse service test relevant blocks ---'
sed -n '1,235p' src/main/rate-limits/service-muse-usage.test.ts
Repository: stablyai/orca
Length of output: 26982
Script executed:
set -o pipefail
printf'%s\n''--- fetch queue ---'
cat src/main/rate-limits/service/service-fetch-queue.ts
printf'%s\n''--- fetch control ---'
cat src/main/rate-limits/service/service-fetch-control.ts
printf'%s\n''--- orchestration tests around queued refreshes and cancellation ---'
sed -n '300,490p' src/main/rate-limits/service-refresh-orchestration.test.ts
printf'%s\n''--- all direct references to sibling batch publication ---'
rg -n -F --glob '*.ts' -e 'grokResultPromise' -e 'antigravityResultPromise' -e 'museResultPromise' -e 'settleSiblingProviderResult' src/main/rate-limits
Repository: stablyai/orca
Length of output: 19958
Script executed:
set -o pipefail
rg -n -F --glob '*.ts' -e 'withFetchingStatus' -e 'applyStalePolicy' -e 'trackActiveFailureStreak' src/main/rate-limits/service
sed -n '1,230p' src/main/rate-limits/service/service-fetch-policy.ts
sed -n '1,210p' src/main/rate-limits/service/service-state.ts
Repository: stablyai/orca
Length of output: 21730
Do not make Muse part of the existing sibling batch.
Muse can delay Grok, Cursor, Zcode, and Antigravity publication. The worst-case delay is about 20 seconds when the help check takes 5 seconds and the quota read then takes 15 seconds. A help timeout alone returns after 5 seconds.
Apply the existing four-provider update first. Apply Muse in a separate update with its own abort check.
@brennanb2025 Hi! I just finished all the follow up from CodeRabbit, please take a look if you have time, this PR is contributed on integration of Muse Code.
Reads `muse usage --json` (Muse Code 1.4.13+), which reports the
subscription allowance without a model turn, and maps `allowance.window`
to the five-hour session meter and `allowance.weekly` to the weekly meter.
`rateLimits.muse` now appears in `orca account list --json`.
- Gate on `muse --help` listing `usage`: older builds treat an unknown
subcommand as a prompt, so Orca never sends `usage` to them.
- Run with MUSE_NO_AUTO_UPDATE=1 and MUSE_LOGIN=0 so a background poll
never self-updates the launcher or starts a device sign-in.
- Missing CLI, signed out, API-key login / no allowance, non-JSON output,
and timeouts each map to an explicit unavailable/error snapshot.
- Hidden meters skip the spawn, and Muse publishes after the sibling batch
so a slow CLI cannot delay Grok/Cursor/ZCode/Antigravity.
- Default-on status-bar item with a one-shot migration, CLI-detection
gating, visibility menu and Settings toggle, remote-owner mapping.
Based on the design in #34232 by ShemYu.
Co-authored-by: ShemYu <[email protected]>
* feat(usage): show Muse subscription quota in the status bar
Reads `muse usage --json` (Muse Code 1.4.13+), which reports the
subscription allowance without a model turn, and maps `allowance.window`
to the five-hour session meter and `allowance.weekly` to the weekly meter.
`rateLimits.muse` now appears in `orca account list --json`.
- Gate on `muse --help` listing `usage`: older builds treat an unknown
subcommand as a prompt, so Orca never sends `usage` to them.
- Run with MUSE_NO_AUTO_UPDATE=1 and MUSE_LOGIN=0 so a background poll
never self-updates the launcher or starts a device sign-in.
- Missing CLI, signed out, API-key login / no allowance, non-JSON output,
and timeouts each map to an explicit unavailable/error snapshot.
- Hidden meters skip the spawn, and Muse publishes after the sibling batch
so a slow CLI cannot delay Grok/Cursor/ZCode/Antigravity.
- Default-on status-bar item with a one-shot migration, CLI-detection
gating, visibility menu and Settings toggle, remote-owner mapping.
Based on the design in #34232 by ShemYu.
Co-authored-by: ShemYu <[email protected]>
* fix(usage): cap Muse usedPercent and date readings by fetch time
Muse can report over-quota usage above 100; clamp to the 0-100 meter
contract like the other providers. Use the fetch time for updatedAt so a
cached older asOfMs cannot make every window focus trigger a refresh.
* fix(usage): prevent Muse launcher installation during polling
* fix(usage): gate Muse on its version file and run the active build directly
- Read the launcher's `.muse-version` and require 1.4.13 or newer (the
release that added `muse usage`); only installs without that file fall
back to `muse --help`, cached by launcher path, mtime and size.
- Execute `muse-bin-<version>` directly when it exists, so the launcher's
update, sign-in and install paths never run; the env guards stay for
the launcher fallback. A version change during the call discards the
reading as stale.
- Start the Muse fetch at the beginning of the full cycle and cap it near
8s (6s usage, 2s help), so a slow CLI holds the shared queue far less.
---------
Co-authored-by: ShemYu <[email protected]>
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
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.
ELI5
Muse users can see their subscription quota and reset times in Orca's footer and Usage menu. When Muse reports no allowance, Orca shows "Usage unavailable" instead of inventing a percentage.
What Changed
muse usage --jsonwith automatic updates disabled, bounded execution, cancellation, and a command-support check. Never fall back to a model request.Historical token accounting stays separate from subscription quota. Authentication stays with Muse.
Why
Muse Code 1.4.13 introduced a quota command without a model turn. PR #26938 addresses the same footer feature using a model-turn probe. This PR uses the newer quota command. The existing proposal is linked here to make the overlapping scope explicit.
Linked Issue
Fixes #23471
Related: #26938
Visual Proof
Matched before/after captures of the existing Usage menu, with Muse added after the change. All data is synthetic.
Sixteen headless captures cover actual footer/menu/chip/roster components in both themes, including missing allowance. They establish component presentation; full Electron and live quota UI acceptance remain unperformed. Images are attached, not committed.
Testing
Latest documentation alignment, after integrating upstream
9e9b545248:pnpm check:changed --base=a027f676f1bae77329a73ffdf54a1c3ee6de2ec1 --maxWorkers=2passed both selected checks. This checks the one-file documentation change after the upstream integration commit; it is not a new full-feature gate result.docs/sitepackage passed all 19 tests, lint (5 warnings in unchanged components), TypeScript, and the production build, generating all 121 static pages.pnpm tcpassed. Focused backend/UI verification passed 14 suites / 265 tests, covering Muse, upstream Claude and Antigravity behavior, visibility, remote ownership, web compatibility, and hydration.git diff --check.The documentation now follows the upstream page's headings and provider list, with one short Muse paragraph. The mobile paragraph describes Claude/Codex account usage without a separate Muse exception section.
The previous full contribution gate at
7558a247against upstreamb29ae01912passed 25/26 checks: 5,003 related files passed, 15 skipped, and one unchanged SQLite fixture file had two Bun read-only WAL failures. A built-in-only reproduction confirmed that error on Bun1.4.4 and succeeded on Node24.20; terminal-wire tests passed in that run. That is historical validation, not a full-gate pass for this documentation refresh. The unrelated diagnostic infrastructure patch remains excluded.Sixteen earlier headless component captures use synthetic state in both themes. Earlier full lint/typecheck/build runs predate these upstream integrations; the full native build required a verified temporary Swift6.3.3 toolchain and SDK26.5. Its native products are compile-only evidence and are not committed or suitable for release; CI must rebuild with its supported Apple toolchain.
Full Electron live acceptance and live Windows/Linux/SSH testing remain unperformed. Upstream CI still needs maintainer approval.
AI Disclosure
OpenAI Codex implemented and independently reviewed the change. Muse Code investigated the installed CLI quota contract. A Grok review attempt did not start because of a workspace-trust prompt and is not counted as review.
Review
Agent skill upstream boundary
Notes
Author: ShemYu · X: @ShemYuYu
Checklist