fix(copilot): parse complete message instead of delta for display#345
Merged
Merged
Conversation
- `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
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
assistant.message_deltaevents (streaming chunks without a trailing newline), which caused thePrefixedWriterbuffer to accumulate repeated content (e.g.storedstored)assistant.message(the complete message event) instead, which Copilot CLI also emits and carries the fullcontentfield; this produces a single correct[OUT]line per stepassistant.message_deltato the ignored-event list since its delta content is now superseded by the complete messageChanges
Infrastructure
internal/infrastructure/agents/copilot_provider.go: Switch display event parser fromassistant.message_delta/deltaContenttoassistant.message/content; removeDelta: trueflag from the returned eventTests
internal/infrastructure/agents/copilot_provider_parse_display_events_test.go: Rename test suite and update all fixtures to useassistant.messageevents; add case for missingcontentfield; assertDeltais false on complete-message events; moveassistant.message_deltato the ignored-types test table; update error-path and benchmark fixturesChangelog
CHANGELOG.md: Document bug fix B016 — Copilot streaming display duplication root cause and resolutionTest plan
make testand verify allparseCopilotDisplayEventstests pass with the updated fixtures[OUT]display lineassistant.message_deltaevents are now silently ignored during stream processingmake lintto confirm no linter violationsGenerated with awf commit workflow