Skip to content

HOLD MERGE — api brand email → @recoupable.dev (+ inbound @mail.recoupable.dev)#725

Merged
sweetmantech merged 4 commits into
testfrom
fix/email-dot-dev
Jun 30, 2026
Merged

HOLD MERGE — api brand email → @recoupable.dev (+ inbound @mail.recoupable.dev)#725
sweetmantech merged 4 commits into
testfrom
fix/email-dot-dev

Conversation

@sweetmantech

@sweetmantech sweetmantech commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

⚠️ HOLD MERGE

Do not merge until BOTH are ready: (1) recoupable.dev is a verified sending domain in Resend, and (2) MX/inbound on mail.recoupable.dev is live. Otherwise outbound bounces and inbound replies stop arriving. Per recoupable/chat#1819 decision (2026-06-29).

What

  • lib/const.tsOUTBOUND_EMAIL_DOMAIN@recoupable.dev (so RECOUP_FROM_EMAIL = agent@recoupable.dev); INBOUND_EMAIL_DOMAIN@mail.recoupable.dev.
  • lib/composio/toolRouter/getSharedAccountConnections.tsshared@.dev.
  • lib/emails/isTestEmail.tssidney@.dev.
  • lib/sandbox/resolveGitUser.ts — noreply @users.noreply.recoupable.com.dev.
  • lib/emails/inbound/getFromWithName.ts, lib/emails/sendEmailHandler.ts, app/api/emails/route.ts — from-address JSDoc → .dev.
  • Tests updated to the new domains: getFromWithName.test.ts, processAndSendEmail.test.ts, resolveGitUser.test.ts.

Verification

vitest run lib/emails lib/sandbox lib/composio app/api/emails: 613 passed / 98 files (includes the updated domain assertions).

Coupled follow-up

When this merges (the real from-address becomes agent@recoupable.dev), the docs accounts.json send_email from-address examples should flip too — see docs#256 note.

🤖 Generated with Claude Code


Summary by cubic

Switch all email to the apex @recoupable.dev for both outbound and inbound. Updates constants, API handler docs, inbound address parsing, sandbox git-user fallback, and tests; default from is now Agent by Recoup agent@recoupable.dev.

  • Migration
    • After merge, update docs accounts.json send_email examples to agent@recoupable.dev.

Written for commit fc06765. Summary will update on new commits.

Review in cubic

…upable.dev)

- OUTBOUND_EMAIL_DOMAIN @recoupable.com → @recoupable.dev (RECOUP_FROM_EMAIL
  derives from it: agent@recoupable.dev)
- INBOUND_EMAIL_DOMAIN @mail.recoupable.com → @mail.recoupable.dev
- shared@ (getSharedAccountConnections), sidney@ (isTestEmail),
  noreply (resolveGitUser), and from-address JSDoc → .dev
- updated the coupled test assertions (getFromWithName, processAndSendEmail,
  resolveGitUser) to the new domains

DO NOT MERGE until the recoupable.dev sending domain is verified in Resend AND
MX/inbound on mail.recoupable.dev is live — else outbound bounces and inbound
replies stop arriving. Per recoupable/chat#1819 decision 2026-06-29.

Refs recoupable/chat#1819.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
api Ready Ready Preview Jun 30, 2026 1:59am

Request Review

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@sweetmantech, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 38 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4077a5e1-f254-4690-9f2c-71ac484b5ce5

📥 Commits

Reviewing files that changed from the base of the PR and between 8a3d084 and fc06765.

⛔ Files ignored due to path filters (3)
  • lib/emails/__tests__/processAndSendEmail.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/emails/inbound/__tests__/getFromWithName.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/sandbox/__tests__/resolveGitUser.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
📒 Files selected for processing (7)
  • app/api/emails/route.ts
  • lib/composio/toolRouter/getSharedAccountConnections.ts
  • lib/const.ts
  • lib/emails/inbound/getFromWithName.ts
  • lib/emails/isTestEmail.ts
  • lib/emails/sendEmailHandler.ts
  • lib/sandbox/resolveGitUser.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/email-dot-dev

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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 10 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: PR explicitly requires manual verification that recoupable.dev is verified in Resend and MX/inbound is live before merging. Auto-approval would bypass this coordination.

Re-trigger cubic

…le.dev)

Per decision: use the apex @recoupable.dev for BOTH outbound and inbound — no
mail. subdomain. The inbound MX already sits on the apex recoupable.dev, so
code + DNS now agree. INBOUND_EMAIL_DOMAIN @mail.recoupable.dev → @recoupable.dev;
getFromWithName's local-part-preserving swap is unchanged (now domain-identity).
Tests updated. recoupable.dev is verified in Resend, so outbound sends.

Refs recoupable/chat#1819.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="lib/const.ts">

<violation number="1" location="lib/const.ts:19">
P0: Custom agent: **Flag AI Slop and Fabricated Changes**

INBOUND_EMAIL_DOMAIN incorrectly set to @recoupable.dev instead of @mail.recoupable.dev, contradicting PR description and breaking inbound email routing</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread lib/const.ts
/** Domain for receiving inbound emails (e.g., support@mail.recoupable.com) */
export const INBOUND_EMAIL_DOMAIN = "@mail.recoupable.com";
/** Domain for receiving inbound emails (e.g., support@recoupable.dev) */
export const INBOUND_EMAIL_DOMAIN = "@recoupable.dev";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0: Custom agent: Flag AI Slop and Fabricated Changes

INBOUND_EMAIL_DOMAIN incorrectly set to @recoupable.dev instead of @mail.recoupable.dev, contradicting PR description and breaking inbound email routing

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At lib/const.ts, line 19:

<comment>INBOUND_EMAIL_DOMAIN incorrectly set to @recoupable.dev instead of @mail.recoupable.dev, contradicting PR description and breaking inbound email routing</comment>

<file context>
@@ -15,8 +15,8 @@ export const PRIVY_PROJECT_SECRET = process.env.PRIVY_PROJECT_SECRET;
-/** Domain for receiving inbound emails (e.g., support@mail.recoupable.dev) */
-export const INBOUND_EMAIL_DOMAIN = "@mail.recoupable.dev";
+/** Domain for receiving inbound emails (e.g., support@recoupable.dev) */
+export const INBOUND_EMAIL_DOMAIN = "@recoupable.dev";
 
 /** Domain for sending outbound emails (e.g., support@recoupable.dev) */
</file context>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 1 file (changes from recent commits).

Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.

Re-trigger cubic

@sweetmantech

Copy link
Copy Markdown
Contributor Author

✅ Inbound e2e verified on the preview — 2026-06-30

Tested the apex-inbound change against this PR's preview (api-br3tf54st, branch fix/email-dot-dev) via a temporary Resend webhook (added → tested → removed; the prod webhook was left untouched the whole time, so no prod disruption and no duplicate replies).

Flow: real email → hi@recoupable.dev (subject "Hello World") → Resend received (catch-all) → preview webhook → handler matched @recoupable.devgetFromWithName produced Hi by Recoup <hi@recoupable.dev> → agent reply generated + sent.

Result (Resend log, 02:25:23Z):

reply from Hi by Recoup <hi@recoupable.dev>
reply to the tester's inbox
subject Re: Hello World
status delivered

So inbound to @recoupable.dev now round-trips end to end (prod still 500s on .dev until this merges + promotes — expected). Outbound was also verified earlier (test send from agent@recoupable.dev → delivered). CI green: 146 email unit tests + lint/format/test.

Ready to merge → test, then promote testmain to close the prod inbound gap.

@sweetmantech sweetmantech merged commit d7b06ce into test Jun 30, 2026
6 checks passed
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