Skip to content

fix(tools/mail-source/imap): accept a bare Message-ID in every thread operation - #1962

Merged
potiuk merged 3 commits into
apache:mainfrom
potiuk:imap-bare-id-every-op
Nov 1, 2026
Merged

potiuk merged 3 commits into
apache:mainfrom
potiuk:imap-bare-id-every-op

Conversation

@potiuk

@potiuk potiuk commented Nov 1, 2026

Copy link
Copy Markdown
Member

Summary

  • create_draft, list_drafts and list_sent_since now canonicalise the thread id with canonical_thread_id, as fix(tools/mail-source/imap): accept bare Message-IDs #1953 does for read_thread and thread_url. With a bare id, create_draft stopped 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_thread drops the redundant original_thread_id variable.

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

  • Skill change (.claude/skills/<name>/) — eval fixtures updated below
  • Tool / bridge contract (tools/<system>/*.md)
  • Python package (tools/*/ with pyproject.toml)
  • Groovy reference impl
  • Cross-cutting (RFC, AGENTS.md, sandbox, privacy-LLM)
  • Documentation (docs/, README.md, CONTRIBUTING.md)
  • Project template (projects/_template/)
  • CI / dev loop (prek, workflows, validators)
  • Other:

Test plan

  • For Python packages touched: uv run pytest (37 passed) and ruff check / ruff format --check pass for tools/mail-source/imap
  • Other: one bare-id test per operation (test_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 id

RFC-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

xiaobai0529 and others added 3 commits November 1, 2026 19:05
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
potiuk enabled auto-merge (squash) November 1, 2026 23:53
@github-actions github-actions Bot added family:tools tools/* contract:mail-source Tool capability: inbound-mail ingestion (mbox / IMAP / ...) labels Nov 1, 2026
@potiuk
potiuk merged commit d5dd37f into apache:main Nov 1, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contract:mail-source Tool capability: inbound-mail ingestion (mbox / IMAP / ...) family:tools tools/*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants