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 }}
This repository was archived by the owner on May 24, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on May 24, 2026. It is now read-only.
App freezes and crashes under heavy parallel session load #336
When running many CLI sessions in parallel (5+), the app progressively freezes and eventually becomes unresponsive.
Root Causes
1. Render flood overwhelms WebKit
Each parallel session fires OnStateChanged on every SDK event (tool start, phase change, turn start). With N sessions doing tool calls, the WebView's WebContent process gets starved — macOS logs show hundreds of WebProcess::updateFreezerStatus: isFreezable=1, error=-1 errors.
High-frequency event paths that trigger re-renders:
ToolExecutionStartEvent → phase change to Working
AssistantTurnStartEvent → phase change to Thinking
ServerManager.StartServerAsync and StopServer never dispose Process objects. OS handles accumulate across reconnect cycles. The SDK's StartCliServerAsync also leaks — crash log shows 468+ "No process is associated" unobserved exceptions from accessing Process.HasExited on GC'd handles.
3. Connection reset cascade
Under heavy load, the persistent copilot server drops connections (414 "Connection reset by peer" entries in crash log). Amplified by process handle exhaustion.
Evidence from crash.log
468 × No process is associated with this object (process leak)
414 × Connection reset by peer (server overwhelm)
241 × updateFreezerStatus in macOS system logs (WebKit freeze)
Fix
Coalesce high-frequency OnStateChanged events with 150ms timer
Dispose Process handles in ServerManager and DevTunnelService
Problem
When running many CLI sessions in parallel (5+), the app progressively freezes and eventually becomes unresponsive.
Root Causes
1. Render flood overwhelms WebKit
Each parallel session fires
OnStateChangedon every SDK event (tool start, phase change, turn start). With N sessions doing tool calls, the WebView's WebContent process gets starved — macOS logs show hundreds ofWebProcess::updateFreezerStatus: isFreezable=1, error=-1errors.High-frequency event paths that trigger re-renders:
ToolExecutionStartEvent→ phase change to WorkingAssistantTurnStartEvent→ phase change to ThinkingToolExecutionCompleteEvent→ permission denial checkWsBridgeClient.OnStateChanged→ remote session sync2. Process handle leaks
ServerManager.StartServerAsyncandStopServernever dispose Process objects. OS handles accumulate across reconnect cycles. The SDK'sStartCliServerAsyncalso leaks — crash log shows 468+ "No process is associated" unobserved exceptions from accessingProcess.HasExitedon GC'd handles.3. Connection reset cascade
Under heavy load, the persistent copilot server drops connections (414 "Connection reset by peer" entries in crash log). Amplified by process handle exhaustion.
Evidence from crash.log
No process is associated with this object(process leak)Connection reset by peer(server overwhelm)updateFreezerStatusin macOS system logs (WebKit freeze)Fix
OnStateChangedevents with 150ms timer