Skip to content

Commit 10d90cd

Browse files
committed
Separate tool name from output across all agent sessions (s03-s_full)
Extends the readability fix from PR #128 (s02) to all remaining sessions. Tool name and output are now on separate lines, consistent with s01's existing pattern and improving readability for multi-line tool output.
1 parent a66558a commit 10d90cd

10 files changed

Lines changed: 20 additions & 10 deletions

agents/s03_todo_write.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ def agent_loop(messages: list):
181181
output = handler(**block.input) if handler else f"Unknown tool: {block.name}"
182182
except Exception as e:
183183
output = f"Error: {e}"
184-
print(f"> {block.name}: {str(output)[:200]}")
184+
print(f"> {block.name}:")
185+
print(str(output)[:200])
185186
results.append({"type": "tool_result", "tool_use_id": block.id, "content": str(output)})
186187
if block.name == "todo":
187188
used_todo = True

agents/s05_skill_loading.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,8 @@ def agent_loop(messages: list):
202202
output = handler(**block.input) if handler else f"Unknown tool: {block.name}"
203203
except Exception as e:
204204
output = f"Error: {e}"
205-
print(f"> {block.name}: {str(output)[:200]}")
205+
print(f"> {block.name}:")
206+
print(str(output)[:200])
206207
results.append({"type": "tool_result", "tool_use_id": block.id, "content": str(output)})
207208
messages.append({"role": "user", "content": results})
208209

agents/s06_context_compact.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,8 @@ def agent_loop(messages: list):
220220
output = handler(**block.input) if handler else f"Unknown tool: {block.name}"
221221
except Exception as e:
222222
output = f"Error: {e}"
223-
print(f"> {block.name}: {str(output)[:200]}")
223+
print(f"> {block.name}:")
224+
print(str(output)[:200])
224225
results.append({"type": "tool_result", "tool_use_id": block.id, "content": str(output)})
225226
messages.append({"role": "user", "content": results})
226227
# Layer 3: manual compact triggered by the compact tool

agents/s07_task_system.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,8 @@ def agent_loop(messages: list):
228228
output = handler(**block.input) if handler else f"Unknown tool: {block.name}"
229229
except Exception as e:
230230
output = f"Error: {e}"
231-
print(f"> {block.name}: {str(output)[:200]}")
231+
print(f"> {block.name}:")
232+
print(str(output)[:200])
232233
results.append({"type": "tool_result", "tool_use_id": block.id, "content": str(output)})
233234
messages.append({"role": "user", "content": results})
234235

agents/s08_background_tasks.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ def agent_loop(messages: list):
210210
output = handler(**block.input) if handler else f"Unknown tool: {block.name}"
211211
except Exception as e:
212212
output = f"Error: {e}"
213-
print(f"> {block.name}: {str(output)[:200]}")
213+
print(f"> {block.name}:")
214+
print(str(output)[:200])
214215
results.append({"type": "tool_result", "tool_use_id": block.id, "content": str(output)})
215216
messages.append({"role": "user", "content": results})
216217

agents/s09_agent_teams.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,8 @@ def agent_loop(messages: list):
372372
output = handler(**block.input) if handler else f"Unknown tool: {block.name}"
373373
except Exception as e:
374374
output = f"Error: {e}"
375-
print(f"> {block.name}: {str(output)[:200]}")
375+
print(f"> {block.name}:")
376+
print(str(output)[:200])
376377
results.append({
377378
"type": "tool_result",
378379
"tool_use_id": block.id,

agents/s10_team_protocols.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,8 @@ def agent_loop(messages: list):
453453
output = handler(**block.input) if handler else f"Unknown tool: {block.name}"
454454
except Exception as e:
455455
output = f"Error: {e}"
456-
print(f"> {block.name}: {str(output)[:200]}")
456+
print(f"> {block.name}:")
457+
print(str(output)[:200])
457458
results.append({
458459
"type": "tool_result",
459460
"tool_use_id": block.id,

agents/s11_autonomous_agents.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,8 @@ def agent_loop(messages: list):
537537
output = handler(**block.input) if handler else f"Unknown tool: {block.name}"
538538
except Exception as e:
539539
output = f"Error: {e}"
540-
print(f"> {block.name}: {str(output)[:200]}")
540+
print(f"> {block.name}:")
541+
print(str(output)[:200])
541542
results.append({
542543
"type": "tool_result",
543544
"tool_use_id": block.id,

agents/s12_worktree_task_isolation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,8 @@ def agent_loop(messages: list):
747747
output = handler(**block.input) if handler else f"Unknown tool: {block.name}"
748748
except Exception as e:
749749
output = f"Error: {e}"
750-
print(f"> {block.name}: {str(output)[:200]}")
750+
print(f"> {block.name}:")
751+
print(str(output)[:200])
751752
results.append(
752753
{
753754
"type": "tool_result",

agents/s_full.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,8 @@ def agent_loop(messages: list):
692692
output = handler(**block.input) if handler else f"Unknown tool: {block.name}"
693693
except Exception as e:
694694
output = f"Error: {e}"
695-
print(f"> {block.name}: {str(output)[:200]}")
695+
print(f"> {block.name}:")
696+
print(str(output)[:200])
696697
results.append({"type": "tool_result", "tool_use_id": block.id, "content": str(output)})
697698
if block.name == "TodoWrite":
698699
used_todo = True

0 commit comments

Comments
 (0)