Skip to content

Commit 52e291f

Browse files
committed
fix: each tool use indicator now expands and collapses independantly
1 parent 5f179dc commit 52e291f

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/core-ai/AIChatPanel.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,10 @@ define(function (require, exports, module) {
422422

423423
const config = TOOL_CONFIG[toolName] || { icon: "fa-solid fa-gear", color: "#adb9bd", label: toolName };
424424

425+
// Use requestId + toolId to ensure globally unique data-tool-id
426+
const uniqueToolId = (_currentRequestId || "") + "-" + toolId;
425427
const $tool = $(
426-
'<div class="ai-msg ai-msg-tool" data-tool-id="' + toolId + '">' +
428+
'<div class="ai-msg ai-msg-tool" data-tool-id="' + uniqueToolId + '">' +
427429
'<div class="ai-tool-header">' +
428430
'<span class="ai-tool-spinner"></span>' +
429431
'<span class="ai-tool-label"></span>' +
@@ -441,7 +443,8 @@ define(function (require, exports, module) {
441443
* Update an existing tool indicator with details once tool input is known.
442444
*/
443445
function _updateToolIndicator(toolId, toolName, toolInput) {
444-
const $tool = $messages.find('.ai-msg-tool[data-tool-id="' + toolId + '"]');
446+
const uniqueToolId = (_currentRequestId || "") + "-" + toolId;
447+
const $tool = $messages.find('.ai-msg-tool[data-tool-id="' + uniqueToolId + '"]');
445448
if (!$tool.length) {
446449
return;
447450
}

0 commit comments

Comments
 (0)