fix(botui): Send TOOL_EXEC (id=6) via WebSocket for direct tool invocation
Some checks failed
BotUI CI / build (push) Failing after 51m11s
Some checks failed
BotUI CI / build (push) Failing after 51m11s
This commit is contained in:
parent
45f56f0f6e
commit
4c5f93fc71
1 changed files with 11 additions and 8 deletions
|
|
@ -1041,14 +1041,17 @@
|
|||
console.log("Parsed action:", action);
|
||||
|
||||
if (action.type === "invoke_tool") {
|
||||
// Check if tool needs parameters
|
||||
if (action.prompt_for_params) {
|
||||
// Need parameters, send text as message
|
||||
window.sendMessage(sugg.text);
|
||||
} else {
|
||||
// No params needed - invoke tool directly
|
||||
window.sendMessage("/tool " + action.tool);
|
||||
}
|
||||
// Invoke tool directly via WebSocket - invisible to user
|
||||
ws.send(JSON.stringify({
|
||||
bot_id: currentBotId,
|
||||
user_id: currentUserId,
|
||||
session_id: currentSessionId,
|
||||
channel: "web",
|
||||
content: action.tool,
|
||||
message_type: 6, // TOOL_EXEC
|
||||
timestamp: new Date().toISOString(),
|
||||
}));
|
||||
return;
|
||||
} else if (action.type === "send_message") {
|
||||
window.sendMessage(
|
||||
action.message || sugg.text,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue