fix(mothership): fix intelligence regression#4171
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThis PR fixes a Mothership intelligence regression by correcting Confidence Score: 5/5Safe to merge — all remaining findings are P2 style improvements with no correctness impact. The core regression fix (sim_test agentId + context propagation) is straightforward and well-guarded with try/catch. No data loss, auth bypasses, or broken contracts identified. Only two P2 suggestions remain: a minor redundant DB fetch opportunity and an import consistency nit. apps/sim/lib/copilot/request/subagent.ts — minor double-fetch on getWorkflowById worth cleaning up. Important Files Changed
Sequence DiagramsequenceDiagram
participant MCP as MCP Client
participant Route as /api/mcp/copilot
participant Build as handleBuildToolCall
participant Sub as orchestrateSubagentStream
participant Ctx as generateWorkspaceContext
participant Go as Go Agent API
MCP->>Route: sim_workflow(request, workflowId)
Route->>Build: agentId === 'workflow'
Build->>Build: authorizeWorkflow → resolvedWorkflowName, resolvedWorkspaceId
Build->>Ctx: generateWorkspaceContext(workspaceId, userId)
Ctx-->>Build: workspaceContext string
Build->>Go: /api/mcp (workflowName, workspaceId, workspaceContext)
Go-->>Route: streamed result
MCP->>Route: sim_test(request, workflowId)
Route->>Sub: agentId = 'run' (was 'test')
Sub->>Sub: resolve workflowName + workspaceId
Sub->>Ctx: generateWorkspaceContext(workspaceId, userId)
Ctx-->>Sub: workspaceContext string
Sub->>Go: /api/subagent/run (workflowName, workspaceId, workspaceContext, isHosted)
Go-->>Route: streamed result
|
Summary
Fix mothership intelligence regression
Type of Change
Testing
Manual
Checklist