Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

docs: scope upload size guidance to legacy JSON transport

[._.]/ Adam Eivy3527cf997507
diff --git a/server/lib/uploadLimits.js b/server/lib/uploadLimits.js
index 8076596fa1..8ecbc68c59 100644
--- a/server/lib/uploadLimits.js
+++ b/server/lib/uploadLimits.js
@@ -1,8 +1,9 @@
/**
- * Single source of truth for how large an uploaded file may be.
+ * JSON transport limits for legacy base64 uploads.
*
- * PortOS ships files to the server base64-encoded inside a JSON body, so the
- * Express body-parser limit — not any per-route rule — is the real ceiling.
+ * Legacy callers send files base64-encoded inside a JSON body, where the
+ * Express body-parser limit sets the transport ceiling. Multipart uploads
+ * stream files separately and are not constrained by this JSON limit.
* Base64 inflates bytes by 4/3, so a route advertising a cap above
* `JSON_BODY_LIMIT × 3/4` is advertising something unreachable: the parser
* 413s before the route's own size check ever runs, and the user sees an
@@ -10,8 +11,8 @@
*
* Keeping the parser limit and the derived file cap in one module is the same
* pattern `server/lib/ports.js` uses for the port map — change the limit here
- * and every route follows. The client mirrors `MAX_BASE64_UPLOAD_BYTES` as
- * `JSON_UPLOAD_MAX_FILE_SIZE` in `client/src/utils/fileUpload.js` (it can't
+ * and every JSON upload consumer follows. The client mirrors
+ * `MAX_BASE64_UPLOAD_BYTES` as `JSON_UPLOAD_MAX_FILE_SIZE` in `client/src/utils/fileUpload.js` (it can't
* import server modules); `uploadLimits.test.js` is what keeps the two honest.
*/