From 3a8c6cb6ba32c8b6a65b355e4953c067a14c540e Mon Sep 17 00:00:00 2001 From: alban bertolini Date: Thu, 28 May 2026 16:36:39 +0200 Subject: [PATCH 1/2] fix(workflow-executor): pass collectionId to MCP activity log The MCP step executor was missing collectionId in buildActivityLogArgs, causing activity logs to not show up in the Forest Admin UI. Co-Authored-By: Claude Sonnet 4.6 --- packages/workflow-executor/src/executors/mcp-step-executor.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/workflow-executor/src/executors/mcp-step-executor.ts b/packages/workflow-executor/src/executors/mcp-step-executor.ts index 4477125809..51e923e306 100644 --- a/packages/workflow-executor/src/executors/mcp-step-executor.ts +++ b/packages/workflow-executor/src/executors/mcp-step-executor.ts @@ -37,6 +37,7 @@ export default class McpStepExecutor extends BaseStepExecutor renderingId: this.context.user.renderingId, action: 'action', type: 'write', + collectionId: this.context.collectionId, label: this.context.stepDefinition.mcpServerId, }; } From 7dacdac977dd0db82d5e4281fa4bd20d1abc090e Mon Sep 17 00:00:00 2001 From: alban bertolini Date: Thu, 28 May 2026 16:39:10 +0200 Subject: [PATCH 2/2] test(workflow-executor): verify MCP activity log args include collectionId Co-Authored-By: Claude Sonnet 4.6 --- .../test/executors/mcp-step-executor.test.ts | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/packages/workflow-executor/test/executors/mcp-step-executor.test.ts b/packages/workflow-executor/test/executors/mcp-step-executor.test.ts index d77cbf67a8..ee30f5bdf5 100644 --- a/packages/workflow-executor/test/executors/mcp-step-executor.test.ts +++ b/packages/workflow-executor/test/executors/mcp-step-executor.test.ts @@ -1033,4 +1033,36 @@ describe('McpStepExecutor', () => { }); }); }); + + describe('activity log', () => { + it('creates activity log with collectionId, renderingId, action, type and mcpServerId as label', async () => { + const tool = new MockRemoteTool({ name: 'send_notification', sourceId: 'mcp-server-1' }); + const { model } = makeMockModel('send_notification', { message: 'Hello' }); + const activityLogPort = { + createPending: jest.fn().mockResolvedValue({ id: 'log-1', index: '0' }), + markSucceeded: jest.fn().mockResolvedValue(undefined), + markFailed: jest.fn().mockResolvedValue(undefined), + }; + const context = makeContext({ + model, + collectionId: 'col-1', + stepDefinition: makeStep({ + executionType: StepExecutionMode.FullyAutomated, + mcpServerId: 'my-mcp-server', + }), + activityLogPort, + }); + const executor = new McpStepExecutor(context, [tool]); + + await executor.execute(); + + expect(activityLogPort.createPending).toHaveBeenCalledWith({ + renderingId: 1, + action: 'action', + type: 'write', + collectionId: 'col-1', + label: 'my-mcp-server', + }); + }); + }); });