Two distinct attachment features are needed. Neither is currently implemented. The delivery pipeline now supports text attachments internally (used by send_confirmation_reply), but the LLM cannot yet attach files to emails it sends, nor can it see attachments on incoming emails.
parse_email_message() in orchestrator.py currently extracts only text/plain body and application/json (continuation). All other MIME parts are silently dropped.
What to build:
• Walk all MIME parts in parse_email_message()
• For text/ parts (text/html, text/csv, text/plain extras): decode and include content
• For application/pdf, application/msword etc.: record filename, content-type, size — do not inline binary
• For image/: record filename and size; optionally base64-encode for multimodal models
• Return attachments as a list under the 'attachments' key in the parsed dict
• Present to LLM in the email context block, e.g.:
Attachments: report.pdf (application/pdf, 42 KB), notes.txt (text/plain, 1.2 KB)
--- notes.txt ---
[content here]
---
Key files: orchestrator.py:parse_email_message() (line ~143), and the email context formatting in call_llm().
The LLM cannot currently attach files to emails it sends. EmailOut in envoy_schema.py has no attachments field.
What to build:
• Add AttachmentOut model to envoy_schema.py:
class AttachmentOut(EnvoyBaseModel):
filename: str
content: str # plain text content
content_type: str # e.g. 'text/plain', 'text/csv'
• Add attachments: List[AttachmentOut] to EmailOut
• Regenerate new_envoy_response_schema.json (run: python3 generate_schema.py or equivalent)
• Update dispatch_immediate_actions() to pass attachments when calling send_email()
• The _build_message() / deliver_via_* functions already accept attachments (added 2026-03-03)
• Update composing phase note to document the attachments field usage
Note: the composing phase note and envoy/start already reference 'the attachments field' — this was aspirational. Once implemented, those references will be correct.
Key files: envoy_schema.py, new_envoy_response_schema.json, orchestrator.py:dispatch_immediate_actions() (~line 1032).
• 2026-03-03: Internal attachment support added to _build_message, deliver_via_local_smtp, deliver_via_brevo, send_email (text attachments only). Used by send_confirmation_reply for the >3 emails case.
• Incoming parsing: not started
• LLM-driven outgoing: not started (schema change needed)