Skip to content

fix(hooks): continue tool calls when the Hermes bridge cannot start - #46

Merged
vincentkoc merged 5 commits into
openclaw:mainfrom
SebTardif:fix/tool-call-without-python
Oct 1, 2026
Merged

vincentkoc merged 5 commits into
openclaw:mainfrom
SebTardif:fix/tool-call-without-python

Conversation

@SebTardif

@SebTardif SebTardif commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Permit discovery, hooks, and middleware without Python only when the Hermes install directory is freshly verified absent or empty. This is not a general bridge-startup fallback.
  • Preserve installed guards: nonempty/incomplete installations, unreadable or dangling paths, ambiguous missing paths containing ./.., and Python-owned home expansion do not establish absence. Explicit tools, commands, CLI commands, and skills still require Python.
  • Propagate startup, import, registration, protocol, timeout, cancellation, and pre-tool decision callback failures before host tool I/O. Observer callbacks retain warning-and-continue behavior.
  • Retain Sebastien Tardif's original contribution and ancestry; integrate current main with a normal maintainer merge, including the session-start ownership repair in fix(hooks): drop a rejected session start before the next turn #45. No dependency or release changes.

Compatibility

  • Source apps: Hermes Agent; existing Claude Code and Codex imported guards remain active without Hermes.
  • Affected surfaces: Hermes discovery, hooks, middleware, and native/Codex pre-tool execution.
  • Trust boundary: only verified absence permits the empty-provider result; an unavailable installed decision provider fails closed. Availability discovery stays inside the existing serialized request lane so it cannot bypass a pending session start.
  • README compatibility table, detailed compatibility documentation, and changelog describe the new behavior. Main's src/index.ts and src/session-start-pending.test.ts are byte-for-byte unchanged.

Exact-head verification

Reviewed/tested head: 7958e361651c124af2f4d609c0fa2334ff44cf4b.
Integrated main: 75d94845ee297f1165a92d3af7ee16ef6118833f.
Original contributor head retained as an ancestor: 89a8916e8a22669405b900e73f4a5ea22da791f7.

  • git diff --check; both ancestry checks; protected main file equality; unchanged package/dependency inputs.
  • npm run build.
  • Focused Hermes bridge, host tool-call bridge, native registration, and session-start ownership tests: 58 passed / 4 files.
  • npm run check: 218 passed / 13 files.
  • npm run pack:check: 24 files / 294,387 unpacked bytes.
  • Frozen OpenClaw and Codex 2026.9.7 production host tool-effect proof: 34/34 distinct cells, 17 cases through each adapter; host source 2b4055f8dd703e9c09985940dce9a9c6fc3c29bf.
  • Updated README compatibility table and CHANGELOG.md; public diff and this description scrubbed of private paths and generated artifacts.
  • Fresh independent read-only high-reasoning static review of the complete eight-file diff at the exact head: no actionable introduced scoped findings. Confirmed protected main files, additive docs/tests, verified absence, guard failure propagation, and request ordering.

Proof bounds: production host evidence is pinned to 2026.9.7, not every host release. Unreadability uses a mocked EACCES; dangling/dot-path unit probes exclude Windows. Hosted Windows CI remains a required gate. The independent review inspected the retained runtime evidence but did not independently rerun it.

Final tool-effect evidence

Both native OpenClaw and Codex adapters registered the built plugin and exercised the real host tool path in isolated temporary HOME/state directories. Allowed cells produced exactly one receipt; denied cells produced zero tool I/O.

Case Native receipts Codex receipts
Empty install, missing Python 1 1
Absent install, missing Python 1 1
Installed guard, missing Python 0 0
Incomplete installation 0 0
Ambiguous parent traversal 0 0
Python-owned tilde path 0 0
Plugin import failure 0 0
Plugin registration failure 0 0
Pre-tool callback failure 0 0
Decision middleware failure 0 0
Early helper exit 0 0
Decision timeout 0 0
Malformed protocol 0 0
Invalid response envelope 0 0
Cancellation 0 0
Healthy guard veto 0 0
Healthy Hermes argument rewrite 1 1

All cells passed. The package/host proof uses fixtures only, not live OpenClaw state.

