paperclipai/paperclip · error · Error
Bridge response body exceeded the configured size limit of
Error message
Bridge response body exceeded the configured size limit of ${maxBodyBytes} bytes. What it means
Size-limit enforcement in the sandbox callback bridge worker: the response body the handler produced exceeds the configured maxBodyBytes cap, so it is refused rather than being shipped through the size-bounded bridge channel.
Solutions
- Reduce the bridge response body size below ${maxBodyBytes} bytes.
- Raise the configured body size limit if large responses are expected.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/adapter-utils/src/sandbox-callback-bridge.ts:981 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of paperclipai/paperclip@3f1d897a7c (2026-08-18).
Data as JSON: /api/errors/2724bdb975ec2716.
Report an issue: GitHub.
Appendix: source
Thrown at packages/adapter-utils/src/sandbox-callback-bridge.ts:1112
completedAt: new Date().toISOString() });
return;
}
const denialReason = await authorizeRequest(request);
if (denialReason) {
await finalize({
id: request.id,
status: 403,
headers: { "content-type": "application/json" },
body: JSON.stringify({ error: denialReason }),
completedAt: new Date().toISOString(),
});
return;
}
// Claim the request for the handler before the host operation starts. When
// the recovery path already claimed it, it writes a 503 and the caller may
// retry, so do not run the mutation; the retry then applies it once. When
// the handler claims first, the recovery path leaves the request alone and
// the handler writes the real response.
if (!claimForHandler()) {
return;
}
// Build the response, then finalize once. The handler already holds the
// claim, so `finalize` writes the real response.
let response: SandboxCallbackBridgeResponse;
let handlerReturned = false;
try {
const { bodyEncoding, ...forwardRequest } = request;
const result = await input.handleRequest({ ...forwardRequest,
body: bodyEncoding === "base64" ? decodeSandboxBridgeBody(request, maxBodyBytes) : request.body,
}, { signal: guard.controller.signal, reservation });
handlerReturned = true;
const responseBytes = Buffer.byteLength(result.body ?? "");
if (responseBytes > maxBodyBytes) throw new Error("Bridge response body exceeded the configured size limit.");
if (!reservation.reserve(4 * sandboxBridgeEnvelopeLimit(responseBytes))) {View on GitHub (pinned to 3f1d897a7c)