Uh oh!
There was an error while loading. Please reload this page.
feat: extract roomId from email text before checking headers - #100
Conversation
Primary check now looks for Recoup chat link in email body text: https://chat.recoupable.com/chat/{uuid} Falls back to references header lookup if not found in text. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Extract roomId from email text before checking headers - Convert stored UI parts (step-start, dynamic-tool, reasoning) to simple text-based ModelMessages for AI SDK compatibility - Fixes AI_InvalidPromptError when replying to email threads 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Rename extractText to extractTextFromParts - Move to lib/emails/inbound/extractTextFromParts.ts - Add SRP/DRY/KISS principles to CLAUDE.md 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add comprehensive tests for extractRoomIdFromText covering valid chat links, edge cases (undefined, empty string, invalid UUIDs), and wrong domains - Add tests for getEmailRoomId covering primary text extraction, fallback to references header, and various undefined scenarios - Verify priority: chat link in email text takes precedence over headers 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
Summary
https://chat.recoupable.com/chat/{uuid}Problem
step-start,dynamic-tool,reasoningwithstate) that don't match theModelMessage[]schema the AI SDK expects, causingAI_InvalidPromptError.Solution
extractRoomIdFromText()helper that uses regex to find the UUID from the chat link pattern.getEmailRoomMessages()to convert UI parts to simple text-based ModelMessages, extracting only the text content from user and assistant messages.🤖 Generated with Claude Code