Skip to content

Send every reply as the sender the prefill resolved - #372

Merged
jeremy merged 5 commits into
mainfrom
reply-acting-sender
Sep 1, 2026
Merged

Send every reply as the sender the prefill resolved#372
jeremy merged 5 commits into
mainfrom
reply-acting-sender

Conversation

@jeremy

@jeremy jeremy commented Aug 31, 2026

Copy link
Copy Markdown
Member

Every reply path filled acting_sender_id from the SDK's account default, ignoring the sender HEY resolved for the thread. The reply prefill (GET /entries/{id}/replies/new) picks its sender by inspecting the entry's own to and from addresses; the create path trusts whatever acting_sender_id it is handed. So hey reply, hey compose --thread-id, and the TUI reply all delivered as the account owner — on a HEY for Work account with a shared support address, the wrong identity on every reply. This is the acting-sender leg (part 2 of 3) of #341.

Stacked on #370 (base: fix/reply-subject) and built on basecamp/hey-sdk#135, which takes an actingSenderID on CreateReply/CreateReplyDraft (zero = the account default, as today). go.mod pins that branch head (v0.28.2-0.20260831231248-da9d3ca760d5); the pin moves to merged mainline once the SDK PR lands, as #370's did. The vendored MCP model snapshot and Nix vendorHash ride along with the pin (model files are byte-identical — the SDK change is wrapper-only).

Change

  • replyPrefillFromServer answers a replyPrefill struct — subject, acting sender, recipients — instead of a growing tuple. The sender is the prefill's sender.id, which HEY names exactly when the resolved sender differs from the acting user; it shares the id-space acting_sender_id reads (the identity's sender contacts).
  • hey reply and hey compose --thread-id hand it to CreateReply/CreateReplyDraft on both the delivery and draft paths — the reporter's "Me → …" drafts were this same wrong identity.
  • The TUI reply carries it from the same prefill read Carry the reply prefill's subject onto every reply #370 added, through the form to the send.
  • Like the subject, the sender survives the recipient fallback: only the recipients need the local computation, which cannot name a sender and leaves the SDK on the account default — exactly today's behavior for a thread with no alternate sender.

Tests

  • CLI: the prefill's sender reaches the wire (acting_sender_id 215, not the default 42); a prefill naming no sender falls back to the account default.
  • TUI: the context load resolves the prefill's sender and the send delivers as it; a hand-built context threads it through the form; the recipientless-prefill fallback keeps the sender alongside the subject; an empty prefill leaves it on the account default.
  • TMPDIR=/tmp/t make check green; Nix vendorHash verified by a full build.

Basecamp: [SDK] Replies go out as the account owner, not the address the thread was sent to


Summary by cubic

Fixes replies going out as the account default sender instead of the sender HEY resolved for the thread, so hey reply, hey compose --thread-id, and the TUI reply now deliver from the right identity on shared or alternate addresses. Drafts also keep their recorded sender through edits and the final send; a prefill that names no sender still falls back to the account default.

Bug Fixes

  • The prefilled sender is carried alongside the subject and recipients, and survives the recipient fallback.
  • draft update and draft send now say the draft's own sender back to HEY instead of reverting it to the account default.
  • Depends on the hey-sdk change adding an acting sender to CreateReply/CreateReplyDraft and DraftContent; go.mod pins that branch, and the Nix vendorHash and MCP provenance file follow (the model itself is byte-identical).

Written for commit 66ae265. Summary will update on new commits.

Review in cubic

Copilot AI balanced review requested due to automatic review settings August 31, 2026 23:25
@jeremy
jeremy requested a review from a team as a code owner August 31, 2026 23:25
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-01T01:15:00.742764Z 66ae265 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

Pull request overview

Carries HEY’s resolved sender identity through CLI and TUI reply creation.

Changes:

  • Adds the acting sender to reply context and send operations.
  • Preserves it during recipient fallback.
  • Updates SDK dependency metadata and tests.

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.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
internal/cmd/thread_reply.go Resolves and retains the prefilled sender.
internal/cmd/thread_reply_test.go Tests sender resolution and default fallback.
internal/cmd/reply.go Passes the sender when sending or saving replies.
internal/cmd/compose.go Passes the sender for thread replies.
internal/tui/compose.go Carries the sender through TUI reply forms.
internal/tui/compose_test.go Tests TUI sender propagation.
go.mod Updates the HEY SDK revision.
go.sum Updates SDK checksums.
nix/package.nix Updates the Nix vendor hash.
internal/mcpserver/model/PROVENANCE.json Records the corresponding SDK revision.

💡 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
Comment thread internal/cmd/compose.go
@jeremy
jeremy force-pushed the reply-acting-sender branch from ef90b66 to 2f91c4d Compare August 31, 2026 23:47
@jeremy

jeremy commented Aug 31, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 2f91c4db0c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 12 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread internal/cmd/thread_reply.go
@jeremy
jeremy force-pushed the reply-acting-sender branch from 63133cf to 8d4b042 Compare September 1, 2026 00:26
@jeremy
jeremy force-pushed the reply-acting-sender branch from 8d4b042 to 1e268c1 Compare September 1, 2026 01:03
Base automatically changed from fix/reply-subject to main September 1, 2026 01:12
jeremy added 5 commits August 31, 2026 18:12
Every reply path filled acting_sender_id from the SDK's account
default, ignoring the sender HEY resolved for the thread. The reply
prefill picks its sender by inspecting the entry's own to and from
addresses — on a shared or alternate address (a HEY for Work support
address, an extension, a forwarded external account) that is not the
account default — and the create path trusts whatever it is handed.
So hey reply, hey compose --thread-id, and the TUI reply all
delivered as the account owner: the wrong identity on every reply
from a shared address.

Keep the prefill's sender alongside its subject and recipients —
replyPrefillFromServer now answers a replyPrefill struct — and hand
it to CreateReply and CreateReplyDraft as the acting sender, on the
delivery and draft paths of both commands and the TUI form alike.
Like the subject, the sender survives the recipient fallback: only
the recipients needed the local computation, which cannot name a
sender and leaves the SDK on the account default, exactly as before.

Follows the SDK signature change in basecamp/hey-sdk#135; go.mod
pins that branch head until it merges. The vendored MCP model
snapshot and Nix vendorHash ride along with the pin.
The acting-sender branch grew DraftContent.ActingSenderID and the
untouched pass-through; pseudo-version, model provenance and vendorHash
follow.
draftContentFrom now says the edit state's sender back on every rewrite
— HEY revises a draft from the whole request, so omitting it handed a
draft composed from a shared or alternate address back to the account
default on its first edit or the final send. Rides the refreshed SDK
pin, whose DraftContent carries ActingSenderID (zero still meaning the
account default).
@jeremy
jeremy force-pushed the reply-acting-sender branch from 1e268c1 to 66ae265 Compare September 1, 2026 01:12
@jeremy
jeremy merged commit 42daa99 into main Sep 1, 2026
32 checks passed
@jeremy
jeremy deleted the reply-acting-sender branch September 1, 2026 01:12
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.

2 participants