Skip to content

[BUG]: Rename dialog loses focus when subagents spawn #14799

Closed

Description

@cwalternicolas

Description

When using /rename to rename a session while the agent is actively working, the rename dialog loses focus if subagents spawn. The user has to press Esc and run /rename again to continue typing.

The root cause is a reactive createEffect in packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx that calls input.focus() on the main prompt whenever the visible prop re-evaluates. Since visible depends on session()?.parentID, permissions(), and questions() — all of which can change when subagents spawn via SSE events — the effect fires and steals focus from the rename dialog's textarea.

Steps to reproduce

  1. Start a session and send a prompt that triggers subagent spawning
  2. While the agent is working, type /rename to open the rename dialog
  3. Observe that focus is stolen from the rename dialog when a subagent spawns
  4. The rename input becomes unresponsive until you press Esc and /rename again

Operating System

macOS (not OS-specific, affects all platforms)

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Feb 23, 2026
  2. github-actions commented on Apr 25, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions