Skip to content

stdout pollution: Node.js warnings mixed into JSON action responses #88

@ameet

Description

@ameet

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

  1. Redirect internal logging to stderr (not stdout) in --agent mode
  2. Ensure stdout contains only the structured JSON response
  3. Suppress Node.js experimental warnings when --agent flag is present

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions