The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(image_gen): catch only the JSON error the fallback parse can raise
Mariano Nicolini8d0c59d75c6f
diff --git a/tools/image_generation_tool.py b/tools/image_generation_tool.pyindex 5af23ba2118..e59ca9773d7 100644--- a/tools/image_generation_tool.py+++ b/tools/image_generation_tool.py@@ -802,7 +802,7 @@ def _fall_back_to_fal(raw: str, prompt: str, aspect_ratio: str, sources: dict[stSource images never fall back; FAL would route them to an edit endpoint with different semantics."""try:result = json.loads(raw)- except Exception: # noqa: BLE001+ except ValueError:return rawif not isinstance(result, dict) or result.get("success") or not result.get("fallback_eligible"):return raw