Multitask Strategy Does Not Work in /runs/wait for Langgraph JS #171

Open
opened 2026-02-15 17:16:42 -05:00 by yindo · 0 comments
Owner

Originally created by @jasontjahjono on GitHub (Feb 13, 2025).

Here's my code with the 'rollback' multitask strategy:

async function createRun(threadId: string, assistantId: string, message: string, configurable: any) {
  const response = await fetch(
    `http://localhost:2024/threads/${threadId}/runs/wait`,
    {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({
        assistant_id: assistantId,
        input: {
          messages: [new HumanMessage(message)],
        },
        multitask_strategy: 'rollback',
        config: {
          configurable: {
            ...configurable,
            recursionLimit: 10,
          },
        },
      }),
    },
  );
  return await response.json();
}

I then created 3 of these runs (using createRun) 3 times 0.5s between each run, but none of it got interrupted. Why is this?

Image

How do I fix this? I want to create a system such that every time a run gets interrupted, the input from the interrupted run gets appended to the interruptor run. Example: run 1, input A -> gets interrupted by run 2, input B -> expected: run 2 with input A\nB

Originally created by @jasontjahjono on GitHub (Feb 13, 2025). Here's my code with the 'rollback' multitask strategy: ``` async function createRun(threadId: string, assistantId: string, message: string, configurable: any) { const response = await fetch( `http://localhost:2024/threads/${threadId}/runs/wait`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ assistant_id: assistantId, input: { messages: [new HumanMessage(message)], }, multitask_strategy: 'rollback', config: { configurable: { ...configurable, recursionLimit: 10, }, }, }), }, ); return await response.json(); } ``` I then created 3 of these runs (using `createRun`) 3 times 0.5s between each run, but none of it got interrupted. Why is this? <img width="969" alt="Image" src="https://github.com/user-attachments/assets/de729c33-e6e6-4aff-8beb-257e8318c83f" /> How do I fix this? I want to create a system such that every time a run gets interrupted, the input from the **interrupted** run gets appended to the **interruptor** run. Example: run 1, input A -> gets interrupted by run 2, input B -> expected: run 2 with input A\nB
yindo added the bug label 2026-02-15 17:16:42 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#171