aaif-goose / aaif-goose/goose

Add support for Meta Muse Code subscriptions (provider)

Đang mở
#11,766 4 bình luận 0 reaction 1 người được giao Được @vincenzopalazzo nhận Xem trên GitHub
Ngôn ngữ chính
Rust
Star
54.2k
Fork
6.2k
Merge trung bình
3 ngày 4 giờ
Pull request đã merge (30 ngày)
240

Mô tả

**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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Review the draft implementation in PR #11765, focusing on `muse_code_def.rs`. Understand how it reuses `AnthropicProvider`. The key files are in the `providers` module. Test by running `cargo test -p goose` and verify the provider works with the Meta API endpoint `https://api.meta.ai/v1/messages`. Check the bundled canonical registry for model definitions. Ensure the `anthropic-version` header is accepted and that the `/v1/models` endpoint behaves as expected.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
rust
Lĩnh vực
api, backend
Loại issue
Tính năng
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
65/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.