Spaces:
Running
Running
sync: 179 file da Baida98/AI@1212f6f2 (2026-08-25 11:03 UTC) [deploy-all]
Browse files
agents/unified_loop_tools.py
CHANGED
|
@@ -313,7 +313,10 @@ class DirectToolsMixin:
|
|
| 313 |
),
|
| 314 |
timeout=TOOL_TIMEOUT,
|
| 315 |
)
|
| 316 |
-
|
|
|
|
|
|
|
|
|
|
| 317 |
return f"[convert_csv_to_json: errore — {str(written.get('error', 'scrittura non riuscita'))[:300]}]"
|
| 318 |
if on_step:
|
| 319 |
await _maybe_await(on_step({
|
|
|
|
| 313 |
),
|
| 314 |
timeout=TOOL_TIMEOUT,
|
| 315 |
)
|
| 316 |
+
# Il registry restituisce `ok` per i tool filesystem; questa
|
| 317 |
+
# scorciatoia diretta aggira l'executor che normalmente adatta
|
| 318 |
+
# l'esito al contratto `success`.
|
| 319 |
+
if not written.get("ok"):
|
| 320 |
return f"[convert_csv_to_json: errore — {str(written.get('error', 'scrittura non riuscita'))[:300]}]"
|
| 321 |
if on_step:
|
| 322 |
await _maybe_await(on_step({
|
tests/test_direct_file_conversion.py
CHANGED
|
@@ -9,7 +9,8 @@ def _install_tool_stubs(writes, image_url="https://example.test/generated.png"):
|
|
| 9 |
|
| 10 |
async def write_file(path, content):
|
| 11 |
writes[path] = content
|
| 12 |
-
|
|
|
|
| 13 |
|
| 14 |
async def generate_image(prompt, width=512, height=512):
|
| 15 |
return {"url": image_url, "prompt": prompt, "width": width, "height": height}
|
|
|
|
| 9 |
|
| 10 |
async def write_file(path, content):
|
| 11 |
writes[path] = content
|
| 12 |
+
# Il registry reale usa il contratto `ok` per le operazioni filesystem.
|
| 13 |
+
return {"ok": True, "path": path}
|
| 14 |
|
| 15 |
async def generate_image(prompt, width=512, height=512):
|
| 16 |
return {"url": image_url, "prompt": prompt, "width": width, "height": height}
|