Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(chat): stop labelling the tool-discovery bridge a web search

M3gA-Mind5242686c81cb
diff --git a/app/src/features/conversations/components/AssistantUiToolCall.tsx b/app/src/features/conversations/components/AssistantUiToolCall.tsx
index 650780af46..e3ef08d87b 100644
--- a/app/src/features/conversations/components/AssistantUiToolCall.tsx
+++ b/app/src/features/conversations/components/AssistantUiToolCall.tsx
@@ -12,7 +12,7 @@ import type {
ToolFailureExplanation,
ToolTimelineEntryStatus,
} from '../../../store/chatRuntimeSlice';
-import { formatToolName } from '../../../utils/toolTimelineFormatting';
+import { formatToolName, inferIntegrationActionName } from '../../../utils/toolTimelineFormatting';
import { BubbleMarkdown } from './AgentMessageBubble';
import { ToolFailureLines } from './ToolFailureLines';
@@ -86,6 +86,33 @@ function inferredToolLabel(toolName: string, running: boolean, args: unknown, re
? Object.keys(parsedArgs as object).map(key => key.toLowerCase())
: [];
const renderedResult = typeof result === 'string' ? result : JSON.stringify(result ?? '');
+ // The harness's tool-discovery bridge, resolved BEFORE the heuristics below.
+ // `tool_search` matches `looksLikeSearch` twice — its name contains "search"
+ // AND its argument is `query` — so it rendered as "Searched the web" even
+ // though it never touches the network: it ranks the deferred tool catalogue
+ // (`vendor/tinyagents/crates/tinyagents-harness/src/tool/discover/bridge.rs`).
+ // Observed cost: a turn that fetched the user's own Google Calendar through
+ // Composio showed "Searched the web" as its first row, and the call that did
+ // the work showed as a bare "Tool Call".
+ //
+ // Both intrinsics are `ToolSchema` values, not `Tool` impls, so they carry no
+ // server `display_label` and there is nothing upstream to override.
+ if (lowerName === 'tool_search') {
+ return running ? 'Finding the right tool' : 'Found the right tool';
+ }
+ if (lowerName === 'tool_call') {
+ // `tool_call_schema()` declares `{name, arguments}` with both required, so
+ // `name` is always the wrapped tool. Label the row by what was actually
+ // invoked rather than by the wrapper.
+ const wrapped =
+ parsedArgs && typeof parsedArgs === 'object' && !Array.isArray(parsedArgs)
+ ? (parsedArgs as { name?: unknown }).name
+ : undefined;
+ if (typeof wrapped === 'string' && wrapped.trim()) {
+ const action = inferIntegrationActionName(wrapped);
+ return action ? `${action.provider}: ${action.action}` : formatToolName(wrapped);
+ }
+ }
const looksLikeSearch =
lowerName.includes('search') ||
argKeys.some(key => ['query', 'q', 'search_query'].includes(key)) ||
diff --git a/app/src/utils/toolTimelineFormatting.ts b/app/src/utils/toolTimelineFormatting.ts
index 8d792a1d7e..fedb989f5b 100644
--- a/app/src/utils/toolTimelineFormatting.ts
+++ b/app/src/utils/toolTimelineFormatting.ts
@@ -29,6 +29,19 @@ const TOOL_DISPLAY_NAMES: Record<string, string> = {
// timeline row — without this entry a real search rendered as the
// humanized "Web Search Tool".
web_search_tool: 'Searching the web',
+ // The harness's tool-discovery bridge — NOT a web search.
+ // `vendor/tinyagents/crates/tinyagents-harness/src/tool/discover/bridge.rs`
+ // advertises two intrinsics: `tool_search` ranks the *deferred tool
+ // catalogue* (Composio actions, MCP tools) and `tool_call` invokes a hit by
+ // name. Neither reaches the network.
+ //
+ // They are `ToolSchema` values rather than `Tool` impls, so they carry no
+ // server `display_label` and there is nothing upstream to override — the
+ // label is the client's to get right. Without these entries `tool_search`
+ // fell through to a substring heuristic that fires on "search", and a
+ // Composio calendar fetch rendered as "Searched the web".
+ tool_search: 'Finding the right tool',
+ tool_call: 'Using a tool',
gitbooks_search: 'Searching docs',
file_read: 'Reading file',
file_write: 'Writing file',
@@ -654,7 +667,7 @@ function inferIntegrationName(input?: string): string | undefined {
* an upper-case `<TOOLKIT>_<ACTION>` name on a known toolkit, so ordinary
* tools and unknown toolkits keep their generic label.
*/
-function inferIntegrationActionName(
+export function inferIntegrationActionName(
name: string
): { provider: string; action: string } | undefined {
if (!/^[A-Z][A-Z0-9]*(?:_[A-Z0-9]+)+$/.test(name)) return undefined;