anomalyco / anomalyco/opencode

fix(server): reset session status to idle when async prompt fails

Open
#45,610 1 comment 0 reactions 1 assignee View on GitHub

@rekram1-node is already working on this.

Since Aug 27, 2026.

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

Description

Description

When an async prompt fails, the session status remains stuck in a running state instead of being reset to idle.

Reproduction Steps

  1. Start an async prompt that fails (e.g., tool error, provider error)
  2. Observe session status remains in running/error state
  3. Session never returns to idle

Expected Behavior

Session status should be reset to idle when async prompt fails, allowing new prompts to be sent.

Actual Behavior

Session status stuck, blocking new prompts.

System Info

  • OS: Linux/macOS/Windows
  • opencode version: dev

Fix

Add yield* statusSvc.set(ctx.params.sessionID, { type: "idle" }).pipe(Effect.ignore) in the error handler of the async prompt handler.

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.