Skip to content

Conversation

@IanShaw027
Copy link

@IanShaw027 IanShaw027 commented Feb 5, 2026

Fixes #12240

Summary

Fix orphaned process cleanup on macOS that was causing white screen issues due to memory accumulation.

Problem

The previous implementation used killall opencode-cli which doesn't match the actual process name (opencode). This caused:

  • Orphaned processes accumulating across app restarts
  • Memory leak (observed 5 opencode processes consuming 1.3GB RAM)
  • WebView white screen when system memory pressure kills the render process

Solution

  • Use pkill -f to match processes by full path instead of process name
  • Clean up all three process types: opencode, openwrk, openwork-server

Changes

  • packages/desktop/src-tauri/src/lib.rs: Replace killall opencode-cli with pkill -f commands for all OpenWork processes

The previous implementation used `killall opencode-cli` which doesn't match
the actual process name. The binary is named `opencode`, not `opencode-cli`.

This caused orphaned processes to accumulate across app restarts, leading to:
- Memory leak (observed 5 opencode processes consuming 1.3GB RAM)
- WebView white screen when system memory pressure kills the render process

Changes:
- Use `pkill -f` to match processes by full path instead of process name
- Clean up all three process types: opencode, openwrk, openwork-server
- Add comments explaining the purpose of the cleanup
@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found one potentially related PR:

Related PR:

The searches consistently returned only PR #12238 (the current PR), which suggests there are no other open PRs directly addressing macOS orphaned process cleanup or the specific pkill migration mentioned in this fix.

@Brendonovich
Copy link
Collaborator

The CLI process is definitely called opencode-cli, not quite sure what this PR is addressing? Your changes also reference OpenWork which isn't relevant here.
image

@IanShaw027 IanShaw027 closed this Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

macOS desktop app white screen due to orphaned process accumulation

2 participants