fix(csa-acp): suppress ACP noise and separate diagnostic events from output#380
Merged
RyderFreeman4Logos merged 2 commits intomainfrom Mar 8, 2026
Merged
Conversation
Filter out protocol-level SessionUpdate variants (AvailableCommandsUpdate, ConfigOptionUpdate, CurrentModeUpdate, UserMessageChunk) that produce multi-KB JSON blobs polluting stdout and corrupting summary extraction. These events are now suppressed at the source (update_to_event returns None) instead of being collected as SessionEvent::Other. Activity timestamps are still refreshed for idle-timeout accuracy. A catch-all branch remains for future non-exhaustive variants. Fixes: ACP [other] noise from PR #379, session-mode output quality Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
collect_agent_output now only includes AgentMessage and AgentThought events in its return value (used for stdout and summary extraction). Diagnostic events (PlanUpdate, ToolCallStarted, ToolCallCompleted, Other) remain written to the output.log spool for audit purposes but are excluded from the caller-facing output string. Previously, PR #379 added all event types to collect_agent_output to fix zero-stdout when claude-code only produces plans/tool-calls. The fix was correct for the spool (output.log) but caused diagnostic noise to leak into stdout and corrupt summary extraction — the summary would pick up the last non-empty line which was often a [tool:completed] or CSA section marker instead of actual agent content. This commit separates the two output channels: - output.log (spool): all event types for debugging/audit - ExecutionResult.output (return): AgentMessage + AgentThought only Bump version to 0.1.104. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AvailableCommandsUpdate,ConfigOptionUpdate,CurrentModeUpdate,UserMessageChunk) at the source inupdate_to_event— these multi-KB JSON blobs were polluting stdout and corrupting summary extractioncollect_agent_output— onlyAgentMessageandAgentThoughtevents are returned to the caller (stdout + summary);PlanUpdate,ToolCallStarted,ToolCallCompleted, andOtherevents are still written tooutput.logspool for audit purposesRoot Cause
PR #379 fixed zero-stdout by adding all ACP event types to
collect_agent_output. While correct for theoutput.logspool, it also leaked diagnostic events ([tool:started],[tool:completed],[plan],[other]) into:ExecutionResult.output→ caller stdoutbuild_summary(last_non_empty_line(stdout))→result.tomlsummaryThis caused session summaries to show
<!-- CSA:SECTION:details:END -->or[tool:completed] successinstead of meaningful agent content.Design: Two Output Channels
output.log(spool)ExecutionResult.output(return)Test plan
collect_agent_output_excludes_diagnostic_events— verifies only AgentMessage/AgentThought in returnstream_new_agent_messages_writes_all_event_types_to_spool— verifies all events written to output.logjust pre-commitexits 0🤖 Generated with Claude Code