Skip to content

Pending permission/question prompts not displayed when attaching to an existing session #21154

Closed as duplicate

Description

@jtubbenhauer

Description

When attaching a TUI client to an already-running session (via opencode attach), any pending permission or question prompts that were raised while the client was detached are not displayed. The session appears stuck in a "busy" state with no way for the user to respond.

Expected behavior:
On attach, pending permission and question prompts should appear in the UI so the user can respond to them.

Actual behavior:
The session shows as busy but no prompt is rendered. The bootstrap() function in the TUI sync context fetches sessions, messages, config, etc., but never calls GET /permission or GET /question to load pending requests into the store. These are only populated via real-time SSE events (permission.asked, question.asked), which are ephemeral BusEvents — if no client was connected when they fired, they're lost.

Root cause:
packages/opencode/src/cli/cmd/tui/context/sync.tsx — the bootstrap() non-blocking phase does not call sdk.client.permission.list() or sdk.client.question.list(). The server endpoints exist and return the correct pending items, but the TUI never queries them on startup.

Note

This is distinct from #15172, which covers questions lost after a server restart (in-memory state destroyed). This bug occurs with a running server — the pending state is alive in memory, the TUI client just doesn't fetch it on connect.

Steps to reproduce

  1. Start opencode in server mode (opencode serve)
  2. Attach to a session and send a prompt that triggers a permission request (e.g. a bash command)
  3. Detach the TUI before responding to the permission prompt
  4. Re-attach to the same session via opencode attach
  5. The permission prompt is not shown — the session appears stuck

Operating System

Linux

Terminal

Any

Activity

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

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Please review those issues and consider whether this should be linked or closed as a duplicate.

  3. jtubbenhauer commented on Apr 6, 2026

    @jtubbenhauer
    Author

    This would be solved by #13657

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