Repository navigation
fix(tools/mail-source/imap): accept a bare Message-ID in every thread operation - #1962
Merged
Merged
Conversation
Normalize caller-supplied thread IDs at the read and archive-link boundaries so the documented bare and bracketed forms resolve to the same thread. Generated-by: Codex (GPT-6)
Keep caller-side bare Message-ID normalization separate from the bracketed-token rule used for mail headers. Generated-by: Codex (GPT-6)
… operation create_draft, list_drafts and list_sent_since now canonicalise the thread id the way read_thread and thread_url do, so a bare id no longer reports "thread root not found" or an empty list. Generated-by: Claude Opus 5
potiuk
enabled auto-merge (squash)
November 1, 2026 23:53
7 of 15 tasks
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.
Summary
create_draft,list_draftsandlist_sent_sincenow canonicalise the thread id withcanonical_thread_id, as fix(tools/mail-source/imap): accept bare Message-IDs #1953 does forread_threadandthread_url. With a bare id,create_draftstopped with "thread root ... not found" and the two list operations returned an empty list, which tells a caller "no reply drafted or sent yet" when there is one.read_threaddrops the redundantoriginal_thread_idvariable.The mail-source contract (
tools/mail-source/contract.md, Thread identity) says an id typed without brackets is accepted on input and normalised; after this every IMAP operation that takes a thread id does.Depends on #1953: this branch carries its commit, and only the last commit is new. Once #1953 merges, this PR is that one commit.
Type of change
.claude/skills/<name>/) — eval fixtures updated belowtools/<system>/*.md)tools/*/withpyproject.toml)docs/,README.md,CONTRIBUTING.md)projects/_template/)prek, workflows, validators)Test plan
uv run pytest(37 passed) andruff check/ruff format --checkpass fortools/mail-source/imaptest_create_draft_accepts_a_bare_root_id,test_list_drafts_accepts_a_bare_root_id,test_list_sent_since_accepts_a_bare_root_id), each asserting the same messages as the bracketed idRFC-AI-0004 compliance
No RFC-AI-0004 surface changes: no new mutation, network access, skill behaviour or write path.
Linked issues
Refs #1924, #1953
Notes for reviewers (optional)
This was found reviewing #1953; the push to the contributor's branch was refused, so it comes as a follow-up rather than a commit on that PR.
Generative AI was used: Claude Code drafted the change, the tests and this description; I reviewed the diff.
🤖 Generated with Claude Code