Skip to content

fix(mcp): pass empty args when a command tool omits them - #43

Merged
vincentkoc merged 3 commits into
openclaw:mainfrom
SebTardif:fix/mcp-command-empty-args
Oct 1, 2026
Merged

vincentkoc merged 3 commits into
openclaw:mainfrom
SebTardif:fix/mcp-command-empty-args

Conversation

@SebTardif

@SebTardif SebTardif commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Keep Sebastien Tardif's narrow empty-string default for imported Hermes MCP command tools.
  • Document optional arguments in the README compatibility table and compatibility reference.
  • Add repeatable built-stdio coverage for omitted arguments, {}, { "args": "" }, and explicit text.
  • Related issue: none. This is a bounded 0.1.1 compatibility repair, not the feature work in Track OpenClaw seams needed for full imported-plugin parity #1.

Compatibility

  • Source app: Hermes Agent, through the optional MCP stdio server.
  • Surface: babelfish_command__hermes__<plugin>__<command>.
  • Omitted command arguments now reach the handler as "". Explicit text and command routing are unchanged.
  • No new permissions, dependencies, public names, manifest contracts, or install ownership changes.
  • Background command tasks retain their existing bridge envelope and empty-string default.

Verification

Exact candidate: 344f868465754d0562f7f5047024fefd74fddf05.
Original contributor head: 70a107f58a2a602ef5c624ee8d6cc717bce08a5d.

  • Focused src/mcp-server.test.ts: 9 tests passed.
  • npm run check: build and 135 tests passed across 11 files.
  • npm run pack:check: 24 package files, 279074 bytes unpacked.
  • README compatibility table, compatibility reference, and credited changelog entry.
  • Diff contains no private paths, credentials, or generated output.
  • Independent exact-head local review completed:
    session 01a0f6c8-2e9f-7072-915f-a59cac4314b0, no actionable findings.
  • Fresh ClawSweeper exact-head verdict: no actionable findings or remaining
    pre-merge items, review.
  • Exact-head four-job CI,
    low-memory, and
    CodeQL passed.

Real Behavior Proof

On October 1, 2026, Node 26.8.1 / npm 11.19.1 / Python 3.14.6 / macOS arm64:

npm run build
npx vitest run src/mcp-server.test.ts
npm run check
npm run pack:check

The committed preserves optional command arguments through built stdio test
builds the real CLI entrypoint with production bundling settings in a temporary
runtime and copies the Python helper there,
sets isolated HOME and plugin state, and speaks MCP stdio to dist/bin.js mcp.
Its real Python command handler returns:

Input Handler result
omitted arguments {"command":""}
{} {"command":""}
{"args":""} {"command":""}
{"args":"explicit text"} {"command":"explicit text"}

The same session starts a background command without args and observes
status: "completed" with the unchanged {plugin, command, result} envelope and
inner {"command":""} result. Existing native-tool and task-capacity tests also pass.
This proves the built MCP/Python route, not third-party client UI behavior.

Review Resolution

The prior ClawSweeper finding about missing README compatibility documentation is
resolved in the Compatible commands row, with matching reference documentation.
Independent review identified a stale-build prerequisite in the first test
revision. The test now builds inside its temporary runtime; a focused run after
node scripts/clean-dist.mjs passed all 9 tests.
Maintainer additions preserve the original contributor commit and scope.
Thanks @SebTardif.

tools/call with an arguments object that has no args field fell
through to the whole object. The Hermes command handler then
received {} instead of a string. babelfish_task_start already
defaults a missing command args field to an empty string.

An explicit args string is unchanged.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 30, 2026
@clawsweeper

clawsweeper Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed October 1, 2026, 5:29 AM ET / 09:29 UTC (Revision 4).

ClawSweeper review

What this changes

The branch defaults omitted Hermes MCP command arguments to an empty string, documents that behavior, and adds coverage through the built CLI and Python bridge.

Merge readiness

✅ Ready for maintainer review

This PR remains useful because current main still forwards an empty argument object to command handlers. The prior documentation finding is resolved, the supplied production-path proof covers the repair, and no blocking defect remains.

Priority: P2
Reviewed head: 344f868465754d0562f7f5047024fefd74fddf05

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with convincing production-path evidence, compatibility coverage, and the prior documentation blocker resolved.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The captured exact-head run reports observed handler results through the built CLI, real MCP stdio client/server, and Python bridge for omitted arguments, {}, empty text, explicit text, and background completion. Inspection confirms that the harness exercises those production owners with isolated fixture state. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured exact-head run reports observed handler results through the built CLI, real MCP stdio client/server, and Python bridge for omitted arguments, {}, empty text, explicit text, and background completion. Inspection confirms that the harness exercises those production owners with isolated fixture state. No stored-data contract changes.
Evidence reviewed 6 items Pinned introduced change: The pinned main-to-head delta changes only the command argument fallback, focused tests, README compatibility row, compatibility reference, and changelog. Public names, dependencies, routing identities, permissions, and installation ownership are unchanged.
Existing contract and current-main necessity: Current main advertises an optional string args property but falls back to the complete arguments object when args is absent. Consequently, {} reaches the Python handler as an object. The existing background-command route already defaults absent args to an empty string; the patch repairs the direct route to match.
Real production boundary and reported after-fix results: The captured PR body reports an October 1 macOS arm64 run at the exact head using Node 26.8.1 and Python 3.14.6. The inspected harness builds src/bin.ts with production bundling settings, launches the real MCP stdio server with isolated HOME and plugin state, and invokes an actual Python fixture handler. Reported results preserve explicit text, return an empty string for all three empty forms, and complete the background command with its existing envelope. No transport or bridge mock replaces this path; this reviewer did not execute it.
Findings None None.
Security None None.

