diff --git a/web/src/components/Shell.jsx b/web/src/components/Shell.jsx index 5667fba..70b2df8 100644 --- a/web/src/components/Shell.jsx +++ b/web/src/components/Shell.jsx @@ -204,7 +204,7 @@ export default function Shell({ api }) { const tabsRef = useRef({}) const nextIdRef = useRef(1) const settingsRef = useRef({ fontSize: 12, fontFamily: "'JetBrains Mono', 'Fira Code', monospace", theme: 'default' }) - const activeTabRef = useRef(activeTab) + const activeTabRef = useRef(null) const pendingCommandsRef = useRef({}) useEffect(() => { activeTabRef.current = activeTab }, [activeTab]) diff --git a/web/src/components/Studio.jsx b/web/src/components/Studio.jsx index c35e2a1..f49a53b 100644 --- a/web/src/components/Studio.jsx +++ b/web/src/components/Studio.jsx @@ -197,7 +197,7 @@ function FeedItem({ msg }) { ) } - const cleanContent = displayContent.replace(/]*>[\s\S]*?<\/think>/gi, '') + let cleanContent = displayContent.replace(/]*>[\s\S]*?<\/think>/gi, '') return (
@@ -532,6 +532,8 @@ export default function Studio({ api }) { if (event && event.tool_call) { toolCalls = [...toolCalls, { call: event.tool_call, result: null }] setStreamToolCalls([...toolCalls]) + accumulated = '' + setStreaming('') return } if (event && event.tool_result) { @@ -558,6 +560,11 @@ export default function Studio({ api }) { aiMsg.content = JSON.stringify({ content: finalContent, tool_calls: toolCalls.map(tc => tc.call), + tool_results: toolCalls.map(tc => ({ + tool_call_id: tc.call?.tool_call_id, + result: tc.result?.content || '', + is_error: tc.result?.is_error || false, + })), }) } setMessages(prev => [...prev, aiMsg])