From b70fa3137b5280a5d48426844d3f58374c50f907 Mon Sep 17 00:00:00 2001 From: aix-ahmet Date: Tue, 21 Jul 2026 11:46:08 +0300 Subject: [PATCH] test(v2): match Arabic inspector steps by the inspector's configured name The backend uses the inspector's own name as the step agent id, and this test names its inspector 'ArabicContentValidator-', which the substring matcher ('inspector') missed. --- tests/functional/v2/test_arabic_agent.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/functional/v2/test_arabic_agent.py b/tests/functional/v2/test_arabic_agent.py index aed2be60..753d9186 100644 --- a/tests/functional/v2/test_arabic_agent.py +++ b/tests/functional/v2/test_arabic_agent.py @@ -171,11 +171,12 @@ def _build_name(prefix: str, model_name: str) -> str: return f"{prefix}-{model_name}-{int(time.time())}-{uuid.uuid4().hex[:6]}" -def _is_inspector_step(step: dict) -> bool: +def _is_inspector_step(step: dict, inspector_name: str = "") -> bool: # The backend reports the inspector's own name as the step agent id - # (e.g. 'output_inspector_gpt_4o'), not an 'inspector|...' prefix. + # (e.g. 'ArabicContentValidator-gpt-4o'), not an 'inspector|...' prefix. agent_info = step.get("agent") or {} - return "inspector" in (agent_info.get("id") or "").lower() + step_id = (agent_info.get("id") or "").lower() + return "inspector" in step_id or (bool(inspector_name) and step_id == inspector_name.lower()) def _is_inspector_abort_message(output: str) -> bool: @@ -310,7 +311,7 @@ def test_arabic_inspector_agent_across_llms(client, resource_tracker, model_name response = team_agent.run(ARABIC_QUERIES["pure_arabic"]) output, steps = _assert_success_response(response) - inspector_steps = [step for step in steps if _is_inspector_step(step)] + inspector_steps = [step for step in steps if _is_inspector_step(step, inspector.name)] assert inspector_steps, "Expected inspector step(s) in the run" if _is_inspector_abort_message(output):