Skip to content

Commit 8583cdd

Browse files
committed
Address Copilot comments
1 parent 793b39c commit 8583cdd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/agents.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ function extractTextFromMessageEntry(entry: unknown, depth = 0): string {
352352
}
353353
}
354354

355-
return extractTextFromValue(entry, depth + 1, false);
355+
return extractTextFromValue(entry, depth + 1, false /* allow all types when falling back */);
356356
}
357357

358358
/**
@@ -362,6 +362,10 @@ function extractTextFromMessageEntry(entry: unknown, depth = 0): string {
362362
* from newest to oldest, returning the first user-role message with textual content.
363363
*/
364364
function extractTextFromAgentInput(input: unknown): string {
365+
if (input == null) {
366+
return '';
367+
}
368+
365369
if (typeof input === 'string') {
366370
return input.trim();
367371
}
@@ -408,10 +412,6 @@ function extractTextFromAgentInput(input: unknown): string {
408412
}
409413
}
410414

411-
if (input == null) {
412-
return '';
413-
}
414-
415415
return String(input);
416416
}
417417

0 commit comments

Comments
 (0)