From f34691fd18b4cfa55b1e2c0febc9bde24a5c1b0b Mon Sep 17 00:00:00 2001 From: Henkey Date: Sat, 2 May 2026 14:45:16 +0100 Subject: [PATCH] fix(acp): keep read-file starts compact --- acp_adapter/tools.py | 15 ++++----------- tests/acp/test_tools.py | 8 +++----- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/acp_adapter/tools.py b/acp_adapter/tools.py index 8fc9eacf07..2f85ebb773 100644 --- a/acp_adapter/tools.py +++ b/acp_adapter/tools.py @@ -960,18 +960,11 @@ def build_tool_start( ) if tool_name == "read_file": - path = arguments.get("path", "") - offset = arguments.get("offset") - limit = arguments.get("limit") - bits = [] - if offset: - bits.append(f"from line {offset}") - if limit: - bits.append(f"limit {limit}") - suffix = f" ({', '.join(bits)})" if bits else "" - content = [_text(f"Reading {path}{suffix}")] + # The title and location already identify the file. Sending a synthetic + # "Reading ..." content block makes Zed render an unhelpful Output + # section before the real file contents arrive on completion. return acp.start_tool_call( - tool_call_id, title, kind=kind, content=content, locations=locations, + tool_call_id, title, kind=kind, content=None, locations=locations, ) if tool_name == "search_files": diff --git a/tests/acp/test_tools.py b/tests/acp/test_tools.py index 40423174a2..8de1292172 100644 --- a/tests/acp/test_tools.py +++ b/tests/acp/test_tools.py @@ -189,15 +189,13 @@ class TestBuildToolStart: assert "ls -la /tmp" in text def test_build_tool_start_for_read_file(self): - """read_file should include the path in content.""" + """read_file start should stay compact; completion carries file contents.""" args = {"path": "/etc/hosts", "offset": 1, "limit": 50} result = build_tool_start("tc-3", "read_file", args) assert isinstance(result, ToolCallStart) assert result.kind == "read" - assert len(result.content) >= 1 - content_item = result.content[0] - assert isinstance(content_item, ContentToolCallContent) - assert "/etc/hosts" in content_item.content.text + assert result.content is None + assert result.raw_input is None def test_build_tool_start_for_search(self): """search_files should include pattern in content."""