fix(advanced): close the code interpreter REPL at exit (0.16 line) - #1100
Merged
radu-mocanu merged 1 commit intoSep 18, 2026
Merged
radu-mocanu merged 1 commit into
radu-mocanu merged 1 commit into
Conversation
… can terminate langchain-quickjs 0.3.7 closes its QuickJS contexts from __del__ by blocking on its daemon worker thread. At interpreter finalization that thread no longer runs, so any process that built the middleware hangs on exit and the robot never learns the job suspended or finished. Bumps to 0.16.21 so CD publishes on merge. (cherry picked from commit 456bc38)
There was a problem hiding this comment.
🟢 Approval recommended
The change is narrowly scoped, adds explicit regression coverage for the new behavior, and aligns the release version bumps consistently.
Pull request overview
This PR backports a fix to the 0.16 release line to ensure advanced-agent processes using the code interpreter can terminate cleanly (so runs don’t stay “Running” forever), and bumps the package version for release publishing.
Changes:
- Register the code interpreter REPL registry cleanup via
atexitto avoid hangs caused by upstream__del__behavior during interpreter finalization. - Add a unit test asserting the
atexit.register(...)hook is installed by the middleware factory. - Bump
uipath-langchainversion to0.16.21in bothpyproject.tomlanduv.lock.
File summaries
| File | Description |
|---|---|
src/uipath_langchain/agent/advanced/code_interpreter.py |
Registers REPL registry closure via atexit when building the code interpreter middleware. |
tests/agent/advanced/test_code_interpreter.py |
Adds a test to verify the REPL registry close method is registered with atexit. |
pyproject.toml |
Version bump to 0.16.21 for release. |
uv.lock |
Lockfile version update to 0.16.21 for release consistency. |
Review details
- Files reviewed: 3/4 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
radu-mocanu
enabled auto-merge (squash)
September 18, 2026 10:34
robert-ursu
approved these changes
Sep 18, 2026
andreibalas-uipath
approved these changes
Sep 18, 2026
|
radu-mocanu
disabled auto-merge
September 18, 2026 10:39
radu-mocanu
merged commit Sep 18, 2026
c9498c2
into
release/uipath-langchain-0.16.16
17 of 18 checks passed
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
Why
cherry-pick of #1099 onto
release/uipath-langchain-0.16.16, whose tip is the 0.16.20 pinned by the s202 payload. langchain-quickjs 0.3.7 closes its QuickJS contexts from__del__by blocking on its daemon worker thread, which no longer runs at interpreter finalization, so the process hangs on exit and the robot never learns the job suspended or finished. Only the version lines conflicted, the code and test hunks applied unchanged.Verified on this branch:
tests/agent/advanced/test_code_interpreter.py36 passed with langchain-quickjs 0.3.7 resolved (the version carrying the__del__behaviour), ruff and mypy clean.