fix(open-interpreter): terminate disconnected stream workers - #2818
Open
tang-vu wants to merge 1 commit into
Open
fix(open-interpreter): terminate disconnected stream workers#2818tang-vu wants to merge 1 commit into
tang-vu wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
kill()if the child ignores the bounded termination waitWhy this matters
POST /chat/streamstarts a Python worker for every stream. When a browser, proxy, or client disconnects after receiving a chunk, Starlette closes the generator, but the old implementation only removed the runner file and left the worker alive. Repeated disconnects could accumulate interpreter processes, CPU/memory use, and in-flight model work until the optional service became unhealthy.Overlap check
Searched open and closed upstream PRs for
open interpreter stream subprocess cleanup,open-interpreter,disconnect, and the changed production fileextensions/library/services/open-interpreter/server.py. PR #403 hardened authentication and container execution but does not manage streaming child lifecycles. No open or closed PR covers disconnect cleanup.Test plan
python -m pytest -q ods/extensions/library/services/open-interpreter/tests/test_server.py(3 passed)python -m py_compile ods/extensions/library/services/open-interpreter/server.pyThe regression tests exercise the stream generator boundary: closing after the first SSE event terminates the live worker and removes the runner; normal completion does not terminate an exited worker; an unresponsive worker is killed.
Generated with Codex.