Skip to content

feat(agents): add muse-system-settings bundle MCP mode (superseded) - #166193

Closed
zorahrel wants to merge 1 commit into
openclaw:mainfrom
zorahrel:muse-bundle-mcp-mode
Closed

zorahrel wants to merge 1 commit into
openclaw:mainfrom
zorahrel:muse-bundle-mcp-mode

Conversation

@zorahrel

@zorahrel zorahrel commented Oct 6, 2026 •

Copy link
Copy Markdown

Status: superseded by the external SDK adapter

The adapter is available as openclaw-muse-cli v0.7.0. This PR's vendor-specific core mode is no longer needed and is withdrawn. Its diff remains as historical context; it has not been merged or deployed.

The original claim that a plugin could not obtain fresh capture credentials through the supported transport was too broad. On unmodified OpenClaw 2026.9.5, prepareExecution.execute receives the final environment after capture refresh. The plugin consumes that settings path at execution time, translates HTTP to Muse's streamable-http, and stages Muse's private native settings. OpenClaw retains admission, per-session lanes, tool grants/capture, watchdog and history. No launcher or MCP proxy is required.

The same transport delivers the complete host system prompt through Muse's run.system_prompt, refreshes context on resume, forwards reasoning levels and normalizes terminal events. The release includes compiled JavaScript for package installs.

Validation of the replacement

  • Automated parser, emitted-backend and SDK-execution checks pass, including fresh capture, resume/context, non-zero exit and abort cleanup.
  • The release archive installs in an isolated OpenClaw state: runtime loaded, backend muse-cli, zero diagnostics.
  • Private live checks verified host tools, resumed history, correct channel context and concurrent sessions on one gateway.
  • Validation record and model limitations.

This supersedes the core-mode proposal in #165943. It does not claim that raising Muse's reasoning effort makes autonomous follow-through reliable.

Stage a per-turn XDG_CONFIG_HOME with translated muse/settings.json (http to streamable-http, resolved headers, auth symlinked) and rewrite it in place for the capture attempt. 5 new tests; gemini/bundle suites green.
@clawsweeper

clawsweeper Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling size: M triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Oct 6, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 6, 2026
@clawsweeper

clawsweeper Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed October 6, 2026, 12:20 PM ET / 16:20 UTC.

ClawSweeper review

What this changes

Adds a Muse CLI bridge mode that stages MCP settings and authentication links in a temporary configuration directory and refreshes the host tool token before execution.

Merge readiness

⛔ Blocked before merge - 11 items remain

The Muse integration remains useful and is not implemented on current main, but two introduced MCP policy bypasses block merging. The core-versus-plugin contract also needs a maintainer decision.

