Skip to content

Raise the proxy's gateway response limit to 16 MiB - #22

Merged
akshitkrnagpal merged 2 commits into
mainfrom
response-limit
Nov 19, 2026
Merged

akshitkrnagpal merged 2 commits into
mainfrom
response-limit

Conversation

@akshitkrnagpal

@akshitkrnagpal akshitkrnagpal commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Tool results larger than 1 MiB were dropped by toolstile mcp proxy ("SSE event exceeded the size limit" / "Response exceeded the size limit"), so the agent never saw the reply.

  • MAX_RESPONSE_BYTES (16 MiB) in src/bounds.ts bounds gateway JSON bodies, SSE lines and SSE events.
  • The stdout write queue now allows two maximum-size replies (32 MiB, was 8 MiB), so one large reply cannot close the connection.
  • Agent stdin lines and control-plane API responses stay at 1 MiB.
  • New test relays a reply just under 16 MiB over JSON and SSE (fails on main, and fails with the old 8 MiB output cap); the oversized-SSE test now uses the new limit.

typecheck, test (138 passing) and build pass locally.

Reviewed with sol-loop: 1 round with gpt-6.2-sol on high. Sol verdict: approved

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

akshitkrnagpal and others added 2 commits November 19, 2026 18:42
Tool results over 1 MiB were rejected by the proxy before reaching the
agent. JSON bodies, SSE lines and SSE events from the gateway now share a
16 MiB cap, and the output queue holds two such replies. Agent input and
control-plane API responses keep their 1 MiB limits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@akshitkrnagpal
akshitkrnagpal merged commit f3d651e into main Nov 19, 2026
1 check passed
@akshitkrnagpal
akshitkrnagpal deleted the response-limit branch November 19, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant