Skip to content

Commit 486d077

Browse files
committed
fix(mothership): keep display activity out of integration and mcp tool arguments
1 parent daf2379 commit 486d077

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

‎apps/sim/lib/mothership/tool-executor/executor.test.ts‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,20 @@ describe('copilot tool executor fallback', () => {
306306
)
307307
})
308308

309+
it('keeps display activity out of integration and MCP execution parameters', async () => {
310+
isKnownTool.mockReturnValue(false)
311+
isClientExecuted.mockReturnValue(false)
312+
executeAppTool.mockResolvedValue({ success: true })
313+
await executeTool(
314+
'mcp-server-get_overview',
315+
{ activity: { id: 'gauge-read' }, category_id: null },
316+
{ userId: 'person', workspaceId: 'workspace', requestMode: 'agent' }
317+
)
318+
const [, appParams] = executeAppTool.mock.calls[0]
319+
expect(appParams).not.toHaveProperty('activity')
320+
expect(appParams).toMatchObject({ category_id: null })
321+
})
322+
309323
it('projects resolved secrets before logging registered handler failures', async () => {
310324
const secret = 'mounted-secret-value'
311325
const registry = new ResolvedSecretTraceRegistry([

‎apps/sim/lib/mothership/tool-executor/executor.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ export function clearHandlers(): void {
4242

4343
export async function executeTool(
4444
toolId: string,
45-
params: Record<string, unknown>,
45+
args: Record<string, unknown>,
4646
context: ToolExecutionContext
4747
): Promise<ToolExecutionResult> {
48+
/** `activity` is the chat's display label for the call; no tool takes it as an argument. */
49+
const { activity: _activity, ...params } = args
4850
if (
4951
context.benchmark &&
5052
!(context.benchmark === 'distill'
@@ -293,8 +295,7 @@ async function executeGatedTool(
293295
}
294296

295297
try {
296-
const { activity: _activity, ...executionParams } = params
297-
return await handler(executionParams, context)
298+
return await handler(params, context)
298299
} catch (error) {
299300
const message = toError(error).message
300301
logger.error('Tool execution failed', {

0 commit comments

Comments
 (0)