fix(adk/filesystem): fix emptyStreamConcatErr when streaming execute command has no output#790
Merged
fix(adk/filesystem): fix emptyStreamConcatErr when streaming execute command has no output#790
Conversation
…command has no output When executing commands with no stdout output (e.g., mkdir, touch) via ExecuteStreaming, the stream would fail with emptyStreamConcatErr because convExecuteResponse returned empty string for successful commands with no output. Changes: - Refactor newStreamingExecuteTool to handle stream chunks properly: - Collect exitCode across chunks, process truncated per-chunk - Combine Output and Truncated info within the same chunk before sending - Send success message when no content was sent and command succeeded - Add test case for successful command with no output - Keep convExecuteResponse for non-streaming newExecuteTool with same fix~
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #790 +/- ##
==========================================
- Coverage 80.51% 80.40% -0.11%
==========================================
Files 129 129
Lines 13007 13026 +19
==========================================
+ Hits 10472 10473 +1
- Misses 1733 1753 +20
+ Partials 802 800 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
meguminnnnnnnnn
approved these changes
Feb 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When using
ExecuteStreamingto run commands that produce no stdout output (e.g.,mkdir,touch), the operation fails withconcat stream reader fail: stream reader is empty, concat failerror, even though the command itself succeeds.Root Cause
Call chain:
local.ExecuteStreamingexecutes the command and sends&filesystem.ExecuteResponse{ExitCode: new(int)}to indicate successful completion (ExitCode=0) when there's no stdoutnewStreamingExecuteToolcallsconvExecuteResponse(chunk)for each chunkconvExecuteResponsereturns an empty string""becauseOutput="",ExitCode=0doesn't match the!= 0condition, andTruncated=falsestr == "", the streaming logic skips this chunk and sends nothingconcatStreamReaderreceives only EOF with an empty items slice, triggeringemptyStreamConcatErrSolution
Refactored the streaming logic in
newStreamingExecuteTool:During stream consumption:
exitCodeacross chunksOutputandTruncatedinfo within the same chunk before sending (avoiding multiple sends per chunk)After stream completion:
exitCode != 0, append failure message with error code[Command executed successfully with no output]Preserved
convExecuteResponse: Used by non-streamingnewExecuteTool, with the same fix appliedChanges
adk/middlewares/filesystem/filesystem.go: Refactored streaming logicadk/middlewares/filesystem/filesystem_test.go: Added test case for "successful command with no output"