Skip to content

fix(csa-acp): suppress ACP noise and separate diagnostic events from output#380

Merged
RyderFreeman4Logos merged 2 commits intomainfrom
fix/acp-output-noise-and-session-return
Mar 8, 2026
Merged

fix(csa-acp): suppress ACP noise and separate diagnostic events from output#380
RyderFreeman4Logos merged 2 commits intomainfrom
fix/acp-output-noise-and-session-return

Conversation

@RyderFreeman4Logos
Copy link
Owner

Summary

  • Fix 1 (da42dad): Filter out ACP protocol overhead events (AvailableCommandsUpdate, ConfigOptionUpdate, CurrentModeUpdate, UserMessageChunk) at the source in update_to_event — these multi-KB JSON blobs were polluting stdout and corrupting summary extraction
  • Fix 2 (913cc05): Separate diagnostic events from caller-facing output in collect_agent_output — only AgentMessage and AgentThought events are returned to the caller (stdout + summary); PlanUpdate, ToolCallStarted, ToolCallCompleted, and Other events are still written to output.log spool for audit purposes
  • Version bump: 0.1.103 → 0.1.104

Root Cause

PR #379 fixed zero-stdout by adding all ACP event types to collect_agent_output. While correct for the output.log spool, it also leaked diagnostic events ([tool:started], [tool:completed], [plan], [other]) into:

  1. ExecutionResult.output → caller stdout
  2. build_summary(last_non_empty_line(stdout))result.toml summary

This caused session summaries to show <!-- CSA:SECTION:details:END --> or [tool:completed] success instead of meaningful agent content.

Design: Two Output Channels

Channel Contents Purpose
output.log (spool) All event types Audit trail, debugging
ExecutionResult.output (return) AgentMessage + AgentThought only Caller stdout, summary extraction

Test plan

  • collect_agent_output_excludes_diagnostic_events — verifies only AgentMessage/AgentThought in return
  • stream_new_agent_messages_writes_all_event_types_to_spool — verifies all events written to output.log
  • All 2391 unit tests pass + 16 E2E tests pass
  • just pre-commit exits 0

🤖 Generated with Claude Code

RyderFreeman4Logos and others added 2 commits March 8, 2026 08:07
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>
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@RyderFreeman4Logos RyderFreeman4Logos merged commit 668565e into main Mar 8, 2026
4 of 6 checks passed
@RyderFreeman4Logos RyderFreeman4Logos deleted the fix/acp-output-noise-and-session-return branch March 8, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant