anomalyco / anomalyco/opencode
prompt_async on a busy session persists the message but never schedules a turn
@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
- Start a long agentic turn on a session (sync prompt is fine).
- While it runs,
POST /session/:id/prompt_asyncthe same session. - The endpoint returns 204 and the user message is persisted.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.