Skip to content

run --session hangs when the model uses the question tool on an externally created session #44556

Closed

Description

@gitRasheed

Description

opencode run denies the question and plan tools only for sessions it creates. Resuming a session created through the HTTP API skips those rules, leaving the question tool available. If the model calls it, the server waits without a timeout and the run never returns. --auto only handles permission events, not question events.

Plugins

none

OpenCode version

1.18.21 (also present on current dev)

Steps to reproduce

  1. Start a server: opencode serve
  2. Create a session over HTTP: curl -s -X POST "$OPENCODE_URL/session" -H 'content-type: application/json' -d '{}'
  3. opencode run --auto --session <id> "use the question tool to ask me something"
  4. The command hangs until killed. The same prompt without --session exits 0 with "I don't have a question tool available".

Screenshot and/or share link

No response

Operating System

Linux (WSL2, Ubuntu)

Terminal

bash

Activity

  1. github-actions commented on Aug 24, 2026

    @github-actions
    Contributor

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

  2. gitRasheed commented on Aug 24, 2026

    @gitRasheed
    ContributorAuthor

    Not a duplicate. #11899 added the deny rules at session create; the --session/--continue/--fork paths just never apply them, so HTTP-created sessions slip through. #44559 extends that fix to those paths.

  3. neriousy commented on Oct 19, 2026

    @neriousy
    Member

    This is fixed in v2: non-interactive opencode run cancels question requests for the session it is running, including resumed sessions, and tells the model to continue without an answer instead of waiting for input. Upgrade with npm i -g @opencode/cli@latest. If you still see this on v2, please open a new issue with the details.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions