Repository navigation
Description
An email attachment is never indexed on 0.5, so chat cannot find anything inside one. The four PRs that built this (#3011, #3012, #3014, #3062) are merged and unreachable — they live in convex/, which the 0.5 backend only reaches through the shim.
Why
Three separate cuts, each deliberate and each recorded in the code:
The bind stops short of indexing. backend/domains/conversations/shim.ts:546 says it: "the 0.4 conversation-scope RAG upgrade rides the conversation-corpus retrieval leg (still honest-empty in 0.5) — bound, never queued here." So #3010's binding works and #3012's indexing does not.
The retrieval gate has no conversation branch. backend/domains/knowledge/service.ts decides a ref on documentId or threadId only. Its SELECT does not read fm.conversation_id, even though 0037_conversation_attachments.sql adds the column. A conversation-scoped row would fall through to the same-org fallback, which is the posture #3011 was written to prevent.
Message refs are refused outright. service.ts:107: if (ref.startsWith('msg:')) { continue; } — the whole of #3062.
backend/MIGRATION.md lists "conversation/email retrievable branches" as PENDING on the knowledge row, so this is deferred work rather than a porting slip.
What still works
bindFileToConversation binds, so #3010 is live. The Documents-side listings from #3033 and #3035 read file_metadata directly and are unaffected. Conversation search (#3006, #3084) searches subjects, contacts and message bodies in SQL, not the corpus, and is unaffected.
The gap is retrieval of attachment CONTENT: a CV, a signed contract, a spreadsheet someone emailed in.
Scope
Three pieces, in the order #3011 and #3012 shipped them:
- Carry
conversation_idthrough the corpus write and the SQL scope clause, and add the conversation branch tofilterRetrievableRagFileIds, decided byconversationAssignmentAllows— the predicate already ported tobackend/domains/conversations. - Queue on bind, in the bind's own transaction. fix(platform): stop email attachments starving the RAG indexing cap #2995 is the record of what splitting that promise across a boundary costs.
- Restore the
msg:branch once something writes a message ref.
#3015 step 3 (index email bodies) depends on all three and should not start before them.
Not a security exposure. Nothing indexes these files, so no corpus rows exist to leak — the fallback is unreachable today. It becomes reachable the moment step 2 lands, so step 1 ships first.
Activity
Israeltheminer commentedon Sep 4, 2026
Step 1 is #3220 — the conversation retrievable branch.
The write side was already there:
core/knowledge/indexing.tsstampsconversation_idand its comment says why. What was missing is exactly what this issue says: the SELECT readthread_idonly, anddecideRetrievablehad no conversation branch.The decision is assignment privacy rather than org scope, so it delegates to
conversationAssignmentAllowsinstead of restating it, and resolves the allowed set from the candidates' conversations — an admin may read every conversation, so enumerating theirs would ship thousands of ids into every dispatch.Steps 2 and 3 are unblocked and left for their own changes, in the order this issue sets out.
yannickmonney commentedon Sep 27, 2026
Fixed in two steps: #3220 added the conversation retrievable branch, and #3225 (50db977) makes
bindFileToConversationenqueuerag.index_fileinside the bind transaction; chat retrieval has amail-attachmentleg. Step 3 (msg:refs) only applies once message bodies are indexed, which #3015 tracks. Attachments bound before #3225 are deliberately not backfilled.