fix: Send tool display text instead of internal ID when clicking tools
All checks were successful
BotUI CI / build (push) Successful in 5m42s

Fixed issue where clicking a tool button sent the internal ID (e.g., "03-missa")
instead of the display text (e.g., " Agendar Missa") to the chat.

The bug was in chat.html where invoke_tool actions were sending action.tool
(the internal ID) instead of sugg.text (the user-friendly display text).

Now tool buttons work correctly on the first click without sending internal IDs.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Rodrigo Rodriguez 2026-02-16 00:04:37 +00:00
parent f0aba607e9
commit a8bff4e1a7

View file

@ -794,8 +794,9 @@
console.log("Parsed action:", action); console.log("Parsed action:", action);
if (action.type === "invoke_tool") { if (action.type === "invoke_tool") {
// Send the tool name as text - the backend will handle tool invocation // Send the display text so it shows correctly in chat
window.sendMessage(action.tool); // The backend will recognize this as a tool request
window.sendMessage(sugg.text);
} else if (action.type === "send_message") { } else if (action.type === "send_message") {
window.sendMessage(action.message || sugg.text); window.sendMessage(action.message || sugg.text);
} else if (action.type === "select_context") { } else if (action.type === "select_context") {