Repository navigation
feat(oauth): add experimental Muse Code subscription provider - #14492
CanadaOrNaw wants to merge 1 commit into
Conversation
|
Re-homed to |
, cheaper-inference#14138, cheaper-inference#13634, cheaper-inference#14267, cheaper-inference#12687) Single branch with everything useful from the open Muse Code PRs that release/v3.8.52 does not have yet: - cheaper-inference#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. - cheaper-inference#12687: opencode-go sends reasoning.effort=max verbatim for muse-spark-1.3+, one xhigh retry on the unsupported-effort 400. - cheaper-inference#13634: MuseCodeExecutor restores the 24h prompt_cache_retention window stripped by the generic sanitizer. - cheaper-inference#14267: device-flow hardening (origin pin, expiry cap, poll-error allowlist, bounded auth requests). - cheaper-inference#14138: mint-failure contract (401/403 forces re-login, 429/transient keeps the stored key). Skipped as subsumed or rejected: duplicate OAuth flows (merged cheaper-inference#14329 covers them), cheaper-inference#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>
|
Hi @CanadaOrNaw — closing this pull request to clear the open queue. The branch |
|
Hi @CanadaOrNaw — reopening this pull request. The close was a mistake, and it is back in the merge queue. The branch |
|
Re-homed to |
|
Thanks @CanadaOrNaw, this is a careful write-up and the host pinning and no-fallback billing boundary are well thought out. Since you opened this, #14329 landed with a Muse Code device login, key mint and re-mint under the |
Summary
Adds an experimental Muse Code subscription-backed provider for OmniRoute using Meta's device-login flow and the Muse Code key-mint endpoint.
Provider ID: muse-code-subscription
Alias: mcs
This implementation keeps Muse subscription credentials separate from generic Meta API-key billing and from the existing Muse web/API paths.
Authentication flow
The implementation deliberately does not:
Related Issues / PRs
Several implementations of Muse subscription auth are currently open. Their main architectural differences are around provider identity and the DCA/key lifecycle.
This PR is intentionally a draft alternative / comparison implementation, not a claim that it should supersede the other open PRs. In particular:
Maintainers should prefer whichever lifecycle and provider structure is best supported by Meta's current behavior and product terms.
Changes
Tests Added Or Updated
The protocol tests cover device authorization, RFC 8628 polling behavior, hostile verification URLs, DCA-to-key minting, active-subscription enforcement, inference-endpoint pinning, credential provenance, error redaction, response-size bounds, Responses normalization, tool-result continuity, vision payload preservation, and generic API-key rejection.
The HTTP test exercises the complete flow against a loopback mock server: device code -> pending -> approved -> key mint -> authenticated Responses SSE request.
Validation
Change type: provider / OAuth / routing
Pre-publication sandbox validation performed on the prepared implementation:
The published branch is a single commit with 17 changed files, 1,298 insertions, and 1 deletion.
Coverage Notes
New production paths are covered by the new protocol, HTTP, and integration tests. The standalone protocol/HTTP tests intentionally avoid importing the full OmniRoute application so they can validate the credential and transport contract independently.
The full application integration test still needs to be run in a complete checkout with OmniRoute dependencies installed.
Live Validation Required Before Ready for Review
This PR should remain draft until the following are verified with an active Muse Code subscription:
A successful HTTP 200 alone is not sufficient evidence for the billing boundary. Subscription-meter movement and API billing need to be checked separately.
Reviewer Notes
Security / billing boundary
Authentication and inference destinations are fixed. The provider does not accept generic API keys, alternate base URLs, extra key rotation, or caller-supplied auth headers. This is intended to reduce the chance of accidentally crossing from subscription usage into normal API billing.
The client identifies itself as OmniRoute/MuseCodeSubscription rather than impersonating a specific official Muse CLI build.
Credential lifecycle
This PR takes a conservative lifecycle approach:
That may be too conservative if Meta expects DCA retention for key re-minting. feat(oauth): add Muse Code device login with CLIProxyAPI-parity remint #14329 takes the opposite approach and is useful comparison material.
Protocol research
The key-mint wire contract was independently implemented from the public CLIProxyAPI Meta integration. Meta's current documentation and observed live behavior should remain the source of truth for whether this credential can be routed by third-party clients and how usage is metered.
See docs/providers/MUSE_CODE_SUBSCRIPTION.md for the implementation assumptions and full live-acceptance checklist.