Repository navigation
Commit 1600efa
fix: [#834] address re-review — gate refuse-branch telemetry to transition only
Reviewer N1: every refused call fired `doom_loop_detected` telemetry.
A runaway agent that hammers todowrite after refusal would produce
~9,000+ events per session — pure noise. The warn branch already
fires once (`===` semantics); the refuse branch was using `>=`,
firing repeatedly.
Fix: gate the telemetry call to `decision.count === TODOWRITE_REFUSE_THRESHOLD`
so it fires exactly once on the transition into refusal. Subsequent
refused calls return the same refusal output but emit no telemetry.
Also renamed the test "counter survives reset and starts fresh" to
"counter is cleared by _resetTodoWriteCounters and starts fresh" —
the old name was the opposite of what the test verifies.
Validation
- typecheck pass
- 12 todowrite tests pass
- Marker check pass
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>1 parent 6cb296b commit 1600efa
2 files changed
Lines changed: 18 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
129 | 137 | | |
130 | 138 | | |
131 | 139 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
| |||
0 commit comments