Skip to content

fix(quickjs): forward config for skills and PTC tools#554

Open
Luiz Eduardo Zappa (luizzappa) wants to merge 5 commits into
langchain-ai:mainfrom
luizzappa:fix/quickjs-pass-config-to-skills-backend
Open

fix(quickjs): forward config for skills and PTC tools#554
Luiz Eduardo Zappa (luizzappa) wants to merge 5 commits into
langchain-ai:mainfrom
luizzappa:fix/quickjs-pass-config-to-skills-backend

Conversation

@luizzappa

@luizzappa Luiz Eduardo Zappa (luizzappa) commented May 23, 2026

Copy link
Copy Markdown

Summary

Fixes #553.

createCodeInterpreterMiddleware() had two places where the LangGraph runnable config was available but not forwarded:

  • the skillsBackend setup path
  • Programmatic Tool Calling from inside the QuickJS REPL, e.g. await tools.task(...)

In the first case, getCurrentTaskInput() fell back to AsyncLocalStorage, which breaks in browser/web environments where AsyncLocalStorage is unavailable or stubbed.

In the second case, bridged tools were invoked without graph runtime config, which breaks tools that need current graph state, such as DeepAgents’ task tool.

Changes

  • Pass config from the code interpreter tool handler into prepareSkillsForEval()
  • Use getCurrentTaskInput(config) in the quickjs skills backend path
  • Store the active eval tool config on ReplSession
  • Forward that config to PTC tool invocations via t.invoke(rawInput, config)
  • Add coverage proving a PTC tool invoked through tools.* receives the eval config

Why

This allows QuickJS skills and PTC tools to work in browser/web builds and preserves graph runtime context for tools called from inside the interpreter.

@changeset-bot

changeset-bot Bot commented May 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: dc5fec9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
deepagents Patch
@langchain/quickjs Patch
deepagents-acp Patch
@deepagents/evals Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented May 23, 2026

Copy link
Copy Markdown

Open in StackBlitz

deepagents-acp

npm i https://pkg.pr.new/deepagents-acp@554

deepagents

npm i https://pkg.pr.new/deepagents@554

@langchain/sandbox-standard-tests

npm i https://pkg.pr.new/@langchain/sandbox-standard-tests@554

@langchain/daytona

npm i https://pkg.pr.new/@langchain/daytona@554

@langchain/deno

npm i https://pkg.pr.new/@langchain/deno@554

@langchain/modal

npm i https://pkg.pr.new/@langchain/modal@554

@langchain/node-vfs

npm i https://pkg.pr.new/@langchain/node-vfs@554

@langchain/quickjs

npm i https://pkg.pr.new/@langchain/quickjs@554

commit: dc5fec9

@luizzappa Luiz Eduardo Zappa (luizzappa) changed the title fix(quickjs): pass config when preparing skills fix(quickjs): pass config when preparing skills and subagents May 24, 2026
@luizzappa Luiz Eduardo Zappa (luizzappa) changed the title fix(quickjs): pass config when preparing skills and subagents fix(quickjs): forward config for skills and PTC tools May 31, 2026
Comment on lines +644 to +646
setToolConfig(config?: RunnableConfig): void {
this.toolConfig = config;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

FWIW I think this might cause some issues with how we handle parallel eval calling. Its something we have to guard against at the emscripten boundary but if we make enhancements there this becomes problematic. We'll probably be addressing sometime soon so I'll try to keep this top of mind

@bleafman

Copy link
Copy Markdown

Hello! Any blockers to merging this? I just hit this gap when trying to add tools to PTC that have different behavior based on the runtime context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

QuickJS middleware drops LangGraph config for skillsBackend and PTC tool calls

3 participants