Skip to content

Primary agent responds in subagent view; delegated subagent views become inaccessible #4422

@ndrwstn

Description

@ndrwstn

Description

When switching to a subagent view by clicking on a delegated subagent in the right-hand panel, the text input box remains active and accepts user input. However, the primary agent (as selected by the 'tab' key) responds within the subagent's view instead of the subagent itself.

This creates two critical issues:

  1. Unexpected interaction behavior: Users expect to engage with the subagent when typing in a subagent view, but the primary agent responds instead, making it unclear which agent's context is being used
  2. Inaccessible subagent views: When the primary agent delegates a new task while in a subagent's view, the newly created subagent view becomes completely inaccessible

This prevents proper debugging of subagent behavior and makes it impossible to review their tool calls, responses, or interact with them directly in complex agent workflows.

OpenCode version

v1.0.67 (issue likely persists in v1.0.68)

Steps to reproduce

  1. Start an OpenCode session with the primary agent
  2. Have the primary agent delegate a task to a subagent (e.g., using the task tool)
  3. Click on the subagent entry in the right-hand panel to switch to its view
  4. Type a message in the text input box while viewing the subagent
  5. Observe that the primary agent responds in the subagent's view instead of the subagent
  6. While still in the subagent view, have the primary agent delegate another task
  7. Observe that the newly created subagent view is now inaccessible

Expected behavior

  • When viewing a subagent, user input should engage with that specific subagent
  • OR the text input should be disabled/hidden when viewing a subagent to prevent confusion
  • All delegated subagent views should remain accessible regardless of which view the delegation occurred from
  • Clear visual indication of which agent is currently active for user input

Actual behavior

  • Primary agent responds in the subagent's view
  • Unclear which agent's context receives user messages
  • Newly delegated subagent views become inaccessible when delegation happens from within another subagent's view

Screenshot and/or share link

[Will be provided if requested - issue is reproducible with any agent workflow involving subagent delegation]

Operating System

macOS 26.1 (arm64, nix-darwin)

Terminal

Ghostty v1.1.2

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersopentuiThis relates to changes in v1.0, now that opencode uses opentui

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions