test/tools: catalog, grants, and async tool helpers

This commit is contained in:
2026-07-24 14:57:03 +08:00
parent 2f6133f685
commit 12c8adda3a
12 changed files with 285 additions and 35 deletions
+6 -2
View File
@@ -432,16 +432,20 @@ async def test_yolo_rebuilds_tool_registry(tmp_path: Path) -> None:
)
try:
assert st.agent.tools is not None
# Soft-confirm hooks stay installed; YOLO only auto-allows YOLO-tagged tools.
assert st.agent.tools.soft_confirm is True
assert st.agent.tools.yolo is False
st.set_yolo("on")
assert st.agent.tools is not None
assert st.agent.tools.soft_confirm is False
assert st.agent.tools.soft_confirm is True
assert st.agent.tools.yolo is True
st.set_yolo("once")
assert st.agent.tools is not None
assert st.agent.tools.soft_confirm is False
assert st.agent.tools.yolo is True
st.set_yolo("off")
assert st.agent.tools is not None
assert st.agent.tools.soft_confirm is True
assert st.agent.tools.yolo is False
finally:
await memory.close()