Add support for Meta Muse Code subscriptions (provider)
- Lingua principale
- Rust
- Stelle
- 54.2k
- Fork
- 6.2k
- Merge medio
- 3g 2h
- PR unite (30g)
- 262
Descrizione
**What problem would this solve?**
Goose currently has no first-class provider for [Meta Muse Code](https://ai.developer.meta.com/docs/muse-code/subscriptions), so subscribers pay per-token elsewhere instead of using their Muse Code subscription quota. This affects goose users on CLI and desktop who want subscription-billed access to the Muse Spark models for agent coding.
**What would a good outcome look like?**
- `goose configure` lists a "Meta Muse Code" provider; the user pastes a `META_MODEL_API_KEY` (same flow OpenCode uses) and gets working sessions.
- Anthropic Messages format (`POST /v1/messages` on `https://api.meta.ai`) with cross-turn thinking replay, tool loops, and live model discovery where the platform supports it.
- The provider shows up in the desktop settings with docs links via the existing inventory metadata.
**Possible approaches**
A working draft implementation exists: #11765 (2 commits, ~190 LOC). It reuses `AnthropicProvider` wholesale — `muse_code_def.rs` only adds metadata, Bearer auth, host config, and a model list enriched from the bundled canonical registry via a new `"muse_code" => "meta"` alias (the established `xai` pattern). Design choices worth confirming in review:
1. **Anthropic Messages endpoint** vs. OpenAI Responses (`/v1/responses`, Meta's "full feature set" endpoint). Messages was chosen because goose's `formats::anthropic` is the most mature path and it supports thinking replay; Responses would need the one-off pattern from `chatgpt_codex.rs`.
2. **`anthropic-version` header** — sent for Claude-Code parity; needs live confirmation Meta accepts it.
3. **Model list** — canonical-registry-backed, with `GET /v1/models` attempted and static fallback if Meta doesn't implement it.
4. **Subscription-only** — no non-subscription API-key fallback in scope.
**Additional context**
- Endpoint facts from the Muse Code subscriptions doc: `/v1/responses` (full features), `/v1/chat/completions` (no cross-turn reasoning), `/v1/messages` (Anthropic-format, thinking replay).
- Models: `muse-spark-1.2` (default), `muse-spark-1.1`, `muse-spark-1.2-contributor` — already present in the bundled canonical registry with reasoning flags and context limits.
- Verification plan for the PR: local CI green (`cargo test -p goose`, clippy `-D warnings`); live testing against an active subscription still pending (header acceptance, `/v1/models` behavior, thinking replay).
- [x] I have verified this does not duplicate an existing feature request
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.