Description
Action responses in --agent mode occasionally include Node.js warnings, debug logging, or other non-JSON text mixed into stdout. This breaks JSON parsing of the response.
Examples observed:
(node:12345) ExperimentalWarning: ... before the JSON
- Debug log lines interspersed with response data
Setting NODE_NO_WARNINGS=1 reduces but doesn't eliminate the issue.
Impact
Consumers must implement defensive JSON extraction that searches for {...} boundaries in raw output rather than parsing the full stdout:
text = raw_output.strip()
start = text.find("{")
end = text.rfind("}")
if start >= 0 and end > start:
text = text[start : end + 1]
result = json.loads(text)
Suggested Fix
- Redirect internal logging to stderr (not stdout) in
--agent mode
- Ensure stdout contains only the structured JSON response
- Suppress Node.js experimental warnings when
--agent flag is present
Description
Action responses in
--agentmode occasionally include Node.js warnings, debug logging, or other non-JSON text mixed into stdout. This breaks JSON parsing of the response.Examples observed:
(node:12345) ExperimentalWarning: ...before the JSONSetting
NODE_NO_WARNINGS=1reduces but doesn't eliminate the issue.Impact
Consumers must implement defensive JSON extraction that searches for
{...}boundaries in raw output rather than parsing the full stdout:Suggested Fix
--agentmode--agentflag is present