Repository navigation
feat(oauth): add Muse Code subscription provider (muse-code-oauth) + fix muse-code apikey - #14138
SIGTERM-015 wants to merge 6 commits into
Conversation
…fix muse-code apikey baseUrl and catalog - Add Muse Code OAuth provider using device flow against auth.meta.com - Mint API key via api.meta.ai/muse-code/key - Token refresh re-mints the key - Register muse-code-oauth / mco in the provider registry as hiddenFromDashboard - Fix muse-code apikey baseUrl to https://api.meta.ai/v1/responses - Add 5 muse-spark models to the catalog
… and add muse-code-oauth to NO_PKCE
…counts, complexity, Meta ToS notice
|
CI triage — every red below is pre-existing on API Route Typecheck — Fast Quality Gates — 3 gates:
No new ESLint warnings — Docs Gates (fast-path) — Merge integrity — Unit Tests (4/4 shards) — all pre-existing:
Fixed in bcae7c3: provider registry flags + reserved-prefix guard test, docs counts (359 → 360 across README / llm.txt / provider reference), file-complexity cap on the new OAuth module, and the Meta ToS notice for |
Revert the manual 359->360 provider-count bump in AGENTS.md, README.md, llm.txt, package.json and the 4 regenerated SVG diagrams (docs/diagrams/*, public/images/tier-flow-*) back to the release/v3.8.51 state. These counts are updated only on the release train, not per-provider-PR, to avoid every provider PR racing to bump the same number. docs/reference/PROVIDER_REFERENCE.md keeps its regenerated content since it is the auto-generated source of truth. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
|
This is a clean implementation and the way it reuses the central We're landing #13634 as the base for this feature: it was opened a few days earlier, implements the |
|
Re-homed to |
…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>
|
Thanks @SIGTERM-015 — the Muse Code OAuth implementation (device flow, re-mint refresh, ToS notice, |
Summary
Adds a Muse Code subscription OAuth provider (
muse-code-oauth) and fixes the existingmuse-codeAPI-key provider.Included
muse-code-oauth) againstauth.meta.comusing the publicclient_id(no secret).api.meta.ai/muse-code/key.401/429instead of a standard refresh-token exchange.muse-code/mcplusmuse-code-oauth/mco, withhiddenFromDashboardon the OAuth variant.muse-code:https://api.meta.ai/v1/responses; catalog entries corrected to the 5muse-sparkmodels.NO_PKCEhandling for the device-flow provider;publicCredsand provider registry/consistency wiring updated.Changed files
Production code in
open-sse/andsrc/; details:open-sse/config/providers/registry/muse-code/index.ts— apikey provider fix (baseUrl + model catalog)open-sse/config/providers/registry/muse/code/index.ts— new OAuth provider registrationopen-sse/services/tokenRefresh/providers/museCode.ts— re-mint refresh on 401/429src/lib/oauth/providers/muse-code.ts— device-flow implementationsrc/shared/constants/providers/oauth.ts,src/lib/oauth/constants/oauth.ts, registry/index wiring,src/app/api/v1/muse-code/models/route.ts,oauthTestConfig.tsRelated Issues
Validation
npm run lint(eslint clean)Checks green before opening:
public-credscheck: passprovider-consistencycheck: passeslint: cleanTests Added Or Updated
tests/unit/muse-code-oauth-provider.test.ts(new — device flow + mint)tests/unit/muse-code-token-refresh.test.ts(new — re-mint on 401/429)tests/unit/muse-code-models.test.ts(updated — 5 muse-spark catalog)tests/unit/oauth-providers-config.test.ts(updated — dual-auth aliases, hiddenFromDashboard)tests/snapshots/provider/translate-path.json(updated snapshot)Coverage Notes
All new production paths in
src/lib/oauth/providers/muse-code.tsandopen-sse/services/tokenRefresh/providers/museCode.tsare covered by the new unit tests above (device-flow start/poll, mint, re-mint on 401 and 429). No coverage decrease in touched files.Reviewer Notes
client_idonly; nothing secret is committed — guarded by thepublic-credscheck.muse-code-oauthis intentionallyhiddenFromDashboard; use the dual auth aliasesmc/mco.museCode.ts.