Skip to content

[BUG]:session.processor crashes sidecar on unhandled AbortError #26667

Closed

Description

@lb714-bit

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

  1. Start a long-running task loop that sends continuous LLM requests with tool calls
  2. Wait for a stream interruption to occur (network timeout, API-side disconnection, etc.)
  3. 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

  1. github-actions commented on May 10, 2026

    @github-actions
    Contributor

    This issue might be related to existing issues. Please check if any of these are duplicates or related:

    If 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.

  2. lb714-bit commented on May 10, 2026

    @lb714-bit
    Author

    I've reviewed all three and my issue is distinct:

    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 AbortError in session.processor crashes 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).

  3. changed the title [-]session.processor crashes sidecar on unhandled AbortError[/-] [+][BUG]:session.processor crashes sidecar on unhandled AbortError[/+] on May 10, 2026
  4. lb714-bit commented on May 11, 2026

    @lb714-bit
    Author

    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 AbortError stack trace in session.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

  5. fibbery commented on May 13, 2026

    @fibbery

    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.

  6. UncleXJ commented on May 15, 2026

    @UncleXJ

    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

    • Sidecar starts normally, serves requests
    • After completing a conversation turn (LLM response + tool calls), the \session.processor\ throws an unhandled \AbortError\
    • Sidecar exits with code 1
    • OpenCode auto-restarts sidecar, but all in-progress context is lost

    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:

    • OpenCode version (tested v1.14.50, v1.14.51, v1.15.0)
    • OMO version (tested v4.0.0, v4.1.2)
    • Provider or model

    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.

  7. WhiteBite commented on May 17, 2026

    @WhiteBite

    Confirming connection leak issue on latest Windows 11 + adding logs
    Environment:

    • Windows 11 24H2 (10.0.26200)
    • OpenCode Desktop 1.14.41
    • Using Fireworks AI API (minimax-m2p7, kimi-k2p6)
    • 15 MCP servers configured (mix of local stdio + remote)
    • No proxy (direct connection)
      Reproduction:
    • Happens multiple times per day (5+ times today)
    • Triggers on: file glob tasks, MCP tool calls, LLM streaming responses
    • Not only after git commit — also on regular file operations
      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:
    • Desktop UI freezes completely
    • Lost connection to local server (Sisyphus can't reach CLI)
    • Need to fully kill all opencode processes and restart
    • Empty log files (0 bytes) appear during crash
  8. Brendonovich commented on May 18, 2026

    @Brendonovich
    Member

    Thanks for the error logs @lb714-bit, looking into this now

  9. Brendonovich commented on May 18, 2026

    @Brendonovich
    Member

    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.

    Image
  10. lb714-bit commented on May 19, 2026

    @lb714-bit
    Author

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions