fix: non-dict tool result content falls back to outputs=None

Replace str(content) fallback with empty string so non-dict content
(e.g. list-shaped text_editor results) produces outputs=None instead
of raw Python object representations in logs.
This commit is contained in:
Andrzej Pomirski
2026-03-18 12:37:13 +01:00
parent 5b3e84f383
commit 3962fbc33a
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -713,7 +713,7 @@ class ModelResponseIterator:
parts.append(f"STDERR: {content['stderr']}")
logs = "".join(parts)
else:
logs = str(content)
logs = ""
tool_input = self._server_tool_inputs.get(call_id, {})
code = tool_input.get("command", "") if isinstance(tool_input, dict) else ""
log_outputs = (
@@ -1777,7 +1777,7 @@ class AnthropicConfig(AnthropicModelInfo, BaseConfig):
parts.append(f"STDERR: {content['stderr']}")
logs = "".join(parts)
else:
logs = str(content)
logs = ""
log_outputs = (
[OutputCodeInterpreterCallLog(type="logs", logs=logs)]
if logs