Repository navigation
Description
Description
The session.processor service does not gracefully handle AbortError from LLM streaming responses. When a stream is interrupted (network timeout, API disconnection, or internal cancellation), the unhandled AbortError propagates up the Effect.js fiber stack and crashes the entire sidecar process, causing the local server to become unreachable.
The UI displays "Failed to fetch" immediately before the disconnect. This is especially easy to trigger during long-running continuous operations (e.g., task loops that send repeated LLM requests), as the probability of hitting a stream interruption increases with runtime.
Log Evidence
Crash code-yeongyu/oh-my-openagent#1 (2026-05-10T000121.log):
ERROR 2026-05-10T00:11:53 +625366ms service=session.processor
session.id=ses_1f0c73b9bffdySyhyhZAER438S
messageID=msg_e0f39e7160024LtypELcfvOn1w
error=Aborted
stack=AbortError: Aborted
at new DOMException (node:internal/per_context/domexception:76:18)
at Array. (.../node-BaTHrJu2.js:284227:27)
at ~effect/Effect/successCont (.../node-BaTHrJu2.js:7884:29)
at ~effect/Effect/evaluate (.../node-BaTHrJu2.js:7898:25)
at FiberImpl.runLoop (.../node-BaTHrJu2.js:7710:112)
at FiberImpl.evaluate (.../node-BaTHrJu2.js:7680:26)
at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
Crash code-yeongyu/oh-my-openagent#2 (2026-05-10T001732.log) — identical signature, different chunk (app auto-updated):
ERROR 2026-05-10T00:26:55 +557849ms service=session.processor
session.id=ses_1f0b86e05ffdAQYUHnFCeObsdm
messageID=msg_e0f479201002JRPaEkprhrEOzo
error=Aborted
stack=AbortError: Aborted
at new DOMException (node:internal/per_context/domexception:76:18)
at Array. (.../node-BTl6fcFc.js:284265:27)
at ~effect/Effect/successCont (.../node-BTl6fcFc.js:7884:29)
at ~effect/Effect/evaluate (.../node-BTl6fcFc.js:7898:25)
at FiberImpl.runLoop (.../node-BTl6fcFc.js:7710:112)
at FiberImpl.evaluate (.../node-BTl6fcFc.js:7680:26)
at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
Plugins
oh-my-openagent 4.0.0
OpenCode version
OpenCode Desktop 1.14.45
Steps to reproduce
- Start a long-running task loop that sends continuous LLM requests with tool calls
- Wait for a stream interruption to occur (network timeout, API-side disconnection, etc.)
- Observe: sidecar process crashes, UI shows "Failed to fetch", local server becomes unreachable
Screenshot and/or share link
No response
Operating System
Windows 11
Terminal
No response
Activity
github-actions commentedon May 10, 2026
This issue might be related to existing issues. Please check if any of these are duplicates or related:
session.processorand orphaned state, though focused on stuck sessions rather than sidecar crashAbortError: Abortedfrom stream interruption on Windows, though triggered by a different code path (glob/file tasks)session.processorerrors during long agent runsIf your issue is distinct from these (e.g., the sidecar process fully exits rather than just erroring), it is worth keeping open as a separate report. It may help to note whether the sidecar process fully terminates or just logs the error and continues.
lb714-bit commentedon May 10, 2026
I've reviewed all three and my issue is distinct:
AbortError, but triggered by glob/file tasks. Mine: triggered by LLM stream interruption during continuous agent loops (repeated API requests). The error path is the same (session.processor→AbortError: Abortedvia Effect.js fiber), but the trigger and severity differ.ECONNRESETduring streaming, process continues. Mine: process does not continue — it fully terminates.the sidecar process fully terminates, not just logs an error. After each crash, the only logs produced are MCP initialization errors from the fresh restart, confirming the process fully died.
The key distinction from all three: in my case the unhandled
AbortErrorinsession.processorcrashes the process outright. The other issues deal with the process surviving but sessions becoming stuck or errored.Model info:
zai-coding-plan / glm-5.1(ZhipuAI GLM-5.1 via OpenAI-compatible API).[-]session.processor crashes sidecar on unhandled AbortError[/-][+][BUG]:session.processor crashes sidecar on unhandled AbortError[/+]lb714-bit commentedon May 11, 2026
Reproduction with Evidence — Confirmed on v1.14.48, Two Different Providers
I'm experiencing the exact same issue on OpenCode Desktop v1.14.48 (Windows 11). I cleared all logs and captured two separate crashes in a clean environment. Both crashes share the identical
AbortErrorstack trace insession.processor, but were triggered via two completely different model providers — confirming this is an OpenCode-side parsing/handling bug, not a provider-specific issue.Crash #1 — Zhipu GLM-5.1 (empty stream response)
Server log (
~/.local/share/opencode/log/2026-05-11T105738.log):ERROR 2026-05-11T11:07:55 +611226ms service=session.processor session.id=ses_1e947a4e3ffeRYMSOvWO4I1giK messageID=msg_e16b8aa9d0014wgPqlh47p7dE8 error=Aborted stack=AbortError: Aborted
main.log(%APPDATA%\@opencode-ai\desktop\logs\main.log):[2026-05-11 19:07:55.851] [warn] sidecar exited { code: 1 }
Message data from OpenCode DB — the API returned completely empty:
{ "message": { "id": "msg_e16b8aa9d0014wgPqlh47p7dE8", "role": "assistant", "modelID": "glm-5.1", "providerID": "zhipuai-coding-plan", "cost": 0, "tokens": { "input": 0, "output": 0, "reasoning": 0 } }, "parts": [] }Zero tokens. Empty parts. The stream opened and closed with no content.
Crash #2 — big-pickle via opencode provider (interrupted mid-stream)
Same session, 16 minutes later, after manual restart and switching to a completely different model and provider.
main.log:[2026-05-11 19:23:44.555] [warn] sidecar exited { code: 1 }
Message data from OpenCode DB — the stream was interrupted mid-generation:
{ "message": { "id": "msg_e16c749eb0017Zx5MIEF92HRfi", "role": "assistant", "modelID": "big-pickle", "providerID": "opencode", "cost": 0, "tokens": { "input": 0, "output": 0, "reasoning": 0 } }, "parts": [ { "type": "reasoning", "text": "Let me gather the context directly..." }, { "type": "text", "text": "" }, { "type": "tool", "tool": "read", "state": { "status": "completed" } }, { "type": "tool", "tool": "glob", "state": { "status": "running" } }, { "type": "tool", "tool": "glob", "state": { "status": "running" } }, { "type": "tool", "tool": "glob", "state": { "status": "pending", "input": {} } } ] }The stream was interrupted mid-generation — two glob tool calls stuck in "running", one stuck in "pending" with empty input. The response never completed.
wo entirely unrelated LLM providers trigger the identical crash. The common factor is OpenCode's session.processor not gracefully handling stream interruptions — whether the stream returns empty or is cut off mid-generation.
The session.processor Effect.js fiber lacks an error boundary for AbortError, so any stream interruption propagates up and kills the entire sidecar process.
Environment
OpenCode Desktop: v1.14.48
OS: Windows 11 (10.0.26200)
Plugin: oh-my-openagent@latest
oh-my-opencode.log
desktop-logs-main.log
opencode-log-2026-05-11T105738.log
fibbery commentedon May 13, 2026
When will this problem be solved? I also encountered the same issue, as soon as the AI reports an error, OpenCode Desktop will crash, but there's no problem using TUI.
UncleXJ commentedon May 15, 2026
Confirmed on v1.15.0 + Windows 11 (with full crash trace)
Still reproducible on OpenCode Desktop v1.15.0 (released 2026-05-15), Windows 11 x64.
Crash Trace
From sidecar log (
share/log/2026-05-15T045357.log):\
ERROR service=session.processor session.id=ses_xxxx messageID=msg_xxxx error=Aborted stack=AbortError: Aborted
at new DOMException (node:internal/per_context/domexception:76:18)
at Array. (node-CDG1DJG7.js:293605:27)
at Generator.next ()
at ~effect/Effect/successCont (node-CDG1DJG7.js:7907:29)
at ~effect/Effect/evaluate (node-CDG1DJG7.js:7921:25)
at FiberImpl.runLoop (node-CDG1DJG7.js:7733:112)
at FiberImpl.evaluate (node-CDG1DJG7.js:7703:26)
\\
Crash Pattern
Timeline from main.log
\
[12:53:55] sidecar started
[12:55:46] sidecar exited { code: 1 } // ~2 min after first request
[12:56:51] sidecar exited { code: 1 } // second crash after auto-restart
\\
Frequency
Crash is not 100% deterministic — some turns complete fine, others trigger the AbortError. Estimated ~30-50% of turns crash. No obvious trigger pattern (not limited to tool calls, long responses, or specific providers).
OMO Interaction
We have \oh-my-openagent\ installed. OMO registers an \uncaughtException\ handler that calls \process.exit(1), which converts the unhandled AbortError into a hard sidecar crash. However, the root cause is OpenCode's \session.processor\ not catching AbortError, not OMO.
Evidence: disabling OMO changes the crash behavior (sidecar may survive but session becomes corrupted), confirming the underlying AbortError is from OpenCode code.
Workaround
None found. The crash happens regardless of:
Suggested Fix
\session.processor\ should catch \AbortError\ gracefully — log the error, clean up the streaming state, and allow the session to continue rather than propagating the exception as unhandled.
WhiteBite commentedon May 17, 2026
Confirming connection leak issue on latest Windows 11 + adding logs
Environment:
Reproduction:
Observed errors from logs:
ERROR service=llm providerID=fireworks-ai error={"name":"AI_APICallError","cause":{"errno":-4079,"code":"ECONNABORTED","syscall":"write"}}
ERROR service=llm providerID=fireworks-ai error={"name":"AI_APICallError","cause":{"errno":-4077,"code":"ECONNRESET"}}
ERROR service=session.processor error=Aborted
Additional symptom:
Brendonovich commentedon May 18, 2026
Thanks for the error logs @lb714-bit, looking into this now
Brendonovich commentedon May 18, 2026
The AbortError being referenced is never thrown, it's only created via
new DOMExpection.This seems to be a windows-only problem since I've seen a similar thing happen on there where the server goes offline, likely related to invalid tool calls instead of this AbortError.
lb714-bit commentedon May 19, 2026
Fair points. The invalid tool call theory sounds plausible — can't confirm or deny that from my end.
That said, OpenCode's web and TUI modes on Windows work fine, so it doesn't seem to be purely a Windows thing.
Ultimately though, regardless of what triggers the interrupt, the real issue is that
halt()produces an error that nothing catches — and that's what crashes the sidecar. The trigger and the crash are separate problems. Even if the root cause gets fixed, the fiber still needs proper error handling to prevent this class of crashes.