From d7d4b97df36fe6dadc43d03790dd7d0737b63bbd Mon Sep 17 00:00:00 2001 From: Xubin Ren <52506698+Re-bin@users.noreply.github.com> Date: Fri, 9 Oct 2026 13:18:29 +0800 Subject: [PATCH] test(my): handle escaped Windows paths in inspection output --- tests/agent/tools/test_runtime_control.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/agent/tools/test_runtime_control.py b/tests/agent/tools/test_runtime_control.py index 307cf4615..fefe9afd9 100644 --- a/tests/agent/tools/test_runtime_control.py +++ b/tests/agent/tools/test_runtime_control.py @@ -285,8 +285,8 @@ async def test_workspace_inspection_matches_registered_file_tool( assert status["restrict_to_workspace"] is restricted assert status["level"] == ("application" if restricted else "off") assert status["enforced"] is False - assert str(project.resolve()) in await tool.execute(action="check", key="workspace_sandbox") - assert str(project.resolve()) in await tool.execute(action="check") + assert repr(str(project.resolve())) in await tool.execute(action="check", key="workspace_sandbox") + assert repr(str(project.resolve())) in await tool.execute(action="check") assert await tool.execute(action="check", key="workspace_sandbox.restrict_to_workspace") == ( f"workspace_sandbox.restrict_to_workspace: {restricted!r}" ) @@ -328,7 +328,7 @@ async def test_workspace_inspection_is_isolated_between_concurrent_turns(tmp_pat await ready.wait() await asyncio.sleep(0) result = await tool.execute(action="check", key="workspace_sandbox.workspace_root") - assert str(project.resolve()) in result + assert repr(str(project.resolve())) in result return tool._runtime_control.snapshot().workspace_sandbox finally: reset_workspace_scope(token) @@ -377,7 +377,7 @@ async def test_workspace_inspection_reaches_model_from_selected_chat(tmp_path: P msg["tool_call_id"]: msg["content"] for msg in calls[1].kwargs["messages"] if msg["role"] == "tool" } - assert str(project.resolve()) in results["inspect"] + assert repr(str(project.resolve())) in results["inspect"] assert "'restrict_to_workspace': True" in results["inspect"] assert "selected project" in results["read"] assert calls[0].kwargs["tools"] == calls[1].kwargs["tools"]