Priority: P2
Reviewed head: b84c30a33b4184c266ce5b6dfd4840d12d6de6c4
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The focused integration has a concrete consumer, but observable runtime evidence and correct policy enforcement are required for readiness.
Proof confidence 🦪 silver shellfish (2/6) Needs stronger real behavior proof before merge: Authority-chain proof required: demonstrate an allowed direct MCP call and rejection of the nearest denied tool and excluded ambient server before server-side effects. The body claims a live Muse/Gateway run of staging, tool calls, and cleanup but supplies no observable transcript for the new adapter; the five tests are supplemental. Add redacted terminal output or logs, removing credentials and private endpoints; updating the PR body triggers review, or a maintainer can request @clawsweeper re-review. Original persistent settings are not rewritten, so no stored-data migration is introduced. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦪 silver shellfish (2/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: Authority-chain proof required: demonstrate an allowed direct MCP call and rejection of the nearest denied tool and excluded ambient server before server-side effects. The body claims a live Muse/Gateway run of staging, tool calls, and cleanup but supplies no observable transcript for the new adapter; the five tests are supplemental. Add redacted terminal output or logs, removing credentials and private endpoints; updating the PR body triggers review, or a maintainer can request @clawsweeper re-review. Original persistent settings are not rewritten, so no stored-data migration is introduced. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 9 items Pinned introduction and merge ownership: Reviewed the merge-base-to-head introduction. Independently inspected the test merge's raw parents: pinned main followed by the exact PR head. Its result adds only the five introduced paths; unrelated main changes are not PR removals.
Direct MCP restrictions are discarded: The new normalizer preserves connection fields but drops toolFilter. The Muse branch also does not pass mcpToolsDeny. Native policy preparation supplies allowed and denied tool identities for direct configured servers, which do not pass through the OpenClaw loopback grant.
Ambient servers survive authoritative selection: The adapter recursively merges selected servers into the user's existing Muse settings. RFC 7396 merging retains omitted keys, so an ambient server survives even when excluded by server overrides, native policy, or exclusiveConfig.
Findings 2 actionable findings [P1] Enforce tool restrictions on direct MCP servers
[P1] Replace ambient MCP inventory with the selected server map
Security Needs attention Direct server tool-policy bypass: Dropping native tool restrictions exposes denied tools on otherwise permitted direct MCP servers.
Ambient server selection bypass: Recursive merging preserves ambient MCP servers omitted by the authoritative host selection, including exclusive runs.

How this fits together

OpenClaw's CLI runner translates host and configured MCP servers into settings consumed by external agent CLIs. Those settings determine which tool servers the CLI can contact during a turn.

flowchart TD
 A[Host tool grant] --> C[CLI MCP preparation]
 B[Configured MCP servers] --> C
 C --> D[Conversation tool policy]
 D --> E[Muse settings adapter]
 F[Existing Muse settings] --> E
 E --> G[Muse CLI]
 G --> H[MCP tool calls]
Loading

Decision needed

Question Recommendation
Should Muse staging use the existing plugin execution transport, a generic settings seam, or this fourth built-in bridge mode? Evaluate plugin-owned execution: Use the existing final-environment execution transport if it can stage Muse settings while preserving host policy.

Why: The external plugin establishes demand, but adding vendor-specific core behavior expands the public contract without proving the existing transport inadequate.

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: Authority-chain proof required: demonstrate an allowed direct MCP call and rejection of the nearest denied tool and excluded ambient server before server-side effects. The body claims a live Muse/Gateway run of staging, tool calls, and cleanup but supplies no observable transcript for the new adapter; the five tests are supplemental. Add redacted terminal output or logs, removing credentials and private endpoints; updating the PR body triggers review, or a maintainer can request @clawsweeper re-review. Original persistent settings are not rewritten, so no stored-data migration is introduced. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Enforce tool restrictions on direct MCP servers (P1) - When a configured MCP server permits read_docs but denies delete_docs, native policy projects that restriction into toolFilter and mcpToolsDeny. This normalizer drops the filter, and the Muse dispatch does not pass the denials. Muse receives the direct server connection with unrestricted tool access; the OpenClaw loopback grant cannot protect calls made directly to that server. Route restricted servers through an enforcing host boundary or omit them when enforcement is unavailable.
  • Replace ambient MCP inventory with the selected server map (P1) - If the real Muse settings contain a server excluded by host policy, server overrides, or exclusiveConfig, this recursive merge retains it because omitted keys are not deleted. Restricted runs therefore launch with additional direct MCP servers outside the selected host grant. Preserve unrelated preferences, but make the staged MCP inventory exactly match the authoritative selection.
  • Resolve security concern: Direct server tool-policy bypass - Dropping native tool restrictions exposes denied tools on otherwise permitted direct MCP servers.
  • Resolve security concern: Ambient server selection bypass - Recursive merging preserves ambient MCP servers omitted by the authoritative host selection, including exclusive runs.
  • Resolve merge risk (P1) - The new public Muse bridge mode lacks maintainer-confirmed placement; the existing plugin execution transport has not been shown insufficient.
  • Complete next step (P2) - Obtain maintainer agreement on adapter placement, fix both MCP policy bypasses, and attach redacted after-fix Muse runtime evidence.
  • Improve patch quality - Repair both server-selection and tool-restriction bypasses.
  • Improve patch quality - Provide after-fix Muse traces showing allowed calls and denied calls rejected before final effects.
  • Improve patch quality - Resolve the plugin-versus-core contract placement.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.

Findings

  • [P1] Enforce tool restrictions on direct MCP servers — src/agents/cli-runner/bundle-mcp-muse.ts:60
  • [P1] Replace ambient MCP inventory with the selected server map — src/agents/cli-runner/bundle-mcp-muse.ts:106
  • [high] Direct server tool-policy bypass — src/agents/cli-runner/bundle-mcp-muse.ts:60
  • [high] Ambient server selection bypass — src/agents/cli-runner/bundle-mcp-muse.ts:106
Agent review details

Security

Needs attention: The new settings adapter allows direct MCP access outside host-selected server and tool restrictions.

PR surface

Source +170, Tests +170, Docs +1. Total +341 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 3 171 1 +170
Tests 1 170 0 +170
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 342 1 +341

Review metrics

Metric Value Why it matters
Public backend contract 1 new bridge-mode value A vendor-specific mode becomes supported plugin API and needs an explicit placement decision.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #165943
Summary: This PR is the explicit implementation candidate for the same author's open Muse bridge request.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Preserve exact host policy (recommended)
    Replace ambient server inventory and enforce tool restrictions through a host-controlled path before exposing Muse MCP access.
  2. Resolve adapter placement first
    Pause landing while evaluating plugin-owned staging against the existing execution contract.

Technical review

Best possible solution:

Keep Muse layout plugin-owned where feasible, while ensuring every exposed MCP server and tool remains subject to the host's exact policy.

Do we have a high-confidence way to reproduce the issue?

Yes, source establishes two focused failing scenarios: a direct server with an allowed and denied tool, and an ambient Muse server omitted from exclusiveConfig. These scenarios were not executed during this read-only review.

Is this the best way to solve the issue?

Unclear. The adapter follows the existing lifecycle, but loses authoritative policy and has not established why supported plugin-owned execution cannot provide the staging.

Full review comments:

  • [P1] Enforce tool restrictions on direct MCP servers — src/agents/cli-runner/bundle-mcp-muse.ts:60
    When a configured MCP server permits read_docs but denies delete_docs, native policy projects that restriction into toolFilter and mcpToolsDeny. This normalizer drops the filter, and the Muse dispatch does not pass the denials. Muse receives the direct server connection with unrestricted tool access; the OpenClaw loopback grant cannot protect calls made directly to that server. Route restricted servers through an enforcing host boundary or omit them when enforcement is unavailable.
    Confidence: 0.98
  • [P1] Replace ambient MCP inventory with the selected server map — src/agents/cli-runner/bundle-mcp-muse.ts:106
    If the real Muse settings contain a server excluded by host policy, server overrides, or exclusiveConfig, this recursive merge retains it because omitted keys are not deleted. Restricted runs therefore launch with additional direct MCP servers outside the selected host grant. Preserve unrelated preferences, but make the staged MCP inventory exactly match the authoritative selection.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 3d23bf9dd463.

Labels

Label changes:

  • add P2: This is a bounded optional backend feature with blocking defects, rather than an observed shipped regression.
  • add merge-risk: 🚨 compatibility: The PR expands the public CLI-backend bridge contract without a confirmed maintainer direction.
  • add merge-risk: 🚨 security-boundary: Muse can receive direct MCP connections without host-selected tool restrictions or exact server selection.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦪 silver shellfish and patch quality is 🦪 silver shellfish.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Authority-chain proof required: demonstrate an allowed direct MCP call and rejection of the nearest denied tool and excluded ambient server before server-side effects. The body claims a live Muse/Gateway run of staging, tool calls, and cleanup but supplies no observable transcript for the new adapter; the five tests are supplemental. Add redacted terminal output or logs, removing credentials and private endpoints; updating the PR body triggers review, or a maintainer can request @clawsweeper re-review. Original persistent settings are not rewritten, so no stored-data migration is introduced. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P2: This is a bounded optional backend feature with blocking defects, rather than an observed shipped regression.
  • merge-risk: 🚨 security-boundary: Muse can receive direct MCP connections without host-selected tool restrictions or exact server selection.
  • merge-risk: 🚨 compatibility: The PR expands the public CLI-backend bridge contract without a confirmed maintainer direction.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦪 silver shellfish and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Authority-chain proof required: demonstrate an allowed direct MCP call and rejection of the nearest denied tool and excluded ambient server before server-side effects. The body claims a live Muse/Gateway run of staging, tool calls, and cleanup but supplies no observable transcript for the new adapter; the five tests are supplemental. Add redacted terminal output or logs, removing credentials and private endpoints; updating the PR body triggers review, or a maintainer can request @clawsweeper re-review. Original persistent settings are not rewritten, so no stored-data migration is introduced. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

Security concerns:

  • [high] Direct server tool-policy bypass — src/agents/cli-runner/bundle-mcp-muse.ts:60
    Dropping native tool restrictions exposes denied tools on otherwise permitted direct MCP servers.
    Confidence: 0.98
  • [high] Ambient server selection bypass — src/agents/cli-runner/bundle-mcp-muse.ts:106
    Recursive merging preserves ambient MCP servers omitted by the authoritative host selection, including exclusive runs.
    Confidence: 0.99

What I checked:

  • Pinned introduction and merge ownership: Reviewed the merge-base-to-head introduction. Independently inspected the test merge's raw parents: pinned main followed by the exact PR head. Its result adds only the five introduced paths; unrelated main changes are not PR removals. (b84c30a33b41)
  • Direct MCP restrictions are discarded: The new normalizer preserves connection fields but drops toolFilter. The Muse branch also does not pass mcpToolsDeny. Native policy preparation supplies allowed and denied tool identities for direct configured servers, which do not pass through the OpenClaw loopback grant. (src/agents/cli-runner/bundle-mcp-muse.ts:60, b84c30a33b41)
  • Ambient servers survive authoritative selection: The adapter recursively merges selected servers into the user's existing Muse settings. RFC 7396 merging retains omitted keys, so an ambient server survives even when excluded by server overrides, native policy, or exclusiveConfig. (src/agents/cli-runner/bundle-mcp-muse.ts:106, b84c30a33b41)
  • Current-main necessity: Pinned current main exposes only Claude, Codex, and Gemini bridge modes. Its preparation and capture dispatch contain no Muse adapter, and no merged fixing PR is established by the supplied related context. (src/plugins/cli-backend.types.ts:84, 3d23bf9dd463)
  • Existing public execution contract: Prepared execution can return a plugin-owned transport, whose context receives the final environment and a current-authority assertion. This is a supported alternative worth evaluating before expanding the public bridge-mode union; its adequacy for Muse is not established. (src/plugins/cli-backend.types.ts:125, b84c30a33b41)
  • Existing external integration: Verified repository ownership and read its README. The plugin already uses Gemini staging plus a stdio proxy for Muse; this positively establishes a concrete consumer. Its documented tests and existing proxy do not demonstrate this PR's native adapter after the change. (README.md, 0924b3b5786f)

Likely related people:

  • Ayaan Zaidi: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Patrick Erichsen: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@zorahrel zorahrel changed the title feat(agents): add muse-system-settings bundle MCP mode feat(agents): add muse-system-settings bundle MCP mode (superseded) Oct 7, 2026
@zorahrel zorahrel closed this Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant