Refactor idle-notification in terms of emit-event system#8
Merged
timvisher-dd merged 2 commits intomainfrom Mar 19, 2026
Merged
Conversation
f35c2ba to
4fce23b
Compare
timvisher-dd
added a commit
that referenced
this pull request
Mar 18, 2026
Also exit early from bin/test when byte-compilation or tests fail, so the README check doesn't run against broken output. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace direct idle-notification-start/cancel calls with event subscriptions: turn-complete starts the timer, clean-up cancels it. Fix pre-existing agent-shell-mode-hook-subscriptions-survive-state-init test by stubbing agent-shell--handle and relaxing subscription count assertion. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
93737e3 to
22e144c
Compare
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.
Replace direct
idle-notification-start/cancelcalls with event subscriptions:turn-completestarts the timer,clean-upcancels it. This removes the coupling between the idle notification feature and the specific call sites that emit these events, letting the event system handle the wiring instead.Direct cancel calls remain at user-input boundaries (
--insert-to-shell-buffer,agent-shell-queue-request) since those are programmatic inputs that don't triggerpost-command-hook.Also fixes the pre-existing
agent-shell-mode-hook-subscriptions-survive-state-inittest failure by stubbingagent-shell--handle(the test only cares about subscription survival, not the initialization pipeline) and relaxing the subscription count assertion to accommodate additional internal subscriptions.Checklist
M-x checkdocandM-x byte-compile-file.