You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature: emailed attachments cannot be enumerated anywhere #3016
Asked what documents exist, chat answers with whatever the query text happens to match. There is no way to enumerate what is in scope.
Why it matters
Retrieval finds passages that resemble a query. Some questions have no answer inside any passage:
"How many CVs are there?" — the count is written in no document.
"List every document you can see." — the set is written in no document.
"Which of these are for sales?" — needs each document classified, not the one most similar to the question.
So an answer to a question about the corpus is decided by phrasing rather than by contents, and the model reports it with the same confidence as a real hit.
Observed on a live deployment: two CVs in the corpus, and a question about CVs returned one — correctly, as it happens, but the mechanism cannot distinguish "one exists" from "one matched".
This is a solved shape
#3008 fixed exactly this for tasks and projects. When the wording matches nothing, those legs list what is in scope and sources reports listed rather than searched, so the model never presents a listing as a match. The documents leg has no equivalent, and is the last leg without one.
Shape
Give the documents leg a listing fallback over the caller's readable scope, reported as listed. Two constraints carried over from #3008:
The listing and the search must decide scope with the same code, so a list and a search cannot disagree about what is visible.
A listing is bounded, so it must bound what it examines as well as what it keeps, and say when the walk was cut short rather than implying completeness.
rag_search gained a required action verb, and list browses one kind with filters and no text match. document is one of the nine kinds. So a question about what exists is no longer answered by whatever the query text happens to match — for the Document Hub.
What it did not cover
list kind="document" is backed by list_documents_for_agent.ts, which walks the documents table. An emailed attachment has no documents row: it exists as a fileMetadata row plus a corpus row, which is exactly why the retrieval gate needed a separate conversation branch — its document path keys on metadata.documentId, and for a mail attachment that is undefined.
So emailed attachments are not enumerable. A document list will not show them.
Why the remaining half matters more than the first
An emailed attachment has no listing surface anywhere in the product. It is absent from the Documents page for the same reason it is absent from the list action, and its only appearance is on its own conversation in the Inbox. So retrieval is the only way to discover one, and discovery by retrieval requires guessing words that appear in it.
That is the case that opened this issue: two CVs in the corpus, one findable because its own text repeated the job title, the other not findable at all despite being indexed and in scope.
#3014 improves the odds by putting the mail's subject and correspondent into the chunk header, so an attachment becomes findable by the role it was sent for rather than only by its filename and contents. It does not make attachments enumerable.
Shape of what is left
A listing surface for conversation-scoped attachments. Constraints inherited from #3029 and #3011:
Visibility is the conversation's live assignment, decided by conversationAssignmentAllows — not a stamp, so a reassignment moves the file with it.
The listing and the search must decide scope with the same code, so they cannot disagree about what is visible.
Bound what is examined as well as what is kept, and say when the walk was cut short rather than implying completeness.
Note for whoever picks this up
Do not close this against #3029 without checking which table the document list walks. That assumption was nearly made once already.
changed the title [-]Feature: chat cannot enumerate the documents in scope[/-][+]Feature: emailed attachments cannot be enumerated anywhere[/+]on Aug 21, 2026
Closing: the remaining half shipped in #3033 and #3035.
Checked against the note above about which table the list walks. convex/file_metadata/list_mail_attachments.ts walks fileMetadata, not documents, so emailed attachments are enumerable on their own terms rather than through a document row they do not have. mail-attachment is a rag_search kind, and list kind="mail-attachment" answers under mailAttachments.
The three constraints this issue set:
Live assignment, not a stamp — visibility goes through conversationAssignmentAllows, so reassigning a conversation moves its attachments with it.
Listing and search decide scope with the same code — both resolve the caller through conversationCallerResolver, so a list and a search cannot disagree about what is visible.
Bound what is examined, and say so — the walk stops at SCAN_CAP rows examined, not just rows kept, and reports truncated so a cut-short walk never reads as a complete one.
The walk runs on by_organizationId_and_mailReceivedAt in arrival order, newest first, so the bound returns the most recent attachments rather than whichever the index happened to reach.
Verified on a deployment: an owner and an admin see the listing, a member outside the conversation's team sees nothing, list→fetch works, and the arrival ordering is correct.
The corpus-question shape that opened this issue — "how many CVs are there" — is answered for attachments now. #3015 remains open for email bodies, which is a different corpus.
Activity
Israeltheminer commentedon Aug 21, 2026
Partly resolved by #3029, and the remaining half is the one worth keeping open.
What #3029 covered
rag_searchgained a requiredactionverb, andlistbrowses one kind with filters and no text match.documentis one of the nine kinds. So a question about what exists is no longer answered by whatever the query text happens to match — for the Document Hub.What it did not cover
list kind="document"is backed bylist_documents_for_agent.ts, which walks thedocumentstable. An emailed attachment has nodocumentsrow: it exists as afileMetadatarow plus a corpus row, which is exactly why the retrieval gate needed a separate conversation branch — its document path keys onmetadata.documentId, and for a mail attachment that is undefined.So emailed attachments are not enumerable. A document list will not show them.
Why the remaining half matters more than the first
An emailed attachment has no listing surface anywhere in the product. It is absent from the Documents page for the same reason it is absent from the list action, and its only appearance is on its own conversation in the Inbox. So retrieval is the only way to discover one, and discovery by retrieval requires guessing words that appear in it.
That is the case that opened this issue: two CVs in the corpus, one findable because its own text repeated the job title, the other not findable at all despite being indexed and in scope.
#3014 improves the odds by putting the mail's subject and correspondent into the chunk header, so an attachment becomes findable by the role it was sent for rather than only by its filename and contents. It does not make attachments enumerable.
Shape of what is left
A listing surface for conversation-scoped attachments. Constraints inherited from #3029 and #3011:
conversationAssignmentAllows— not a stamp, so a reassignment moves the file with it.Note for whoever picks this up
Do not close this against #3029 without checking which table the document list walks. That assumption was nearly made once already.
[-]Feature: chat cannot enumerate the documents in scope[/-][+]Feature: emailed attachments cannot be enumerated anywhere[/+]Israeltheminer commentedon Aug 22, 2026
Closing: the remaining half shipped in #3033 and #3035.
Checked against the note above about which table the list walks.
convex/file_metadata/list_mail_attachments.tswalksfileMetadata, notdocuments, so emailed attachments are enumerable on their own terms rather than through a document row they do not have.mail-attachmentis arag_searchkind, andlist kind="mail-attachment"answers undermailAttachments.The three constraints this issue set:
conversationAssignmentAllows, so reassigning a conversation moves its attachments with it.conversationCallerResolver, so a list and a search cannot disagree about what is visible.SCAN_CAProws examined, not just rows kept, and reportstruncatedso a cut-short walk never reads as a complete one.The walk runs on
by_organizationId_and_mailReceivedAtin arrival order, newest first, so the bound returns the most recent attachments rather than whichever the index happened to reach.Verified on a deployment: an owner and an admin see the listing, a member outside the conversation's team sees nothing, list→fetch works, and the arrival ordering is correct.
The corpus-question shape that opened this issue — "how many CVs are there" — is answered for attachments now. #3015 remains open for email bodies, which is a different corpus.