Skip to content

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

feat(timeline): format direct connected-service actions by provider

Steven Enamakel5027e3d0dc66
diff --git a/app/src/utils/__tests__/toolTimelineFormatting.test.ts b/app/src/utils/__tests__/toolTimelineFormatting.test.ts
index b0b2b073c2..ba97947f26 100644
--- a/app/src/utils/__tests__/toolTimelineFormatting.test.ts
+++ b/app/src/utils/__tests__/toolTimelineFormatting.test.ts
@@ -68,43 +68,25 @@ describe('formatTimelineEntry', () => {
});
});
- it('formats delegate_to_integrations_agent with a known toolkit arg', () => {
+ it('labels a direct connected-service action by its provider', () => {
expect(
formatTimelineEntry(
entry({
- name: 'delegate_to_integrations_agent',
- argsBuffer: JSON.stringify({
- toolkit: 'gmail',
- prompt: 'Find the latest invoice from Stripe.',
- }),
+ name: 'GMAIL_SEND_EMAIL',
+ argsBuffer: JSON.stringify({ to: '[email protected]' }),
})
)
- ).toEqual({
- title: 'Making requests to your Gmail account',
- detail: 'Find the latest invoice from Stripe.',
- });
- });
-
- it('formats delegate_to_integrations_agent with an unknown toolkit arg', () => {
+ ).toEqual({ title: 'Making requests to your Gmail account', detail: 'Send email' });
expect(
- formatTimelineEntry(
- entry({
- name: 'delegate_to_integrations_agent',
- argsBuffer: JSON.stringify({ toolkit: 'slack_bot', prompt: 'post update' }),
- })
- )
- ).toEqual({ title: 'Checking your Slack Bot', detail: 'post update' });
+ formatTimelineEntry(entry({ name: 'GOOGLE_CALENDAR_CREATE_EVENT' }))
+ ).toEqual({ title: 'Updating your Google Calendar', detail: 'Create event' });
});
- it('formats delegate_to_integrations_agent without a toolkit arg as a generic connected-app label', () => {
- expect(
- formatTimelineEntry(
- entry({
- name: 'delegate_to_integrations_agent',
- argsBuffer: JSON.stringify({ prompt: 'do something useful' }),
- })
- )
- ).toEqual({ title: 'Checking your connected app', detail: 'do something useful' });
+ it('keeps the generic label for upper-case names on unknown toolkits', () => {
+ expect(formatTimelineEntry(entry({ name: 'STRIPE_LIST_CHARGES' }))).toEqual({
+ title: 'STRIPE LIST CHARGES',
+ detail: undefined,
+ });
});
it('formats delegate_tools_agent with toolkit context from args', () => {
@@ -402,7 +384,6 @@ describe('isKnownClientTool', () => {
expect(isKnownClientTool('file_read')).toBe(true);
expect(isKnownClientTool('shell')).toBe(true);
expect(isKnownClientTool('subagent:researcher')).toBe(true);
- expect(isKnownClientTool('delegate_to_integrations_agent')).toBe(true);
// The streamed search-slot name, so the client label wins over the
// server's humanized "Web Search Tool".
expect(isKnownClientTool('web_search_tool')).toBe(true);
diff --git a/app/src/utils/toolTimelineFormatting.ts b/app/src/utils/toolTimelineFormatting.ts
index a10cc5d5ea..667a1640a1 100644
--- a/app/src/utils/toolTimelineFormatting.ts
+++ b/app/src/utils/toolTimelineFormatting.ts
@@ -304,21 +304,23 @@ export function formatTimelineEntry(entry: ToolTimelineEntry): { title: string;
inferIntegrationNameFromPrompt(parsedArgs?.prompt) ??
inferIntegrationName(entry.name);
- let title: string;
- if (provider) {
- title = integrationActivityTitle(provider);
- } else if (entry.name === 'delegate_to_integrations_agent') {
- const rawToolkit = parsedArgs?.toolkit?.trim();
- title = rawToolkit
- ? integrationActivityTitle(humanizeIdentifier(rawToolkit))
- : 'Checking your connected app';
- } else {
- title = humanizeIdentifier(entry.name);
- }
-
+ const title = provider ? integrationActivityTitle(provider) : humanizeIdentifier(entry.name);
return { title, detail: entry.detail ?? parsedArgs?.prompt };
}
+ // A connected-service action called directly (`GMAIL_SEND_EMAIL`,
+ // `SLACK_SEND_MESSAGE`): the orchestrator finds these through
+ // `tool_search` and calls them itself, so this is the row a user sees
+ // for "send that email". Label it by the service, with the action as
+ // the detail, rather than a raw humanised slug.
+ const directAction = inferIntegrationActionName(entry.name);
+ if (directAction) {
+ return {
+ title: integrationActivityTitle(directAction.provider),
+ detail: entry.detail ?? directAction.action,
+ };
+ }
+
// ── Tool-specific formatting with args-derived detail ──────────────
// Pass the completed result text so args-aware formatters can surface
// details only known post-execution (e.g. the resolved search provider).
@@ -639,6 +641,33 @@ function inferIntegrationName(input?: string): string | undefined {
return undefined;
}
+/**
+ * Split a Composio action slug (`GMAIL_SEND_EMAIL`) into its known provider
+ * and a readable action ("Send email"). `undefined` for anything that is not
+ * an upper-case `<TOOLKIT>_<ACTION>` name on a known toolkit, so ordinary
+ * tools and unknown toolkits keep their generic label.
+ */
+function inferIntegrationActionName(
+ name: string
+): { provider: string; action: string } | undefined {
+ const match = name.match(/^([A-Z][A-Z0-9]*(?:_[A-Z0-9]+)*?)_([A-Z0-9_]+)$/);
+ if (!match) return undefined;
+ // Try the longest toolkit prefix first (`GOOGLE_CALENDAR_...`), then the
+ // shortest (`GMAIL_...`).
+ const parts = name.split('_');
+ for (let i = Math.min(parts.length - 1, 2); i >= 1; i -= 1) {
+ const toolkit = parts.slice(0, i).join('_');
+ if (KNOWN_TOOLKIT_RE.test(toolkit)) {
+ const action = parts.slice(i).join(' ').toLowerCase();
+ return {
+ provider: normalizeIntegrationName(toolkit),
+ action: action.charAt(0).toUpperCase() + action.slice(1),
+ };
+ }
+ }
+ return undefined;
+}
+
function integrationActivityTitle(provider: string): string {
switch (provider) {
case 'GitHub':