feat: add config toggle to disable transition notifications#580
Open
johnuopini wants to merge 10 commits intoasheshgoplani:mainfrom
Open
feat: add config toggle to disable transition notifications#580johnuopini wants to merge 10 commits intoasheshgoplani:mainfrom
johnuopini wants to merge 10 commits intoasheshgoplani:mainfrom
Conversation
8ce2ba0 to
176c887
Compare
Add TransitionEvents *bool field to NotificationsConfig with a getter that defaults to true. This allows users to globally suppress transition event dispatch (tmux send-keys to parent sessions) via: [notifications] transition_events = false
Per-session flag to suppress transition event dispatch. When true, the transition daemon skips sending tmux messages to the parent for this session's status changes. Serialized as no_transition_notify with omitempty.
Check GetTransitionEventsEnabled() and Instance.NoTransitionNotify in both syncProfile() and emitHookTransitionCandidates() before calling NotifyTransition(). When either is suppressed, the event is silently skipped (no dispatch, no logging).
Mirrors the --no-parent pattern. Sets NoTransitionNotify on the new instance so the transition daemon skips dispatch for it.
Same as the add command flag — sets NoTransitionNotify on the instance.
Toggle transition event dispatch per-session: agent-deck session set-transition-notify <id> <on|off> When off, the daemon skips sending tmux messages to the parent for this session's status transitions. The parent link is unchanged.
Display the flag in both JSON and human-readable output. Only shown in human-readable when the flag is true.
The field was only set in memory but lost on save/load because it was missing from the statedb InstanceRow, SQL schema, and the three mapping layers (Instance→InstanceRow, InstanceRow→InstanceData, InstanceData→Instance). Add no_transition_notify column (schema v5 with migration), wire it through SaveInstance, SaveInstances, LoadInstances, and all storage mapping sites.
176c887 to
15744da
Compare
The daemon guards (syncProfile, emitHookTransitionCandidates) correctly skipped calling NotifyTransition() when the flag was set, but dispatch() itself never checked it. Deferred/retried events bypass the daemon guards and call dispatch() directly, so sessions with no_transition_notify=true still received events. Drop the event in dispatch() right after the child instance is resolved, before any parent lookup or delivery attempt.
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.
Summary
Add global and per-session controls to suppress transition event notifications
(tmux messages sent to parent sessions when a child changes status).
transition_eventstoggle in[notifications]config (default: true)NoTransitionNotifyfield on Instance for per-session suppression--no-transition-notifyflag onaddandlaunchcommandssession set-transition-notify <id> <on|off>subcommand for runtime controlsyncProfile()andemitHookTransitionCandidates()daemon pathsdispatch()itself to cover deferred/retried events that bypass daemon guardsParent linking is unaffected — only dispatch is suppressed.
Usage
Global (config.toml):
Per-session (at creation):
agent-deck add --no-transition-notify -c claude .Per-session (runtime toggle):
Test plan
go vet ./...passesgo build ./...passes--no-transition-notifysuppresses tmux messagessession set-transition-notify worker off/on, verify behavior changestransition_events = falsein config.toml, verify global suppression