♻️ refactor(ai-chat): remove simple turn fast path#15471
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8928eb03a6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const { assistantMessage: assistantMessageItem, userMessage: userMessageItem } = | ||
| await createMessagePairPromise; | ||
| agentTouchUpdatedAtTask | ||
| ? (await Promise.all([createMessagePairPromise, agentTouchUpdatedAtTask]))[0] | ||
| : await createMessagePairPromise; |
There was a problem hiding this comment.
Don't wait on the non-critical agent touch
When creating a new topic with an agentId, this now waits for agentTouchUpdatedAtTask before returning the persisted message response. That touch is best-effort and already catches failures, but if the agents update is slow or blocked, the chat send response is delayed even though the topic and messages have already been created; the previous fire-and-forget behavior avoided putting this sidebar timestamp update on the critical path.
Useful? React with 👍 / 👎.
💻 Change Type
🔗 Related Issue
Related to #15436.
🔀 Description of Change
Remove the simple new/existing topic fast path from
aiChatand route message persistence back through the existing model-level flow:sendMessageInServerTopicModel.createMessageModel.createUserAndAssistantMessagesAiChatService.getMessagesAndTopicsThis drops the Drizzle CTE
insert().select()implementation fromAiChatServiceso schema column drift no longer breaks this path at insert-builder construction time.🧪 How to Test
bunx vitest run --silent='passed-only' src/server/services/aiChat/index.test.ts src/server/routers/lambda/__tests__/aiChat.test.ts📸 Screenshots / Videos
N/A
📝 Additional Information
No UI changes. No cloud-specific business logic is included in this submodule change.