Repository navigation
Open
Labels
app/muse-proxybin/muse-proxy.mjs OpenAI-compatible Muse bridgebin/muse-proxy.mjs OpenAI-compatible Muse bridgeeffort/sSmall: expected under 2 hours of workSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)Something isn't working (prefixed form of the classic bug label)meta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)Ordinary priority (the default)status:in-reviewtask/small-fixQueue packet kind: bounded fix with reproduction and targeted testsQueue packet kind: bounded fix with reproduction and targeted tests
Description
muse-proxy attestation aliasing (shell→run_command, bash→terminal) has collision, leak, and bypass modes
From the 2026-11-05 tool-call audit (~/workspace/scratch/toolcall-audit-2026-11-04/code-inventory.md §6). Context: Meta's gate 403s tools named shell/bash, so bin/muse-proxy.mjs renames them to run_command/terminal in tool definitions, history function_call items, and tool_choice, and renames them back in output/SSE (aliasResponsesRequestBody L1118-1141, unaliasSseData L1150-1162 at audit time). The mechanism is deliberate; its edges are not handled:
- Collision: if the client already defines a tool named
run_commandorterminal, the alias is skipped for the blocked name (directToolAliastaken-check, L1107-1111) —shellthen goes up under its blocked name and the whole request 403s. Fix: pick a non-colliding alias (and rename back consistently), or fail the request locally with a clear error instead of an upstream 403. - Leak: SSE un-aliasing inspects only
evt.itemandevt.response.output. Any event shape carrying afunction_callname elsewhere would leak the alias name (run_command) to the client, which would then try to execute/report a tool that does not exist. Fix: un-alias by scanning the event generically for function_call items, with a test covering the shapes Meta actually emits. - Bypass: request bodies that fail
JSON.parseforward verbatim unaliased (L1119-1121) — a malformed-but-accepted body skips the gate workaround silently. Fix: log/metric the bypass at minimum; ideally reject unparseable bodies on the direct path.
Tests exist for the happy path (muse-proxy.test.mjs alias tests); add one per failure mode above. Note the door's end state is the façade migration (opencode#1155) — this is hardening for the standing door, sized small.
Acceptance criteria
- Collision: when the client already defines
run_command/terminal, the proxy picks a non-colliding alias (renamed back consistently) or fails the request locally with a clear error —shellnever goes up under its blocked name to a 403. - Leak: SSE un-aliasing scans events generically for function_call items (not only
evt.item/evt.response.output), with a test covering the shapes Meta actually emits. - Bypass: an unparseable request body on the direct path is logged/metric'd at minimum (ideally rejected) — it never forwards unaliased silently.
- One new test per failure mode in
muse-proxy.test.mjs; the existing happy-path alias tests still pass.
Metadata
Metadata
Assignees
Labels
app/muse-proxybin/muse-proxy.mjs OpenAI-compatible Muse bridgebin/muse-proxy.mjs OpenAI-compatible Muse bridgeeffort/sSmall: expected under 2 hours of workSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)Something isn't working (prefixed form of the classic bug label)meta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)Ordinary priority (the default)status:in-reviewtask/small-fixQueue packet kind: bounded fix with reproduction and targeted testsQueue packet kind: bounded fix with reproduction and targeted tests
Activity
developing-today commentedon Nov 5, 2026
CODE-1764
dezren39 commentedon Nov 5, 2026
Overlap note (found on a later dedupe pass): #2770 already tracks the alias-inverse defect (a genuine run_command/terminal tool's calls renamed back to shell/bash; declaring both names collapses them), and #3102/#4445 cover request-scoped alias fixes. This issue's remaining distinct scope: (1) the taken-check collision mode — when the client already defines run_command/terminal, the blocked name goes up unaliased and the request 403s upstream instead of failing locally or picking a non-colliding alias; (2) SSE un-aliasing only inspects evt.item / evt.response.output, so other event shapes can leak the alias name to the client; (3) unparseable request bodies bypass aliasing entirely and forward verbatim. If those land better on #2770, move them there and close this as its duplicate — the audit evidence is in ~/workspace/scratch/toolcall-audit-2026-11-04/code-inventory.md §6 either way.
dezren39 commentedon Nov 5, 2026
Intake review
~/workspace/scratch/toolcall-audit-2026-11-04/code-inventory.md§6); Door front migration: muse-proxy (18747) callers repoint to the façade developing-today-forks/opencode#1155 (the façade migration — this door's end state; this issue is hardening until then, per the body).aliasResponsesRequestBody/unaliasSseData/directToolAliasinbin/muse-proxy.mjs); happy-path alias tests exist, the three failure modes are unhandled.60 remaining items
dezren39 commentedon Nov 6, 2026
🤖 Agent note · handed off
dezren39 commentedon Nov 6, 2026
🤖 Agent note · picked up
dezren39 commentedon Nov 6, 2026
🤖 Agent note · done
node --test bin/muse-proxy.test.mjs— 47/47 passed;git diff --checkpassed.