anomalyco / anomalyco/opencode
fix(server): reset session status to idle when async prompt fails
Open
@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
- Start an async prompt that fails (e.g., tool error, provider error)
- Observe session status remains in running/error state
- 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
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.