tenseleyflow/loader / 520c30f

Browse files

Show error state for failed write/edit tool calls instead of DiffWidget

Authored by espadonne
SHA
520c30f12812e403c0571449c09cb4bc2331e64a
Parents
3585027
Tree
1b1dd2d

1 changed file

StatusFile+-
M src/loader/ui/app.py 3 3
src/loader/ui/app.pymodified
@@ -634,7 +634,7 @@ class LoaderApp(App):
634634
 
635635
         # Check if this is an edit tool with diff info
636636
         # Note: old_string can be empty string (inserting), so check `is not None`
637
-        if message.tool_name == "edit" and message.new_string and message.old_string is not None:
637
+        if message.tool_name == "edit" and message.new_string and message.old_string is not None and not message.is_error:
638638
             # Replace tool widget with diff widget
639639
             self._debug_log(
640640
                 "  -> showing EDIT diff widget "
@@ -650,8 +650,8 @@ class LoaderApp(App):
650650
                 new_string=message.new_string,
651651
             )
652652
             msg_area.mount(diff_widget)
653
-        # Check if this is a write tool - show as diff (new file)
654
-        elif message.tool_name == "write" and message.new_string:
653
+        # Check if this is a write tool - show as diff (new file), but only on success
654
+        elif message.tool_name == "write" and message.new_string and not message.is_error:
655655
             self._debug_log(f"  -> showing WRITE diff widget ({len(message.new_string)} chars)")
656656
             if tool_widget:
657657
                 tool_widget.remove()