Skip to content

feat(usage): show Muse quota without model probes - #34232

Closed
ShemYu wants to merge 5 commits into
stablyai:mainfrom
ShemYu:ShemYu/contribute-on-adding-muse-quota-monitoring-into-the-footer
Closed

ShemYu wants to merge 5 commits into
stablyai:mainfrom
ShemYu:ShemYu/contribute-on-adding-muse-quota-monitoring-into-the-footer

Conversation

@ShemYu

@ShemYu ShemYu commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

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

  • 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.

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.

Theme Before After
Light Before: Usage menu in light theme After: Muse quota in light theme
Dark Before: Usage menu in dark theme After: Muse quota in dark theme

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.

Notes

Author: ShemYu · X: @ShemYuYu

Checklist

  • Focused on one user-facing feature
  • ELI5, before/after behavior, mechanism, and rationale explained
  • Before/after screenshots attached
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, remote, mobile, and folder-workspace impact considered
  • Required checks/builds pass as a complete gate (local exceptions and recovery are documented above; upstream CI pending)

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Out of Scope Changes check Warning 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 Passed checks: 4 passed
Check name Status Explanation
Title check Passed 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 Passed 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 Passed [#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 Passed 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


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: 5793b343-31e5-4e50-9b4d-aca9805b1201
Commits

Reviewing files that changed from the base of the PR and between 3347d47 and 1a51b92.

Files selected for processing: 66
  • config/scripts/vitest-sqlite-runtime-boundary.test.ts
  • config/scripts/vitest-sqlite-runtime-scan.mjs
  • docs/site/content/docs/agents/usage-tracking.mdx
  • src/main/provider-account-services.ts
  • src/main/rate-limits/disabled-usage-snapshot.ts
  • src/main/rate-limits/muse-usage-fetcher.test.ts
  • src/main/rate-limits/muse-usage-fetcher.ts
  • src/main/rate-limits/muse-usage-response.test.ts
  • src/main/rate-limits/muse-usage-response.ts
  • src/main/rate-limits/rate-limit-service-test-harness.ts
  • src/main/rate-limits/service-account-target-selection.test.ts
  • src/main/rate-limits/service-antigravity-usage.test.ts
  • src/main/rate-limits/service-cursor-usage.test.ts
  • src/main/rate-limits/service-inactive-account-previews.test.ts
  • src/main/rate-limits/service-inactive-claude-cooldown.test.ts
  • src/main/rate-limits/service-live-claude-usage.test.ts
  • src/main/rate-limits/service-minimax-usage.test.ts
  • src/main/rate-limits/service-muse-usage.test.ts
  • src/main/rate-limits/service-opencode-go-credentials.test.ts
  • src/main/rate-limits/service-refresh-orchestration.test.ts
  • src/main/rate-limits/service-window-activation.test.ts
  • src/main/rate-limits/service-zcode-usage.test.ts
  • src/main/rate-limits/service/service-configuration.ts
  • src/main/rate-limits/service/service-fetch-policy.ts
  • src/main/rate-limits/service/service-full-cycle-application.ts
  • src/main/rate-limits/service/service-full-cycle-preparation.ts
  • src/main/rate-limits/service/service-polling.ts
  • src/main/rate-limits/service/service-sibling-provider-result.ts
  • src/main/rate-limits/service/service-state.ts
  • src/main/rate-limits/service/service-types.ts
  • src/renderer/src/components/settings/AppearanceWindowSidebarSection.tsx
  • src/renderer/src/components/settings/appearance-status-bar-muse-toggle-search.ts
  • src/renderer/src/components/settings/appearance-status-bar-search.ts
  • src/renderer/src/components/status-bar/MuseUsage.fixture.tsx
  • src/renderer/src/components/status-bar/StatusBarProviderSegment.tsx
  • src/renderer/src/components/status-bar/StatusBarVisibilityMenu.test.tsx
  • src/renderer/src/components/status-bar/StatusBarVisibilityMenu.tsx
  • src/renderer/src/components/status-bar/UsageRosterPanel.test.tsx
  • src/renderer/src/components/status-bar/owner-usage-rate-limits.test.ts
  • src/renderer/src/components/status-bar/owner-usage-rate-limits.ts
  • src/renderer/src/components/status-bar/status-bar-agent-gating.test.ts
  • src/renderer/src/components/status-bar/status-bar-agent-gating.ts
  • src/renderer/src/components/status-bar/status-bar-provider-visibility.test.ts
  • src/renderer/src/components/status-bar/status-bar-provider-visibility.ts
  • src/renderer/src/components/status-bar/tooltip.tsx
  • src/renderer/src/components/status-bar/usage-error-copy.ts
  • src/renderer/src/components/status-bar/usage-provider-settings-target.ts
  • src/renderer/src/components/status-bar/use-status-bar-controller.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/store/slices/ui-hydration-workspace-preferences.test.ts
  • src/renderer/src/store/slices/ui/ui-slice-hydration-status-bar-items.ts
  • src/renderer/src/web/preload-api/web-muse-status-bar-preference.test.ts
  • src/renderer/src/web/preload-api/web-muse-status-bar-preference.ts
  • src/renderer/src/web/preload-api/web-preference-normalization.ts
  • src/renderer/src/web/preload-api/web-ui-api.ts
  • src/shared/constants.ts
  • src/shared/persisted-ui-state-types.ts
  • src/shared/rate-limit-state-factory.ts
  • src/shared/rate-limit-types.ts
  • src/shared/rpc-contract/client-ui-params.ts
  • src/shared/status-bar-defaults.ts
  • src/shared/ui-chrome-types.ts
  • src/shared/wsl-move/wsl-move-ui-dispositions.ts
  • tests/e2e/cross-version-wire/host-terminal-runtime-stub.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

case 'antigravity':
return 'A'
case 'minimax':
case 'muse':

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

Supported by static analysis

Script executed:

#!/bin/bash
rg -nP -C3 '\bgetProviderLetter\s*\(' src/renderer/src/components/status-bar

Repository: stablyai/orca

Length of output: 1497


Script executed:

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':

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


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: 111c7afa-997c-4219-b132-9c6048dea7b3
Commits

Reviewing files that changed from the base of the PR and between b4335b3 and 7558a24.

Files selected for processing: 11
  • src/main/provider-account-services.ts
  • src/main/rate-limits/service-antigravity-usage.test.ts
  • src/main/rate-limits/service/service-full-cycle-application.ts
  • src/main/rate-limits/service/service-full-cycle-preparation.ts
  • src/main/rate-limits/service/service-state.ts
  • 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-muse-status-bar-preference.ts
  • src/renderer/src/web/preload-api/web-ui-api.ts
  • src/shared/constants.ts
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.

Comment on lines +196 to +203
const [grokSettled, cursorSettled, zcodeSettled, antigravitySettled, museSettled] =
await Promise.all([
grokResultPromise,
cursorResultPromise,
zcodeResultPromise,
antigravityResultPromise,
museResultPromise
])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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.

Suggested fix
-    const [grokSettled, cursorSettled, zcodeSettled, antigravitySettled, museSettled] =
+    const [grokSettled, cursorSettled, zcodeSettled, antigravitySettled] =
       await Promise.all([
         grokResultPromise,
         cursorResultPromise,
         zcodeResultPromise,
-        antigravityResultPromise,
-        museResultPromise
+        antigravityResultPromise
       ])
@@
-    const muse = settleSiblingProviderResult('muse', museSettled)
@@
-    this.trackActiveFailureStreak('muse', muse)
     this.updateState({
@@
-      muse: this.applyStalePolicy(muse, previousState.muse)
     })
+
+    const museSettled = await museResultPromise
+    if (signal.aborted) {
+      return
+    }
+    const muse = settleSiblingProviderResult('muse', museSettled)
+    this.trackActiveFailureStreak('muse', muse)
+    this.updateState({
+      ...this.state,
+      muse: this.applyStalePolicy(muse, previousState.muse)
+    })

@ShemYu

ShemYu commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

@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.

nwparker added a commit that referenced this pull request Nov 6, 2026
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]>
nwparker added a commit that referenced this pull request Nov 7, 2026
* 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]>
@ShemYu ShemYu closed this Nov 7, 2026
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.

[Feature]: Integrate Meta Muse quota measurement

1 participant