Skip to content

Commit 89c9cb4

Browse files
committed
Fix empty/non-iterable choices.
1 parent 7ba4bf9 commit 89c9cb4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/github/copilotRemoteAgent/chatSessionContentBuilder.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,10 @@ export class ChatSessionContentBuilder {
270270
let currentResponseContent = '';
271271

272272
for (const chunk of logChunks) {
273+
if (!chunk.choices || !Array.isArray(chunk.choices)) {
274+
continue;
275+
}
276+
273277
for (const choice of chunk.choices) {
274278
const delta = choice.delta;
275279
if (delta.role === 'assistant') {

0 commit comments

Comments
 (0)