Skip to content

Commit 802de11

Browse files
authored
fix runtool empty message (#4911)
* fix runtool empty message * del unused code * fix
1 parent b4ecfb0 commit 802de11

File tree

1 file changed

+4
-5
lines changed
  • packages/service/core/workflow/dispatch/agent/runTool

1 file changed

+4
-5
lines changed

packages/service/core/workflow/dispatch/agent/runTool/index.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ export const dispatchRunTools = async (props: DispatchToolModuleProps): Promise<
8686
});
8787

8888
// Check interactive entry
89-
const interactiveResponse = lastInteractive;
9089
props.node.isEntry = false;
9190
const hasReadFilesTool = toolNodes.some(
9291
(item) => item.flowNodeType === FlowNodeTypeEnum.readFiles
@@ -143,7 +142,7 @@ export const dispatchRunTools = async (props: DispatchToolModuleProps): Promise<
143142
})
144143
}
145144
];
146-
if (interactiveResponse) {
145+
if (lastInteractive && isEntry) {
147146
return value.slice(0, -2);
148147
}
149148
return value;
@@ -183,7 +182,7 @@ export const dispatchRunTools = async (props: DispatchToolModuleProps): Promise<
183182
toolModel,
184183
maxRunToolTimes: 30,
185184
messages: adaptMessages,
186-
interactiveEntryToolParams: interactiveResponse?.toolParams
185+
interactiveEntryToolParams: lastInteractive?.toolParams
187186
});
188187
}
189188
if (toolModel.functionCall) {
@@ -194,7 +193,7 @@ export const dispatchRunTools = async (props: DispatchToolModuleProps): Promise<
194193
toolNodes,
195194
toolModel,
196195
messages: adaptMessages,
197-
interactiveEntryToolParams: interactiveResponse?.toolParams
196+
interactiveEntryToolParams: lastInteractive?.toolParams
198197
});
199198
}
200199

@@ -224,7 +223,7 @@ export const dispatchRunTools = async (props: DispatchToolModuleProps): Promise<
224223
toolNodes,
225224
toolModel,
226225
messages: adaptMessages,
227-
interactiveEntryToolParams: interactiveResponse?.toolParams
226+
interactiveEntryToolParams: lastInteractive?.toolParams
228227
});
229228
})();
230229

0 commit comments

Comments
 (0)