Skip to content

fix(quickjs): propagate JS task() subagent interrupts#4401

Open
Mason Daugherty (mdrxy) wants to merge 1 commit into
mainfrom
mdrxy/langchain-quickjs/js-task-interrupts
Open

fix(quickjs): propagate JS task() subagent interrupts#4401
Mason Daugherty (mdrxy) wants to merge 1 commit into
mainfrom
mdrxy/langchain-quickjs/js-task-interrupts

Conversation

@mdrxy

@mdrxy Mason Daugherty (mdrxy) commented Jul 1, 2026

Copy link
Copy Markdown
Member

QuickJS exposes a JavaScript task() helper so an eval can fan out work to Deep Agents subagents, but that helper was not quite equivalent to the normal task tool path. When a JS-launched subagent hit HITL, the nested GraphInterrupt was caught and rendered as an eval error instead of reaching LangGraph’s normal interrupt machinery; the bridge also skipped the parent runtime config and child tool call id when invoking the underlying task tool.

Changes

  • Preserve the parent ToolRuntime.config and pass a synthetic child tool_call_id when call_subagent_task_tool invokes the Deep Agents task tool. This keeps subagent dispatch closer to the normal ToolNode path, including config-driven behavior such as thread/run metadata and runtime context propagation.
  • Let GraphInterrupt bubble through both the subagent helper and the QuickJS task() bridge. Other validation/runtime failures are still wrapped as eval errors, but LangGraph interrupts remain control-flow signals rather than being converted into <error type="GraphInterrupt">....

@github-actions github-actions Bot added fix A bug fix (PATCH) internal User is a member of the `langchain-ai` GitHub organization quickjs QuickJS sandbox partner package size: S 50-199 LOC labels Jul 1, 2026
@mdrxy Mason Daugherty (mdrxy) changed the title fix(langchain-quickjs): propagate JS task() subagent interrupts fix(quickjs): propagate JS task() subagent interrupts Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix A bug fix (PATCH) internal User is a member of the `langchain-ai` GitHub organization quickjs QuickJS sandbox partner package size: S 50-199 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant