Skip to content

feat(oauth-draft): thread drafts by explicit In-Reply-To / References - #2051

Merged
potiuk merged 1 commit into
apache:mainfrom
potiuk:oauth-draft-explicit-in-reply-to
Nov 10, 2026
Merged

potiuk merged 1 commit into
apache:mainfrom
potiuk:oauth-draft-explicit-in-reply-to

Conversation

@potiuk

@potiuk potiuk commented Nov 10, 2026

Copy link
Copy Markdown
Member

oauth-draft only set In-Reply-To / References from the last message of a Gmail thread_id. When the inbound message never reached the user's Gmail (e.g. a security report Gmail classified as spam, so it exists only in the PonyMail archive), the skills had no thread id and the reply to the reporter went out unthreaded.

  • create_draft (MCP) and oauth-draft-create (CLI) take optional in_reply_to / --in-reply-to and references / --references. Angle brackets optional; each ID must be a single local@domain token, so whitespace / CR / LF (header injection) are rejected. References defaults to in_reply_to, which is appended to a given chain when missing.
  • With thread_id too, the draft stays attached to the thread but the explicit headers win (no thread read). Plain-text-only output unchanged.
  • threading.md / draft-backends.md document the header-threaded path between thread attachment and subject fallback; the security import, sync and invalidate reply steps pass the PonyMail / recorded Message-ID when no Gmail thread exists.
  • Unit tests cover normalization, injection rejection, precedence with thread_id, and the MCP schema.

🤖 Generated with Claude Code

oauth-draft set In-Reply-To / References only from the last message of a
Gmail thread_id. A report that never reached the user's Gmail (classified
as spam, LDAP-only subscription, other account) exists only in the
PonyMail archive, so the reply to the reporter went out unthreaded.

- create_draft (MCP) and oauth-draft-create (CLI) take optional
  in_reply_to / --in-reply-to and references / --references. Angle
  brackets are optional; each ID must be a single local@domain token of
  printable ASCII, so whitespace and CR / LF (header injection) are
  rejected. References defaults to in_reply_to alone, and in_reply_to is
  appended when the given chain does not name it (RFC 5322).
- With thread_id as well, the draft is still attached to the thread but
  the explicit headers win and the thread is not read. no_reply_headers
  and in_reply_to are mutually exclusive. Plain-text-only output is
  unchanged.
- threading.md and draft-backends.md add the header-threaded path between
  thread attachment and the subject fallback; the security import, sync
  and invalidate reply steps pass the PonyMail / recorded Message-ID when
  there is no Gmail thread.

Generated-by: Claude Opus 5
@potiuk
potiuk enabled auto-merge (squash) November 10, 2026 10:47
@potiuk
potiuk merged commit 6b10227 into apache:main Nov 10, 2026
10 checks passed
@github-actions github-actions Bot added family:security security-* skills family:tools tools/* family:docs Docs, MISSION.md, READMEs capability:intake Import external signal + sync tracker state capability:resolve Close-out: invalidate, dedupe, CVE allocate, announcement contract:mail-archive Tool capability: mailing-list / forum archive reads contract:mail-source Tool capability: inbound-mail ingestion (mbox / IMAP / ...) contract:mail-create Tool capability: outbound mail composition (editable draft; sending is a separate human step) labels Nov 10, 2026
potiuk added a commit that referenced this pull request Nov 10, 2026
Brings the specs up to main bfc99bb (37 commits since 1e5c4f9), ahead
of the next dev-version bump:

- security-issue-lifecycle: the import renders the report as defanged
  markdown under a data note, with `description_format: inert` as the
  fenced alternative (#2048).
- adapters: oauth-draft threading by explicit In-Reply-To / References
  (#2051); the typed-decision Jev request shape (#2023).
- adoption-and-setup, marketplace-distribution, codex-runtime: the setup
  sub-action is `update`, and every skill offers the upgrade until it has
  run (#2041); the most specific `sandbox.enabled` wins (#2011); the
  family MCP allows cover single-item reads only (#2020).
- agent-isolation-sandbox: bare `gh auth status` only (#2019); draft
  creation and whole-mailbox search stay prompted (#2020).
- pr-management-family: the CI gate's way out for a non-required check
  (#2029); the adversarial export keeps export-ignore paths (#2030);
  install.md per family (#2031); merge-candidates / thread-mentor names
  (#2025).
- contributor-growth: the candidate-screen committer / PMC headline
  (#2024).
- issue-management-family, repo-health-family: install.md (#2031).
- project-agnosticism: the merge-candidates example path and a re-counted
  example-name gap (#2025).

Generated-by: Claude Opus 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capability:intake Import external signal + sync tracker state capability:resolve Close-out: invalidate, dedupe, CVE allocate, announcement contract:mail-archive Tool capability: mailing-list / forum archive reads contract:mail-create Tool capability: outbound mail composition (editable draft; sending is a separate human step) contract:mail-source Tool capability: inbound-mail ingestion (mbox / IMAP / ...) family:docs Docs, MISSION.md, READMEs family:security security-* skills family:tools tools/*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant