feat(mothership): Add conversationId to mship block#4577
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThis PR adds an optional
Confidence Score: 5/5Safe to merge — the change is additive and all existing paths are unaffected. All changed paths are well-covered: the handler correctly trims and falls back, the route always returns conversationId so the non-optional schema is consistent, and the new test explicitly validates both the trimmed chatId in the outgoing request body and the correct generateId call count when a conversation ID is supplied versus when one is generated. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant W as Workflow Executor
participant H as MothershipBlockHandler
participant R as /api/mothership/execute
participant M as Mothership Service
W->>H: execute(ctx, block, inputs)
note over H: inputs.conversationId provided?
alt conversationId provided
H->>H: "chatId = inputs.conversationId.trim()"
else not provided
H->>H: "chatId = generateId()"
end
H->>H: "messageId = generateId()"
H->>H: "requestId = generateId()"
H->>R: "POST { messages, chatId, messageId, requestId, ... }"
R->>R: "effectiveChatId = chatId || generateId()"
R->>M: "runHeadlessCopilotLifecycle({ chatId: effectiveChatId })"
M-->>R: "result { content, toolCalls, usage }"
R-->>H: "{ content, model, conversationId: effectiveChatId, tokens, toolCalls }"
H-->>W: "{ content, model, conversationId, tokens, toolCalls, cost }"
Reviews (1): Last reviewed commit: "Add convo id to mship block" | Re-trigger Greptile |
Summary
Add convo id to mship block
Type of Change
Testing
Manual
Checklist