fix ACP start events for polished tools

This commit is contained in:
godlin
2026-05-15 13:01:14 +08:00
committed by Teknium
parent 3c51da1cb7
commit 6622277f11
2 changed files with 10 additions and 1 deletions
-1
View File
@@ -1123,7 +1123,6 @@ def build_tool_start(
)
# Generic fallback
import json
try:
args_text = json.dumps(arguments, indent=2, default=str)
except (TypeError, ValueError):
+10
View File
@@ -207,6 +207,16 @@ class TestBuildToolStart:
assert result.content is None
assert result.raw_input is None
def test_build_tool_start_for_browser_navigate(self):
"""browser_navigate should emit a polished start event."""
args = {"url": "https://x.com"}
result = build_tool_start("tc-browser-start", "browser_navigate", args)
assert isinstance(result, ToolCallStart)
assert result.title == "navigate: https://x.com"
assert result.kind == "fetch"
assert result.content[0].content.text == '{\n "url": "https://x.com"\n}'
assert result.raw_input is None
def test_build_tool_start_for_search(self):
"""search_files should include pattern in content."""
args = {"pattern": "TODO", "target": "content"}