Skip to content

SSE client disconnects and never reconnects — UI goes blank #207

@neocody

Description

@neocody

Summary

CodeNomad UI goes completely blank/white intermittently. All workspace instances show "Instance Disconnected". Requires manually closing tabs or restarting the app to recover.

Environment

  • CodeNomad: 0.11.5-dev-20260228-482313f6 (also reproduced on stable 0.11.4)
  • OpenCode: 1.2.18
  • macOS: 15.7.4 (24G517), MacBookPro18,4 ARM64

Root Cause (from debug log)

The Electron renderer's SSE connection to the CodeNomad backend drops and never auto-reconnects:

Line 16:     {"level":20,"component":"sse","clientId":1,"msg":"SSE client connected"}
Line 179747: {"level":20,"component":"sse","clientId":1,"msg":"SSE client disconnected"}

After the disconnect:

  • The backend continues running normally — workspace events keep publishing, plugin pongs continue, OpenCode serve processes stay alive
  • But no new SSE client connects — there is no reconnection logic
  • The UI receives no more events and goes blank

Evidence

  • Only 1 SSE client connected for the entire session (clientId: 1)
  • After disconnect, ~18,815 more log lines of workspace events published to nobody
  • Zero errors/warnings in the log (all level 20 = DEBUG) — the disconnect is silent
  • No crash report generated — the backend doesn't crash, it just loses its UI listener
  • Separately, an EXC_BREAKPOINT (SIGTRAP) crash was observed in the Electron renderer's V8 garbage collector (CppHeap::CollectGarbageInYoungGenerationForTesting), which may be triggering the SSE disconnect

Related Crash Report

A macOS crash report was generated for CodeNomad Helper (Renderer):

Exception: EXC_BREAKPOINT (SIGTRAP)
Termination: Trace/BPT trap: 5
Faulting thread: 0
Stack: Electron Framework → CppHeap::CollectGarbageInYoungGenerationForTesting
       → TraceTraitFromInnerAddressImpl::GetTraceDescriptor
       → v8::PropertyDescriptor::set() const
       → v8::Value::IsFunction() const

Expected Behavior

  • SSE client should auto-reconnect on disconnect with exponential backoff
  • UI should show a "reconnecting..." indicator instead of going blank
  • If reconnection fails after retries, UI should prompt to reload rather than staying blank

Steps to Reproduce

  1. Open CodeNomad with multiple workspace tabs (3-5)
  2. Use normally for an extended session
  3. Eventually the UI goes blank across all tabs
  4. Debug log shows SSE client disconnect with no reconnection attempt

Debug Log

Available on request (512KB, 198K lines, captured with --debug flag).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions