feat(oauth): import the Muse Code CLI credential behind a ToS warning - #3337
Merged
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds
meta-muse, an OAuth provider that reuses the API key the Muse Code CLI already holds, for operators who signed that CLI in and would rather not provision a second key.This ships because the repository owner authorized it for his own account. An earlier phase in this unit closed the same idea as a
NOOP, and that reasoning stands: proving a credential works is not the same as being allowed to use it, so an agent must not spend a user's ToS risk on its own initiative. A user spending his own deliberately is a different act — and the repository already models it, sinceanthropicandgoogle-antigravitysit in the sameHIGH_RISKmap for the same reason.Two measurements shaped the design
~/.config/muse/auth.jsonholds no secret — it is a pointer to a macOS Keychain item. That item carries both anaccess_tokenand anapi_key, and only theapi_keyauthenticates: the OAuth access token returns401 invalid_api_keyon/v1/modelswhile the sibling key returns 200. So this is a static-key credential with nothing to refresh — the shapecommand-codealready uses.Import-only, macOS-only
muse loginhas no non-interactive mode, so a spawned child could outlive cancellation; and polling for the pointer file is satisfied instantly by the one already on disk, which would reimport the old account on a force-login. When no credential is present the provider says what to run instead of running it.The warning reaches both surfaces, which took two fixes
loginOAuthdirectly, so a user who had already logged in could refresh a high-risk credential without ever seeing the modal.onReauthnow routes through the warning-aware path, carryingaccountIdso acknowledgement continues the same operation rather than a plain login against the active account.login-cli.tsnever reads the registry note, soocx login meta-musehad no warning at all.loginMetaMuseemits it throughctrl.onProgressbefore it touches the pointer or the Keychain.The disclosures say what is actually known
Meta scopes this credential to its own CLI, and how these calls settle is not observable from the API — so the note says treat every call as billable rather than asserting pay-as-you-go as fact. It also states plainly that the key is copied into OpenCodex's auth store, because it is:
runLoginpersists it like every other OAuth credential.Also included
privacy:scandetector for the measuredLLM|<digits>|<tail>key shape, exercised through a new exportedscanTextseam — a test that re-declared the regex would stay green after the production detector was deleted.supportsPerAccountQuotastays false, with a test. That predicate gatesfetchAccountQuota, whose fallback sends any non-Kiro/non-Antigravity bearer to Anthropic's usage endpoint; flipping it without a dedicated branch would ship a Meta key to Anthropic.Quota is deferred. Meta does report subscription windows, but only as a
response.subscription_usageSSE event on streaming turns — that needs a passive read-and-cache seam rather than a probe, and it touches the streaming path and account attribution. Planned as wp5 in050_wp5_passive_muse_quota.md.Verification
bun teston the six touched suites — 166 pass, 0 fail, 1417 assertions.cd gui && bun test tests/oauth-tos-warning-gate.test.tsx— 12 pass, 0 fail.bun x tsc --noEmit— exit 0.bun run privacy:scan— passed.bun run lint:gui— clean.cd gui && bun run build— success.cd docs-site && bun install --frozen-lockfile && bun run build— 417 pages.bun run test:changed— 14157 pass / 11 skip / 1 fail. The single failure istests/lab-fabric-task.test.ts(CL-07 producer, ~760ms timeout), unrelated: that file passes 49/49 standalone with this branch applied, and it failed the same way on the wp1 PR.Checklist
docs-siteprovider section stating the unsupported-use boundary, macOS/CLI requirement, auth-store persistence, and themeta-modelalternative.)defaultRefreshPolicy: "disabled"prevents unattended traffic on a vendor-restricted credential. Refresh cannot re-import and overwrite a different account's slot. New scanner rule covers the key shape.)Summary by CodeRabbit