Muse Code: show a user-selected dev.meta.ai team quota when the login omits quotas - #4011
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review blockedAutomated review did not run, so no review verdict was produced. Reason: The input-safety check rejected material in this revision. No detected value, path, or scanner output is reproduced here. ClawSweeper will not retry this unchanged revision. Next step: If this is a genuine credential, remove and rotate it. If it is an intentional test fixture, a maintainer must review and qualify it. |
d1d4af8 to
e8d977d
Compare
e8d977d to
2cd6b2e
Compare
|
The input-safety block looks like a pre-existing fixture, not new material. TruffleHog (3.97.9, run locally) finds nothing in this PR's diff or body. Scanning the full changed files gives one hit: the That line is already on Could a maintainer qualify that fixture so the review can run? I left the line unchanged to keep unrelated tests out of this PR. Separately, revision 2 replaced a real team ID in the Muse fixtures with a fictitious one. |
Preserve the contributor commits while bringing the Muse quota work onto the current development baseline. Maintainer corrections follow separately. Refs steipete#4011. Co-authored-by: enieuwy <121954036+enieuwy@users.noreply.github.com>
List visible teams in settings without choosing one implicitly. Preserve a selected team that becomes unavailable, and disclose browser-team quota usage. Try later browser sessions after account mismatches or expired credentials, with a five-request budget. Keep malformed resets and durations unknown. Add synthetic regressions on both plugin engines and menu rendering proof. Move the release note to the current Unreleased section and credit enieuwy. Fixes steipete#4002. Refs steipete#4011.
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
|
Merged as yours, @enieuwy, with your commits intact; the maintainer commits on your branch replaced the pasted team ID with a picker of the teams the session can see, added bounded session iteration after wrong-account responses, and brought in fixtures, docs, and the changelog line. It ships in 0.67.1. Thanks for the rework! |
Summary
Fixes #4002. Replaces #4003, following the conditions in its close comment.
When the Muse Code 5-hour window is idle,
POST /muse-code/keyomitssubs_usage, so CodexBar (and the Muse CLI/usage) show no quota even when the weekly limit has real usage. This adds an opt-in browser-team quota inside the bundledmuse.tsplugin. It never infers which team holds the subscription.How each close condition is met
workspaceIDconfig field, as OpenCode Go and Devin do). Empty by default. A quota is read only when the ID exactly matches a team the session can see.oauth+web,dataConfidence: estimated(neverexact).api.meta.ai;dev.meta.aigets only the cookie.MusePluginTests, run on both plugin engines.Extra guards:
tiermust equal the login'ssubs_tier_name; a different plan shows no browser reading (covers "Everyday quota under a Power login")./api/auth/me) must match the CLI login email.subs_usagealways wins; the browser is never contacted.The new suite fails against the #4003 plugin (wrong team, list order, different plan, expired windows) and passes here.
Scope decision
The team list lives in the menu card, and the setting is a text field, not a picker. A real Settings picker needs either a new plugin API that returns the team list or a public Core function that reads the browser cookie from the Settings pane (as Kilo's Refresh does). I kept that out to avoid widening the plugin host; happy to add it as a follow-up if you prefer the picker.
Proof
.github/pr-proof/muse-web-team-quota.log— real account, production CLI path, no CodexBar Keychain read, 5-hour window idle:oauth, Quota: Not included in this login responseoauth+web,estimated, 5h 0%, weekly 22.58% (matches direct endpoint: 13,550,839,000 / 60,000,000,000)Different-plan and multi-team order cases can't be shown with a one-team account; fixtures cover them.
Existing coverage
Searched issues/PRs for
muse,meta.ai,subscription-quota,llama_dev_sess:No open Muse PR.
Validation
swift test --filter 'MusePluginTests|MuseMenuCardModelTests|MuseCredentialsTests|MuseKeychainAccessTests|ProviderArchitectureGatekeeperTests|ProviderPluginRuntimeTests|ProviderSettingsDescriptorTests|ConfigValidationTests|MenuCardModel|OpenCodeGoMenuCardModelTests|CookieProviderCutover|BrowserCookieAccessGate'— 354 tests passmake check— 0 violations