Skip to content

fix(gmail): add reply-all recipients for draft replies#805

Merged
steipete merged 1 commit into
mainfrom
clawsweeper/issue-openclaw-gogcli-804
Jun 15, 2026
Merged

fix(gmail): add reply-all recipients for draft replies#805
steipete merged 1 commit into
mainfrom
clawsweeper/issue-openclaw-gogcli-804

Conversation

@clawsweeper

@clawsweeper clawsweeper Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add --reply-all to gog gmail drafts create and gog gmail drafts update.
  • Infer To/Cc recipients from the reply target when --reply-all is set, reusing the existing reply recipient logic.
  • Preserve current no-recipient draft behavior unless users explicitly opt into --reply-all.
  • Update generated command docs and changelog release-note context.

Fixes #804

Testing

  • make docs-commands
  • go test -vet=off ./internal/cmd -run 'Test(GmailDrafts(Create|Update)Cmd|BuildReplyRecipients|ReplyInfo|FetchReplyInfo)'
  • make ci

Notes

Reported by @privatenumber in #804.

ClawSweeper 🐠 replacement reef notes:

fish notes: reasoning high; reviewed against 6582fc7.

@clawsweeper clawsweeper Bot added clawsweeper Tracked by ClawSweeper automation clawsweeper:autogenerated PR created automatically by ClawSweeper clawsweeper:automerge ClawSweeper generated this PR and armed bounded exact-head automerge labels Jun 14, 2026
@clawsweeper

clawsweeper Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

Codex review: needs maintainer review before merge. Reviewed June 15, 2026, 1:27 AM ET / 05:27 UTC.

Summary
The PR adds an opt-in --reply-all mode to Gmail draft create/update, infers reply recipients from the target message, and updates command docs, spec text, changelog context, and focused tests.

Reproducibility: yes. Source inspection shows current main prepares draft reply metadata but builds draft recipients only from explicit To/Cc/Bcc while allowing missing To, matching the linked report.

Review metrics: 3 noteworthy metrics.

  • Changed files: 6 files affected. The diff is bounded to one Gmail implementation file plus generated docs/spec, changelog context, and tests.
  • Implementation files: 1 Gmail implementation file changed. Recipient-routing review can focus on the draft compose/update path and shared reply-recipient helper.
  • Draft reply tests: 4 tests added. The tests cover the main create/update reply-all paths and explicit recipient replacement behavior.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🌊 off-meta tidepool
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P2] Maintainers should confirm the opt-in draft --reply-all contract and wait for required checks before merging.

Risk before merge

  • [P1] The PR intentionally changes inferred recipient headers for reply-shaped drafts when users opt into --reply-all, so maintainers should confirm that contract before merge.
  • [P1] A collaborator explicitly paused ClawSweeper automation, so this should proceed only through human review or an intentional maintainer restart.

Maintainer options:

  1. Land After Recipient-Semantics Review (recommended)
    If maintainers approve explicit draft --reply-all behavior, merge this head after required checks complete.
  2. Pause For A Different Draft Policy
    If maintainers want default recipient inference, warning-only behavior, or no new flag, leave this PR paused and resolve that policy in the linked issue first.

Next step before merge

  • [P2] A collaborator paused ClawSweeper automation, so maintainers need to review and decide whether to land this recipient-routing behavior manually.

Security
Cleared: The diff changes Gmail compose logic, generated command docs/spec text, changelog context, and tests only; no new dependency, workflow, credential, secret, or code-execution surface was found.

Review details

Best possible solution:

Land the latest head after maintainer review and green checks if the opt-in draft --reply-all contract is approved; otherwise keep the linked issue as the behavior-policy discussion.

Do we have a high-confidence way to reproduce the issue?

Yes. Source inspection shows current main prepares draft reply metadata but builds draft recipients only from explicit To/Cc/Bcc while allowing missing To, matching the linked report.

Is this the best way to solve the issue?

Yes for the latest PR shape, subject to maintainer approval of the new CLI flag. The explicit opt-in mode preserves no-recipient drafts by default while matching the existing send/reply-all recipient derivation model.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 23b847ca53cf.

Label changes

Label justifications:

  • P2: This is a normal-priority Gmail draft reply workflow fix with clear scripted-use impact and limited blast radius.
  • merge-risk: 🚨 message-delivery: The PR changes who appears in To/Cc/Bcc for reply-shaped drafts when --reply-all is used, which is message-delivery-sensitive.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is an autogenerated ClawSweeper bot PR, so the external-contributor real behavior proof gate does not apply; the PR body reports targeted tests and make ci.
Evidence reviewed

