[PR #554] fix(quickjs): forward config for skills and PTC tools #556

Open
opened 2026-06-05 17:23:44 -04:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/deepagentsjs/pull/554
Author: @luizzappa
Created: 5/23/2026
Status: 🔄 Open

Base: mainHead: fix/quickjs-pass-config-to-skills-backend


📝 Commits (5)

  • 2ec7147 fix(quickjs): pass config when preparing skills
  • 2ddb3ed chore: add changeset
  • 9fff43a fix(deepagents): pass config when creating task tool
  • c81f834 chore(): changeset for deepagents
  • dc5fec9 fix(quickjs): forward config to PTC tools

📊 Changes

6 files changed (+78 additions, -4 deletions)

View changed files

.changeset/rare-buses-switch.md (+5 -0)
.changeset/strict-ads-smell.md (+5 -0)
📝 libs/deepagents/src/middleware/subagents.ts (+1 -1)
📝 libs/providers/quickjs/src/middleware.test.ts (+45 -0)
📝 libs/providers/quickjs/src/middleware.ts (+10 -2)
📝 libs/providers/quickjs/src/session.ts (+12 -1)

📄 Description

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/deepagentsjs/pull/554 **Author:** [@luizzappa](https://github.com/luizzappa) **Created:** 5/23/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/quickjs-pass-config-to-skills-backend` --- ### 📝 Commits (5) - [`2ec7147`](https://github.com/langchain-ai/deepagentsjs/commit/2ec7147bceabfd0500e5640143dafb65daca8505) fix(quickjs): pass config when preparing skills - [`2ddb3ed`](https://github.com/langchain-ai/deepagentsjs/commit/2ddb3edadd6cb04de1a791b04625cf1a13e61a69) chore: add changeset - [`9fff43a`](https://github.com/langchain-ai/deepagentsjs/commit/9fff43a41e704dd46f8f6b99f70236c2439af9e0) fix(deepagents): pass config when creating task tool - [`c81f834`](https://github.com/langchain-ai/deepagentsjs/commit/c81f8345e4cc3d6f95826f5c22ec1dfe3a01ad3f) chore(): changeset for deepagents - [`dc5fec9`](https://github.com/langchain-ai/deepagentsjs/commit/dc5fec942b59bc16bc1bf3ce6c003c762651958b) fix(quickjs): forward config to PTC tools ### 📊 Changes **6 files changed** (+78 additions, -4 deletions) <details> <summary>View changed files</summary> ➕ `.changeset/rare-buses-switch.md` (+5 -0) ➕ `.changeset/strict-ads-smell.md` (+5 -0) 📝 `libs/deepagents/src/middleware/subagents.ts` (+1 -1) 📝 `libs/providers/quickjs/src/middleware.test.ts` (+45 -0) 📝 `libs/providers/quickjs/src/middleware.ts` (+10 -2) 📝 `libs/providers/quickjs/src/session.ts` (+12 -1) </details> ### 📄 Description ## 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-06-05 17:23:44 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/deepagentsjs#556