Skip to content

feat: optimize stream output formatting for agents and human readability - #10

Merged
philschmid merged 3 commits into
mainfrom
stream-fix
Jun 5, 2026
Merged

philschmid merged 3 commits into
mainfrom
stream-fix

Conversation

@philschmid

Copy link
Copy Markdown
Contributor

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new verbose output mode (--verbose / -v) across CLI commands, which outputs completed execution steps and interaction metadata as JSON lines. It also refactors the default output mode (renamed to 'Normal') to be more concise by buffering tool calls and printing them inline with their results. Additionally, a fetchWithTimeout helper is introduced to replace raw fetch calls, and the test suite is updated to directly test the HumanStreamRenderer. The review feedback identifies two critical issues in src/lib/output.ts: first, in verbose mode, handleStepDelta returns early, preventing the accumulation of arguments and results which can cause failures in finalizeStep(); second, the use of single string properties for buffering tool calls in normal mode can lead to overwritten values during parallel tool execution, suggesting a Map keyed by call ID instead.

@google-gemini google-gemini deleted a comment from gemini-code-assist Bot Jun 5, 2026
@google-gemini google-gemini deleted a comment from gemini-code-assist Bot Jun 5, 2026
@philschmid
philschmid merged commit d50a23f into main Jun 5, 2026
6 checks passed
@philschmid
philschmid deleted the stream-fix branch June 5, 2026 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant