We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d5da6c9 commit 4976370Copy full SHA for 4976370
src/agent/src/Toolbox/StreamResult.php
@@ -39,9 +39,10 @@ public function getContent(): \Generator
39
}
40
41
$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) {
+ // Strings are iterable in PHP but yield from would iterate character-by-character.
+ // We need to yield the complete string as a single value to preserve streaming behavior.
+ // null should also be yielded as-is.
45
+ if (is_string($content) || $content === null) {
46
yield $content;
47
} else {
48
yield from $content;
0 commit comments