mirror of
https://github.com/usestrix/strix.git
synced 2026-08-23 03:12:37 +02:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user