Skip to content

gmail drafts create/update: add --thread-id for parity with gmail send #673

@chrischall

Description

@chrischall

Summary

gog gmail send accepts --thread-id ("Reply within a Gmail thread (uses latest message for headers)"), but gog gmail drafts create and gmail drafts update do not — they only accept --reply-to-message-id. There's no thread-aware reply path when composing a draft.

Why it matters

Callers who know the thread they want to reply to (but not the specific latest message id) have nowhere to put it. Passing a thread id into --reply-to-message-id produces a draft that lands in the thread via subject/participant fallback but is not anchored to the parent's RFC822 Message-Id — so In-Reply-To/References are wrong and Gmail doesn't render it as a clean reply. It fails silently (no error), surfacing only when a human opens the draft.

Thread ids and message ids are both 16-hex strings, so this mix-up is easy and undetectable from the value alone.

Proposal

Add --thread-id to GmailDraftsCreateCmd and GmailDraftsUpdateCmd, mirroring gmail send:

  • Resolve the latest message in the thread and set In-Reply-To/References from its Message-Id (same helper send already uses).
  • --reply-to-message-id and --thread-id are mutually exclusive (match send's use only one of … guard).

Repro

  1. gmail thread get a multi-message thread; note the latest message's top-level id vs its headers Message-Id.
  2. gmail drafts create … --reply-to-message-id <THREAD_ID>.
  3. Observe the draft's In-Reply-To is not the latest message's RFC822 Message-Id.
  4. Desired: gmail drafts create … --thread-id <THREAD_ID> anchors to the latest message, exactly like gmail send --thread-id.

(Reported via the gogcli-mcp wrapper; the wrapper will resolve thread→latest-message client-side in the interim, but native --thread-id is the correct home for this.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal priority bug or improvement with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossThis issue is about lost, duplicated, misrouted, or suppressed channel messages.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions