Skip to content

Commit 3e00e95

Browse files
shukladivyanshcopybara-github
authored andcommitted
fix: returns '<No stdout/stderr captured>' instead of empty strings for clearer agent feedback and correct typing
PiperOrigin-RevId: 889521009
1 parent 27cc98d commit 3e00e95

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/google/adk/tools/bash_tool.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,12 @@ async def run_async(
141141
try:
142142
stdout, stderr = await asyncio.wait_for(process.communicate(), timeout=30)
143143
return {
144-
"stdout": stdout.decode(),
145-
"stderr": stderr.decode(),
144+
"stdout": (
145+
stdout.decode() if stdout is not None else "<No stdout captured>"
146+
),
147+
"stderr": (
148+
stderr.decode() if stderr is not None else "<No stderr captured>"
149+
),
146150
"returncode": process.returncode,
147151
}
148152
except asyncio.TimeoutError:

0 commit comments

Comments
 (0)