You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tui: worker terminate races in-flight RPC and current-swap; thread-mode closed promise never resolves #401
packages/opencode/src/cli/tui/worker-process.ts:154-161,196,253-272: terminate() sets stopping, disconnect(), kill(SIGTERM), awaits exited - but if terminate runs between launch() and exited registration while current was swapped to a replacement after a crash, disconnect/kill hits the stale child and the new child stays orphaned. The thread path createThreadWorker.terminate (:272) is sync worker.terminate() with no await and signal is a no-op: tui.ts:261 await worker.terminate() returns immediately while the thread is still flushing Rpc.emit("global.event"), and the closed promise (resolved only via worker.onerror) never resolves in thread mode, leaking the onExit error toast.
Repro: crash the worker then immediately Ctrl-C; two current processes, closed hangs, onExit not called in thread mode. Fix size: small (capture childToKill=current before swap; await both exited and the thread terminate promise; make the signal no-op explicit).
Activity
fix(tui): settle thread-worker closed promise and await terminate flu…
fix(tui): settle thread-worker closed promise and await terminate flu…
fix(tui): settle thread-worker closed promise and await terminate flu…