-
Notifications
You must be signed in to change notification settings - Fork 341
Open
Description
Bug Description
In PR #165 (Add OpenClaw CLI provider support), the implementation passes the entire web page content as a CLI argument via --message <prompt>.
Location
The bug is in src/llm/cli.ts:
const args = [
"agent",
"--agent",
model && model.trim().length > 0 ? model.trim() : "main",
"--message",
prompt, // ← BUG: Entire web page content passed here!
"--json",
"--timeout",
String(Math.max(1, Math.ceil(timeoutMs / 1000))),
];Why It's a Problem
- Shell argument limits: Most systems cap CLI arguments at 128KB-2MB. Web pages can be 50KB-500KB+, which will cause failures
- No stdin support: The implementation should pass content via stdin (like other CLI tools do) instead of CLI arguments
- Test was flawed: The PR author's smoke test used a tiny message:
This works, but real usage with full web pages will break
printf 'OpenClaw summarizes through the main agent.\n' | ...
Suggested Fix
Use stdin or file input instead of CLI arguments:
Option 1: Use stdin (recommended)
const args = ["agent", "--agent", model, "-", "--json", "--timeout", ...];
// Then pass prompt via stdin in execCliWithInputOption 2: Write to temp file
// Write prompt to temp file, then use --message-file (if supported)Test Case
To reproduce:
- Summarize a large web page (>100KB of content)
- Observe failure due to argument size limits
Additional Notes
- This is a great feature addition (OpenClaw support)!
- The implementation is otherwise solid — this is just an input method issue
- Works fine for small content, but needs fixing for production use with real web pages
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels