GeezerVison is showing github.com — fix(pty): pty session handle leak by kikuchan · Pull Request #15599 · anomalyco/opencode
Conversation
kikuchan
commented
Mar 1, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Issue for this PR
Closes #15592
Type of change
- Bug fix
- New feature
- Refactor / code improvement
- Documentation
What does this PR do?
Ensure to call session.process.kill() on ptyProcess.onExit to clean up PTY sessions properly.
How did you verify your code works?
(edited) Added an automated test for the issue.
static analysis, and dynamic analysis by hands with `console.log`.
Before the patch:
onExit() -> publish Exited event -> state().delete(id) -> cannot remove() anymore.
After the patch:
onExit() -> publish Exited event -> session.process.kill() -> publish Delete event
Note:
onExit() and remove() are called twice at most, so I have to move state().delete(id) to above and add session.info.status === 'exited' check.
Checklist
- I have tested my changes locally
- I have not included unrelated changes in this PR
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Mte90 reacted with thumbs up emoji
|
The following comment was made by an LLM, it may be inaccurate:
Based on my search, I found one potentially related PR:
The other results (PRs #12718 and #12877) are older signal handler PRs that address orphaned processes but appear to be different approaches.
PR #13186 is the most relevant as it deals with the same core issue: ensuring proper cleanup of processes to prevent memory leaks and zombie processes.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Rwanbt
pushed a commit
to Rwanbt/unifia
that referenced
this pull request
May 5, 2026
AIALRA-0
pushed a commit
to AIALRA-0/opencode-turn-engine
that referenced
this pull request
Jun 10, 2026
Reviewers
Hona
Hona approved these changes
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
PTY handle leaks
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.