The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
fix(timeline): handle missing tool call arguments gracefully
Steven Enamakel5ba989683288
diff --git a/app/src/utils/toolTimelineFormatting.ts b/app/src/utils/toolTimelineFormatting.tsindex 8d792a1d7e..4a10750bad 100644--- a/app/src/utils/toolTimelineFormatting.ts+++ b/app/src/utils/toolTimelineFormatting.ts@@ -13,6 +13,10 @@ interface ParsedToolArgs {query?: string;tool_name?: string;question?: string;+ /** `tool_call` (harness discovery bridge): the deferred tool it invokes. */+ name?: string;+ /** `tool_call`: the arguments forwarded to {@link ParsedToolArgs.name}. */+ arguments?: unknown;}const TOOL_DISPLAY_NAMES: Record<string, string> = {@@ -30,6 +34,32 @@ const TOOL_DISPLAY_NAMES: Record<string, string> = {// humanized "Web Search Tool".web_search_tool: 'Searching the web',gitbooks_search: 'Searching docs',+ // The other search engines the core registers (`search/`); each is a real+ // web search, so they read the same as the canonical slot.+ brave_news_search: 'Searching the news',+ brave_image_search: 'Searching images',+ brave_video_search: 'Searching videos',+ searxng_search: 'Searching the web',+ seltz_search: 'Searching the web',+ tinyfish_search: 'Searching the web',+ parallel_search: 'Searching the web',+ google_places_search: 'Searching places',+ // Harness tool discovery. `tool_search` finds a deferred tool (a Composio+ // action, say) and is NOT a web search, whatever its name and `query` arg+ // suggest; `tool_call` is unwrapped to the tool it invokes in+ // `formatTimelineEntry`, this entry is only its fallback.+ tool_search: 'Searching tools',+ tool_call: 'Using a tool',+ search_tool_catalog: 'Searching tools',+ mcp_registry_search: 'Searching MCP servers',+ skill_registry_search: 'Searching skills',+ // Memory reads. Named `*_search`, but they search the user's memory.+ memory_recall: 'Recalling memory',+ memory_hybrid_search: 'Searching memory',+ memory_vector_search: 'Searching memory',+ memory_store_raw_search: 'Searching memory',+ memory_tree_search_entities: 'Searching memory',+ flow_memory_recall: 'Recalling memory',file_read: 'Reading file',file_write: 'Writing file',edit: 'Editing file',@@ -189,6 +219,13 @@ const TOOL_CATEGORIES: Record<string, ToolCategory> = {web_search: 'search',web_search_tool: 'search',gitbooks_search: 'search',+ brave_news_search: 'search',+ brave_image_search: 'search',+ brave_video_search: 'search',+ searxng_search: 'search',+ seltz_search: 'search',+ tinyfish_search: 'search',+ parallel_search: 'search',gitbooks_get_page: 'read',shell: 'run',node_exec: 'run',@@ -258,6 +295,19 @@ export function summarizeToolGroup(entries: ToolTimelineEntry[]): string {export function formatTimelineEntry(entry: ToolTimelineEntry): { title: string; detail?: string } {const parsedArgs = parseToolArgs(entry.argsBuffer);+ // The harness discovery bridge: `tool_call {name, arguments}` runs a deferred+ // tool (usually a Composio action the orchestrator found with `tool_search`).+ // Label the tool it ran, not the bridge.+ const bridged = entry.name === 'tool_call' ? parsedArgs?.name?.trim() : undefined;+ if (bridged && bridged !== 'tool_call') {+ return formatTimelineEntry({+ ...entry,+ name: bridged,+ argsBuffer: stringifyBridgedArgs(parsedArgs?.arguments),+ displayName: undefined,+ });+ }+if (entry.name === 'spawn_subagent' && parsedArgs?.agent_id === 'integrations_agent') {const provider =inferIntegrationName(parsedArgs.toolkit) ?? inferIntegrationNameFromPrompt(parsedArgs.prompt);@@ -713,6 +763,42 @@ function inferIntegrationNameFromPrompt(prompt?: string): string | undefined {return known.find(name => lower.includes(name.toLowerCase()));}+function stringifyBridgedArgs(value: unknown): string | undefined {+ if (value === undefined || value === null) return undefined;+ if (typeof value === 'string') return value;+ try {+ return JSON.stringify(value);+ } catch {+ return undefined;+ }+}++/**+ * The label and detail for one tool call, from its name, raw argument text and+ * result, for surfaces that hold a tool part rather than a timeline row.+ *+ * Deliberately the same formatter the timeline uses: every surface labels a+ * tool from the tool's identity. Nothing here guesses a category from a+ * substring of the name or from which argument keys happen to be present —+ * that heuristic is what labelled `tool_search` and every Composio action with+ * a `query` argument as a web search.+ */+export function toolCallLabel(+ toolName: string,+ argsText?: string,+ result?: string+): { title: string; detail?: string } {+ return formatTimelineEntry({+ id: '',+ name: toolName,+ round: 0,+ seq: 0,+ status: result === undefined ? 'running' : 'success',+ argsBuffer: argsText,+ result,+ });+}+function parseToolArgs(argsBuffer?: string): ParsedToolArgs | null {if (!argsBuffer) return null;try {