Skip to content

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

@CommanderCrowCode

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

Metadata

Metadata

Assignees

Labels

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

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions