feat(cli): add --message-file to openclaw agent#93351
Conversation
|
Codex review: found issues before merge. Reviewed June 21, 2026, 9:02 AM ET / 13:02 UTC. Summary PR surface: Source +67, Tests +80, Docs +18. Total +165 across 6 files. Reproducibility: yes. at source level: pass an inline message with surrounding whitespace through Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Preserve inline message bytes for embedded dispatch while using trimming only for validation and Gateway request semantics, then add a focused whitespace regression test. Do we have a high-confidence way to reproduce the issue? Yes, at source level: pass an inline message with surrounding whitespace through Is this the best way to solve the issue? No, not yet: the file input itself is a narrow maintainable addition, but the current implementation normalizes existing inline input too early. The safer fix is to keep file messages exact while preserving current inline embedded-dispatch semantics. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c85113e30e2a. Label changesLabel justifications:
Evidence reviewedPR surface: Source +67, Tests +80, Docs +18. Total +165 across 6 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
|
|
/clownfish automerge |
|
Clownfish is on the reef for this PR. 🐠 I tagged A maintainer can call |
|
🦞✅ Source: Why human review is needed: What the maintainer can do as a next step: I added |
|
Clownfish 🐠 reef automerge status This repair lap finished without changing the PR. Clownfish checked the reef and found no safe patch to push this time. Target: #93351 Worker actions:
No push, rebase, replacement PR, merge, or ClawSweeper re-review happened this swim. fish notes: model gpt-5.5, reasoning medium. |
7614ed4 to
8f19b3b
Compare
|
Thanks, Vincent. Rebased this on current main and pushed the follow-up ClawSweeper was worried about: I added the file-backed |
|
🦞✅ Source: Why human review is needed: What the maintainer can do as a next step: I added |
8f19b3b to
cd05d4a
Compare
|
Clownfish 🐠 reef automerge status This repair lap finished without changing the PR. Clownfish checked the reef and found no safe patch to push this time. Target: #93351 Worker actions:
Nothing moved downstream from this pass: no branch update, replacement PR, merge, or re-review. fish notes: model gpt-5.5, reasoning medium. |
|
Clownfish 🐠 reef automerge status This repair lap finished without changing the PR. Clownfish checked the reef and found no safe patch to push this time. Target: #93351 Worker actions:
Clownfish left the PR as-is: no push, no rebase, no replacement PR, no merge, and no fresh ClawSweeper pass. fish notes: model gpt-5.5, reasoning medium. |
cd05d4a to
62c330f
Compare
|
Clownfish 🐠 reef automerge status No new branch changes from this lap. Clownfish kept the current tidy instead of splashing around. Target: #93351 Worker actions:
Nothing moved downstream from this pass: no branch update, replacement PR, merge, or re-review. fish notes: model gpt-5.5, reasoning medium. |
fffcde9 to
4897f2f
Compare
Merges the Clownfish-repaired contributor branch for openclaw#93351. The latest repair preserves inline --message whitespace, adds --message-file coverage for gateway and local embedded runs, and the PR is clean/mergeable on head 4897f2f.
Summary
openclaw agentcurrently requires inline--message, which makes long prompts, Markdown/code blocks, JSON, and Windows PowerShell multiline content awkward or fragile to pass through shell quoting.--message-file <path>to theopenclaw agentone-shot CLI, reads the file as valid UTF-8, strips an optional UTF-8 BOM, and preserves multiline content for both Gateway and--localdispatch.--messagebehavior stays unchanged: it is still trimmed and sent through the existing dispatch path.openclaw message send, channel adapter chunking/truncation semantics, live delivery limits, and any transport/protocol changes.openclaw agent --agent ops --message-file ./task.mdwithout shell-escaping the prompt, while clear errors catch missing files, invalid UTF-8, empty files, or passing both message inputs.Linked context
No separate issue. This is a small CLI ergonomics gap found while trying to hand off multiline agent work from Windows/PowerShell.
Related #79182 and #79200 cover the adjacent
openclaw message send --message-filesurface. This PR intentionally targetsopenclaw agentonly and does not close that issue or replace that PR.Real behavior proof (required for external PRs)
openclaw agentcan now accept a multiline prompt from--message-fileinstead of requiring all content to fit safely inside a shell-quoted--messageargument.fix/agent-message-file, commit7614ed4e36, Nodev22.22.0, pnpm11.2.2, built source checkout, isolatedOPENCLAW_STATE_DIRandOPENCLAW_CONFIG_PATHunder.artifacts/agent-message-file-proof.--message-file, reads the file, and advances past message validation to the next real validation boundary (No target session selected). Before this patch, Commander required--messageand would not accept a file-only agent invocation. The second command confirms the new input is mutually exclusive with inline--message.openclaw agentregistered.requiredOption("-m, --message <text>", ...), so--message-filecould not be used as the sole message input.Tests and validation
Commands run:
Results:
Regression coverage added:
--message-fileto the agent command without requiring inline--message.--messageand--message-filefails before dispatch.Message file not found.Message file must be valid UTF-8.Risk checklist
Did user-visible behavior change? (
Yes/No)Yes.
openclaw agentnow accepts--message-file <path>as an alternative to inline--message.Did config, environment, or migration behavior change? (
Yes/No)No.
Did security, auth, secrets, network, or tool execution behavior change? (
Yes/No)No. The CLI reads only the caller-supplied local path under the current OS user, before existing Gateway/local dispatch.
What is the highest-risk area?
Prompt content boundaries: accidentally trimming or corrupting file content before dispatch, or silently accepting non-UTF-8 input.
How is that risk mitigated?
Inline messages keep the old trim behavior, file messages preserve content after BOM removal, strict UTF-8 decoding rejects corrupt input, and focused tests assert the exact Gateway
params.messagevalue plus error paths.Current review state
What is the next action?
Wait for GitHub CI, ClawSweeper, and maintainer review after PR creation.
What is still waiting on author, maintainer, CI, or external proof?
CI and ClawSweeper are pending. No known author-side blocker remains.
Which bot or reviewer comments were addressed?
None yet. This is a new PR.