fix(context): keep tool-output retrieval reliable and stream pages

Exempt read_tool_output from result-bounding so paging a large stored
output isn't re-spilled under a new id, byte-cap each page in place, and
stream the requested window with islice instead of loading the whole
file per page.
This commit is contained in:
Ahmed Allam
2026-07-26 00:16:02 +00:00
committed by Devin AI
parent 1da3140d84
commit 90d0dfb4f0
4 changed files with 54 additions and 5 deletions
+11
View File
@@ -110,3 +110,14 @@ async def test_chat_completions_filesystem_custom_tool_becomes_function_tool() -
factory._configure_filesystem_tools(toolset, chat_completions=True)
assert isinstance(toolset.read_file, FunctionTool)
def test_read_tool_output_is_not_result_bounded() -> None:
# Every other FunctionTool gets the result-bounding wrapper, but the
# retrieval tool must be exempt or paging a large stored output would be
# re-spilled under a new id.
agent = factory.build_strix_agent(is_root=True)
by_name = {t.name: t for t in agent.tools}
assert getattr(by_name["read_tool_output"], "_strix_bounded", False) is False
assert getattr(by_name["think"], "_strix_bounded", False) is True