Repository navigation
feat(eval): multi-agent orchestration eval (loops, context loss, mis-… - #1050
Merged
AmitoVrito merged 6 commits intoSep 18, 2026
Merged
Conversation
…not position Positional step_counter arithmetic (step_counter-2/-1) collapsed a handoff into a self-loop whenever it wasn't sandwiched between exactly one node event on each side, corrupting the graph fed to LoopDetector and ContextLossDetector. Resolve source/target by matching agent name against the nearest surrounding node events instead. Co-authored-by: Premvkmishra <[email protected]>
- publish_graph() was only ever called with graph_list[0], silently dropping the dashboard snapshot for every other graph in a multi-run misrouting batch. Node/edge ids are run_id-prefixed, so combine every evaluated graph into one snapshot instead. - evaluate_and_publish never called live._maybe_autostart(), unlike observe/runtime.py and dream/core.py. With SYNAPSEKIT_LIVE=1 as the only enabling signal in-process, bus.enabled stayed False and every publish() silently no-op'd. - Narrow the wrapping `except Exception: pass` to `except ImportError` so real bugs in report/graph construction surface instead of being silently swallowed. Co-authored-by: Premvkmishra <[email protected]>
RunGraph.from_handoff_result reads item["timestamp"]/item["context"] from HandoffChain.run's history, but history entries never carried those keys, so every RunNode.timestamp was silently None on the primary production path. Stamp each history entry with a timestamp (additive field); document that "context" has no equivalent in HandoffChain today so ContextLossDetector falls back to text matching. Co-authored-by: Premvkmishra <[email protected]>
LLMContextLossJudge was defined and exported but never invoked by evaluate()/evaluate_and_publish, so constructing one had no effect despite the PR description framing it as part of the detection story. Add an optional llm_judge constructor param and an async evaluate_async() that runs the judge over transfers the heuristic ContextLossDetector didn't already flag, avoiding a double-charge on the same miss. Co-authored-by: Premvkmishra <[email protected]>
Cycle spans are positional indices into agent_sequence() (sorted by .step), but node lookup used nodes_by_step[step] keyed by raw .step values. Non-contiguous step numbering silently dropped most nodes from a detected cycle's node_ids. Index into the same sorted-by-step list agent_sequence() derives from instead. Co-authored-by: Premvkmishra <[email protected]>
Collaborator
|
Thanks for this one, Prem. Solid work on the RunGraph abstraction and the three detectors, and nice fixture coverage too. I pushed a few follow up fixes on top (the from_events self loop bug, the Live publish/autostart gaps, and wiring up LLMContextLossJudge) and merged. Appreciate the contribution, this is your third PR in now and it shows. |
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
Goal-level, orchestration-aware evaluation over a framework-agnostic
RunGraphabstraction detecting three core failure modes: infinite handoff loops (LoopDetector), per-transfer context loss (ContextLossDetector), and non-deterministic mis-routing (MisroutingDetector).Closes #983 (Epic #947, milestone v3.0)
Type of change
Changes
RunGraphAbstraction:RunNode&Transferdataclasses adapted fromHandoffResult(from_handoff_result) or Live event history (from_events).LoopDetector: Exact periodic cycles + stalled input similarity (>= 0.92).ContextLossDetector: Extracted factual span tracking (retention threshold 0.7) + opt-inLLMContextLossJudge.MisroutingDetector: Target modal distribution across goals & golden route matching.OrchestrationEvalReport(JSON/Markdown) &OrchestrationEvaluator.evaluate_and_publish()wired to SynapseKit Live bus (🧭 icon + story line).orchestration-eval-gateCI job, andexamples/orchestration_eval.py.Testing
uv run pytest tests/ -q)Documentation
Usage::examples## [Unreleased]Notes for reviewer
RunGraphis framework-agnostic (not tied toHandoffChain).LLMContextLossJudgeis opt-in and not constructed/invoked by defaultContextLossDetector.orchestration-eval-gateCI job uses deterministic structural fixtures with zero external network dependencies.