Repository navigation
fix(runtime): spawn hook argv without a login shell - #25
Conversation
Accept Claude Code exec-form hook args and command arrays, then spawn those hooks as argv. String command values still run through /bin/sh -lc. Plugin install remains trusted code execution. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. Reviewed September 15, 2026, 10:47 PM ET / September 16, 2026, 02:47 UTC (Revision 9). ClawSweeper reviewWhat this changesPreserve literal arguments in imported command hooks by supporting direct executable invocation while retaining shell execution for strings and Windows process-tree supervision. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 5 items remain The change remains necessary and the previous supervision bypass is repaired, but the revised Windows decoder prevents argv hooks from starting. GitHub’s Windows failure annotations confirm the new defect. Priority: P2 Review scores
Verification
How this fits togetherBabelfish translates installed Claude Code and Codex plugin hooks into OpenClaw lifecycle behavior. Its launcher passes event JSON to child processes and returns their output or blocking decisions. flowchart TD
A[Installed plugin hooks] --> B[Hook discovery]
B --> C{Command format}
C -->|String| D[Shell execution]
C -->|Argument array| E[Direct executable launch]
D --> F[Platform process supervision]
E --> F
F --> G[Hook output or failure]
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Decode Windows argv without collapsing array elements, then preserve literal arguments and Job cleanup while keeping existing string-shell behavior intact. Do we have a high-confidence way to reproduce the issue? Yes: current-main source demonstrably ignores hook args, and the exact PR head’s Windows check independently captures the new decoder failure. No target code was executed during this read-only review. Is this the best way to solve the issue? The direct-launch approach is appropriate, but the current Windows implementation is incorrect; preserve the decoded JSON array before executable lookup rather than coercing a nested array into a string. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0c481cdb9296. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (8 earlier review cycles)
|
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(runtime): spawn hook argv without a login shell This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
Summary
Imported command hooks ignored
argsand could not preserve the source application's direct-execution behavior. Honor the documented Claude Code exec form:commandplusargslaunches an executable with literal arguments. String commands retain their existing shell behavior; command arrays are also supported.On Windows, both forms remain inside the existing kill-on-close Job supervisor. Exec-form commands travel as Base64-encoded JSON and use Windows argument quoting, so shell syntax stays literal while timeout/output-limit cleanup can still terminate descendants. This preserves the existing execution trust boundary: installing a plugin authorizes its code.
Thanks @SebTardif for the original implementation and reproduction. The maintainer follow-up repairs Windows process-tree supervision and adds portable runtime coverage.
Verification
nodedirectly rather than the Job supervisor; it now passes.npm run check: 70 tests passed.npm run pack:checkpassed.$(echo INJECTED)and unchanged/bin/sh -lcstring execution. No live Gateway session was used; runtime fixtures are synthetic.README compatibility guidance, the compatibility reference, and the Unreleased changelog are updated. The first Windows run exposed PowerShell 5.1 wrapping the decoded JSON array into a single pipeline object. Direct typed assignment now retains the executable and individual arguments. The existing runtime assertions are unchanged.
Windows runtime verification comes from the PR's Windows CI job.