Attachments: send files up to 100 MB over the gateway's file upload #347
All Vouch review confidence checks passed
Residual risk 0.20 = Change Risk (0.50) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 617 lines diff across 7 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.384
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #347"
general
weight: 0.35
Giton22
Stacked on #346. Review that one first; this PR's diff is only the last four commits.
What and why
#346 holds attachments to 12 MB, which is what one WebSocket message carries. This PR raises the limit to 100 MB, which is what the gateway's managed-file upload takes. Files up to 12 MB still go inline, as before.
<files root>/.kyllene-uploads/<random>/<name>. It's read as it goes, so it's never held whole in memory. On Android that means streaming from the picked URI. A file whose size the provider doesn't report is copied to the cache first.pdf.attach. Anything else, or a PDF the gateway can't render, becomes an@file:reference throughfile.attach.file.attachuses it in place (uploaded: false, meaning the chat's workspace contains the uploads folder), because the prompt refers to it. Those are cleared after a week, as the gateway does with its own staged uploads. A failed upload is also removed.Follows up #340.
Gateway
The calls follow hermes-agent:
GET /api/filesgives the default files folder. With?path=it lists the uploads folder, which is how old uploads are found to clear.POST /api/files/upload-streamtakes the multipart fieldsfile,pathandoverwrite. It's capped at 100 MiB, and parent folders are created. Source:hermes_cli/web_routers/files.py.DELETE /api/filestakes{path, recursive}.pdf.attach {session_id, path, filename}andfile.attach {session_id, path, name}are intui_gateway/methods_prompt.py. The in-place rule and theuploadedflag are intui_gateway/prompt_attachments.py.The managed-file routes exist since v2026.7.1. On an older gateway, a 404 or 405 (or a non-JSON listing) gives the update message, and files up to 12 MB work as before.
POST /api/chat/file-uploadwasn't usable here: it's capped at 16 MiB and only runs on the web app's listener.How I tested it
-
ChatSessionTest, withMockEnginefor the file routes andFakeTransportfor JSON-RPC:- a large PDF goes up and is attached by its path
- a 30 MB file is streamed byte for byte, and its progress goes from 0 to 100%
- a file used in place stays
- a PDF the gateway can't render goes as a file
- a gateway without the route, or one that answers with its web page, gets the update message
- a failure after the upload removes it and takes back the queued images
- a refused upload is removed
- a file that changes while it's sent is turned down
- a Windows gateway gets backslash paths
- uploads older than a week are cleared, once per run
- a second send waits for the first one's upload
-
AttachmentUploadsTest: file names (folders,..,$VAR/%VAR%, trailing dots and spaces, Windows device names).-
ChatViewModelTest: the 100 MB limit.- a 12.8 MB PDF arrived, and the agent read back 12,806,962 bytes
- a 60 MB file arrived (60,000,000 bytes), with the app's heap around 31 MB during the upload
- the progress line went from 6% to 100% over about two minutes on the emulator's link, then went away
Screenshots
The pending bubble while a 60 MB file goes up:
Checklist
master, and the command under "Tests" in CONTRIBUTING.md passes./gradlew :desktopApp:compileKotlinJvm)!A pending prompt showing Uploading logs-60mb.bin · 6%