Skip to content

fix(advanced): warm the code interpreter before its first eval deadline (0.16 line) - #1102

Merged
radu-mocanu merged 2 commits into
release/uipath-langchain-0.16.16from
hotfix/uipath-langchain-0.16.22
Sep 21, 2026
Merged

radu-mocanu merged 2 commits into
release/uipath-langchain-0.16.16from
hotfix/uipath-langchain-0.16.22

Conversation

@radu-mocanu

@radu-mocanu radu-mocanu commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • compile the code interpreter's WebAssembly modules when the advanced agent graph is built, outside the per-eval deadline
  • expose warm_code_interpreter() so a host that preloads modules at process start can run the compile earlier

Why

quickjs_rs compiles its source transform module lazily inside the first eval, under the same 5 s deadline as user code. On a CPU-starved instance the compile alone exceeds the deadline, so the first advanced run on a fresh process fails at its first model call with interrupted, and a retry on the same process succeeds. Cherry-pick of #1101, released as 0.16.22.

Copilot AI lite review requested due to automatic review settings September 18, 2026 16:22

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.

🔵 Needs a closer look

Startup initialization failures should be wrapped before approval.

Pull request overview

Pre-warms QuickJS WebAssembly modules before the first advanced-agent evaluation to prevent cold-start deadline failures.

Changes:

  • Added cached interpreter warm-up and import-time preload support.
  • Added warm-up and preload tests.
  • Bumped the package version to 0.16.22.
File summaries
File Summary
uv.lock Synchronizes the locked package version.
tests/agent/advanced/test_code_interpreter.py Tests warm-up and preload behavior.
src/uipath_langchain/agent/advanced/code_interpreter.py Implements cached WASM warm-up. Moderate finding (1 vote): wrap startup initialization failures as structured AgentStartupErrors.
src/uipath_langchain/agent/advanced/code_interpreter_preload.py Provides import-time preloading.
src/uipath_langchain/agent/advanced/__init__.py Exports the warm-up function.
pyproject.toml Updates the package version.
Review details

Suppressed comments (1)

src/uipath_langchain/agent/advanced/code_interpreter.py:257

  • Because this now runs during agent/graph startup, a missing or corrupt _transform.wasm can make transform_source raise a raw third-party TransformError/RuntimeError (and Runtime can likewise raise QuickJSError). The agent startup paths use structured AgentStartupErrors; please catch and chain these initialization failures so a low-level dependency exception does not escape to the host.
    transform_source(
        "warmup.js", "const x = 1;", flags=SourceTransform.TOP_LEVEL_CONST_TO_VAR
    )
  • Files reviewed: 5/6 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.

quickjs_rs compiles its source transform WebAssembly module lazily, inside
the first eval of the process, under the same per-call deadline as user
code. On a CPU-starved instance the compile alone outlasts the deadline, so
the first advanced run on a fresh process fails at its first model call
with "interrupted" and a retry on the same process succeeds. Compile it
when the graph is built instead, and expose the warm-up so a host that
preloads modules at process start can run it earlier.

Claude-Session: https://claude.ai/code/session_013CLJG6q56YoHrgNTgm3pA3
(cherry picked from commit 8fd0a1c)
@radu-mocanu
radu-mocanu force-pushed the hotfix/uipath-langchain-0.16.22 branch from 54913d6 to 9659ea6 Compare September 20, 2026 14:43
@sonarqubecloud

Copy link
Copy Markdown

@radu-mocanu
radu-mocanu merged commit acdc173 into release/uipath-langchain-0.16.16 Sep 21, 2026
17 checks passed
@radu-mocanu
radu-mocanu deleted the hotfix/uipath-langchain-0.16.22 branch September 21, 2026 06:32
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.

3 participants