Skip to content

Skip notifications for child and subagent sessions - #3

Merged
gabparrot merged 1 commit into
mainfrom
skip-subagent-notify
Aug 22, 2026
Merged

Skip notifications for child and subagent sessions#3
gabparrot merged 1 commit into
mainfrom
skip-subagent-notify

Conversation

@gabparrot

Copy link
Copy Markdown
Owner

Problem

When a parent agent launches a Task/subagent, OpenCode creates a child session (Session.parentID). That child emits session.status busy/idle, session.idle, errors, permissions, and questions. The plugin treated every session the same and popped opencode idle (and request/error/question) for work the user never sees in the UI.

Approach

  • Track child session IDs from session.created / session.updated when info.parentID is a non-empty string (createTracked, forget on session.deleted).
  • New notifySubagents option defaults to false (skip). Set true to restore today's child behavior.
  • Fail open: if we have not yet seen created/updated for a session, treat it as visible.
  • Child busy / user-message / error do not pollute parent turn state. Parent idle still notifies when the parent finishes.
  • Permission/question on a child is skipped when the flag is false (no approve exception).

Tests

  • bun run typecheck pass
  • bun test — 93 pass, 0 fail

Child 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.

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.
@gabparrot
gabparrot merged commit f7dfd6a into main Aug 22, 2026
2 checks passed
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