What
The pendingExit flag at ai-slop-detector.ts:923 is set to true when a nested block inside a catch block closes, then unconditionally cleared to false on the very next line before any logic checks it:
if (pendingExit) {
pendingExit = false;
}
The actual catch-block exit is driven by braceDepth <= catchBlockDepth, not pendingExit. The flag is set in two places (lines 944, 976) and cleared in four places (lines 949, 955-956, 987, 995) but never read elsewhere and has no effect on the outcome.
Impact
Dead code. No behavioral change on removal.
Fix
Either wire pendingExit into the exit logic as originally intended, or remove it entirely.
Location
ai-slop-detector.ts:923-995
What
The
pendingExitflag atai-slop-detector.ts:923is set totruewhen a nested block inside a catch block closes, then unconditionally cleared tofalseon the very next line before any logic checks it:The actual catch-block exit is driven by
braceDepth <= catchBlockDepth, notpendingExit. The flag is set in two places (lines 944, 976) and cleared in four places (lines 949, 955-956, 987, 995) but never read elsewhere and has no effect on the outcome.Impact
Dead code. No behavioral change on removal.
Fix
Either wire
pendingExitinto the exit logic as originally intended, or remove it entirely.Location
ai-slop-detector.ts:923-995