Bug: openwork-server.exe processes not terminated after closing window, causing memory accumulation on Windows
Environment
| Item |
Details |
| OS |
Windows 10 (19045) |
| OpenWork version |
Installed 2025-02-04 |
| Install path |
C:\Program Files\OpenWork\ (~375 MB) |
| Workspace |
Starter (local) |
Problem
Every time a new session/tab is opened in OpenWork, a new openwork-server.exe process is spawned. However, when the corresponding UI window/tab is closed, the server process does not exit — it keeps running in the background and listening on its assigned port. Over time, these zombie processes accumulate, causing:
- Continuous memory growth (each instance consumes ~100–137 MB)
- In a single day, 4 processes accumulated, totaling ~476 MB of wasted memory
- Overall system slowdown and degraded OpenWork performance
Steps to Reproduce
- Start OpenWork
- Observe
openwork-server.exe process (tasklist | findstr openwork-server), note the PID
- Close the OpenWork main window
- Check processes again —
openwork-server.exe is still running
- Repeat open/close cycles — each time a new server process is added
Observed Behavior
PID Memory Started Port
18232 ~137 MB 08:15 8787
25976 ~100 MB 15:05 50769
15316 ~117 MB 15:07 51467
16716 ~112 MB 15:22 57375
All 4 processes point to the same workspace (workspaces\starter), each using a different token and port. Old instances are never reused or cleaned up.
Expected Behavior
- When the OpenWork window/tab is closed, the corresponding
openwork-server.exe process should exit.
- Alternatively, implement a singleton pattern: detect existing server instances and reuse them rather than spawning new ones each time.
- At minimum, clean up stale processes for the same workspace before starting a new instance.
Additional Findings
-
Audit log confirms no reuse — audit.jsonl shows a different tokenHash on each launch, confirming each session creates a brand-new server instance with no reuse mechanism.
-
owpenbot WhatsApp bridge stuck in reconnect loop — owpenbot.log shows WebSocket connection to wss://web.whatsapp.com/ws/chat failing, retrying 11 times with increasing backoff, then giving up. After exhaustion, it logs "failed to reach opencode health". This bridge has been non-functional since 2025-02-05. This may also contribute to startup latency.
-
MCP config uses @latest — The default workspace config uses npx -y chrome-devtools-mcp@latest and npx -y n8n-mcp@latest, which checks npm for the latest version on every launch, adding unnecessary startup delay.
Suggested Fixes
- Implement proper process lifecycle management — terminate
openwork-server.exe when the associated window closes
- Consider a singleton/shared server model to avoid redundant processes for the same workspace
- Add cleanup logic on app startup to kill orphaned server processes from previous sessions
- Pin MCP dependency versions instead of using
@latest to reduce startup time
Bug:
openwork-server.exeprocesses not terminated after closing window, causing memory accumulation on WindowsEnvironment
C:\Program Files\OpenWork\(~375 MB)Problem
Every time a new session/tab is opened in OpenWork, a new
openwork-server.exeprocess is spawned. However, when the corresponding UI window/tab is closed, the server process does not exit — it keeps running in the background and listening on its assigned port. Over time, these zombie processes accumulate, causing:Steps to Reproduce
openwork-server.exeprocess (tasklist | findstr openwork-server), note the PIDopenwork-server.exeis still runningObserved Behavior
All 4 processes point to the same workspace (
workspaces\starter), each using a different token and port. Old instances are never reused or cleaned up.Expected Behavior
openwork-server.exeprocess should exit.Additional Findings
Audit log confirms no reuse —
audit.jsonlshows a differenttokenHashon each launch, confirming each session creates a brand-new server instance with no reuse mechanism.owpenbot WhatsApp bridge stuck in reconnect loop —
owpenbot.logshows WebSocket connection towss://web.whatsapp.com/ws/chatfailing, retrying 11 times with increasing backoff, then giving up. After exhaustion, it logs"failed to reach opencode health". This bridge has been non-functional since 2025-02-05. This may also contribute to startup latency.MCP config uses
@latest— The default workspace config usesnpx -y chrome-devtools-mcp@latestandnpx -y n8n-mcp@latest, which checks npm for the latest version on every launch, adding unnecessary startup delay.Suggested Fixes
openwork-server.exewhen the associated window closes@latestto reduce startup time