Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions src/mini_agent/cli/display/printing.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,14 @@ def print_tool_result(name: str, input_data: dict[str, object], output: str) ->
return
old_text = cast(str, input_data["old_text"])
new_text = cast(str, input_data["new_text"])
edited_content = Path(path).read_text()
pos = edited_content.find(new_text)
start_line = edited_content[:pos].count("\n") + 1 if pos != -1 else 1
diff = format_edit_diff(old_text, new_text, start_line)
print(f"{diff}\n")
try:
edited_content = Path(path).read_text()
pos = edited_content.find(new_text)
start_line = edited_content[:pos].count("\n") + 1 if pos != -1 else 1
diff = format_edit_diff(old_text, new_text, start_line)
print(f"{diff}\n")
except FileNotFoundError:
print(f"> {name} - {path} (file no longer available)\n")
Comment thread
kowyo marked this conversation as resolved.
return

if name in ("read_file", "write_file", "activate_skill"):
Expand Down
Loading