fix: empty stdout/stderr produces str(content) instead of empty logs

When both stdout and stderr are empty strings, the `if parts else
str(content)` fallback produced the raw dict representation as logs.
Drop the fallback so logs is correctly empty.
This commit is contained in:
Andrzej Pomirski
2026-03-18 12:37:13 +01:00
parent 2bf8751f6b
commit 4be1d76fd7
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -711,7 +711,7 @@ class ModelResponseIterator:
parts.append(content["stdout"])
if content.get("stderr"):
parts.append(f"STDERR: {content['stderr']}")
logs = "".join(parts) if parts else str(content)
logs = "".join(parts)
else:
logs = str(content)
tool_input = self._server_tool_inputs.get(call_id, {})
@@ -1775,7 +1775,7 @@ class AnthropicConfig(AnthropicModelInfo, BaseConfig):
parts.append(content["stdout"])
if content.get("stderr"):
parts.append(f"STDERR: {content['stderr']}")
logs = "".join(parts) if parts else str(content)
logs = "".join(parts)
else:
logs = str(content)
code_interpreter_results.append(