Skip notifications for child and subagent sessions - #3
Merged
Conversation
OpenCode child sessions emit idle, error, permission, and question events the user never sees. Track parentID from session.created / session.updated and stay silent unless notifySubagents is true.
2 tasks
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.
Problem
When a parent agent launches a Task/subagent, OpenCode creates a child session (
Session.parentID). That child emitssession.statusbusy/idle,session.idle, errors, permissions, and questions. The plugin treated every session the same and poppedopencode idle(and request/error/question) for work the user never sees in the UI.Approach
session.created/session.updatedwheninfo.parentIDis a non-empty string (createTracked, forget onsession.deleted).notifySubagentsoption defaults tofalse(skip). Settrueto restore today's child behavior.Tests
bun run typecheckpassbun test— 93 pass, 0 failChild idle/error/request/question stay silent; parent still notifies; flag true restores child idle; unknown session still notifies; created-after-busy and created-after-asked stay silent once we learn the session is a child.