Skip to content

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

fix(chat): resolve Composio toolkit slugs, and cover the bridge labels

M3gA-Mind4498bae48a52
diff --git a/app/src/features/conversations/components/ChatToolParts.test.tsx b/app/src/features/conversations/components/ChatToolParts.test.tsx
index 1aa5c2dd93..f42528c6a7 100644
--- a/app/src/features/conversations/components/ChatToolParts.test.tsx
+++ b/app/src/features/conversations/components/ChatToolParts.test.tsx
@@ -213,4 +213,59 @@ describe('ChatToolParts', () => {
expect(screen.getByTestId('assistant-ui-tool-call')).toHaveTextContent('Searched the web');
expect(screen.getByTestId('assistant-ui-tool-call')).not.toHaveTextContent(/^Tool done$/);
});
+
+ it('names the tool-discovery bridge for what it is, not a web search', () => {
+ // `tool_search` ranks the DEFERRED TOOL CATALOGUE — Composio actions, MCP
+ // tools — and never touches the network. It matched `looksLikeSearch`
+ // twice (its name contains "search" AND its argument is `query`), so a
+ // turn that fetched the user's own Google Calendar through Composio opened
+ // with "Searched the web".
+ render(
+ <ChatToolFallback
+ type="tool-call"
+ toolName="tool_search"
+ toolCallId="bridge-search"
+ args={{ query: 'list calendar events google calendar' } as never}
+ argsText={'{"query":"list calendar events google calendar"}'}
+ result="1 match(es). Invoke one with tool_call"
+ status={{ type: 'complete' }}
+ addResult={() => {}}
+ resume={() => {}}
+ respondToApproval={() => {}}
+ />
+ );
+
+ expect(screen.getByTestId('assistant-ui-tool-call')).toHaveTextContent('Found the right tool');
+ // The regression this pins: BOTH heuristic legs still match this row, so
+ // dropping the explicit branch renders the web label again.
+ expect(screen.getByTestId('assistant-ui-tool-call')).not.toHaveTextContent('Searched the web');
+ });
+
+ it('labels the tool_call wrapper by the tool it actually invoked', () => {
+ // `tool_call_schema()` declares `{name, arguments}`, both required, so the
+ // wrapped tool is always in `name`. The row used to show only the wrapper,
+ // so the one call that fetched the user's calendar rendered "Tool Call".
+ render(
+ <ChatToolFallback
+ type="tool-call"
+ toolName="tool_call"
+ toolCallId="bridge-call"
+ args={{ name: 'GOOGLECALENDAR_EVENTS_LIST', arguments: { calendarId: 'primary' } } as never}
+ argsText={'{"name":"GOOGLECALENDAR_EVENTS_LIST"}'}
+ result="Items: Product Team Standup"
+ status={{ type: 'complete' }}
+ addResult={() => {}}
+ resume={() => {}}
+ respondToApproval={() => {}}
+ />
+ );
+
+ // Composio slugs carry no separator inside the toolkit name, so this also
+ // pins the `googlecalendar` spelling in `KNOWN_TOOLKIT_RE`: without it the
+ // row degrades to the raw "GOOGLECALENDAR EVENTS LIST".
+ expect(screen.getByTestId('assistant-ui-tool-call')).toHaveTextContent(
+ 'Google Calendar: Events list'
+ );
+ expect(screen.getByTestId('assistant-ui-tool-call')).not.toHaveTextContent('Tool Call');
+ });
});
diff --git a/app/src/utils/toolTimelineFormatting.ts b/app/src/utils/toolTimelineFormatting.ts
index fedb989f5b..018fdc68fd 100644
--- a/app/src/utils/toolTimelineFormatting.ts
+++ b/app/src/utils/toolTimelineFormatting.ts
@@ -643,8 +643,14 @@ function formatToolDetail(
* `delegate_summarize`, `delegate_router`) don't get fake-humanised
* into bogus "integration" labels in the tool timeline.
*/
+// Composio's own slugs have NO separator inside a multi-word toolkit:
+// `GOOGLECALENDAR_EVENTS_LIST`, not `GOOGLE_CALENDAR_EVENTS_LIST`. Only the
+// underscored spellings were listed here, so `GMAIL_*` and `DISCORD_*`
+// resolved while every `GOOGLECALENDAR_*` action fell through to the raw
+// humanizer and rendered "GOOGLECALENDAR EVENTS LIST". Both spellings are
+// kept: the underscored ones are how `delegate_<toolkit>` names arrive.
const KNOWN_TOOLKIT_RE =
- /^(gmail|notion|github|slack|discord|linear|jira|google_calendar|google_drive|calendar)$/i;
+ /^(gmail|notion|github|slack|discord|linear|jira|google_calendar|googlecalendar|google_drive|googledrive|calendar)$/i;
function inferIntegrationName(input?: string): string | undefined {
if (!input) return undefined;
@@ -743,9 +749,11 @@ function normalizeIntegrationName(value: string): string {
case 'gmail':
return 'Gmail';
case 'google_calendar':
+ case 'googlecalendar':
case 'calendar':
return 'Google Calendar';
case 'google_drive':
+ case 'googledrive':
return 'Google Drive';
default:
return humanizeIdentifier(value);