Repository navigation
feat(replies): draft cited replies to imported email - #565
Merged
Merged
Conversation
A reply step drafts a reply to an email from its own namespace's excerpts, each fact cited, gaps marked to confirm, addressed and threaded. Drafts wait for the person; nothing is sent. API, MCP tools, pipeline step, template, docs, requirements and threat model. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xa7Hz2SLg6sNrGksMEzBaz
…-4cz7ul # Conflicts: # docs/mcp.md # fastapi_backend/app/api/v1/router.py # nextjs-frontend/app/openapi-client/index.ts # nextjs-frontend/app/openapi-client/sdk.gen.ts # nextjs-frontend/app/openapi-client/types.gen.ts # nextjs-frontend/openapi.json # threat-model.json
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xa7Hz2SLg6sNrGksMEzBaz
18 of 23 tasks
Also lists the assistant's answers about Lens itself (#400, released in v0.15.0) as built, which check_requirements now asks for. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xa7Hz2SLg6sNrGksMEzBaz
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xa7Hz2SLg6sNrGksMEzBaz
Owner
Author
|
Clicks and keystrokes per feature failed on the phone survey only: I don't think this PR caused it. Its diff doesn't touch chat, research or the stand-in model (
No fix exists yet. I've re-run the failed job once and will look into the phone chat timeout if it fails again. Generated by Claude Code |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xa7Hz2SLg6sNrGksMEzBaz
…-4cz7ul # Conflicts: # CHANGELOG.md
…-4cz7ul # Conflicts: # README.md # docs/requirements.md
…and JSON Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xa7Hz2SLg6sNrGksMEzBaz
…-4cz7ul # Conflicts: # docs/mcp.md # nextjs-frontend/components/pipelines/pipeline-canvas.tsx
This was referenced Oct 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Adeel · project thread
Description
Before: email a watched Gmail or IMAP mailbox brought in was searchable and citable, but nothing helped answer it.
After: Lens drafts a reply to an email from what that email's namespace holds. Each fact is cited
[n]to the excerpt it came from, anything the archive doesn't say is written in as[to confirm: …]and listed as a gap, and the draft is addressed to the sender (or their Reply-To), from the mailbox it came in to, withIn-Reply-ToandReferencesso it threads. Drafts wait to be edited or set aside (undo by setting them back). Nothing is sent.How: a new job step,
reply(app/domain/responder.py), modelled onspec. It reads the message again from its source (ingest.audio_pathpluskeyring.open_plain), strips the quote and signature withmailbox.split, finds excerpts withchat.retrievelimited to the email's own namespace (and never the email itself), and asks the model through a prompt template, Reply to an email, which is seeded at startup and can be edited on the Templates page. The result is stored in a newemail_replytable keyed by recording; it is deleted and moved along with its email.GET /replies(mail that waits: not lists, no-reply senders or your own, plus every draft),POST/GET/PATCH /recordings/{id}/reply.email_replies,draft_reply(withinstructions),get_reply,edit_reply.replystep is available in the editor and canvas. No pipeline has it by default. When a pipeline runs it, automatic mail and your own mail are skipped without a model call.Sending through the mailbox, after the person says yes, comes in a follow-up that reuses the Gmail write half (#552). A Replies page in the web app also comes in a follow-up.
Motivation and Context
This is the flagship consumer app on Lens infrastructure (Adeel, 2026-10-05: infrastructure first, then an email responder). It is built on the existing Gmail and IMAP sensors, the job pipeline, templates, retrieval and the untrusted-text defences.
Types of changes
!in the title)Checklist:
make hookschecks it on commit).docs/accordingly.changelog.d/email-replies.md.Done questions (AGENTS.md)
tests/api/test_replies.py(4 tests),docs/email-replies.md, requirements rows,make openapioutput.mailbox.split/automatic,chat.retrieve/excerpts,untrusted.mark/defang, and templates.Local checks: backend suite, ruff, mypy, tsc, prettier, pipeline jest,
ci/check_requirements.py,ci/validate_threat_model.py --base origin/main,mkdocs build --strict, andci/local-ci.sh --pr 565.🤖 Generated with Claude Code
https://claude.ai/code/session_01Xa7Hz2SLg6sNrGksMEzBaz