fix: position of queen tool bubble

This commit is contained in:
Richard Tang
2026-04-08 18:21:13 -07:00
parent fa0518b249
commit 4c900e9ab2
2 changed files with 9 additions and 3 deletions
+1
View File
@@ -267,6 +267,7 @@ export type EventTypeName =
| "node_action_plan"
| "llm_text_delta"
| "llm_reasoning_delta"
| "llm_turn_complete"
| "tool_call_started"
| "tool_call_completed"
| "client_output_delta"
+8 -3
View File
@@ -33,7 +33,7 @@ export default function QueenDM() {
{ id: string; prompt: string; options?: string[] }[] | null
>(null);
const [awaitingInput, setAwaitingInput] = useState(false);
const [activeToolCalls, setActiveToolCalls] = useState<Record<string, { name: string; done: boolean }>>({});
const [, setActiveToolCalls] = useState<Record<string, { name: string; done: boolean }>>({});
const turnCounterRef = useRef(0);
const queenIterTextRef = useRef<Record<string, Record<number, string>>>({});
@@ -124,6 +124,11 @@ export default function QueenDM() {
setIsStreaming(false);
break;
case "llm_turn_complete":
turnCounterRef.current++;
setActiveToolCalls({});
break;
case "client_output_delta":
case "llm_text_delta": {
const chatMsg = sseEventToChatMessage(event, "queen-dm", queenName, turnCounterRef.current);
@@ -215,7 +220,7 @@ export default function QueenDM() {
setActiveToolCalls((prev) => {
const newActive = { ...prev, [toolUseId]: { name: toolName, done: false } };
const tools = Object.entries(newActive).map(([id, t]) => ({ name: t.name, done: t.done }));
const tools = Object.entries(newActive).map(([, t]) => ({ name: t.name, done: t.done }));
const allDone = tools.length > 0 && tools.every((t) => t.done);
const msgId = `tool-pill-${sid}-${execId}-${turnCounterRef.current}`;
const toolMsg: ChatMessage = {
@@ -253,7 +258,7 @@ export default function QueenDM() {
if (updated[toolUseId]) {
updated[toolUseId] = { ...updated[toolUseId], done: true };
}
const tools = Object.entries(updated).map(([id, t]) => ({ name: t.name, done: t.done }));
const tools = Object.entries(updated).map(([, t]) => ({ name: t.name, done: t.done }));
const allDone = tools.length > 0 && tools.every((t) => t.done);
const msgId = `tool-pill-${sid}-${execId}-${turnCounterRef.current}`;
const toolMsg: ChatMessage = {