The OpenCode bridge (plugins/opencode-tmux-agent-indicator.js) reacts to lifecycle events from every session, including sub-agents spawned by the task tool. Each sub-agent runs in its own child session and fires session.idle, so while the main agent is still working, every sub-agent that finishes flashes the window to the done color.
Sub-agent sessions are identifiable: Session.parentID is set, and session.idle/session.status/session.error carry sessionID (and permission.updated's payload has sessionID). Filtering out sessions whose parentID is set fixes it.
Separately, the handler keys on a permission.asked event that doesn't exist in the SDK (the documented events are permission.updated/permission.replied), so that branch is dead. Driving needs-input from the permission.ask hook + the question tool is higher-signal.
The OpenCode bridge (
plugins/opencode-tmux-agent-indicator.js) reacts to lifecycle events from every session, including sub-agents spawned by thetasktool. Each sub-agent runs in its own child session and firessession.idle, so while the main agent is still working, every sub-agent that finishes flashes the window to thedonecolor.Sub-agent sessions are identifiable:
Session.parentIDis set, andsession.idle/session.status/session.errorcarrysessionID(andpermission.updated's payload hassessionID). Filtering out sessions whoseparentIDis set fixes it.Separately, the handler keys on a
permission.askedevent that doesn't exist in the SDK (the documented events arepermission.updated/permission.replied), so that branch is dead. Drivingneeds-inputfrom thepermission.askhook + thequestiontool is higher-signal.