feat(desktop): make attachment data-URL size limit configurable - #73221
Merged
austinpickett merged 1 commit intoJul 28, 2026
Merged
Conversation
Hard 16 MB cap on readFileDataUrl blocked larger local attaches with no way to raise it. Settings -> Chat now has a free-form MB field. Main process owns the persisted value and clamps only absurd inputs.
Adolanium
force-pushed
the
feat/desktop-attachment-size-setting
branch
from
July 28, 2026 08:38
624f30d to
156eb54
Compare
austinpickett
approved these changes
Jul 28, 2026
austinpickett
left a comment
Collaborator
There was a problem hiding this comment.
Approving. Verified against head 156eb54 on Windows.
What it does: Makes the desktop data-URL read cap (composer attach + local previews) configurable via a free-form MB field in Settings > Chat, replacing the hard 16 MB DATA_URL_READ_MAX_BYTES. Main process owns the persisted value under userData and applies it on every hermes:readFileDataUrl call. Default stays 16 MB.
Verification (PR head):
- Tests: 17/17 in the two PR files (hardening 13, store 4), plus 93/93 in the touched
use-prompt-actions/index.test.tsx. The clamp and store tests are non-vacuous: bounds (undefined to 16, 0 to the 1 floor, 99999 to the 4096 ceiling), rounding, write-through, and failure-keeps-last-known-good. - Typecheck: 26 tsc errors on the branch, but the identical 26 reproduce on clean main (all missing-transitive-dep noise in an incomplete node_modules). Zero reference any file this PR touches.
- Lint: clean on all touched files.
Design notes:
- Device-local pref (not config.yaml) is the right call for a per-machine memory guard, and is consistent with the keep-awake precedent. Correctly skips cli-config.yaml.example.
- i18n is safe: en and zh are strict
Translationsand both were updated, types.ts too. ja/zh-hant/ar go through defineLocale (partial merge over en), so they fall back to English rather than failing the build on the new keys. - The clamp constants are duplicated between electron/hardening.ts and src/store/data-url-read-max.ts, but that split is forced by the process boundary (the renderer cannot import electron main). Both carry keep-in-sync comments. It is the only ongoing maintenance cost here, not a blocker.
This was referenced Jul 29, 2026
OutThisLife
added a commit
that referenced
this pull request
Jul 29, 2026
Keep Settings-configurable preview/image loads on readFileDataUrl, and route remote non-image attach through a 256 MiB IPC so uploads are not stuck on the 16 MiB default after #73221. Co-authored-by: Börje <borje@dqsverige.se>
randlee
pushed a commit
to randlee/hermes-agent
that referenced
this pull request
Aug 11, 2026
…Research#73221) Hard 16 MB cap on readFileDataUrl blocked larger local attaches with no way to raise it. Settings -> Chat now has a free-form MB field. Main process owns the persisted value and clamps only absurd inputs.
randlee
pushed a commit
to randlee/hermes-agent
that referenced
this pull request
Aug 11, 2026
Keep Settings-configurable preview/image loads on readFileDataUrl, and route remote non-image attach through a 256 MiB IPC so uploads are not stuck on the 16 MiB default after NousResearch#73221. Co-authored-by: Börje <borje@dqsverige.se>
prmartinow
pushed a commit
to prmartinow/hermes-agent
that referenced
this pull request
Aug 26, 2026
…Research#73221) Hard 16 MB cap on readFileDataUrl blocked larger local attaches with no way to raise it. Settings -> Chat now has a free-form MB field. Main process owns the persisted value and clamps only absurd inputs.
prmartinow
pushed a commit
to prmartinow/hermes-agent
that referenced
this pull request
Aug 26, 2026
Keep Settings-configurable preview/image loads on readFileDataUrl, and route remote non-image attach through a 256 MiB IPC so uploads are not stuck on the 16 MiB default after NousResearch#73221. Co-authored-by: Börje <borje@dqsverige.se>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
readFileDataUrlhard-capped local file loads at 16 MB. That path backs chat attach and image previews, so larger local files just failed with no way to raise the cap from the UI.Settings -> Chat now has a free-form MB field for the max local attach/preview size. Main owns the persisted value under userData and applies it on every
hermes:readFileDataUrlcall. Default stays 16 MB. Values are clamped to 1..4096 MB as a typo guard only. The field copy notes that very large values load the whole file into memory and can freeze or crash the app.This is a Desktop IPC / memory guard, not a model limit. The existing friendly remote-attach error still parses the real limit from the rejection string, so the toast tracks whatever is configured.
Related Issue
No open issue. Hit while attaching larger local files in Desktop.
Type of Change
Changes Made
apps/desktop/electron/hardening.ts: default/min/max MB helpers and clamp for the data-URL read cap.apps/desktop/electron/main.ts: persistdata-url-read-max.json, IPC get/set, use the live cap inhermes:readFileDataUrl.apps/desktop/electron/preload.ts+apps/desktop/src/global.d.ts: exposedataUrlReadMaxbridge.apps/desktop/src/store/data-url-read-max.ts: renderer mirror of the main-process value.apps/desktop/src/app/settings/config-settings.tsx: free-form MB input on Settings -> Chat.apps/desktop/src/i18n/en.ts+types.ts: labels and description.apps/desktop/src/store/data-url-read-max.test.ts+apps/desktop/electron/hardening.test.ts: clamp/store coverage.How to Test
npx vitest run src/store/data-url-read-max.test.ts electron/hardening.test.tsChecklist
Code
fix(scope):,feat(scope):, etc.)Documentation & Housekeeping
docs/, docstrings) - or N/A (code comments on the IPC path only)cli-config.yaml.exampleif I added/changed config keys - or N/A (device-local Desktop pref, not config.yaml)CONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows - or N/AScreenshots / Logs
npx vitest run src/store/data-url-read-max.test.ts electron/hardening.test.ts Test Files 2 passed (2) Tests 16 passed (16)Settings -> Chat shows a free-form MB input (default 16). Raising it and reopening the app keeps the saved value under userData.