Skip to content

Test#93

Merged
sweetmantech merged 15 commits intomainfrom
test
Jan 7, 2026
Merged

Test#93
sweetmantech merged 15 commits intomainfrom
test

Conversation

@sweetmantech
Copy link
Contributor

@sweetmantech sweetmantech commented Jan 7, 2026

Summary by CodeRabbit

  • New Features

    • Improved email reply logic to intelligently handle CC'd recipients with LLM-based decision-making.
    • Enhanced email display formatting for outbound messages.
  • Chores

    • Centralized configuration for email domains and storage settings.
    • Expanded test coverage for email handling scenarios.

✏️ Tip: You can customize this high-level summary in your review settings.

sweetmantech and others added 15 commits January 6, 2026 12:54
Files changed:
- lib/emails/inbound/__tests__/validateCcReplyExpected.test.ts
- lib/emails/inbound/validateCcReplyExpected.ts
- Introduced RECOUP_EMAIL_DOMAIN constant for better maintainability.
- Updated EmailReplyAgent to utilize the new constant in instructions.
- Created containsRecoupEmail function to check for Recoup email addresses.
- Refactored getFromWithName and validateCcReplyExpected to use the new constant.
- Updated tests to reflect changes in email address handling.
…r-logic-in-validateccreplyexpe-mk2w2l4d

Ralph/updated the cc filter logic in validateccreplyexpe mk2w2l4d
…able.com

- Add INBOUND_EMAIL_DOMAIN and OUTBOUND_EMAIL_DOMAIN constants to lib/consts.ts
- Update getFromWithName to convert inbound domain to outbound domain for replies
- Inbound emails still received at @mail.recoupable.com
- Outbound replies now sent from @recoupable.com

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Always commit/push after completing changes
- Never push directly to main or test branches
- Include build commands and architecture overview

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use RECOUP_EMAIL_DOMAIN from lib/const.ts for inbound (from test branch)
- Add OUTBOUND_EMAIL_DOMAIN to lib/const.ts for outbound emails
- Remove duplicate constants from lib/consts.ts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…tmantech/myc-3864-api-outbound-emails-send-from-agent-by
- Move SUPABASE_STORAGE_BUCKET to lib/const.ts
- Update import in uploadFileByKey.ts
- Delete lib/consts.ts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Clearer naming to distinguish from OUTBOUND_EMAIL_DOMAIN

🤖 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>
- Test inbound @mail.recoupable.com converts to outbound @recoupable.com
- Test finding email in to/cc arrays
- Test error handling for missing recoup email
- Test name capitalization formatting

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Changes FROM display from "Support <email>" to "Support by Recoup <email>"
- Update tests to match new format

🤖 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>
…outbound-emails-send-from-agent-by

Sweetmantech/myc 3864 api outbound emails send from agent by
@sweetmantech sweetmantech merged commit 058c714 into main Jan 7, 2026
1 of 2 checks passed
@coderabbitai
Copy link

coderabbitai bot commented Jan 7, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This change centralizes email domain and storage constants into a unified constant file (lib/const.ts), updates related imports throughout the codebase, introduces a new email validation utility function, and refactors email reply handling logic to use dynamic constants and add conditional logic for To-address handling.

Changes

Cohort / File(s) Change Summary
Constants Migration
lib/const.ts, lib/consts.ts
Adds INBOUND_EMAIL_DOMAIN, OUTBOUND_EMAIL_DOMAIN, and SUPABASE_STORAGE_BUCKET to lib/const.ts; removes SUPABASE_STORAGE_BUCKET from lib/consts.ts. Centralizes constant declarations.
Email Domain Configuration
lib/agents/EmailReplyAgent/createEmailReplyAgent.ts
Imports INBOUND_EMAIL_DOMAIN from @/lib/const and replaces hardcoded domain in agent instructions with template reference for runtime configurability.
Email Handling Refactoring
lib/emails/containsRecoupEmail.ts, lib/emails/inbound/getFromWithName.ts, lib/emails/inbound/validateCcReplyExpected.ts
Adds new containsRecoupEmail utility for domain checking; refactors getFromWithName to use INBOUND_EMAIL_DOMAIN and OUTBOUND_EMAIL_DOMAIN, transforming output format to include "by Recoup" with outbound domain; refactors validateCcReplyExpected to check To-address first and short-circuit LLM invocation when email found in To only.
Import Path Updates
lib/supabase/storage/uploadFileByKey.ts
Updates SUPABASE_STORAGE_BUCKET import source from @/lib/consts to @/lib/const.
Test Expansion
lib/emails/inbound/__tests__/getFromWithName.test.ts, lib/emails/inbound/__tests__/validateCcReplyExpected.test.ts
Adds comprehensive test coverage for domain conversion, inbound email discovery in To/Cc fields, name formatting, agent invocation logic, and early-return behavior when email found in To only.
Workflow & Documentation
.github/workflows/test.yml, CLAUDE.md
Expands test workflow trigger to include test branch; adds new development guidelines documentation covering Git workflow, build commands, architecture overview, and constants location.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Poem

🐰 Constants hopped from consts to const today,
Email domains dance a new ballet—
Inbound and outbound, now unified and bright,
Early returns skip the long LLM flight,
By Recoup, we transform with dynamic delight!

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2f97381 and 9ff616e.

📒 Files selected for processing (11)
  • .github/workflows/test.yml
  • CLAUDE.md
  • lib/agents/EmailReplyAgent/createEmailReplyAgent.ts
  • lib/const.ts
  • lib/consts.ts
  • lib/emails/containsRecoupEmail.ts
  • lib/emails/inbound/__tests__/getFromWithName.test.ts
  • lib/emails/inbound/__tests__/validateCcReplyExpected.test.ts
  • lib/emails/inbound/getFromWithName.ts
  • lib/emails/inbound/validateCcReplyExpected.ts
  • lib/supabase/storage/uploadFileByKey.ts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@vercel
Copy link
Contributor

vercel bot commented Jan 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
recoup-api Building Building Preview Jan 7, 2026 4:53pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments