-
-
Notifications
You must be signed in to change notification settings - Fork 146
Description
Problem
parsePipeline/tokenizeCommand mishandles escapes inside quoted arguments, which can corrupt --args-json payloads before they reach command handlers.
Two user-visible failure modes:
- Backslashes inside double-quoted args are treated too aggressively, so JSON escape content can be altered.
- Escaped apostrophes (
\') inside single-quoted args are treated as quote terminators, causing parse failures.
Reproduction
A) Escaped apostrophe in single-quoted JSON
Input:
openclaw.invoke --args-json '{"prompt":"don\'t"}'Observed (before fix): parser can throw Unclosed quote.
Expected: tokenization should preserve the literal apostrophe and pass valid JSON through.
B) Escapes in double-quoted JSON
Input pattern:
openclaw.invoke --tool llm-task --action json --args-json "{\"prompt\":\"line1\\nline2\"}"Observed (before fix): quoted-token parsing can alter escape sequences, changing payload semantics and risking downstream JSON handling issues.
Expected: escape sequences required by JSON should survive tokenization unchanged (except shell-like quote escaping).
Impact
This breaks existing pipelines that pass prompt-rich JSON through --args-json, especially payloads containing apostrophes and escaped characters.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels