From ef7868515f8d07bfd7097bb81b10203c1e37646e Mon Sep 17 00:00:00 2001 From: yucheng Date: Mon, 26 Oct 2026 16:05:15 -0700 Subject: [PATCH] test(guardrails): drop the wall-clock check from the deep tool arguments unit test The integration test test_deeply_nested_tool_arguments_do_not_stall_the_worker already covers the timing; the unit test keeps the redaction check. --- .../enterprise/enterprise_callbacks/test_secret_detection.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/unit/enterprise/enterprise_callbacks/test_secret_detection.py b/tests/unit/enterprise/enterprise_callbacks/test_secret_detection.py index 719211e095c..9816eb91102 100644 --- a/tests/unit/enterprise/enterprise_callbacks/test_secret_detection.py +++ b/tests/unit/enterprise/enterprise_callbacks/test_secret_detection.py @@ -99,7 +99,7 @@ async def test_tool_arguments_native_hook_cannot_forward_unredacted_credentials( @pytest.mark.asyncio -async def test_deeply_nested_tool_arguments_are_scanned_in_bounded_time(): +async def test_deeply_nested_tool_arguments_are_redacted(): arguments = '{"k":' * 200 + json.dumps(f"AWS_ACCESS_KEY_ID={AWS_KEY}") + "}" * 200 data = { "messages": [ @@ -109,9 +109,7 @@ async def test_deeply_nested_tool_arguments_are_scanned_in_bounded_time(): } ] } - started = time.perf_counter() await _guardrail().async_pre_call_hook(UserAPIKeyAuth(), DualCache(), data, "acompletion") - assert time.perf_counter() - started < 3.0 rewritten = data["messages"][0]["tool_calls"][0]["function"]["arguments"] assert json.loads(rewritten) == json.loads(arguments.replace(AWS_KEY, "[REDACTED]"))