Repository navigation
Conversation
|
The security hygiene here is genuinely the best of the four Muse Code PRs we're comparing — What keeps it from being the landing candidate is the lifecycle: by design this branch discards the I'd like to port your error-sanitization approach (origin pin + fixed poll-error allowlist) onto |
|
Re-homed to |
|
@diegosouzapw should I still do the earlier request? |
…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>
|
@codex review Please review the complete PR candidate, not only the latest commit. Request recorded for head |
|
Closing this full-provider proposal as superseded. The maintainer selected a renewable lifecycle in #14267 (comment), and the live The original source head |
- oauth-polltoken-nonjson-body: the diegosouzapw#14267 hardening carried here allowlists Muse Code poll errors and never echoes upstream text, so a non-JSON 502 page now maps to a bare { error: "invalid_response" } instead of a description quoting the HTML. Kimi and GitHub keep the original assertion. - opencode-go-muse-spark-1-3-12674: diegosouzapw#12687 adds `max` as an explicit muse-spark-1.3 alias (sent verbatim, xhigh fallback on the upstream unsupported-effort 400), so parseEffortLevel(-max) now resolves. Co-authored-by: caniko <caniko@users.noreply.github.com> Co-authored-by: Chewji9875 <Chewji9875@users.noreply.github.com> Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
Adds Muse Code subscription OAuth via the existing device-code framework.
Status: draft — implementation + unit/integration evidence complete, pending fresh CI + maintainer review
Device authorization, browser approval, key exchange, dashboard login, persisted reload, discovery config, route-level discovery, and gateway inference are demonstrated (see below). Remaining: fresh CI triage and upstream review.
What
muse-codeOAuth provider (src/lib/oauth/providers/muse-code.ts): RFC 8628 device authorization againstauth.meta.com(bounded timeouts, no redirects, strict URL validation incl. embedded-credential rejection), server-side polling through the generic device tail with an allowlisted error-code set mapped to fixed messages (upstream descriptions always discarded, prototype-safe lookup), then a key exchange atapi.meta.ai/muse-code/key(onboard: true) for the subscription inference key.accessToken— the default executor prefers it for OAuth connections). The device account token authorizes the exchange and is discarded, never persisted. No refresh-token grant exists: reconnect replaces the stored key (dedup by persistedaccountId, mirroring the Codex rule).baseUrl https://api.meta.ai/v1+/responsessuffix (shared by OAuth and existing API-key connections), livemodelsUrlfor entitled Spark discovery, and static Spark entries matching the verified subscription contract (1.1/1.2/1.3, base + Contributor where entitled) taggedopenai-responsesso Chat callers translate correctly; live discovery stays authoritative so unentitled ids are rejected.getProviderById, merged index, alias lookup), tested; existing API-key connections untouched.client_idembedded viaresolvePublicCred("muse_id")perdocs/security/PUBLIC_CREDS.md(no literal in source).Verification
/api/providers/[id]/modelshandler returns the mocked account catalog with the subscription bearer and excludes static-only ids.oauth-providers-config.test.ts,publicCreds.test.ts, translate-path golden (muse-code URLs resolve to the Responses endpoint)./v1/modelsincludingmuse-spark-1.3-contributor. No secrets printed or persisted.typecheck:coreclean; changed files lint/format clean. Streaming consumption relies on the generic Responses machinery plus the live non-streaming demo; SSE tool-continuation through the gateway remains operator-verified only via dashboard use, not an automated test.Still open