Skip to content

fix: agent's non-JSON output goes to the log verbatim #883

Closed

Description

@EVWorth

src-tauri/crates/mas-agent/src/acp.rs:288 logs every non-JSON stdout line from the agent harness, in full, at DEBUG:

tracing::debug!(line = %line, "ignoring a non-JSON line from the agent");

The file log records DEBUG. A harness's stray output can be anything: SQL it's about to run, a quoted query result, or a token it echoes. That text bypasses the redaction added in #875, because mas-agent doesn't depend on mas-core's redactor.

Fix

Log the line's length and the first few characters at most, for example len = line.len(), and drop the content. If the full line is useful while debugging a harness, log it at TRACE, which the file filter excludes for mas_agent once the target is set explicitly. Add a unit test with a captured subscriber, like mas-core's log_redaction tests.

Activity

  1. added
    bug
    on Oct 24, 2026
  2. added a commit that references this issue on Oct 24, 2026
    f7c4e39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions