Commit e98c346
committed
fix(a2a-server): delimit SSE events with a blank line in /executeCommand
The streaming `/executeCommand` handler wrote each Server-Sent Event with a
single trailing newline (`data: <json>\n`). The SSE specification requires
events to be separated by a blank line (`\n\n`); without it a spec-compliant
EventSource client coalesces every event into one record and never dispatches a
well-formed event, so streaming command output is unusable for real clients.
The existing streaming test did not catch this because it used the Mocha-style
`done` callback, which Vitest 3 does not honour: the test body returned before
its assertions ran, so the test always passed regardless of the payload. Convert
that test to async/await so it actually verifies the emitted events. It fails
before this fix (1 event parsed instead of 2) and passes after.1 parent c82e2b5 commit e98c346
2 files changed
Lines changed: 22 additions & 36 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1134 | 1134 | | |
1135 | 1135 | | |
1136 | 1136 | | |
1137 | | - | |
1138 | | - | |
1139 | | - | |
| 1137 | + | |
1140 | 1138 | | |
1141 | 1139 | | |
1142 | 1140 | | |
| |||
1164 | 1162 | | |
1165 | 1163 | | |
1166 | 1164 | | |
1167 | | - | |
| 1165 | + | |
1168 | 1166 | | |
1169 | 1167 | | |
1170 | 1168 | | |
1171 | 1169 | | |
1172 | | - | |
1173 | | - | |
1174 | | - | |
1175 | | - | |
1176 | | - | |
1177 | | - | |
1178 | | - | |
1179 | | - | |
1180 | | - | |
1181 | | - | |
1182 | | - | |
1183 | | - | |
1184 | | - | |
1185 | | - | |
1186 | | - | |
1187 | | - | |
1188 | | - | |
1189 | | - | |
1190 | | - | |
1191 | | - | |
1192 | | - | |
1193 | | - | |
1194 | | - | |
1195 | | - | |
1196 | | - | |
1197 | | - | |
1198 | | - | |
1199 | | - | |
1200 | | - | |
1201 | | - | |
1202 | | - | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
1203 | 1189 | | |
1204 | 1190 | | |
1205 | 1191 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
| 170 | + | |
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| |||
0 commit comments