fix(agent): make tool error guidance neutral (#6227)

* fix(agent): make tool error guidance neutral

* refactor(tools): share tool error guidance
This commit is contained in:
chengyongru authored and GitHub committed 2026-10-15 16:58:39 +08:00
1 parent c24153db86
commit 841d2b880c
5 files changed
+55 -33

No files matched your search

+5 -2
View File
@@ -626,7 +626,7 @@ async def test_execute_contains_malformed_success_result() -> None:
@pytest.mark.asyncio
async def test_registry_adds_retry_hint_to_malformed_mcp_result() -> None:
async def test_registry_adds_error_hint_to_malformed_mcp_result() -> None:
async def call_tool(_name: str, arguments: dict) -> object:
return SimpleNamespace(content=None)
@@ -638,7 +638,10 @@ async def test_registry_adds_retry_hint_to_malformed_mcp_result() -> None:
assert is_tool_error_result(result)
assert "MCP tool returned malformed content" in result
assert "Analyze the error above and try a different approach" in result
assert (
"[Consider this result in the context of the user's goal "
"and decide whether and how to proceed.]"
) in result
@pytest.mark.asyncio