Commit 075695b
Two bugs in one log line on every evaluator exception path:
1. Log said "accepting response" but the return was verdict=FAIL — caller
could not distinguish a real FAIL (response was bad) from an evaluator
infrastructure error (LLM down, parse error).
2. ``%s`` on the exception was empty whenever ``__str__`` returned ''
(e.g. ConnectionError() with no args, common in aiohttp). The log was
literally "RLM evaluator failed: — accepting response" with no
diagnostic value.
Fix:
* Add ReflectionVerdict.INDETERMINATE so callers can tell evaluator-broke
apart from response-bad. Routing semantics unchanged: graph.py:1080
only branches on verdict == "REFINE"; INDETERMINATE falls through to
persist_conversation, same behavior as the previous FAIL path. FAIL
enum value retained for backwards-compat (currently unused but cheap).
* Log includes ``type(exc).__name__`` + ``repr(exc)`` so empty __str__
no longer produces blank diagnostic lines.
* ``exc_info=True`` captures full traceback for post-mortem.
* Critique field uses ``{exc!r}`` so even empty messages have a useful
representation.
Caller audit: searched for ReflectionVerdict.* and ReflectionResult.verdict
across the codebase. Only chat_workflow/graph.py:1080 branches on the
verdict (string == "REFINE"); knowledge/pipeline/cognifiers/recursive_summarizer
and rlm/__init__ only consume quality_score/critique. No caller needs an
update — INDETERMINATE will route the same as ACCEPT/FAIL did.
Tests: 6 tests, all pass:
* INDETERMINATE returned on infrastructure error (was FAIL)
* Log includes exception type even when str(exc) is empty
* Log claim ("INDETERMINATE" / "passing through") matches the returned verdict
* exc_info=True attaches traceback to LogRecord
* INDETERMINATE present on enum
* Existing ACCEPT / REFINE / FAIL preserved
Acceptance criteria met:
- ✅ Log + verdict agree (no more "accepting" while returning FAIL)
- ✅ Log always includes exception type and repr (never empty diagnostic)
- ✅ exc_info=True captures traceback
- ✅ INDETERMINATE added to ReflectionVerdict enum
- ✅ Caller code (graph.py:1080) handles new value (no change needed —
routing is "REFINE or fall-through")
- ✅ Test induces evaluator failure, asserts log content + verdict
Co-authored-by: t <t@t>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 6e4752b commit 075695b
3 files changed
Lines changed: 148 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
97 | 108 | | |
98 | | - | |
| 109 | + | |
99 | 110 | | |
100 | | - | |
| 111 | + | |
101 | 112 | | |
102 | 113 | | |
103 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
| |||
0 commit comments