mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-08-08 05:18:49 +03:00
fix(agent): read document attachments on demand (#5122)
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user