Skip to content

Commit 1f8bd35

Browse files
committed
Update the root agent to call the arch_mismatch_detector_agent
1 parent 90e76c7 commit 1f8bd35

File tree

6 files changed

+23
-4
lines changed

6 files changed

+23
-4
lines changed

ci_analysis_agent/agent.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,16 @@
2222
from sub_agents.installation_analyst import installation_analyst_agent
2323
from sub_agents.e2e_test_analyst import e2e_test_analyst_agent
2424
from sub_agents.mustgather_analyst import mustgather_analyst_agent
25-
25+
from sub_agents.arch_mismatch_detector import arch_mismatch_detector_agent
2626
import os
2727
MODEL = os.environ.get("MODEL", "ollama_chat/qwen3:4b")
28+
29+
def get_job_name(url: str) -> str:
30+
return url.split("/")[-2]
31+
32+
def get_build_id(url: str) -> str:
33+
return url.split("/")[-1]
34+
2835
ci_analysis_advisor = LlmAgent(
2936
name="ci_analysis_advisor",
3037
model=LiteLlm(model=MODEL),
@@ -34,7 +41,10 @@
3441
instruction=prompt.CI_ANALYSIS_COORDINATOR_PROMPT,
3542
output_key="ci_analysis_advisor_output",
3643
tools=[
44+
get_job_name,
45+
get_build_id,
3746
AgentTool(agent=installation_analyst_agent),
47+
AgentTool(agent=arch_mismatch_detector_agent),
3848
AgentTool(agent=e2e_test_analyst_agent),
3949
AgentTool(agent=mustgather_analyst_agent),
4050
],

ci_analysis_agent/prompt.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
2. ALWAYS perform e2e test analysis to identify test failures and patterns
4747
3. Only if needed for deeper insights, check the must-gather logs for more detailed cluster information
4848
49-
IMPORTANT: Steps 1 and 2 are MANDATORY for every job analysis request. Do not skip e2e analysis.
49+
IMPORTANT: Steps 1,2 and 3 are MANDATORY for every job analysis request. Do not skip e2e analysis.
5050
5151
At each step, clearly inform the user about the current subagent being called and the specific information required from them.
5252
After each subagent completes its task, explain the output provided and how it contributes to the overall root cause analysis process.
@@ -60,6 +60,12 @@
6060
Action: Parse the URL for the job_name and build_id. Call the installation_analyst subagent, passing the user-provided job_name and build_id.
6161
Expected Output: The installation_analyst subagent MUST return the job's job_name, build_id, test_name and a comprehensive data analysis for the installation of the cluster for the given job.
6262
63+
* Arch Mismatch Analysis (Subagent: arch_mismatch_detector) - MANDATORY
64+
65+
Input: In the input for the function call (arch_mismatch_detector tool), provide the job_name and build_id.
66+
Action: Call the arch_mismatch_detector subagent, passing the user-provided job_name and build_id.
67+
Expected Output: The arch_mismatch_detector subagent MUST return a comprehensive analysis on existence of arch mismatch errors (binaries with exec format error) in the job.
68+
6369
* E2E Test Analysis (Subagent: e2e_test_analyst) - MANDATORY
6470
6571
Input: The installation_analysis_output from the installation_analyst subagent.

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ litellm>=1.74.0
33
drain3>=0.9.0
44
google-cloud-storage>=2.10.0
55
python-dotenv>=1.0.0
6-
httpx>=0.24.0
6+
httpx>=0.24.0
7+
pytest

sub_agents/arch_mismatch_detector/agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ async def get_job_start_and_end_time_async(job_name: str, build_id: str)-> Dict[
7878
# model="gemini-2.0-flash",
7979
name="arch_mismatch_detector_agent",
8080
instruction=prompt.ARCH_MISMATCH_DETECTOR_PROMPT,
81-
output_key="installation_analysis_output",
81+
output_key="arch_mismatch_detector_output",
8282
tools=[
8383
get_job_start_and_end_time_tool,
8484
MCPToolset(

sub_agents/e2e_test_analyst/agent.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ def get_junit_results_tool(job_name: str, build_id: str, test_name: str):
329329

330330
e2e_test_analyst_agent = Agent(
331331
model=LiteLlm(model=MODEL),
332+
description="Analyzes e2e test logs and provides detailed analysis.",
332333
name="e2e_test_analyst_agent",
333334
instruction=prompt.E2E_TEST_SPECIALIST_PROMPT,
334335
output_key="e2e_test_analysis_output",

sub_agents/installation_analyst/agent.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ def get_install_logs_tool(job_name: str, build_id: str, test_name: str):
317317
return run_async_in_thread(get_install_logs_async(job_name, build_id, test_name))
318318

319319
installation_analyst_agent = Agent(
320+
description="Analyzes installation logs and provides detailed analysis.",
320321
model=LiteLlm(model=MODEL),
321322
name="installation_analyst_agent",
322323
instruction=prompt.INSTALLATION_SPECIALIST_PROMPT,

0 commit comments

Comments
 (0)