Conversation Logging to Database#77
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: 77e715011a
ℹ️ 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".
| .withIndex("by_session", (q) => q.eq("sessionId", args.sessionId)) | ||
| .filter((q) => | ||
| q.and( | ||
| q.eq(q.field("userId"), args.userId), | ||
| q.eq(q.field("transcript"), args.transcript), |
There was a problem hiding this comment.
Disambiguate repeated transcripts in updateResponse
The response update lookup keys only by sessionId + userId + transcript, so if a user repeats the same utterance in a session (or says it again before the first handler finishes), updateResponse will target the most recent matching log and leave the earlier entry without a response (or attach the response to the wrong record). That corrupts the training data and is hard to detect. Consider passing the inserted log _id (or a unique request/run id) back from logConversation and using that for the update, or add a unique per-utterance key so duplicates are unambiguous.
Useful? React with 👍 / 👎.
This is the PR (via autonomous mode) that adds conversation logging into Convex for each transcript option that the user says.