How this fits together

Babelfish’s optional MCP server exposes installed Hermes plugin commands to MCP clients. It translates incoming tool calls into Python bridge requests and returns the command handler’s result.

flowchart LR
  A[MCP client] --> B[Stdio server]
  B --> C[Installed command route]
  C --> D[Optional argument default]
  D --> E[Python bridge]
  E --> F[Plugin command handler]
  F --> G[MCP result]
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production and test delta production +1/-1; tests +74/-0 The execution repair remains one line, with added coverage exercising the built stdio boundary.

Technical review

Best possible solution:

Preserve the narrow empty-string default while keeping explicit command text, tool arguments, and background-task behavior intact.

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

Yes, source establishes the current-main failure: calling an imported command with arguments {} forwards that object to the Python handler instead of the existing empty-string default. No current-main execution was performed during this read-only review.

Is this the best way to solve the issue?

Yes, removing the whole-object fallback is the narrowest repair for the advertised optional string field, and the added stdio coverage verifies explicit text and background compatibility.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This repairs a bounded compatibility defect in optional Hermes MCP command calls.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured exact-head run reports observed handler results through the built CLI, real MCP stdio client/server, and Python bridge for omitted arguments, {}, empty text, explicit text, and background completion. Inspection confirms that the harness exercises those production owners with isolated fixture state. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured exact-head run reports observed handler results through the built CLI, real MCP stdio client/server, and Python bridge for omitted arguments, {}, empty text, explicit text, and background completion. Inspection confirms that the harness exercises those production owners with isolated fixture state. No stored-data contract changes.

Evidence

What I checked:

  • Pinned introduced change: The pinned main-to-head delta changes only the command argument fallback, focused tests, README compatibility row, compatibility reference, and changelog. Public names, dependencies, routing identities, permissions, and installation ownership are unchanged. (src/mcp-server.ts:410, 344f86846575)
  • Existing contract and current-main necessity: Current main advertises an optional string args property but falls back to the complete arguments object when args is absent. Consequently, {} reaches the Python handler as an object. The existing background-command route already defaults absent args to an empty string; the patch repairs the direct route to match. (src/mcp-server.ts:410, b5a7b6b461f5)
  • Real production boundary and reported after-fix results: The captured PR body reports an October 1 macOS arm64 run at the exact head using Node 26.8.1 and Python 3.14.6. The inspected harness builds src/bin.ts with production bundling settings, launches the real MCP stdio server with isolated HOME and plugin state, and invokes an actual Python fixture handler. Reported results preserve explicit text, return an empty string for all three empty forms, and complete the background command with its existing envelope. No transport or bridge mock replaces this path; this reviewer did not execute it. (src/mcp-server.test.ts:123, 344f86846575)
  • Prior finding resolved: README line 45 now documents omitted arguments, {}, empty args, and preserved explicit text. The compatibility reference and credited changelog entry agree. This satisfies the retained prior finding and rank-up move. The MEMBER re-review comment confirms the intended narrow repair: fix(mcp): pass empty args when a command tool omits them #43 (comment). (README.md:45, 344f86846575)
  • Canonical and release checks: The bounded all-state GitHub PR listing shows no separate merged replacement for this repair. The latest published release remains v0.1.0; current-main source independently establishes that the requested repair is still missing. The broader public-seam request at Track OpenClaw seams needed for full imported-plugin parity #1 concerns different capabilities.
  • Area-history routing and inspection limitation: Current-main history records Sebastien Tardif’s merged MCP task-maintenance work and Vincent Koc’s Hermes identity repair. GitHub verifies SebTardif as the author of fix(mcp): cap concurrent babelfish_task_start processes #22. Some historical blob reads and blame failed with HTTP 403, so no exact source-line introduction attribution is claimed; current source and the introduced diff were inspected successfully. (src/hermes-python.ts, 749d6fdcf4aa)

Likely related people:

  • SebTardif: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: 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.

History

Review history (3 earlier review cycles)
  • reviewed 2026-09-30T15:45:56.437Z sha 70a107f :: needs changes before merge. :: [P3] Document the changed command behavior in the README table
  • reviewed 2026-09-30T15:53:40.264Z sha 70a107f :: needs changes before merge. :: [P3] Document omitted command arguments in the README table
  • reviewed 2026-09-30T22:27:03.610Z sha 70a107f :: needs changes before merge. :: [P3] Document omitted command arguments in the README table

@SebTardif
SebTardif marked this pull request as ready for review September 30, 2026 15:51
@clawsweeper

clawsweeper Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

🦞👀
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.

@vincentkoc vincentkoc self-assigned this Oct 1, 2026
@vincentkoc

Copy link
Copy Markdown
Member

@clawsweeper re-review

Please review exact head 344f868465754d0562f7f5047024fefd74fddf05.
The README-table finding is resolved, with matching compatibility documentation.
Repeatable stdio coverage now builds its own isolated runtime from the real CLI
source; it covers all four argument forms and preserves background task routing.
Focused tests passed 9/9 after cleaning dist, npm run check passed 135/135, and
npm run pack:check passed. Independent exact-head review reports no actionable
findings. No permission, manifest, dependency or install-ownership change.
Original contributor branch and credit remain intact.

@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@vincentkoc
vincentkoc merged commit 5fdda0b into openclaw:main Oct 1, 2026
9 of 10 checks passed
@SebTardif
SebTardif deleted the fix/mcp-command-empty-args branch October 1, 2026 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants