fix(runtime): address review feedback on retry and cleanup

This commit is contained in:
Xubin Ren
2026-04-02 10:57:12 +00:00
parent eefd7e60f2
commit 714a4c7bb6
4 changed files with 121 additions and 2 deletions
+3 -2
View File
@@ -11,6 +11,7 @@ from pathlib import Path
from typing import Any
import tiktoken
from loguru import logger
def strip_think(text: str) -> str:
@@ -214,8 +215,8 @@ def maybe_persist_tool_result(
bucket = ensure_dir(root / safe_filename(session_key or "default"))
try:
_cleanup_tool_result_buckets(root, bucket)
except Exception:
pass
except Exception as exc:
logger.warning("Failed to clean stale tool result buckets in {}: {}", root, exc)
path = bucket / f"{safe_filename(tool_call_id)}.{suffix}"
if not path.exists():
if suffix == "json" and isinstance(content, list):