Revert "Increase context for choosing rule"#374
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Caution Review failedThe pull request is closed. WalkthroughThis pull request refactors multiple parts of the codebase to switch from processing arrays of messages to handling single message/email objects. Parameter names and function signatures across test files, API endpoints, AI-related modules, and utility functions have been updated to accept a single message (or email) instance. Additionally, functions related to email formatting and thread handling have been modified or removed. The overall control flow remains intact while the input structure becomes simplified and more consistent. Changes
Sequence Diagram(s)sequenceDiagram
participant Gmail as Gmail API
participant API as Webhook/API Handler
participant Parser as Message Parser
participant Rules as Rule Engine
participant AI as AI Service
Gmail->>API: getMessage(messageId, "full")
API->>Parser: parseMessage(gmailMessage)
Parser-->>API: Parsed message
API->>Rules: processHistoryItem(parsedMessage)
Rules->>AI: getAiResponse({ email: parsedMessage })
AI-->>Rules: AI response result
Rules-->>API: Processed rule outcome
Possibly related PRs
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 ESLint
apps/web/__tests__/ai-choose-rule.test.tsOops! Something went wrong! :( ESLint: 8.57.1 Error: Failed to load parser '@typescript-eslint/parser' declared in 'apps/web/.eslintrc.json': Cannot find module '@typescript-eslint/parser'
apps/web/app/api/google/webhook/process-history-item.tsOops! Something went wrong! :( ESLint: 8.57.1 Error: Failed to load parser '@typescript-eslint/parser' declared in 'apps/web/.eslintrc.json': Cannot find module '@typescript-eslint/parser'
apps/web/utils/ai/choose-rule/ai-choose-rule.tsOops! Something went wrong! :( ESLint: 8.57.1 Error: Failed to load parser '@typescript-eslint/parser' declared in 'apps/web/.eslintrc.json': Cannot find module '@typescript-eslint/parser'
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (12)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Reverts #373
Summary by CodeRabbit
These updates streamline how email data is processed throughout the system. Email information is now handled as a single, structured object rather than a collection, which enhances clarity and consistency in reply handling and rule evaluation. Automated tests have been updated accordingly, and obsolete features for previous email aggregation and external dataset interactions have been removed, helping reduce overall complexity.