test(guardrails): drop the wall-clock check from the deep tool arguments unit test
Some checks failed
LiteLLM Rust / rust-lint (push) Has been cancelled
LiteLLM Rust / rust-test (push) Has been cancelled
LiteLLM Rust / rust-wheel (push) Has been cancelled
Terraform Modules / fmt, validate, test (aws) (push) Has been cancelled
Terraform Modules / fmt, validate, test (gcp) (push) Has been cancelled
Terraform Provider / gofmt, vet, build, test (push) Has been cancelled
Terraform Provider / Provider endpoints vs proxy OpenAPI schema (push) Has been cancelled

The integration test test_deeply_nested_tool_arguments_do_not_stall_the_worker
already covers the timing; the unit test keeps the redaction check.
This commit is contained in:
yucheng 2026-10-26 16:05:15 -07:00
parent 6106f34854
commit ef7868515f

View file

@ -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]"))