Repository navigation
fix(muse-proxy): gate tools-carrying requests from the warm/exec CLI fallback (#6117) - #6256
Merged
Merged
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 44 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Track 3 of the tool-call-audit "fix all" program (opencode#1708, code#6117): muse-direct's warm/exec fallback doctrine defect.
Where the code actually lives
The audit (§6 of
code-inventory.md) locates muse-direct's implementation in this repo: OpenCode'smuse-directblock speaks OpenAI Responses tobin/muse-proxy.mjson :18747. There is no muse-direct provider underpackages/ai/src/providers/in the opencode fork (that route lands on the generic forkopenaiprovider -> this proxy), so the fix lands here and is cross-recorded on opencode#1708.Fallback map (measured from code)
POST /v1/responses(the actual muse-direct route): direct-only already — no credential = loud 404, exchange/transport failure = loud 502. No vendor fallback exists on this route.POST /v1/chat/completions: direct first; on no-upstream-response (no credential,MUSE_PROXY_DIRECT=0, exchange/fetch transport failure, unexpected direct error) it fell to warm (muse serve), and on any warm failure before commit, to exec (muse exec); a 403client_attestation_deniedon the direct path also returned "fall back" explicitly.toolsarray was never passed (warm receives onlymessages; exec receives only a--prompt-file).formatPromptflattened assistanttool_callsto[Tool Call: name(args)]prose and tool results toTool Result (id): ...transcript lines. The Muse CLI then acted with its OWN tools (--approval-mode never) and only final text returned withfinish_reason: "stop"— a session could flip between real tool calls (direct) and simulated CLI agency (fallback) turn by turn, silently.Decision: gate, don't conform (and why)
Conforming warm/exec to emit real client tool calls is impossible: the
muse serve/muse execsurfaces return only final text — there is no wire tool-call emission for arbitrary client tools to translate. Their conforming end state is the facade migration (opencode#1155). So, per code#6117's muse-proxy ask, the vendor fallback is REMOVED for the class it can harm:tools, a forcedtool_choice, or a history containingtool_calls/role: "tool"messages) is direct-or-error. If direct cannot serve it, the proxy returns a loud 502 witherror.code: "tools_fallback_ineligible"naming the limitation, and warm/exec are never attempted.X-Muse-Proxy-Pathheader (direct/warm/exec).museprovider stays disabled and nothing here dispatches onmuse/*models; the Meta pool was not touched (walled until 2026-11-09).Tests
node --test bin/muse-proxy.test.mjs— 44/44 pass (run twice), 7 new "tools gate" tests:muse exec(--prompt-file) normuse serve(START) was invoked, warm deliberately enabledMUSE_PROXY_DIRECT=0-> 502, no exectoolsarray) -> 502tool_callswith byte-exact arguments,finish_reason: "tool_calls",X-Muse-Proxy-Path: directX-Muse-Proxy-Path: exec/v1/responseswith tools + no credential -> loud 404, CLI never touchedRetest
Ready for the opencode#1708 retest queue: live muse-direct round-trip after the Meta pool wall resets 2026-11-09T00:00:00Z. Not deployed by this PR — the coordinator sequences the shared build/deploy.
Refs developing-today-forks/opencode#1708, closes the muse-proxy item of #6117 (claude-code/commandcode items are separate tracks).
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.