What I checked:

  • Repository policy read: AGENTS.md was read fully; its PR review-mode guidance was applied by inspecting the PR with gh without changing branches or files. (AGENTS.md:31, 23b847ca53cf)
  • Current main lacks draft reply-all: Current main exposes reply target and quote fields for drafts, but no ReplyAll field, and buildDraftMessage passes only explicit To/Cc/Bcc values to the MIME builder. (internal/cmd/gmail_drafts.go:254, 23b847ca53cf)
  • Current main allows no-recipient drafts: The MIME builder only rejects missing To when AllowMissingTo is false, matching the existing draft behavior that this PR preserves by making recipient inference opt-in. (internal/mailmime/mime.go:79, 23b847ca53cf)
  • Existing send path has reply-all parity: gog gmail send already validates --reply-all, derives recipients from the reply target, and lets explicit recipient flags override inferred fields. (internal/cmd/gmail_send.go:82, 23b847ca53cf)
  • PR implementation is bounded: The PR diff adds draft ReplyAll, validates that it has a reply target, calls shared reply-recipient logic, and preserves explicit recipient replacement semantics. (internal/cmd/gmail_drafts.go:262, c89a054abf91)
  • Focused regression coverage added: The PR adds tests for draft create inference, missing-target validation, explicit recipient replacement, and draft update inference. (internal/cmd/gmail_drafts_cmd_test.go:1426, c89a054abf91)

Likely related people:

  • steipete: Current blame for the draft compose path points to the v0.27.0 release authored by Peter Steinberger, and merged reply-command work added the shared reply-recipient surface this PR reuses. (role: recent Gmail write-path contributor; confidence: high; commits: 274a2a61da98, ba350d6824ce; files: internal/cmd/gmail_drafts.go, internal/cmd/gmail_recipients.go, internal/cmd/gmail_reply_commands.go)
  • antons: Merged PR history for allowing drafts without recipients touched the same draft and MIME validation behavior that constrains this fix. (role: draft no-recipient behavior introducer; confidence: medium; commits: 471324b4511a; files: internal/cmd/gmail_drafts.go, internal/cmd/gmail_drafts_cmd_test.go, internal/cmd/gmail_mime.go)
  • chrischall: Related review context traces recent draft thread-ID and attachment-preservation work to this author on the same draft create/update surface. (role: recent draft reply parity contributor; confidence: medium; commits: 22fbc35c7c18, 3d5c9cef65fa; files: internal/cmd/gmail_drafts.go, internal/cmd/gmail_drafts_cmd_test.go)
  • salmonumbrella: Related review context traces the original lower-level gmail send --reply-all recipient-routing behavior to this contributor, which is the parity model for the draft change. (role: adjacent recipient-routing contributor; confidence: medium; commits: bf7d500849a0; files: internal/cmd/gmail_send.go)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 🚀 automerge armed This PR is in ClawSweeper's automerge lane. P2 Normal priority bug or improvement with limited blast radius. labels Jun 14, 2026
@clawsweeper

clawsweeper Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

🦞🔧
ClawSweeper applied a repair to this PR branch.

Repair: kept the fix on this contributor branch instead of opening a replacement PR.
Validation: git diff --check
Updated head: cf1edbffc93c
Run: https://github.com/openclaw/clawsweeper/actions/runs/27524774195

Current state: exact-head review queued immediately; GitHub checks and the review verdict gate final merge.

Automerge progress:

  • 2026-06-14 15:10:07 UTC review queued 3b111abd66b7 (after repair)
  • 2026-06-15 04:50:47 UTC review requested repair 3b111abd66b7 (structured ClawSweeper marker: fix-required (finding=review-feedback sha=3b111a...)
  • 2026-06-15 04:55:15 UTC review queued cf1edbffc93c (after repair)

@steipete steipete added clawsweeper:autofix Bounded ClawSweeper-reviewed autofix without merge and removed clawsweeper:automerge ClawSweeper generated this PR and armed bounded exact-head automerge status: 🚀 automerge armed This PR is in ClawSweeper's automerge lane. labels Jun 15, 2026
@clawsweeper clawsweeper Bot added the status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. label Jun 15, 2026
@steipete steipete removed the clawsweeper:autofix Bounded ClawSweeper-reviewed autofix without merge label Jun 15, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 message-delivery 🚨 Merging this PR could drop, duplicate, misroute, suppress, or wrongly target messages. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 15, 2026
@steipete

Copy link
Copy Markdown
Collaborator

@clawsweeper stop

@clawsweeper

clawsweeper Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

🦞✅
Got it. ClawSweeper will leave this item for human review.

I added clawsweeper:human-review and paused the automation trail until a maintainer asks again.

@clawsweeper clawsweeper Bot added clawsweeper:human-review ClawSweeper automerge is paused for maintainer review rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 15, 2026
Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com>
@steipete
steipete force-pushed the clawsweeper/issue-openclaw-gogcli-804 branch from cf1edbf to c89a054 Compare June 15, 2026 05:21
@steipete
steipete merged commit d6fb001 into main Jun 15, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:autogenerated PR created automatically by ClawSweeper clawsweeper:human-review ClawSweeper automerge is paused for maintainer review clawsweeper Tracked by ClawSweeper automation merge-risk: 🚨 message-delivery 🚨 Merging this PR could drop, duplicate, misroute, suppress, or wrongly target messages. P2 Normal priority bug or improvement with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(gmail): draft replies via --reply-to-message-id don't set a recipient (no --to inference, no --reply-all)

1 participant