Skip to content

prompt_async does not wake idle sessions (noReply: false returns 204 but no assistant turn) #21524

Closed as not planned

Description

@CommanderCrowCode

Summary

POST /session/{id}/prompt_async with noReply: false returns HTTP 204 but does not reliably trigger a new assistant turn when the session is idle. The message is accepted at the HTTP layer but the orchestration loop does not engage.

Steps to Reproduce

  1. Start an OpenCode session, let it complete its current task and go idle (waiting for user input)
  2. POST to /session/{sessionID}/prompt_async with:
    {"noReply": false, "parts": [{"type": "text", "text": "Please respond to this message."}]}
  3. Observe: HTTP 204 returned, but the session stays idle. No assistant response is generated.
  4. Manually type into the session → the injected message appears in history but was never acted on.

Expected Behavior

With noReply: false, the injected prompt should trigger a new assistant turn, just as if the user had typed it.

Context

We're building a multi-agent messaging system (relay-mesh) where agents running in different OpenCode sessions communicate via MCP tools. When Agent A sends a message to Agent B, we use prompt_async to notify B. This works when B is actively working (mid-tool-call), but fails when B is idle.

The behavior is intermittent — sometimes the session does wake up, sometimes it doesn't. This suggests a race condition in the session state machine rather than a fundamental design limitation.

Related Issues

Environment

  • OpenCode v1.3.17
  • Linux (Ubuntu 24.04)
  • Multiple concurrent sessions via shared OpenCode server

Activity

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

    @github-actions
    Contributor

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

  3. OverHash commented on Apr 14, 2026

    @OverHash

    Hi! I'm also experiencing this.

    Image

    In my case, I send the third user message, which then triggers a chain of assistant messages. However, once the assistant is done, I send a new message immediately (no session.idle is triggered).

    Unfortunately, it looks like OC transitions from there to the idle session state, and so the assistant never responds to my latest message (at the bottom). As a result, my bottom message has no action taken.

    To be clear, my chain is finish:"stop" (on the assistant message to my first user message) -> promptAsync second turn -> session.idle -> no parent message.updated.

  4. removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  5. github-actions commented on Jul 3, 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.

  6. Ghilteras commented on Jul 27, 2026

    @Ghilteras

    Why this bug is closed as not planned?

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