Landing gates

  • The independent review is complete; an exact-head durable ClawSweeper verdict and hosted CI matrix / low-memory / CodeQL remain required before squash merge.
  • Maintainer decision on the original fail-open finding: preserve installed guards. The repaired implementation and final-effect evidence above implement that decision rather than accepting a bypass.

Contributor credit: Sebastien Tardif (@SebTardif).

Missing python and a plugin that fails to load rejected before_tool_call,
so every tool failed closed. Ignore only bridge startup failures there,
and skip a plugin whose register() raises.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
@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.

@clawsweeper clawsweeper Bot added P1 Urgent regression or broken agent/channel workflow affecting real users now. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken 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 1, 2026
@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed October 1, 2026, 6:34 AM ET / 10:34 UTC (Revision 2).

ClawSweeper review

What this changes

Babelfish skips Python for freshly verified absent or empty Hermes installations while propagating installed pre-tool guard failures, with focused tests and compatibility documentation.

Merge readiness

✅ Ready for maintainer review

This PR remains necessary: main still requires Python even when no Hermes plugins are installed. The repaired head resolves the earlier findings, and the captured host tool-effect evidence supports the guard-preserving behavior. No actionable introduced defect remains.

Priority: P1
Reviewed head: 7958e361651c124af2f4d609c0fa2334ff44cf4b

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with sufficient scoped final-effect evidence, regression coverage, and resolved prior findings.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The captured exact-head results exercise the built plugin through native and Codex host tool paths in isolated state: verified absence permits one tool receipt, while unavailable or failing installed guards produce zero tool I/O. This covers the earlier authority concern; source inspection supports the reported boundary. 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 results exercise the built plugin through native and Codex host tool paths in isolated state: verified absence permits one tool receipt, while unavailable or failing installed guards produce zero tool I/O. This covers the earlier authority concern; source inspection supports the reported boundary. No stored-data contract changes.
Evidence reviewed 9 items Complete introduced change: Read all eight introduced files against the pinned main parent. Runtime changes are confined to Hermes availability checks, response-envelope validation, and decision callback failure propagation; dependencies, public commands, manifests, and installation ownership are unchanged.
Still missing on main: Main's bridge executes discovery, hooks, and middleware through ensureChild without an installation-absence check. Missing Python therefore rejects these operations even when Hermes is unused. The latest release remains v0.1.0; no merged fixing PR for this availability behavior is established.
Prior findings resolved: The GitHub comparison against the previously reviewed head confirms removal of startup-error bypass classification and plugin-load exception skipping. The current Python collector propagates load failures and pre-tool callback errors. README, compatibility documentation, and changelog now explain the behavior.
Findings None None.
Security None None.

How this fits together

Babelfish translates installed agent plugins into OpenClaw hooks and middleware. Before host tool execution, its Hermes bridge gathers argument changes and blocking decisions alongside imported Claude Code and Codex hooks.

flowchart LR
  A[Host tool request] --> B[Babelfish pre-tool handler]
  B --> C[Check Hermes installation]
  C -->|Absent or empty| E[Imported plugin guards]
  C -->|Installed or unknown| D[Hermes bridge decisions]
  D -->|Successful evaluation| E
  D -->|Failure| F[Prevent tool execution]
  E --> G[Allow or block host tool]
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production and test delta production +58/-3, tests +247 Production growth implements conservative absence verification and failure propagation, with focused compatibility and execution coverage.
Host tool-effect coverage 34 cells across 2 adapters The captured results distinguish allowed execution from denied final tool I/O.

Technical review

Best possible solution:

Retain the narrow verified-absence fallback and preserve installed guard evaluation before host tool execution.

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

Yes: main unconditionally starts the Python bridge for pre-tool middleware and hooks, so an absent interpreter rejects tool preparation even with an empty Hermes installation. This review established the path from source rather than executing it.

Is this the best way to solve the issue?

Yes: checking verified absence within the existing request lane repairs availability without skipping installed guards or creating a competing execution path.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The captured exact-head results exercise the built plugin through native and Codex host tool paths in isolated state: verified absence permits one tool receipt, while unavailable or failing installed guards produce zero tool I/O. This covers the earlier authority concern; source inspection supports the reported boundary. No stored-data contract changes.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured exact-head results exercise the built plugin through native and Codex host tool paths in isolated state: verified absence permits one tool receipt, while unavailable or failing installed guards produce zero tool I/O. This covers the earlier authority concern; source inspection supports the reported boundary. No stored-data contract changes.
  • remove merge-risk: 🚨 compatibility: Current PR review selected no merge-risk labels.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove merge-risk: 🚨 security-boundary: Current PR review selected no merge-risk labels.

Label justifications:

  • P1: Without this repair, a missing Python interpreter can reject host tool calls even when no Hermes provider is installed.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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 results exercise the built plugin through native and Codex host tool paths in isolated state: verified absence permits one tool receipt, while unavailable or failing installed guards produce zero tool I/O. This covers the earlier authority concern; source inspection supports the reported boundary. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured exact-head results exercise the built plugin through native and Codex host tool paths in isolated state: verified absence permits one tool receipt, while unavailable or failing installed guards produce zero tool I/O. This covers the earlier authority concern; source inspection supports the reported boundary. No stored-data contract changes.

Evidence

What I checked:

  • Complete introduced change: Read all eight introduced files against the pinned main parent. Runtime changes are confined to Hermes availability checks, response-envelope validation, and decision callback failure propagation; dependencies, public commands, manifests, and installation ownership are unchanged. (src/hermes-python.ts:189, 7958e361651c)
  • Still missing on main: Main's bridge executes discovery, hooks, and middleware through ensureChild without an installation-absence check. Missing Python therefore rejects these operations even when Hermes is unused. The latest release remains v0.1.0; no merged fixing PR for this availability behavior is established. (src/hermes-python.ts:187, 75d94845ee29)
  • Prior findings resolved: The GitHub comparison against the previously reviewed head confirms removal of startup-error bypass classification and plugin-load exception skipping. The current Python collector propagates load failures and pre-tool callback errors. README, compatibility documentation, and changelog now explain the behavior. (python/hermes_openclaw_bridge.py:690, 7958e361651c)
  • Conservative absence and ordering: Availability discovery runs inside the existing serialized request lane and is checked afresh. Non-ENOENT failures, dangling symlinks, ambiguous missing dot paths, and Python-owned home expansion cannot produce the empty-provider result. Explicit tool, command, and skill operations retain Python execution. (src/hermes-python.ts:371, 7958e361651c)
  • Captured final-effect proof: The complete supplied PR body, captured under source revision d1cd4ab2f9f21ecef5f0ae1ae95869b493bd76e76fe5a888c2d5f9f8bbfcab41, reports 34 distinct production-host cells at the exact head in isolated HOME/state directories. Both adapters produced one receipt for absent/empty installations and healthy rewrites, and zero tool I/O for installed guard failures, import/registration/callback failures, early exit, malformed protocol, timeout, cancellation, and healthy veto. Unreadability is supplemental mocked coverage; the evidence is bounded to host version 2026.9.7 and was not rerun by this reviewer. (7958e361651c)
  • Verified host execution boundary: Verified the proof's host SHA belongs to openclaw/openclaw. Its native execution wrapper rejects pre-tool errors and blocked outcomes before implementation execution. The inspected Codex dynamic-tool adapter also preserves pre-tool failure dispositions and execution-boundary facts. These are OpenClaw-owned tool execution paths; the patch does not change the upstream Codex engine or protocol. (src/agents/agent-tools.before-tool-call.wrapper.ts:415, 2b4055f8dd70)

Likely related people:

  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • RomneyDa: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • SebTardif: 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 (1 earlier review cycle)
  • reviewed 2026-10-01T00:01:35.505Z sha 89a8916 :: needs real behavior proof before merge. :: [P1] Keep early bridge crashes from bypassing installed tool guards | [P1] Do not silently skip a failed blocking plugin | [P2] Document the new pre-tool failure behavior

@vincentkoc vincentkoc self-assigned this Oct 1, 2026
@clawsweeper clawsweeper Bot added 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. and removed merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. labels Oct 1, 2026
@vincentkoc
vincentkoc merged commit dee86b0 into openclaw:main Oct 1, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P1 Urgent regression or broken agent/channel workflow affecting real users now. 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