Skip to content

fix(advanced): close the code interpreter REPL at exit (0.16 line) - #1100

Merged
radu-mocanu merged 1 commit into
release/uipath-langchain-0.16.16from
hotfix/uipath-langchain-0.16.21
Sep 18, 2026
Merged

radu-mocanu merged 1 commit into
release/uipath-langchain-0.16.16from
hotfix/uipath-langchain-0.16.21

Conversation

@radu-mocanu

Copy link
Copy Markdown
Collaborator

Summary

  • an advanced agent process with the code interpreter enabled now exits when its run is over, so the job is reported as suspended instead of staying in Running forever
  • releases the 0.16 line as 0.16.21 (pyproject + uv.lock) so CD publishes on merge

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.py 36 passed with langchain-quickjs 0.3.7 resolved (the version carrying the __del__ behaviour), ruff and mypy clean.

… 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)
Copilot AI lite review requested due to automatic review settings September 18, 2026 10:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 atexit to 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-langchain version to 0.16.21 in both pyproject.toml and uv.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
radu-mocanu enabled auto-merge (squash) September 18, 2026 10:34
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
75.0% Coverage on New Code (required ≥ 90%)

See analysis details on SonarQube Cloud

@radu-mocanu
radu-mocanu merged commit c9498c2 into release/uipath-langchain-0.16.16 Sep 18, 2026
17 of 18 checks passed
@radu-mocanu
radu-mocanu deleted the hotfix/uipath-langchain-0.16.21 branch September 18, 2026 10:39
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.

4 participants