feat(metamodels): Add support for Muse Spark 1.1 via the Meta Models API - #10399
feat(metamodels): Add support for Muse Spark 1.1 via the Meta Models API#10399afternoon wants to merge 11 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8ddf86b352
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
`ThinkingEffort::Off` is not supported by the Muse Spark models, so I've clamped it to `ThinkingEffort::low` which most closely matches the user's intent to have no reasoning. I'd love to get feedback on whether this approach makes sense, or if there's a better way to do it.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bb2f962d80
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| /// supports) rather than sent as-is or omitted. | ||
| fn meta_reasoning_effort(effort: ThinkingEffort) -> &'static str { | ||
| match effort { | ||
| ThinkingEffort::Off | ThinkingEffort::Low => "low", |
There was a problem hiding this comment.
Map Off to Meta's minimal reasoning level
When users choose Off for Muse Spark, this sends reasoning_effort: "low", but Meta documents minimal as the lightest reasoning-effort value (minimal through xhigh). In UI/CLI flows that persist the default off choice, requests therefore run at a higher reasoning level than requested, increasing latency and reasoning-token cost; map Off to minimal (or omit the parameter if that is Meta's default) while keeping Low as low.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This seem to be a red-herring. According to the Meta Models API docs, the accepted values are low, medium, high and xhigh.
Co-authored-by: Ben Godfrey <afternoon@users.noreply.github.com>
Introduce crates/goose-cli/src/session/formatting.rs with pure, testable helpers for a consistent, mostly-grey semantic palette (Role::Primary/Secondary/Muted/Accent/Success/Error), shared indentation constants, and status glyphs modeled on the TUI and tools like Claude Code / Codex. Wire these helpers into output.rs, input.rs, and completion.rs: - User messages are echoed with an accent-colored prompt glyph and gutter-aligned continuation lines, matching the live input prompt. - Tool call headers use a single indented line with a status glyph instead of a heavy horizontal rule, and get a done/error status footer after the tool response. - Parameters, tool output, and error lines use consistent indentation and muted/secondary roles instead of ad-hoc styling. Co-authored-by: Ben Godfrey <afternoon@users.noreply.github.com>
Co-authored-by: Ben Godfrey <afternoon@users.noreply.github.com>
Fix issues found by an independent GPT-5 review of the formatting change: - Suppress the tool-call status footer for requests whose header was never shown (e.g. the internal `load` tool, or an unparseable tool call), so no orphaned '● done' line appears with nothing above it. - Route failed tool responses through the same error-line formatter used elsewhere, instead of a bespoke inline string. - format_user_message_plain now always emits the prompt glyph, even for an empty message, instead of silently rendering nothing. - Make Role::Secondary colorless (bold-only) instead of reusing Accent's cyan at a different weight, so Accent stays the only splash of color in an otherwise grey/dim palette. - Route the execute/subagent tool-graph step lines through formatting::apply(Role::Muted, ..)/PARAM_INDENT instead of ad hoc style(...).dim() calls, for one source of truth on tool-call styling. - Fix a test that mutated console's global color-enabled state without restoring it, which could leak across tests running in the same process. - Add tests: exact-string assertions for the tool status footer, an empty-message case, a Running-status no-footer case, a Secondary-is- colorless case, and coverage for the new footer-suppression bookkeeping. Co-authored-by: Ben Godfrey <afternoon@users.noreply.github.com>
Assistant text/markdown replies previously rendered flush-left via bat, while the user's own echoed messages and all the tool-call chrome sat under the shared 2-space GUTTER. Add formatting::indent_block, a pure helper that indents every non-empty line of an already-rendered block (preserving blank lines and trailing newlines exactly), and use it in print_markdown_raw by capturing bat's output via print_with_writer instead of letting it write straight to stdout. This makes normal model output line up with the user-message prompt glyph and with the rest of the transcript's left margin, instead of being the one thing still flush-left. Add unit tests locking in the indent_block spec (single/multi-line, blank-line handling, trailing newline, empty input), plus an ignored manual_visual_smoke_check test for eyeballing the combined user-message + assistant-reply rendering. Co-authored-by: Ben Godfrey <afternoon@users.noreply.github.com>
- tool_result_status(is_error) maps a CallToolResult's is_error field to a ToolStatus, so a protocol-level Ok(..) that still failed (e.g. a shell command with a non-zero exit code) isn't reported as success. - indent_block now takes an at_line_start flag, and a new ends_at_line_start helper reports whether rendered text leaves the cursor at a fresh line. Streamed replies are rendered in separate chunks that don't necessarily land on line boundaries, so a chunk that only continues the previous chunk's still-open line must not get its own leading gutter. Co-authored-by: Ben Godfrey <afternoon@users.noreply.github.com>
Addresses issues found in an adversarial review of the CLI formatting
changes:
- render_tool_response now derives the status footer from
formatting::tool_result_status(result.is_error) instead of always
showing '\u{25cf} done' for Ok(..), which previously mislabeled failed
tool calls (e.g. shell commands with a non-zero exit code) as
successful.
- render_message_streaming, print_markdown, print_markdown_raw,
print_table, and flush_markdown_buffer now thread an at_line_start
flag through every call, mirroring the existing thinking_header_shown
pattern. Without this, each independently-rendered streaming chunk
re-indented itself from the start of its own output regardless of
whether the cursor was already mid-line, inserting a spurious gutter
in the middle of a sentence whenever a chunk boundary didn't land on a
newline (the common case for token-by-token streaming).
- render_tool_response no longer glues the status footer onto
un-terminated tool output in non-terminal mode (e.g. piped/redirected
stdout), where tool output is printed verbatim without a guaranteed
trailing newline.
Added an ignored manual smoke test demonstrating the streaming fix.
Co-authored-by: Ben Godfrey <afternoon@users.noreply.github.com>
…ixes Documents the goal-4 follow-up (indenting normal model replies) and its implication for the 'no change to bat' non-goal, and fixes a stale note that still described Secondary as colored. Co-authored-by: Ben Godfrey <afternoon@users.noreply.github.com>
…tting-55ea CLI: improve message formatting to match TUI and align with Claude Code/Codex
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1fa690be69
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "reasoning": true | ||
| } | ||
| ], | ||
| "preserves_thinking": true, |
There was a problem hiding this comment.
Disable Muse reasoning replay on chat completions
For Meta sessions that have a returned thinking block before a tool call, preserves_thinking: true causes the OpenAI chat formatter to replay that thinking as reasoning_content on later messages, but Meta's Chat Completions docs state that this endpoint does not preserve Muse Spark reasoning across turns (see https://dev.meta.ai/docs/features/reasoning). Since this provider routes muse-spark-1.1 through chat completions rather than a reasoning-preserving API, multi-turn/tool sessions will send ineffective or unsupported reasoning replay; set this to false unless the provider is routed through an API that supports it.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 32b1c7c0dd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| /// The glyph shown next to a tool call to indicate its status. | ||
| pub fn status_glyph(status: ToolStatus) -> &'static str { | ||
| match status { | ||
| ToolStatus::Running => "○", |
There was a problem hiding this comment.
Update tool-use smoke matchers for the new glyph
When the non-JSON CLI prints a running tool, this glyph change makes headers look like ○ shell developer / ○ execute ...; however the provider smoke tests still only match the old shell | developer or ▸... forms, including the newly added early-success predicate in ui/desktop/tests/integration/test_providers.test.ts:48 and the code-exec matcher in ui/desktop/tests/integration/test_providers_code_exec.test.ts:40-41. Those tests will fail or wait for the full timeout despite successful tool use, so either include the new ○ forms in the matchers or keep a compatible header format.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1fa690be69
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .language("Markdown") | ||
| .wrapping_mode(WrappingMode::NoWrapping(true)) | ||
| .print() | ||
| .print_with_writer(Some(&mut rendered)) |
There was a problem hiding this comment.
Use an io::Write buffer for bat output
With bat 0.26.1, PrettyPrinter::print_with_writer is generic over std::io::Write, but String only implements std::fmt::Write; building goose-cli hits this call when compiling the new markdown capture path. Use a byte buffer such as Vec<u8>/Cursor<Vec<u8>> and convert it back to text before indenting so the CLI continues to compile.
Useful? React with 👍 / 👎.
|
I added unrelated new commits to my fork's main and they ended up in here. I've created a new PR here: #10432 |
Summary
Add support for the Meta Models API and the Muse Spark 1.1 model.
Testing
goose configureIf someone with access to the model can test, we can merge this, or we could wait until I get access.
Related Issues
#10396
Screenshots/Demos (for UX changes)