chore(activity-monitor): drop dead output-tracking assignments in ALERT_RINGING#198
Open
dormouse-bot wants to merge 1 commit into
Open
chore(activity-monitor): drop dead output-tracking assignments in ALERT_RINGING#198dormouse-bot wants to merge 1 commit into
dormouse-bot wants to merge 1 commit into
Conversation
…RT_RINGING The firstOutputAt/outputCountSinceAttention assignments in the ALERT_RINGING branch of onData are overwritten before any read (enterMightBeBusy never reads them; seedFromLatestOutput or enterBusy resets them downstream). Remove the dead, misleading lines. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Deploying mouseterm with
|
| Latest commit: |
5a4e470
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://cf30a564.mouseterm.pages.dev |
| Branch Preview URL: | https://fix-activity-monitor-dead-as.mouseterm.pages.dev |
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.
Surfaced by the nightly code-quality survey.
In
ActivityMonitor.onData, theALERT_RINGINGbranch assignsfirstOutputAtandoutputCountSinceAttentionimmediately before callingenterMightBeBusy(), but neither assignment is ever read:enterMightBeBusy()doesn't touch either field — it clears the activity timers, sets status toMIGHT_BE_BUSY, and armsbusyConfirmTimer.MIGHT_BE_BUSYoverwrites both fields before they can be read: the confirm timer callsseedFromLatestOutput()(which re-derivesfirstOutputAtfromlastOutputAtand resets the count) before transitioning toNOTHING_TO_SHOW, and an interveningonDatainMIGHT_BE_BUSYcallsenterBusy()→resetOutputTracking(). The only readers of these fields (handleNothingToShowOutput, thebusyCandidateTimercallback) run exclusively inNOTHING_TO_SHOW, which is never reached with the line-80/81 values intact.So the two assignments are dead. They also mislead: they mimic the seeding in
handleNothingToShowOutput, implying they prime output tracking for the transition, when in fact the seeding is redone downstream. Removing them.No behavior change, so no regression test accompanies this — the existing
activity-monitor.test.ts(21 cases, including the attention-gatedALERT_RINGING→ resume transition) passes unchanged, andtsc -bis clean (nowis still used earlier inonData).