Skip to content

feat(replies): send a reply through the Gmail it came in on, after your yes - #611

Merged
adeelahmad merged 2 commits into
mainfrom
claude/project-thread-4cz7ul
Oct 18, 2026
Merged

adeelahmad merged 2 commits into
mainfrom
claude/project-thread-4cz7ul

Conversation

@adeelahmad

Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: an email reply (#565, #604) could only be copied or opened in the person's own mail app.

After: when the email came in through a Gmail connection an admin let send (write), the Replies page has Send and Keep in Gmail drafts. The reply goes from that mailbox, in the email's thread, without its citations. Send waits a few seconds with Undo, and the status line then says who sent it, with an Open in Gmail link. A draft with a [to confirm: …] mark left, or without a valid To address, can't be sent, and the button says why. Agents can't send: the MCP tool send_reply files an approval that waits in Approvals with all of the message shown, and approving it sends exactly the text that was approved (a later edit means asking again).

How: responder.outgoing/ask/send reuse the Gmail write half from #552 (connection_tools.outgoing_mail, send_mail, mail_preview). New POST /recordings/{id}/reply/send accepts only a signed-in web session (API keys and apps get 403 and are pointed to send_reply). ai_tools._carry_out handles the send_reply approval. Reply statuses add saved and sent, with sends saying whether the email's connection may send.

Motivation and Context

The last step of the email responder's first version: drafts, then the page, then sending after the person's yes.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (make hooks checks it on commit).
  • I added or updated tests.
  • My change requires documentation updates, and I have updated docs/ accordingly.
  • Users need more than the title to understand it, so I wrote it in changelog.d/send-reply.md.

Done questions (AGENTS.md)

  • Goal: replies go out from the mailbox they belong to, only after the person says yes. Merged on green.
  • Agents: send_reply over MCP files the approval. Sending itself is the person's pick.
  • Zero setup: uses an existing Gmail connection set to write. Nothing new to install.
  • Fewest clicks: one click with Undo, no confirm dialog. The disabled button says why.
  • Configurable: whether a connection may send is the existing per-connection write setting.
  • Light: one Gmail API call per send.
  • Private and secure: admins only, signed-in session only, agents only ask, the approved text only, and each send is audited. Threat model entry updated (prose, YAML, JSON).
  • Cost: no model calls.
  • User decides: nothing is sent without the person's click or approval. Existing defaults are unchanged (connections are read-only unless an admin set write).
  • Upgrades: two new status values and a sent field on existing rows. Nothing to migrate.
  • Honest: docs say what's built. Refine later: SMTP for IMAP mail, members sending, a signature setting.
  • Tests, docs and generated files: two new backend tests in test_replies.py, 2 new page tests, docs/email-replies.md "Sending", docs/mcp.md, requirements rows, make openapi output.
  • Open standards: RFC 5322 threading through the Gmail API.
  • Reported in the project thread.
  • Reuse: the feat(assistant): send mail, add events and write files after a yes #552 Gmail write half and the existing Approvals flow.

Local checks: test_replies.py, test_mcp.py and test_approvals.py (41 passed), tsc, the page's jest suite (12 passed), ci/check_requirements.py, ci/validate_threat_model.py --base origin/main, and make openapi (no diff).


Generated by Claude Code

…ur yes

Send on the Replies page (Undo for a few seconds) or Keep in Gmail drafts,
for admins, when the email came in through a Gmail connection an admin let
send: in the email's thread, without citations, never with something left
to confirm. POST /recordings/{id}/reply/send needs a signed-in session;
agents ask with the MCP tool send_reply, which waits in Approvals and sends
the text it showed. Threat model updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xa7Hz2SLg6sNrGksMEzBaz
@adeelahmad
adeelahmad merged commit 134c9df into main Oct 18, 2026
12 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-4cz7ul branch October 18, 2026 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants