Latest in AI
Migrating Deep Agents code mode to langchain-quickjs 0.4.0
Plan a langchain-quickjs 0.4.0 migration around JavaScript state resets, backend file access and tool updates that now reach graph state.
A code-mode upgrade can change an agent's behavior without changing its prompt. That is the migration problem in langchain-quickjs 0.4.0: old JavaScript state no longer restores, while tool calls that previously dropped state updates now apply them.
The package powers a JavaScript interpreter for Deep Agents. Its November 19 release adds optional backend file access and changes the underlying QuickJS runtime. Existing threads created with 0.3.x start with a fresh JavaScript context on their next evaluation.
For a reporting agent that reads project files, builds a summary and saves a plan, those changes deserve a staged migration rather than a routine dependency bump.
Separate JavaScript memory from application state
Start with an inventory of what your agent needs to finish an interrupted task. A JavaScript variable, a graph-state field and a file in the agent's backend are different places to store information.
The announced compatibility break concerns saved JavaScript state. Do not turn that into an assumption that every graph checkpoint or backend file disappears. Equally, do not assume that preserving a conversation means preserving its interpreter variables.
For the reporting example, store the input filenames and the requested output location in durable application state. Reconstruct temporary totals from those inputs. Make that reconstruction an explicit step rather than relying on a variable from yesterday's evaluation.
Choose the persistence you actually need
The tagged package README describes three persistence modes: thread, the default, retains interpreter state across turns; turn retains it within a turn; call starts fresh for each evaluation. LangGraph thread IDs separate interpreter runtimes.
Choose based on the workflow, not convenience. A one-shot document transformation should not need a long-lived JavaScript session. An interactive analysis may benefit from one, but its recovery path should still work without it.
Before rollout, propose two acceptance cases: resume an older conversation and start a new one with the same inputs. Compare the generated report and saved plan, not just whether both runs return text. Keep the old environment available while investigating differences.
Enable files as a separate decision
Version 0.4.0 introduces opt-in fs=True for using the agent's backend from code mode. This is access to the agent's files, not a promise of a complete Node.js environment.
The filesystem implementation change documents an asynchronous, text-only surface. Alongside reading, it supports writing, listing, checking paths and removing files. Synchronous methods, stat, glob, appendFile and module loading are not part of that surface. Directory listing rejects unsupported options such as recursive rather than silently accepting them.
For a first migration, give the reporting workflow a disposable backend containing sample inputs. Keep generated output in a separate directory and leave real customer files out of the pilot. Review which backend is connected before treating a successful file operation as evidence of correct configuration.
Do not port a Node script by changing its imports and hoping for compatibility. List the filesystem operations it uses, then map each one to the supported interface or redesign that step.
Review tools that return Command
The most consequential behavioral change is easy to miss. Tool calls made through code now apply supported Command updates to graph state, and later calls within that evaluation can see the updated values.
The state-update implementation also sets limits: routing directives such as goto, graph and resume are unsupported through this path. Message handling differs from a normal standalone tool call. Two writes in one evaluation to a single-value-per-step state key can still cause an InvalidUpdateError at the end of the step.
Audit the reporting agent's save-plan tool before upgrading. If earlier code added a second write to compensate for a missing update, investigate whether that workaround should be removed. Prefer one deliberate update to each such field within an evaluation. Verify the resulting graph state rather than trusting the tool's success message alone.
Put deadlines around the whole operation
The README's default five-second timeout bounds JavaScript execution, not wall-clock time spent awaiting tools. An external lookup needs its own deadline and failure handling.
Make the rollout checklist explicit: fresh context recovery, expected backend, supported file operations, correct state updates and bounded external calls. Promote only when those checks match the reporting workflow's requirements. A clean package installation is not the acceptance criterion.
Turn technical changes into useful guidance
I'm Paras. I work at the intersection of AI, engineering and distribution.
I help AI teams turn runtime changes, migration details and developer workflows into technical writing and product stories people can use.