Skip to content

fix(opencode): add SIGKILL fallback to Process.stop()#36559

Open
beowulfof wants to merge 1 commit into
anomalyco:devfrom
beowulfof:stop-escalation
Open

fix(opencode): add SIGKILL fallback to Process.stop()#36559
beowulfof wants to merge 1 commit into
anomalyco:devfrom
beowulfof:stop-escalation

Conversation

@beowulfof

@beowulfof beowulfof commented Jul 12, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #36558

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Process.stop() in packages/opencode/src/util/process.ts only sent proc.kill() (SIGTERM) with no timeout or SIGKILL fallback. When an LSP server ignores SIGTERM (e.g. rust-analyzer, clangd), the process remains as a zombie — no escalation to SIGKILL ever happens.

The abort handler in Process.spawn() (same file, line 74) already had the correct pattern: SIGTERM → 5s timeout → SIGKILL. stop() was simply missing this escalation chain.

The fix wraps the existing proc.kill("SIGTERM") with a race between the process exit event and a 5-second timer that escalates to SIGKILL. The SDK copy (packages/sdk/js/src/process.ts) is updated to stay in sync.

How did you verify your code works?

  • bun typecheck: 30/30 tasks, all pass
  • bun test test/util/process.test.ts: 10/10 tests pass

Screenshots / recordings

N/A

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Jul 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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.

Process.stop() lacks SIGKILL fallback — LSP processes become zombies

1 participant