fix: reset retry counter on handled exceptions and add text to vision tool results

- Reset retry counter to 0 when exception is None or already handled (HandledException, RepairableException) - Add text message to vision_load tool results to prevent model provider errors with image-only messages

frdel committed Mar 22, 2026 at 10:44 UTC f9743cb736a7caeb49886aa40721f1b6f71cdacc
2 files changed +3
plugins/_error_retry/extensions/python/agent_Agent_handle_exception_end/_80_retry_critical_exception.py
+2
@@ -16,9 +16,11 @@ class RetryCriticalException(Extension):
16
17 exception = data.get("exception")
18 if not exception:
19 + self.agent.set_data(DATA_NAME_COUNTER, 0) # reset counter if exception has been handled
20 return
21
22 if isinstance(exception, (HandledException, RepairableException)):
23 + self.agent.set_data(DATA_NAME_COUNTER, 0) # reset counter if exception has been handled
24 return
25
26 max_retries = 1
tools/vision_load.py
+1
@@ -56,6 +56,7 @@ class VisionLoad(Tool):
56 # build image data messages for LLMs, or error message
57 content = []
58 if self.images_dict:
59 + self.agent.hist_add_tool_result(self.name, f"Processed {len(self.images_dict)} images") # some model providers break when they get have images in message history without text
60 for path, image in self.images_dict.items():
61 if image:
62 content.append(