[Feature]: Config option / per-instance toggle to keep large pastes inline instead of converting to attachments
Problem or Use Case
When Desktop's composer pastes text over the hardcoded 3,000-character threshold, it's automatically converted to an attachment file. In a containerized-gateway + remote-SSH-backend topology (see #110174), attachments land in the gateway container's local filesystem (e.g. /opt/data/attachments/), which is disjoint from the SSH execution host the agent actually reads files on — so the attachment is unreadable and the agent gets a "path is outside the allowed workspace" error.
Right now the only workaround is to keep pastes under 3,000 characters, or manually docker cp the file out of the gateway container onto the SSH backend host after the fact. There's no way to tell Hermes "just keep this inline" before hitting the bug.
Proposed Solution
Add a config option to disable the automatic paste→attachment conversion (or raise/disable the threshold), plus a per-instance composer affordance ("keep inline this time") for one-off overrides.
Confirmed on current main: the conversion is a single hardcoded policy in apps/desktop/src/app/chat/composer/large-paste.ts — LARGE_PASTE_ATTACHMENT_THRESHOLD = 3_000 characters, used by shouldConvertPasteToAttachment(text, threshold = LARGE_PASTE_ATTACHMENT_THRESHOLD), called from exactly one place (the composer's paste handler). No config key or per-session override exists today. Since the threshold is already parameterized at that single call site, this should be a small change:
A config value threaded into that call (e.g. composer.largePasteThreshold or a boolean composer.disableLargePasteAttachment). A composer-side "keep inline this time" affordance for the per-instance case. This does not fix the underlying cross-host attachment transfer bug (#110174) — it just makes the symptom avoidable by letting users opt out of attachment conversion in setups where it's currently broken.
Alternatives Considered
Fixing #110174 directly (transferring the attachment bytes to the SSH execution host, or having the gateway proxy container-local reads) would solve the root cause, but that's a separate, larger cross-host-transfer fix. This toggle is a smaller, independent mitigation that's useful regardless of whether/when the transfer bug gets fixed.
Feature Type
Configuration option
Scope
Small (single file, < 50 lines)
Contribution
- I'd like to implement this myself and submit a PR
Debug Report (optional)
Source: NousResearch/hermes-agent