Skip to content

Commit ae08e9d

Browse files
committed
fix: remove double-wrapping from converse-stream Event Stream payloads (closes #162)
Converse stream event builders emitted payloads wrapped with the event type name (e.g. { messageStart: { role: "assistant" } }). The :event-type header already carries the event name, so AWS SDK (botocore) expected flat payloads (e.g. { role: "assistant" }). The redundant wrapping caused botocore to silently return empty dicts, producing KeyError in downstream frameworks like Strands Agents. Affected functions: buildBedrockStreamTextEvents, buildBedrockStreamToolCallEvents, buildBedrockStreamContentWithToolCallsEvents.
1 parent 90a7907 commit ae08e9d

4 files changed

Lines changed: 145 additions & 185 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @copilotkit/aimock
22

3+
## [Unreleased]
4+
5+
### Fixed
6+
7+
- **Converse stream: double-wrapped Event Stream payloads**`buildBedrockStreamTextEvents`, `buildBedrockStreamToolCallEvents`, and `buildBedrockStreamContentWithToolCallsEvents` emitted payloads wrapped with the event type name (e.g. `{ messageStart: { role: "assistant" } }`). The `:event-type` header already carries the event name, so AWS SDK (botocore) expected flat payloads (e.g. `{ role: "assistant" }`). The redundant wrapping caused botocore's `BaseEventStreamParser` to silently return empty dicts, producing `KeyError: 'role'` in downstream frameworks like Strands Agents. (Issue #162, reported by @KMiya84377)
8+
39
## [1.19.1] - 2026-05-07
410

511
### Fixed

0 commit comments

Comments
 (0)