Repository navigation
let agents reply to an email in its thread, sent or saved as a draft - #166
Merged
Merged
Conversation
… and open an email with its Message-ID and thread
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.
An agent asked to reply to an outreach email couldn't: the email tools only sent new email or drafts with no link to the email answered, and opening an email didn't say its thread or Message-ID, so the best it could do was a new message with "Re:" in the subject, which may not land in the conversation. This adds a
repliescollection for Gmail and IMAP mailboxes, with two tools built on the reply the home page's Reply to email already writes (replyToGmail, and the IMAP one, nowreplyToMailbox).replies_sendsends a reply at once and needs Send and Read: a reply reads the email it answers, and Send alone otherwise lets an agent send without seeing the mailbox.replies_draftsaves the reply as a draft in the thread, foremails_sendto send later, and needs Write drafts, which already requires Read. Both takeemail(the id a list gives),bodyandreplyAll(YesorNo). Whom it goes to, its subject and its thread come from the email: its Reply-To, else its sender, or, for an email sent from the account, whom it went to; the subject with "Re:" once; In-Reply-To and References, and on Gmail the email's thread id. A reply to all also goes to the others the email went to and copies whom it copied, never the account itself. Each answers whom it went to (To and Cc), its subject and its id: on Gmail the sent message's id ordraft-<id>with the thread Gmail put it in; on IMAP the draft's id, or a sent reply's Message-ID, since SMTP gives it no id among email. A draft isn't replied to. IMAP replies now work for sent mail as well as the inbox, as Gmail's already did.A catalog command can now name an action it
requiresbeside its own. A tool needing one the agent lacks isn't listed, and a run is refused and logged as denied; the agent pages hide its button too. The Send and Write drafts descriptions in the permissions say what they now cover, and the docs for Email and Google say how replies are addressed and which actions they need.Opening an email (
emails_get) now also returns itsmessageId, the Message-ID header, and on Gmail itsthread, so an agent can check a reply landed in the conversation.Testing
bun run typecheck,bun run test,bun run lintrepliescommands, with the id and thread they answer; reply to all leaves out the account and recipients it already has; an IMAP reply to sent mail goes to whom it went; drafts and empty bodies are turned down;replies_sendis listed and run only with Send and Read, and refused and logged as denied with Send alone;emails_getreturns the Message-ID and Gmail thread