You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Parsers: Sanitize A2A and MCP debug log values only when Debug is on #1707
Two Debug log lines in the protocol parsers call model.SanitizeLogValue when Debug is off. Go evaluates the arguments of slog.Debug before the level check. The sanitizer allocates for each value that has a control rune, and almost every real text has "\n".
parse/a2a, the a2a-parser: part loop in the request parser: one sanitize call for each message part.
parse/mcp, the mcp-parser: payload line: string(body) copies the whole request body before Truncate. Each MCP request with Debug off allocates a copy the size of the body.
Fix decision
Use the guard from #1703 (commit 0cba973) at each site:
For each site, add the two tests from #1703. The Debug-off test compares allocations for U+0085 and "é". The Debug-on test checks that the line is still logged.
The clawgenti review on #1703 found this. That PR changes only the inference parser.
Activity
Fix: Sanitize A2A and MCP debug log values only when Debug is on