Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.
JavaScript aianthropiccross-platformgeminigroqlinuxmacosnvidiaopen-sourceopenaiparakeetspeech-to-texttranscribewhisperwindows
fix: separate tool displayText from LLM data, truncate web search results
Gabriel Steinc6b402f13af8
diff --git a/src/components/AgentOverlay.tsx b/src/components/AgentOverlay.tsxindex 516f9a1e5..f5554dedc 100644--- a/src/components/AgentOverlay.tsx+++ b/src/components/AgentOverlay.tsx@@ -142,11 +142,16 @@ export default function AgentOverlay() {const executeToolCall = registry? async (name: string, argsJson: string) => {const tool = registry.get(name);- if (!tool) return `Unknown tool: ${name}`;+ if (!tool)+ return { data: `Unknown tool: ${name}`, displayText: `Unknown tool: ${name}` };const args = JSON.parse(argsJson);const result = await tool.execute(args);- if (!result.success) return result.displayText;- return typeof result.data === "string" ? result.data : JSON.stringify(result.data);+ const data = result.success+ ? typeof result.data === "string"+ ? result.data+ : JSON.stringify(result.data)+ : result.displayText;+ return { data, displayText: result.displayText };}: undefined;diff --git a/src/services/ReasoningService.ts b/src/services/ReasoningService.tsindex f704baf22..2a8801ad1 100644--- a/src/services/ReasoningService.ts+++ b/src/services/ReasoningService.ts@@ -1435,7 +1435,10 @@ class ReasoningService extends BaseReasoningService {config: {systemPrompt: string;tools?: Array<{ name: string; description: string; parameters: Record<string, unknown> }>;- executeToolCall?: (name: string, args: string) => Promise<string>;+ executeToolCall?: (+ name: string,+ args: string+ ) => Promise<{ data: string; displayText: string }>;}): AsyncGenerator<AgentStreamChunk, void, unknown> {const maxSteps = config.tools?.length ? ReasoningService.MAX_TOOL_STEPS : 1;@@ -1469,17 +1472,18 @@ class ReasoningService extends BaseReasoningService {}for (const call of pendingToolCalls) {- let toolResult: string;+ let toolResult: { data: string; displayText: string };try {toolResult = await config.executeToolCall(call.name, call.arguments);} catch (error) {- toolResult = `Error: ${(error as Error).message}`;+ const errMsg = `Error: ${(error as Error).message}`;+ toolResult = { data: errMsg, displayText: errMsg };}yield {type: "tool_result",callId: call.id,toolName: call.name,- displayText: toolResult,+ displayText: toolResult.displayText,};currentMessages = [@@ -1502,7 +1506,7 @@ class ReasoningService extends BaseReasoningService {type: "tool-result",toolCallId: call.id,toolName: call.name,- output: { type: "text", value: toolResult },+ output: { type: "text", value: toolResult.data },},],},diff --git a/src/services/tools/webSearchTool.ts b/src/services/tools/webSearchTool.tsindex 42db80cca..a6454367b 100644--- a/src/services/tools/webSearchTool.ts+++ b/src/services/tools/webSearchTool.ts@@ -26,7 +26,18 @@ export const webSearchTool: ToolDefinition = {const numResults = typeof args.numResults === "number" ? args.numResults : 5;try {- const results = await window.electronAPI.agentWebSearch!(query, numResults);+ const raw = await window.electronAPI.agentWebSearch!(query, numResults);++ const results = Array.isArray(raw?.results)+ ? raw.results.map(+ (r: { title?: string; url?: string; text?: string; publishedDate?: string }) => ({+ title: r.title || "",+ url: r.url || "",+ text: r.text ? r.text.slice(0, 500) : "",+ publishedDate: r.publishedDate || null,+ })+ )+ : raw;return {success: true,