Rewoo example wrong array destructure in toolExecution? #69

Closed
opened 2026-02-15 17:15:22 -05:00 by yindo · 1 comment
Owner

Originally created by @maciejNisztuk on GitHub (Aug 20, 2024).

In the Rewoo example code in the toolExecution function in the line:
const [, stepName, tool, , toolInputTemplate] = state.steps[_step - 1];
the toolInputTemplate variable is assigned the entire matching string, not the tool input. I think the line should look like this:
const [, stepName, tool, toolInputTemplate] = state.steps[_step - 1];

Originally created by @maciejNisztuk on GitHub (Aug 20, 2024). In the Rewoo example code in the toolExecution function in the line: ` const [, stepName, tool, , toolInputTemplate] = state.steps[_step - 1]; ` the toolInputTemplate variable is assigned the entire matching string, not the tool input. I think the line should look like this: `const [, stepName, tool, toolInputTemplate] = state.steps[_step - 1]; `
yindo closed this issue 2026-02-15 17:15:22 -05:00
Author
Owner

@bracesproul commented on GitHub (Aug 22, 2024):

Thank you for flagging this! I just checked and you're correct. It looks like reason it worked before is the last element in the array it was extracting included the tool input, but also had extra content which was irrelevant. This change should harden the graph for future runs.

PR here

@bracesproul commented on GitHub (Aug 22, 2024): Thank you for flagging this! I just checked and you're correct. It looks like reason it worked before is the last element in the array it was extracting included the tool input, but also had extra content which was irrelevant. This change should harden the graph for future runs. [PR here](https://github.com/langchain-ai/langgraphjs/pull/345)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#69