-
Notifications
You must be signed in to change notification settings - Fork 21
Prevent duplicate check-in replies in IMAP #2002
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -118,6 +118,16 @@ func asMessages(accountID string, t thread.Thread, domain string) []*mail.Messag | |
| } | ||
| } | ||
|
|
||
| // Mail answers carry their sending address in From (AskRequest.As). | ||
| // They belong to the mail transport even before delivery is indexed; | ||
| // projecting them here exposes a second .conversation sender to IMAP. | ||
| if m.Role == thread.RoleAgent && m.Workflow != "" && strings.HasSuffix(strings.ToLower(m.From), "@"+strings.ToLower(domain)) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When AGENTS.md reference: AGENTS.md:L306-L310 Useful? React with 👍 / 👎. |
||
| if strings.HasPrefix(m.Ref, "<") && strings.HasSuffix(m.Ref, ">") { | ||
| prev = m.Ref | ||
| } | ||
| continue | ||
| } | ||
|
|
||
| one := &mail.Message{ | ||
| Bridged: true, | ||
| ID: id, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
QueryWithOptsreturns an error after producing partial output,Askdeliberately clearsAnswerRefbefore recording that partial agent turn, but this call sends the replacement failure notice under the reservedanswerRef. The Inbox arrival therefore cannot deduplicate against the recorded agent turn: the stale partial answer remains and the delivered notice is added as a separateRolePersonmessage from the agent address (and may open a separate projected thread). The removedagent.Sentpath previously attached the actual sent ID to that partial turn, so the fallback needs to be recorded as the agent answer with the reserved identity before delivery.AGENTS.md reference: AGENTS.md:L291-L300
Useful? React with 👍 / 👎.