Agentic test failure triage
An agent that reads the logs of a failed test run, decides whether the product code or the test automation is at fault, and links the failure to existing tickets and test cases.
Built with Python, LangGraph, Deep Agents, Drain3, OpenAI
Problem
Nightly test runs produce a lot of logs. When something fails, an engineer reads them to decide whether the product code or the test automation is to blame, then checks whether the failure is already tracked. Most of that reading is repeat noise.
Approach
- Index whole log files instead of chunking them, so the agent can search a complete run and follow a failure across files.
- Turn each log line into a template and compare only the variable parts against past runs. Only values that look new trigger a full analysis, so known noise costs no model calls.
- An agent plans the investigation, calls search tools over the indexed logs and reports a root cause together with the lines it relied on.
- It then looks up related test cases and tickets, so the report points at existing work instead of duplicating it.
What I would change
The next step is suggesting a fix once the root cause is located, and measuring the agent's verdicts against engineers' final calls so that changes to prompts or models ship behind an evaluation gate.