fix(agent): read document attachments on demand (#5122)

This commit is contained in:
chengyongru
2026-07-28 13:33:06 +08:00
committed by GitHub
parent 096a86a7f4
commit 12f828ea3d
15 changed files with 323 additions and 450 deletions
+10
View File
@@ -96,6 +96,16 @@ class TestReadDedup:
# Images should always return full content blocks, not a stub
assert isinstance(second, list)
@pytest.mark.asyncio
async def test_known_text_extension_falls_back_to_latin1(self, tool, tmp_path):
f = tmp_path / "legacy.csv"
f.write_bytes("name\ncafé".encode("latin-1"))
result = await tool.execute(path=str(f))
assert "1| name" in result
assert "2| café" in result
# ---------------------------------------------------------------------------
# Cross-session isolation (issue #3571)
+2
View File
@@ -36,6 +36,8 @@ def test_coding_tool_descriptions_steer_discovery_and_shell_usage() -> None:
assert "find_files/list_dir first" in read_file
assert "before editing" in read_file
assert "uploaded non-image attachments are referenced by path" in read_file
assert "only when their contents are needed" in read_file
assert "prefer it over shell find/ls" in find_files
assert "prefer this over shell grep" in grep