Repository navigation
feat(oauth): add Muse Code device login with CLIProxyAPI-parity remint - #14329
Conversation
Meta Muse Code uses RFC 8628 against auth.meta.com, then mints a subscription inference key at api.meta.ai/muse-code/key. Persist the durable dca token as refreshToken, remint on 401, honor error.resets_at quota cooldowns, and import CLIProxyAPI type=meta auth files. Dual-auth keeps pasted META_API_KEY on the same dashboard card.
Regenerate the provider reference on release/v3.8.51 and list MUSE_CODE_OAUTH_CLIENT_ID next to the other public OAuth client ids.
e758bb1 to
f055798
Compare
|
@diegosouzapw ping for review. Rebased onto current
CI on the new head is queued. Happy to fix anything that comes back. |
|
Cluster review is done, so here is the outcome and what happens to your work. This is the most complete of the four Muse implementations and it is clean on the rule that usually trips these up: the public client id goes through We are landing #13634 as the base for this feature. It was opened a week earlier and has since been verified end to end against real Meta endpoints — device grant → poll → key mint → models → first inference → re-mint, all 200s, with the maintainer's own browser approval in the loop — and our precedent is that a later, larger PR does not automatically beat an earlier one that was verified live. Rather than let this go unused, three pieces of yours are unique in the cluster and we want to port them into that branch with a
Flagging before we do it so it is not a surprise; tell us if you would rather we take a different subset, or none of it. If #13634's remaining items (a dropped changelog fragment and a stuck fork-CI approval) turn out to be hard to resolve, this branch is the strongest standalone fallback and we would switch to it instead. One note either way: the reds you see are inherited from base-red #14496, not from your changes. |
|
Please port those three pieces into #13634. No different subset.
Credit on the port commit: #14329 stays open as the fallback until #13634 lands. Understood on the reds coming from base-red #14496. |
d54d313
into
diegosouzapw:release/v3.8.51
…s lossy policy; drain 12 base-red files #14529 moved lossy engines off the header-less path in the runtime but not in deriveEffectivePreviewPlan(), so the dashboard preview showed rtk -> caveman while requests ran session-dedup -> lite (#12063 again). The preview now applies downgradeUnrequestedLossy(); the #12063 test pins preview == runtime for the profile, engines-map and safe-profile cases (fails on the old code). Test guards realigned to merged design changes, each traced to its commit: - #14529: compression suites opt in with allow-lossy where they test the operator plan, and assert the header-less downgrade; default seed is session-dedup + lite; the #10503 probe ignores the loopback dashboard telemetry POST that stacked compression emits (the context gate still rejects locally — verified with logging). - #14530: breaker profile asserted on the connection breaker; the provider-wide cooldown case drives the network-error path. - #14370: @opencode/plugin (stable OpenCode 2.x contract, npm maintainer thdxr) added to the dependency allowlist. - #14213: the opt-in empty-turn retry credential site is inventoried as class A (dispatch goes through assertManagedLeaseFence). - #14223 / #14329: flag count 77, quota registry 13 (muse-code). Refs #14496
…iegosouzapw#14138, diegosouzapw#13634, diegosouzapw#14267, diegosouzapw#12687) Single branch with everything useful from the open Muse Code PRs that release/v3.8.52 does not have yet: - diegosouzapw#15234: session-pinned multi-account round-robin, same-owner empty-response retry, semantic-cache bypass, Responses URL fix for custom baseUrl, 512 output-token floor. - diegosouzapw#12687: opencode-go sends reasoning.effort=max verbatim for muse-spark-1.3+, one xhigh retry on the unsupported-effort 400. - diegosouzapw#13634: MuseCodeExecutor restores the 24h prompt_cache_retention window stripped by the generic sanitizer. - diegosouzapw#14267: device-flow hardening (origin pin, expiry cap, poll-error allowlist, bounded auth requests). - diegosouzapw#14138: mint-failure contract (401/403 forces re-login, 429/transient keeps the stored key). Skipped as subsumed or rejected: duplicate OAuth flows (merged diegosouzapw#14329 covers them), diegosouzapw#14492 parallel provider, llama catalog removals, command-code/freebuff catalog additions. Co-authored-by: mdc2122 <mdc2122@users.noreply.github.com> Co-authored-by: SIGTERM-015 <SIGTERM-015@users.noreply.github.com> Co-authored-by: KSonny4 <KSonny4@users.noreply.github.com> Co-authored-by: caniko <caniko@users.noreply.github.com> Co-authored-by: Chewji9875 <Chewji9875@users.noreply.github.com>
Summary
muse-codeprovider card, matching CLIProxyAPI's Meta login: RFC 8628 againstauth.meta.com, mint the subscription inference key atPOST https://api.meta.ai/muse-code/key, persist the durabledca:token, remint on 401, honorerror.resets_atquota cooldowns, and import CLIProxyAPItype: metaauth files.META_API_KEYon the same dashboard card. Curated catalog adds Muse Spark 1.1/1.2/1.3 (+ contributor) alongside the existing Llama models. Responses API wire format is unchanged.Related Issues
Validation
Choose the change type and focused loop from the
Contribution Golden Path. The full unit suite,
Vitest, the 60% coverage gate, and the production build all run in CI on this PR (#8329):
npm run lint(eslint on new OAuth/mint modules; pre-existing unused-import findings in untoucheddefault.ts/tokenRefresh.tslines were not expanded)release/v3.8.51@7a921299c); focused checks rerun afterwardFocused commands run locally:
tsx scripts/check/check-provider-consistency.tsnpm run check:provider-assetsnode scripts/check/check-file-size.mjstsx scripts/docs/gen-provider-reference.tsnode --import tsx/esm --test tests/unit/muse-code-oauth.test.ts tests/unit/muse-code-provider.test.ts tests/unit/muse-code-models.test.ts tests/unit/oauth-providers-config.test.ts tests/unit/oauth-polltoken-nonjson-body.test.ts tests/unit/cliproxy-auth-import-1934.test.ts tests/unit/oauth-test-config-8408.test.ts tests/unit/providers-constants-split.test.ts tests/unit/publicCreds.test.ts tests/unit/provider-translate-path-golden.test.ts tests/unit/oauth-providers-error-handling.test.ts tests/unit/providers-page-utils.test.tsTests Added Or Updated
tests/unit/muse-code-oauth.test.ts(new)tests/unit/muse-code-provider.test.tstests/unit/muse-code-models.test.tstests/unit/oauth-providers-config.test.tstests/unit/oauth-polltoken-nonjson-body.test.tstests/unit/oauth-providers-error-handling.test.tstests/unit/cliproxy-auth-import-1934.test.tstests/unit/publicCreds.test.tstests/unit/providers-page-utils.test.tstests/unit/providers-constants-split.test.tstests/snapshots/provider/translate-path.jsonCoverage Notes
error.resets_atparsing, and CLIProxytype: metaimport are covered by the tests listed above.open-sse/executors/default.tsis intentionally unchanged (frozen file-size). Minted keys have no advertised expiry (RefreshLead = nilin CLIProxyAPI); remint is the 401 /supportsTokenRefresh("muse-code")path.Reviewer Notes
accessToken= minted inference key,refreshToken/providerSpecificData.dcaToken= durabledca:token. Mint at login is best-effort; a DCA-only record is still saved.resolvePublicCred("muse_id").dca, hide a dual alias, or remint on a 24h timer). This PR uses dual-auth on the existingmuse-codeid (ClinePass / CodeBuddy CN pattern)./v1/responsescall withmuse-spark-1.3.