Skip to content

fix: group get_email_thread by Message-ID instead of subject - #123

Merged
patrickfreyer merged 3 commits into
mainfrom
carry/110-thread-message-id
Oct 15, 2026
Merged

patrickfreyer merged 3 commits into
mainfrom
carry/110-thread-message-id

Conversation

@patrickfreyer

Copy link
Copy Markdown
Owner

Opened by Claude (AI assistant) on Patrick's behalf.

Carries over #110 by @herbeckrobin (original commits preserved), rebased onto current main. Split out of #98. Supersedes #110.

Follow-up edits

  • get_email_thread docstring: max_messages caps candidates before linking, so the seed is the newest of the first N matches Mail returns.
  • Replaced the em dash in the _split_thread_by_linkage docstring with a comma.

CHANGELOG.md is taken from main unchanged; the entry is consolidated at release.

Proposed CHANGELOG entry

From the original PR (### Fixed):

  • get_email_thread grouped messages by subject alone, so unrelated
    conversations that happened to share a subject ("Invoice", "Meeting") were
    mixed into one thread, and only Re:/Fwd:/FW: prefixes were stripped.
    Behavior change: candidates are still found by subject (now filtered
    inside Mail with whose instead of walking every message), but the thread
    is then built from the newest match outward through Message-ID,
    In-Reply-To and References. Same-subject messages without a link are
    listed in a separate section instead of inside the thread, messages without
    any Message-ID stay in the thread, the output is sorted oldest first, and
    repeated or localized prefixes (Re: AW: Fwd:, WG:) are stripped.
    max_messages now caps the number of candidates inspected.

🤖 Generated with Claude Code

herbeckrobin and others added 3 commits October 14, 2026 22:23
CHANGELOG.md taken from main; the entry is consolidated at release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The thread is seeded from the newest of the first N subject matches Mail
returns, so say so in the get_email_thread docstring. Swap an em dash in
the _split_thread_by_linkage docstring for a comma.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@patrickfreyer
patrickfreyer merged commit 21f2975 into main Oct 15, 2026
5 checks passed
@patrickfreyer
patrickfreyer deleted the carry/110-thread-message-id branch October 15, 2026 02:11
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.

3 participants