koishi-plugin-chatluna 1.4.0-alpha.21 → 1.4.0-alpha.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -321,7 +321,7 @@ async function executeTools(actions, toolMap, config, signal, handleParsingError
|
|
|
321
321
|
if (tool == null) {
|
|
322
322
|
return {
|
|
323
323
|
action,
|
|
324
|
-
observation: `${action.tool} is not a valid tool
|
|
324
|
+
observation: `${action.tool} is not a valid tool. Try another tool. If this happens repeatedly, stop the task and tell the user you cannot call these tools right now.`
|
|
325
325
|
};
|
|
326
326
|
}
|
|
327
327
|
const mask = config?.configurable?.["toolMask"] ?? config?.configurable?.["subagentContext"]?.["toolMask"];
|
|
@@ -329,14 +329,14 @@ async function executeTools(actions, toolMap, config, signal, handleParsingError
|
|
|
329
329
|
const allowed = Object.values(toolMap).map((item) => item.name).filter((name) => applyToolMask(name, mask));
|
|
330
330
|
return {
|
|
331
331
|
action,
|
|
332
|
-
observation: `Tool '${action.tool}' is not allowed for the current agent. Available tools: ${allowed.join(", ")}
|
|
332
|
+
observation: `Tool '${action.tool}' is not allowed for the current agent. Available tools: ${allowed.join(", ")}. Try another tool, and test whether it can be called first. If this happens repeatedly, stop the task and tell the user you cannot call these tools right now.`
|
|
333
333
|
};
|
|
334
334
|
}
|
|
335
335
|
const callMask = config?.configurable?.["toolMask"]?.toolCallMask ?? config?.configurable?.["subagentContext"]?.["toolMask"]?.toolCallMask;
|
|
336
336
|
if (callMask && !applyToolMask(action.tool, callMask)) {
|
|
337
337
|
return {
|
|
338
338
|
action,
|
|
339
|
-
observation: `You do not have permission to call tool '${action.tool}'. Try another tool.`
|
|
339
|
+
observation: `You do not have permission to call tool '${action.tool}'. Try another tool, and test whether it can be called first. If this happens repeatedly, stop the task and tell the user you cannot call these tools right now.`
|
|
340
340
|
};
|
|
341
341
|
}
|
|
342
342
|
try {
|
|
@@ -300,7 +300,7 @@ async function executeTools(actions, toolMap, config, signal, handleParsingError
|
|
|
300
300
|
if (tool == null) {
|
|
301
301
|
return {
|
|
302
302
|
action,
|
|
303
|
-
observation: `${action.tool} is not a valid tool
|
|
303
|
+
observation: `${action.tool} is not a valid tool. Try another tool. If this happens repeatedly, stop the task and tell the user you cannot call these tools right now.`
|
|
304
304
|
};
|
|
305
305
|
}
|
|
306
306
|
const mask = config?.configurable?.["toolMask"] ?? config?.configurable?.["subagentContext"]?.["toolMask"];
|
|
@@ -308,14 +308,14 @@ async function executeTools(actions, toolMap, config, signal, handleParsingError
|
|
|
308
308
|
const allowed = Object.values(toolMap).map((item) => item.name).filter((name) => applyToolMask(name, mask));
|
|
309
309
|
return {
|
|
310
310
|
action,
|
|
311
|
-
observation: `Tool '${action.tool}' is not allowed for the current agent. Available tools: ${allowed.join(", ")}
|
|
311
|
+
observation: `Tool '${action.tool}' is not allowed for the current agent. Available tools: ${allowed.join(", ")}. Try another tool, and test whether it can be called first. If this happens repeatedly, stop the task and tell the user you cannot call these tools right now.`
|
|
312
312
|
};
|
|
313
313
|
}
|
|
314
314
|
const callMask = config?.configurable?.["toolMask"]?.toolCallMask ?? config?.configurable?.["subagentContext"]?.["toolMask"]?.toolCallMask;
|
|
315
315
|
if (callMask && !applyToolMask(action.tool, callMask)) {
|
|
316
316
|
return {
|
|
317
317
|
action,
|
|
318
|
-
observation: `You do not have permission to call tool '${action.tool}'. Try another tool.`
|
|
318
|
+
observation: `You do not have permission to call tool '${action.tool}'. Try another tool, and test whether it can be called first. If this happens repeatedly, stop the task and tell the user you cannot call these tools right now.`
|
|
319
319
|
};
|
|
320
320
|
}
|
|
321
321
|
try {
|