Skip to content

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

Merged
radu-mocanu merged 1 commit into
mainfrom
fix/code-interpreter-warmup
Sep 21, 2026
Merged

radu-mocanu merged 1 commit into
mainfrom
fix/code-interpreter-warmup

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.

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

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 implementation and optional-extra behavior are covered by focused tests, with no blocking issues identified.

Pull request overview

Warms QuickJS WebAssembly modules before code-interpreter evaluations to avoid first-call deadline failures.

Changes:

  • Adds cached interpreter warm-up during middleware construction.
  • Adds an import-time preload module.
  • Adds tests for warm-up, optional dependency handling, and preload behavior.
File summaries
File Description
src/uipath_langchain/agent/advanced/code_interpreter.py Implements cached WebAssembly warm-up.
src/uipath_langchain/agent/advanced/code_interpreter_preload.py Runs warm-up during module import.
src/uipath_langchain/agent/advanced/__init__.py Exports the warm-up function.
tests/agent/advanced/test_code_interpreter.py Tests warm-up and preload behavior.
Review details
  • Files reviewed: 4/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.

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
@radu-mocanu
radu-mocanu force-pushed the fix/code-interpreter-warmup branch from 75e1200 to 8fd0a1c Compare September 20, 2026 14:41
@sonarqubecloud

Copy link
Copy Markdown

@radu-mocanu
radu-mocanu merged commit d1afb98 into main Sep 21, 2026
95 of 110 checks passed
@radu-mocanu
radu-mocanu deleted the fix/code-interpreter-warmup 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