fix: preserve tool failures under noisy output
This commit is contained in:
@@ -10,6 +10,7 @@ from agent_platform.auth import UserIdentity
|
||||
from agent_platform.config import Settings
|
||||
from agent_platform.runtime.schemas import PlanItem
|
||||
from agent_platform.store import RuntimeStore
|
||||
from agent_platform.text import truncate_middle
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
@@ -337,6 +338,4 @@ class ToolRegistry:
|
||||
|
||||
def tool_result_text(result: Any, limit: int) -> str:
|
||||
text = json.dumps(result, ensure_ascii=False, separators=(",", ":"), default=str)
|
||||
if len(text) <= limit:
|
||||
return text
|
||||
return text[:limit] + "…"
|
||||
return truncate_middle(text, limit)
|
||||
|
||||
Reference in New Issue
Block a user