SSH file-queue bridge: attachment uploads above ~580 KB hit 1 MiB stdout cap and time out
Summary
In an SSH execution environment using the command-managed queue_v1 callback bridge, an agent's multipart attachment upload fails once the file is roughly 580 KB or larger. The client receives HTTP 409 with Timed out waiting for host bridge response and outcome: indeterminate after the bridge deadline. In the observed reproduction, the attachment list remained empty. A longer client timeout does not help.
Reproduction
- Run a
claude_localagent in a Paperclip SSH execution environment using the file-queue bridge. - During the heartbeat, generate a nonsecret 700 KiB binary file and POST it as multipart
fileto/api/companies/{companyId}/issues/{issueId}/attachments, using that run's injected API URL and token. Record the HTTP status and elapsed time; list the target issue's attachments afterward. - Repeat with a 250 KiB file.
Observed: the larger request returns 409 after about 30–35 seconds and creates no attachment; the smaller request succeeds (observed ~16 seconds). The API attachment limit is 10 MiB, so this fails well below the documented maximum. These are observations from one SSH environment, not a claim about every transport.
Expected: accepted uploads within the attachment size limit succeed, or a deterministic bridge size failure returns promptly with an actionable error rather than an indeterminate timeout.
Suspected cause (source inspection of the running ghcr.io/paperclipai/paperclip:latest image on 2026-09-28)
packages/adapter-utils/src/execution-target.ts:679-688configurescreateSshCommandManagedRuntimeRunnerwithSSH_COMMAND_MAX_BUFFER_BYTES = 1024 * 1024;packages/adapter-utils/src/ssh.ts:79applies it asexecFile'smaxBuffer.packages/adapter-utils/src/sandbox-callback-bridge.ts:688-694reads the request envelope throughhead -c N+1 <file> | base64. The JSON envelope already contains the multipart body in base64. Double encoding plus line wrapping makes the SSH stdout roughly 1.8 times the raw upload; the 1 MiB stdout cap is crossed around 580 KB.- The read error is rethrown at
sandbox-callback-bridge.ts:1064-1068; the recovery read at:1355fails again and continues at:1371. No response is written before the 30-second gateway deadline at:2408-2437, yielding the 409 at:2534-2543.
Could the SSH bridge stream this read, avoid the second base64 pass, or size the runner buffer to the envelope limit? A deterministic max-buffer failure should also produce a prompt explicit response/log rather than being retried until timeout. No local Paperclip patch was applied.
Source: paperclipai/paperclip