File tree Expand file tree Collapse file tree
apps/sim/lib/mothership/tool-executor Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ( [
Original file line number Diff line number Diff line change @@ -42,9 +42,11 @@ export function clearHandlers(): void {
4242
4343export 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' , {
You can’t perform that action at this time.
0 commit comments