feat(detectors): integrated rca into evaluation workflow#210
Merged
Conversation
afarntrog
requested changes
May 4, 2026
afarntrog
requested changes
May 4, 2026
afarntrog
previously approved these changes
May 4, 2026
afarntrog
approved these changes
May 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Integrates the detection pipeline (
detect_failures→analyze_root_cause) into theExperimentevaluation workflow so that failing cases are automatically diagnosed and fix recommendations surface directly in the report.What's new
diagnose_session()— single-call pipeline that runs failure detection followed by root cause analysis on aSession. Returns aDiagnosisResultwith failures, root causes, and deduplicated recommendations.DiagnosisResult— Pydantic model with arecommendationsproperty that extracts and deduplicates fix strings from all root causes.DiagnosisConfig— groups all diagnosis-related parameters into a single config object:trigger: DiagnosisTrigger = "on_failure"— when to run diagnosis ("on_failure"or"always")model: Model | str | None = None— override the LLM used for diagnosisconfidence_threshold: ConfidenceLevel = "medium"— minimum confidence for failure detectionExperimentintegration — accepts an optionaldiagnosis_config: DiagnosisConfigparameter. WhenNone(the default), diagnosis is disabled. When provided, diagnosis runs according to the trigger setting.EvaluationReport— two new fields:diagnoses: list[dict | None]andrecommendations: list[str | None], populated per-case (shared across evaluator reports).Usage
Standalone diagnosis:
Integrated with Experiment:
Testing
diagnose_session()(skips RCA when no failures, passes model/threshold, serialization round-trip)DiagnosisResult.recommendations(deduplication, empty case)Experimentintegration (disabled when no config, calls diagnosis for failing cases, skips passing cases, handles non-Session trajectory, shared across evaluators, exception handling)All 13 tests pass.
Type of Change
New feature
Checklist