Skip to content

Refactor idle-notification in terms of emit-event system#8

Merged
timvisher-dd merged 2 commits intomainfrom
timvisher/idle-notification-emit-event-refactor
Mar 19, 2026
Merged

Refactor idle-notification in terms of emit-event system#8
timvisher-dd merged 2 commits intomainfrom
timvisher/idle-notification-emit-event-refactor

Conversation

@timvisher-dd
Copy link
Owner

Replace direct idle-notification-start/cancel calls with event subscriptions: turn-complete starts the timer, clean-up cancels 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 trigger post-command-hook.

Also fixes the pre-existing agent-shell-mode-hook-subscriptions-survive-state-init test failure by stubbing agent-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

  • I agree to communicate (PR description and comments) with the author myself (not AI-generated).
  • I've reviewed all code in PR myself and will vouch for its quality.
  • I've read and followed the Contributing guidelines.
  • I've filed a feature request/discussion for a new feature.
  • I've added tests where applicable.
  • I've updated documentation where necessary.
  • I've run M-x checkdoc and M-x byte-compile-file.

@timvisher-dd timvisher-dd force-pushed the timvisher/idle-notification-emit-event-refactor branch from f35c2ba to 4fce23b Compare March 18, 2026 19:46
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>
timvisher-dd and others added 2 commits March 18, 2026 16:02
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>
@timvisher-dd timvisher-dd force-pushed the timvisher/idle-notification-emit-event-refactor branch from 93737e3 to 22e144c Compare March 18, 2026 20:02
@timvisher-dd timvisher-dd marked this pull request as ready for review March 19, 2026 14:46
@timvisher-dd timvisher-dd merged commit 215f19a into main Mar 19, 2026
2 checks passed
@timvisher-dd timvisher-dd deleted the timvisher/idle-notification-emit-event-refactor branch March 19, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant