Skip to content

Commit 4976370

Browse files
CopilotOskarStark
andcommitted
Improve code comments and comparison consistency
Co-authored-by: OskarStark <995707+OskarStark@users.noreply.github.com>
1 parent d5da6c9 commit 4976370

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/agent/src/Toolbox/StreamResult.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ public function getContent(): \Generator
3939
}
4040

4141
$content = $innerResult->getContent();
42-
// Strings are iterable in PHP but should be yielded as single values
43-
// null should also be yielded as-is
44-
if (is_string($content) || null === $content) {
42+
// Strings are iterable in PHP but yield from would iterate character-by-character.
43+
// We need to yield the complete string as a single value to preserve streaming behavior.
44+
// null should also be yielded as-is.
45+
if (is_string($content) || $content === null) {
4546
yield $content;
4647
} else {
4748
yield from $content;

0 commit comments

Comments
 (0)