Repository navigation
fix(memory): tolerate folded and invalid Date headers in email import - #3297
Open
Chen Yufeiyang (feiiiiii5) wants to merge 1 commit into
Open
Chen Yufeiyang (feiiiiii5) wants to merge 1 commit into
Chen Yufeiyang (feiiiiii5) wants to merge 1 commit into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
importEmailFromMimeText, used byimportEmlFileandloadEmailMessagesFromDir, passed the rawDate:header to a strict source-date parser. A malformed header threwTemporalValueErrorand aborted the whole file (or directory) import; a folded RFC 5322 header left an embedded newline insentOnRawand in the stored temporalmessageTime.rawshown as evidence.Root cause
The header value was neither unfolded nor validated before parsing.
mailparsersynthesizes a date for malformed headers, but that is not the sender's stated date, so it must not be adopted silently.Fix
Unfold continuation whitespace, parse once, and only keep
sentOnRawwhen parsing succeeds. Unparseable headers leavesentOnandsentOnRawunset instead of failing the import.Verification
TemporalValueError; with the fix 7/7 pass.@typeagent/conversation-memorylocal suite: 55/55 across 6 suites.tsc -band Prettier clean on changed files.Not verified: live LLM/network calls, full workspace CI, other import formats, or Windows line-ending behavior beyond
\r?\n.AI-assisted development. Human review requested before merge.