Skip to content

Reply to explicit recipients without losing the thread - #474

Open
robzolkos wants to merge 2 commits into
mainfrom
rob/issue-463-reply-recipients
Open

robzolkos wants to merge 2 commits into
mainfrom
rob/issue-463-reply-recipients

Conversation

@robzolkos

@robzolkos robzolkos commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

What changed

  • add repeatable and comma-separated hey reply --to, --cc, and --bcc recipient overrides
  • merge overrides into HEY's reply prefill by default, moving an explicitly named address to its requested line without duplicates
  • add --replace-recipients for a fully explicit envelope
  • add a read-only --dry-run that reports the resolved account, thread, entry, subject, sender, and final recipients without reading a body, uploading attachments, or sending
  • let explicit recipients make a reply target addressable when HEY cannot resolve recipients itself
  • apply the same final envelope when saving a reply draft

Replies continue through the existing entry reply endpoint, so they remain in the original thread.

Verification

  • make test
  • make lint
  • HEY_SMOKE_STRICT=1 go test -run '^TestReplyRecipientOverrides$' -count=1 -v in tests/smoke
  • built binary help and baseline CLI reproduction

Closes #463


Summary by cubic

Adds hey reply recipient overrides (--to, --cc, --bcc, repeatable and comma-separated) so replies can address explicit recipients without leaving the thread. Overrides merge into HEY's prefill, moving a named address to its requested line; --replace-recipients uses only the explicit list. A read-only --dry-run reports the resolved account, thread, entry, subject, sender, and final recipients without sending. Explicit recipients now let replies go out even when HEY cannot resolve recipients itself, and the resolved envelope applies to drafts as well.

  • Dry runs and --replace-recipients sends never read the original message body.
  • When HEY's prefill is unavailable, a dry run refuses to guess the original recipients and suggests --replace-recipients with explicit addresses.

Written for commit 77f2039. Summary will update on new commits.

Review in cubic

@robzolkos
robzolkos requested a review from a team as a code owner September 20, 2026 21:02
Copilot AI balanced review requested due to automatic review settings September 20, 2026 21:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Dry runs and replacement envelopes can still fetch—and fail on—the original message body before explicit recipients are applied.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds configurable reply recipients and a read-only envelope preview while preserving in-thread delivery.

Changes:

  • Adds merge/replace recipient overrides.
  • Adds --dry-run envelope previews.
  • Updates tests, documentation, skill guidance, and CLI surface.

[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

File Description
.surface Records new reply flags.
docs/​cli.md Documents overrides and dry runs.
internal/​cmd/​compose.go Rejects unaddressed thread replies.
internal/​cmd/​compose_test.go Tests compose rejection behavior.
internal/​cmd/​reply.go Implements flags and preview output.
internal/​cmd/​thread_reply.go Resolves senders and merges recipients.
internal/​cmd/​thread_reply_test.go Tests reply envelopes and previews.
internal/​mail/​reply_prefill.go Exposes the resolved reply sender.
internal/​mail/​reply_prefill_test.go Tests sender extraction.
skills/​hey/​SKILL.md Updates agent reply guidance.
tests/​smoke/​threads_test.go Smoke-tests override delivery.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread internal/cmd/reply.go Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. Cursor Bugbot was not running; Cursor Security Agent passed with no findings that need human review. No reviewers were assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver

@robzolkos

Copy link
Copy Markdown
Collaborator Author

Fixed - dry runs and replacement envelopes no longer fetch the original message. Tests cover failed and oversized body reads, and non-replacement previews refuse to guess unresolved recipients.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hey reply: override recipients (--to/--cc) without losing the thread

2 participants