Add Muse Code subscription usage windows - #3435
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🟢 Approval recommended
The Muse provider integration is self-contained, covered by focused tests, and the only feedback is a minor improvement to diagnostic detail.
Pull request overview
Adds first-class Muse Code support focused on subscription usage visualization (rolling 5-hour + weekly windows) by minting quota data from Meta’s /muse-code/key endpoint using the Muse CLI’s device-code (dca:) token, and updates project docs/site copy to reflect the new provider count.
Changes:
- Added Muse provider plumbing (descriptor, credentials reader, OAuth fetch strategy, usage fetcher + snapshot mapping).
- Added focused Swift Testing coverage for Muse mint parsing/credential handling and updated architecture fingerprints.
- Updated docs/site/changelog to include Muse and bump “69 → 70 providers”.
File summaries
| File | Description |
|---|---|
| Tests/CodexBarTests/ProviderArchitectureGatekeeperTests.swift | Updates expected provider/branding fingerprints for the new provider set. |
| Tests/CodexBarTests/MuseUsageFetcherTests.swift | Adds parsing + transport + credential-safety tests for Muse subscription minting. |
| Sources/CodexBarCore/Providers/Providers.swift | Registers new UsageProvider.muse case. |
| Sources/CodexBarCore/Providers/ProviderManifest.swift | Adds Muse descriptor to the core manifest. |
| Sources/CodexBarCore/Providers/ProviderInstanceIDAliases.generated.swift | Adds .muse instance ID alias. |
| Sources/CodexBarCore/Providers/Muse/MuseUsageFetcher.swift | Implements mint request/validation + response parsing into a usage snapshot. |
| Sources/CodexBarCore/Providers/Muse/MuseProviderDescriptor.swift | Defines Muse metadata/branding and OAuth-only fetch pipeline. |
| Sources/CodexBarCore/Providers/Muse/MuseCredentials.swift | Reads Muse login state/token from auth.json + Keychain (no-UI query). |
| Sources/CodexBar/Resources/ProviderIcon-muse.svg | Adds Muse provider icon resource. |
| Sources/CodexBar/Providers/Shared/ProviderImplementationManifest.swift | Registers Muse provider implementation in the app layer. |
| Sources/CodexBar/Providers/Muse/MuseProviderImplementation.swift | Adds app-layer availability/presentation wiring for Muse. |
| README.md | Adds Muse to provider list and updates “70 providers” marketing copy. |
| docs/social.html | Updates landing-page provider count to 70. |
| docs/site-locales.mjs | Updates localized provider-count strings across supported locales. |
| docs/providers.md | Updates provider count and adds Muse fetch-strategy row. |
| docs/provider-ids.md | Adds muse to the documented provider ID list. |
| docs/muse.md | New provider doc describing auth, data shown, and privacy notes. |
| docs/llms.txt | Updates provider count in LLM-readable summary. |
| docs/index.html | Updates meta/og copy and on-page provider count to 70. |
| CHANGELOG.md | Adds unreleased entry for Muse subscription windows. |
Review details
- Files reviewed: 19/20 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Codex review: needs changes before merge. Reviewed September 8, 2026, 4:51 PM ET / 20:51 UTC (Revision 6). ClawSweeper reviewWhat this changesAdds Muse Code subscription tracking through the CLI login, showing five-hour and weekly usage windows in CodexBar. Merge readiness⛔ Needs changes before merge - 2 items remain This remains a useful, distinct contribution with sufficient live proof. Earlier functional findings are addressed; one minor release-note placement issue remains. Priority: P2 Review scores
Verification
How this fits togetherCodexBar’s provider pipeline reads Muse credentials and requests subscription usage from Meta. It converts the response into the shared usage model consumed by the CLI and menu-bar app. flowchart LR
A[Muse CLI login] --> B[Credential selection]
C[Optional auth file] --> B
B --> D[Meta subscription endpoint]
D --> E[Validate subscription windows]
E --> F[Shared usage snapshot]
F --> G[CLI and menu bar]
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep the focused subscription provider on the shared pipeline and document its availability in the release that first ships it. Do we have a high-confidence way to reproduce the issue? Not applicable to the provider addition; the supplied live CLI output demonstrates the new behavior. The release-note placement defect is directly verifiable from source and release metadata. Is this the best way to solve the issue? Yes, the implementation follows the shared provider architecture and supplies a CLI credential path unavailable to local plugins; only the release-note placement needs correction. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 928166f89947. LabelsLabel justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
Fixes the three actionable findings on PR steipete#3435: - Guard the window-duration conversion. `window_duration_mins: 1e30` decoded as a Double and then trapped in `Int(minutes.rounded())`, turning malformed provider data into a process-level crash. The decoder now uses `Int(exactly:)` and throws a decoding error, which the surrounding handler maps to `MuseUsageError.parseFailed`. - Register a provider-owned credential adapter so login detection is reported. Without it `codexbar diagnose` fell back to an empty adapter and printed `auth.configured: false` with no modes whenever a fetch failed, even with a valid Muse login. The adapter is OAuth-only and prompt-free: no API-key override, and detection reuses `MuseCredentials.hasLogin`. - Document the auth file's real credential precedence. An inline `providers.meta.access_token` selects the account queried and takes precedence over Keychain, so the file is not only a login marker. Also drops a stray blank line before the `UsageProvider` closing brace that SwiftFormat flagged. Verification: `swift test --filter MuseUsageFetcherTests` (12 passed) and `make check` (0 violations, 2128 files).
|
@clawsweeper re-review Published fixes at 0b131e7 address all three findings: checked Int conversion rejects oversized duration values; an OAuth-only credential adapter reports prompt-free login diagnostics; auth documentation now states inline-token precedence over Keychain. Also fixed the SwiftFormat trailing blank line. Verification: make check passed; all 12 Muse tests and ProviderArchitectureGatekeeperTests passed. The full make test run passed 78 groups before UsageStoreCachedTokenHydrationTests timed out. All remaining selections were then run successfully (1,020 of 1,021 selections passed overall). The identical isolated hydration-suite command also timed out after 180 seconds on clean PR base 4d27bb1, with Keychain access suppressed; this is not being reported as a fully green make test. Please reassess the duration crash, login diagnostics, and documentation findings against the new published head. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review Fixed the additional reset-timestamp finding in c080982. Both windows now omit reset timestamps beyond Date.distantFuture while preserving valid usage percentages. A parser → UsageSnapshot → countdown regression covers window and weekly independently: both cases failed before the fix and pass after it; the unaffected window retains its countdown. The requested focused Muse/diagnose/diagnostic-export/architecture suites passed, as did make check. The full final-tree make test is running again; the previously documented hydration-suite timeout also reproduced on the exact PR base. Release bundle will be rebuilt and installed from this final head. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Final verification for c080982: make check passed; the focused Muse/diagnose/diagnostic-export/architecture tests passed, including both new parser-to-countdown cases. The full make test again passed 78 groups and then hit the previously baseline-reproduced UsageStoreCachedTokenHydrationTests timeout. All 84 remaining non-hydration selections were subsequently run successfully. Full make test is not claimed green. Release packaging succeeded, including strict ad-hoc code-signature verification, bundled CLI/resource probes with the source checkout inaccessible, and a six-second app launch smoke. Installed the final release build in /Applications/CodexBar.app; installed app and CLI SHA-256 hashes match the packaged build and the installed CLI reports 0.56.6. Thanks for the re-review confirming all four findings addressed and no remaining blockers. |
c080982 to
7fb3d4c
Compare
Fixes the three actionable findings on PR steipete#3435: - Guard the window-duration conversion. `window_duration_mins: 1e30` decoded as a Double and then trapped in `Int(minutes.rounded())`, turning malformed provider data into a process-level crash. The decoder now uses `Int(exactly:)` and throws a decoding error, which the surrounding handler maps to `MuseUsageError.parseFailed`. - Register a provider-owned credential adapter so login detection is reported. Without it `codexbar diagnose` fell back to an empty adapter and printed `auth.configured: false` with no modes whenever a fetch failed, even with a valid Muse login. The adapter is OAuth-only and prompt-free: no API-key override, and detection reuses `MuseCredentials.hasLogin`. - Document the auth file's real credential precedence. An inline `providers.meta.access_token` selects the account queried and takes precedence over Keychain, so the file is not only a login marker. Also drops a stray blank line before the `UsageProvider` closing brace that SwiftFormat flagged. Verification: `swift test --filter MuseUsageFetcherTests` (12 passed) and `make check` (0 violations, 2128 files).
Fixes the three actionable findings on PR steipete#3435: - Guard the window-duration conversion. `window_duration_mins: 1e30` decoded as a Double and then trapped in `Int(minutes.rounded())`, turning malformed provider data into a process-level crash. The decoder now uses `Int(exactly:)` and throws a decoding error, which the surrounding handler maps to `MuseUsageError.parseFailed`. - Register a provider-owned credential adapter so login detection is reported. Without it `codexbar diagnose` fell back to an empty adapter and printed `auth.configured: false` with no modes whenever a fetch failed, even with a valid Muse login. The adapter is OAuth-only and prompt-free: no API-key override, and detection reuses `MuseCredentials.hasLogin`. - Document the auth file's real credential precedence. An inline `providers.meta.access_token` selects the account queried and takes precedence over Keychain, so the file is not only a login marker. Also drops a stray blank line before the `UsageProvider` closing brace that SwiftFormat flagged. Verification: `swift test --filter MuseUsageFetcherTests` (12 passed) and `make check` (0 violations, 2128 files).
7fb3d4c to
47ab8a0
Compare
47ab8a0 to
54af11d
Compare
Summary
Adds Muse Code as provider #70 with subscription visualization (the 5-hour and weekly windows Meta added for Everyday / High / Power Usage). Existing Muse PRs do not cover this:
Closes the gap called out on #3409 and #3340.
How it works
muse loginstores a device-codedca:token in Keychain (ai.meta.dev.credentials/meta). CodexBar reads it withKeychainNoUIQuery(no prompt) andPOSTshttps://api.meta.ai/muse-code/key. The mint payload includesis_subs_active,subs_tier_name, andsubs_usage.{window,weekly}(used_percent,window_duration_mins,resets_at).Dashboard
LLM_keys and Muse-mintedLLM|inference keys 401 on that mint endpoint and are not used.Live proof (this desk)
Card last-four is not displayed.
Tests
swift test --filter 'MuseUsageFetcherTests|ProviderArchitectureGatekeeperTests'— 51 passed.