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 }}
This repository was archived by the owner on Oct 16, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Oct 16, 2026. It is now read-only.
fix(copilot): consolidate agent_message_chunk events into single log lines #1046
When running agentv eval with a Copilot target, the stream log files are hard to read because each agent_message_chunk ACP event is written as a separate log line. A single assistant response can produce dozens of fragmented lines:
```
[+00:02] [agent_message_chunk] Let me
[+00:02] [agent_message_chunk] analyze
[+00:02] [agent_message_chunk] this code
[+00:02] [agent_message_chunk] and fix the bug
```
Root Cause
CopilotStreamLogger.handleEvent() in copilot-utils.ts emits one log line per ACP event. The summarizeAcpEvent() function in copilot-cli.ts limits chunks to 200 chars each, but does nothing to consolidate them.
Best Practice (from code-insights research)
code-insights uses a flush-on-turn-boundary pattern:
Accumulate assistant.message_delta / chunk events into a text buffer
Flush the buffer as a single complete entry only at turn boundaries (tool_call, session.idle, session.shutdown, or close())
Result: [+00:05] [assistant_message] Let me analyze this code and fix the bug...
Proposed Fix
Modify CopilotStreamLogger in copilot-utils.ts:
Add a pendingText buffer for chunk accumulation
In handleEvent(): buffer chunk events instead of writing immediately; flush on non-chunk events
In close(): flush any remaining buffered text before closing
Purely a log formatting improvement — no behavioral change to eval execution.
Acceptance Criteria
Single assistant response produces one [assistant_message] log line, not dozens of [agent_message_chunk] lines
Tool calls, session start/end still appear as separate lines
json format mode is unaffected (keep per-event for full fidelity)
Both copilot-cli and copilot-sdk providers benefit (shared CopilotStreamLogger)
Activity
fix(copilot): consolidate agent_message_chunk events into single log …