Skip to content

tui worker swallows ALL unhandledRejection/uncaughtException (defects never surface; RPC hangs look like freezes) #396

Closed

Description

@mdev34-lab

Severity: high | global review pass P3.

packages/opencode/src/cli/tui/worker.ts:14-16,115-116: onUnhandledRejection = (_e)=>{} and onUncaughtException = (_e)=>{} are registered for the worker's lifetime. Any defect from Server.listen, Rpc.handleRequest, GlobalBus projection or BackgroundJob never reaches logging, never rejects an RPC call, and never triggers the worker-process crash-restart (isCrash only checks signal/code). The main thread sees an RPC hang / frozen footer instead of rpc.error.

Repro: throw inside any rpc.server handler or leave a rejected promise in an EventV2 listener: the worker stays alive, client.call(...) never settles, the TUI freezes with no toast. Fix size: small (log + Rpc.emit("worker.error") + rethrow/exit for true defects).

Metadata

Metadata

Assignees

No one assigned

    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