Skip to content

OpenCode plugin: sub-agent sessions flash the main window state #5

@Adamkadaban

Description

@Adamkadaban

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions