{"version":"2.1.227","anchor":"event-loop-stall-detector-rewritten-as-a-class","canonical_anchor":"event-loop-stall-detector-rewritten-as-a-class","heading":"Event loop stall detector rewritten as a class","tier":"internal","area":"Performance","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.227\/e\/event-loop-stall-detector-rewritten-as-a-class","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.227","markdown":"### Event loop stall detector rewritten as a class\n\nThe event-loop stall detector was rewritten as a class with identical behaviour.\n\n**What**\n\nThe stall detector's counters were moved into a class with a single instance. Same 200 ms interval, same threshold and sleep\/wake heuristic, same `[event-loop-stall] detector started` line, same `tengu_event_loop_stall` event fields, and the same terminal mode reassertion after a suspected sleep\/wake.\n\n**Details**\n\n- Two neighbouring singletons got the same treatment: a run-budget tracker exposing `isOverBudget`, `recordRun` and `firstPolicySkipFor`, and a deduper exposing `markIfChanged`. Nothing in the surrounding code shows what those two control.\n\n**Evidence**\n\n`[event-loop-stall] detector started`\n\n- Flag `tengu_event_loop_stall`: Gate removed from the code (read for one account on one subscription tier against v2.1.227; this account: on, anonymous baseline: on, compiled default: not a boolean we can read) These values were read against a different version of Claude Code, so treat them as the nearest reading available instead of one taken on this release.\n- Area: Performance\n- Tier: Under the hood\n- Useful: 1\/5\n- Signal: 0\/5"}