anomalyco / anomalyco/opencode

prompt_async on a busy session persists the message but never schedules a turn

Open
#46,842 1 comment 0 reactions 1 assignee View on GitHub

@nexxeln is already working on this.

Since Sep 2, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

When POST /session/:id/prompt_async lands while the session's runner state is Running, the user message is persisted but its turn never runs.

promptAsync (server/routes/instance/httpapi/handlers/session.ts) forks prompt() and returns 204 immediately. prompt() (session/prompt.ts) persists the user message, then calls loop()ensureRunning() (effect/runner.ts), which on Running returns awaitDone(st.run.done) — the forked fiber waits for the existing run and returns its result, so the new message's runLoop never executes.

Observed in production over a week of programmatic use: async prompts sent during long agentic turns are persisted (visible via GET /session/:id/message) but never answered, unless the running loop happens to re-read messages between tool rounds and absorbs them.

Plugins

None (core server behavior).

OpenCode version

dev as of 2026-09-02 (verified against source; observed on v1.18.x)

Steps to reproduce
  1. Start a long agentic turn on a session (sync prompt is fine).
  2. While it runs, POST /session/:id/prompt_async the same session.
  3. The endpoint returns 204 and the user message is persisted.
  4. When the turn ends, no reply is generated for the async message.
Screenshot and/or share link

n/a — transcript state: async user message present, no assistant response after it, session idle.

Operating System

Linux

Terminal

n/a (server API)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.