You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: MCP sync execution recorded as triggered_by=manual instead of mcp #473
When an agent execution is triggered via MCP in synchronous mode, the execution is recorded in schedule_executions with triggered_by = 'manual' and no MCP source fields populated (source_mcp_key_id, source_mcp_key_name are null). This breaks the audit trail — executions triggered by external MCP clients are indistinguishable from manual UI triggers.
MCP synchronous mode likely passes the task dispatch through a different code path than async MCP execution, missing the step that sets triggered_by = 'mcp' and populates the MCP key source fields. The async MCP path presumably sets these correctly; the sync path does not.
Reproduction Steps
Configure an MCP client with a valid MCP API key
Call a chat_with_agent or equivalent MCP tool in synchronous mode (blocking, awaits result)
After the execution completes, query schedule_executions for that execution
Observe triggered_by = 'manual' and null MCP source fields
Suggested Fix
Identify where the sync MCP path dispatches the task and ensure it passes the same source context (MCP key ID + name) as the async path. The execution creation call should include triggered_by='mcp', source_mcp_key_id, and source_mcp_key_name.
Activity
fix(execution): set triggered_by=mcp for MCP sync task executions (Ab…