fix(email): default EmailMessage.sent_at to now() when omitted (sibling of openhuman#5169) - #133
Conversation
An email payload missing `sent_at` hard-rejected the entire thread with `missing field 'sent_at'` — the same failure mode the chat arm fixed in openhuman#5169. Mirror `ChatMessage::timestamp`: add a `chrono_now` serde default on `sent_at`, plus missing/null/explicit regression tests. Refs tinyhumansai/openhuman#5281, tinyhumansai/openhuman#5169
There was a problem hiding this comment.
M3gA-Mind has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 25 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
Comment |
Summary
EmailMessage::sent_athad no serde default, so an email payload omittingsent_athard-rejected the whole thread withmissing field 'sent_at'. This is the email-arm counterpart of the chat fix inopenhuman#5169—ChatMessage::timestampalready tolerates the missing field via#[serde(default = "chrono_now")]; email did not.Change
src/memory/ingest/canonicalize/email.rs:chrono_now()default helper (mirrorschat.rs).#[serde(default = "chrono_now")]tosent_at, so an omitted field falls back toUtc::now()instead of rejecting.email_tests.rs: 3 regression tests —missing_sent_at_defaults_to_now,null_sent_at_defaults_to_now, andexplicit_sent_at_still_parses(guards the default from masking a real value).Behaviour is otherwise unchanged: an explicit
sent_at(epoch-ms or RFC 3339) still parses exactly as before.Tests
Regression tests mirror the chat-arm ones added in openhuman#5169. Not run locally (no-local-build policy); relying on CI.
Related
Note: the openhuman submodule pin bump + merge are intentionally deferred to the maintainer.