Skip to content

fix(copilot): parse complete message instead of delta for display#345

Merged
pocky merged 1 commit into
mainfrom
fix/copilot-display-parser-use-complete-message
May 13, 2026
Merged

fix(copilot): parse complete message instead of delta for display#345
pocky merged 1 commit into
mainfrom
fix/copilot-display-parser-use-complete-message

Conversation

@pocky
Copy link
Copy Markdown
Contributor

@pocky pocky commented May 13, 2026

Summary

  • Fix duplicated output in Copilot streaming display — the parser was consuming assistant.message_delta events (streaming chunks without a trailing newline), which caused the PrefixedWriter buffer to accumulate repeated content (e.g. storedstored)
  • Switch to assistant.message (the complete message event) instead, which Copilot CLI also emits and carries the full content field; this produces a single correct [OUT] line per step
  • Flip assistant.message_delta to the ignored-event list since its delta content is now superseded by the complete message

Changes

Infrastructure

  • internal/infrastructure/agents/copilot_provider.go: Switch display event parser from assistant.message_delta/deltaContent to assistant.message/content; remove Delta: true flag from the returned event

Tests

  • internal/infrastructure/agents/copilot_provider_parse_display_events_test.go: Rename test suite and update all fixtures to use assistant.message events; add case for missing content field; assert Delta is false on complete-message events; move assistant.message_delta to the ignored-types test table; update error-path and benchmark fixtures

Changelog

  • CHANGELOG.md: Document bug fix B016 — Copilot streaming display duplication root cause and resolution

Test plan

  • Run make test and verify all parseCopilotDisplayEvents tests pass with the updated fixtures
  • Execute a Copilot workflow step and confirm output appears once (not duplicated) in the [OUT] display line
  • Verify assistant.message_delta events are now silently ignored during stream processing
  • Run make lint to confirm no linter violations

Generated with awf commit workflow

- `internal/infrastructure/agents/copilot_provider.go`: Switch parser from `assistant.message_delta`/`deltaContent` to `assistant.message`/`content`, remove Delta flag
- `internal/infrastructure/agents/copilot_provider_parse_display_events_test.go`: Update all tests to reflect new event type and field, add missing-content-field case, assert Delta is false
@pocky pocky marked this pull request as ready for review May 13, 2026 15:35
@pocky pocky merged commit b88c161 into main May 13, 2026
5 checks passed
@pocky pocky deleted the fix/copilot-display-parser-use-complete-message branch May 13, 2026 15:35
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