Skip to content

Increase default payload size threshold from 1KB to 10KB#807

Merged
lpcox merged 2 commits intomainfrom
copilot/increase-default-max-payload-size
Feb 7, 2026
Merged

Increase default payload size threshold from 1KB to 10KB#807
lpcox merged 2 commits intomainfrom
copilot/increase-default-max-payload-size

Conversation

Copy link
Contributor

Copilot AI commented Feb 7, 2026

Raises the inline payload threshold to accommodate larger tool responses before falling back to disk storage.

Changes

  • Constants: Updated DefaultPayloadSizeThreshold from 1024 to 10240 in:

    • internal/config/config_payload.go
    • internal/cmd/flags_logging.go
  • Documentation: Updated comments to reflect 10KB default in config_core.go and config_payload.go

  • Tests: Updated test expectations in flags_logging_test.go

Behavior

Payloads ≤ 10KB now returned inline; larger payloads stored to disk at {payloadDir}/{sessionID}/{queryID}/payload.json.

Threshold remains configurable via --payload-size-threshold flag, MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD env var, or payload_size_threshold config field.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • example.com
    • Triggering command: /tmp/go-build2815537700/b275/launcher.test /tmp/go-build2815537700/b275/launcher.test -test.testlogfile=/tmp/go-build2815537700/b275/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true /opt/hostedtoolcache/go/1.25.6/x64/src/runtime/cgo1.25.6 cfg 64/pkg/tool/linux_amd64/vet -pthread -Wl,--no-gc-sect-unsafeptr=false -fmessage-length/tmp/go-build1973070374/b003/vet.cfg 64/pkg/tool/linux_amd64/vet 6552�� /opt/hostedtoolcache/go/1.25.6/x64/src/runtime/c-errorsas cfg nfig/composer/vendor/bin/as --gdwarf-5 --64 -o as (dns block)
  • invalid-host-that-does-not-exist-12345.com
    • Triggering command: /tmp/go-build67267443/b001/config.test /tmp/go-build67267443/b001/config.test -test.testlogfile=/tmp/go-build67267443/b001/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true go --global 64/bin/as user.email (dns block)
  • nonexistent.local
    • Triggering command: /tmp/go-build2815537700/b275/launcher.test /tmp/go-build2815537700/b275/launcher.test -test.testlogfile=/tmp/go-build2815537700/b275/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true /opt/hostedtoolcache/go/1.25.6/x64/src/runtime/cgo1.25.6 cfg 64/pkg/tool/linux_amd64/vet -pthread -Wl,--no-gc-sect-unsafeptr=false -fmessage-length/tmp/go-build1973070374/b003/vet.cfg 64/pkg/tool/linux_amd64/vet 6552�� /opt/hostedtoolcache/go/1.25.6/x64/src/runtime/c-errorsas cfg nfig/composer/vendor/bin/as --gdwarf-5 --64 -o as (dns block)
  • slow.example.com
    • Triggering command: /tmp/go-build2815537700/b275/launcher.test /tmp/go-build2815537700/b275/launcher.test -test.testlogfile=/tmp/go-build2815537700/b275/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true /opt/hostedtoolcache/go/1.25.6/x64/src/runtime/cgo1.25.6 cfg 64/pkg/tool/linux_amd64/vet -pthread -Wl,--no-gc-sect-unsafeptr=false -fmessage-length/tmp/go-build1973070374/b003/vet.cfg 64/pkg/tool/linux_amd64/vet 6552�� /opt/hostedtoolcache/go/1.25.6/x64/src/runtime/c-errorsas cfg nfig/composer/vendor/bin/as --gdwarf-5 --64 -o as (dns block)
  • this-host-does-not-exist-12345.com
    • Triggering command: /tmp/go-build2815537700/b284/mcp.test /tmp/go-build2815537700/b284/mcp.test -test.testlogfile=/tmp/go-build2815537700/b284/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true /opt/hostedtoolcache/go/1.25.6/x64/src/runtime/c-c=4 cfg 64/pkg/tool/linux_amd64/vet --gdwarf-5 --64 -o 64/pkg/tool/linux_amd64/vet 6552�� ache/go/1.25.6/x64/src/net cfg .test --gdwarf-5 --64 -o .test (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot AI changed the title [WIP] Increase default max payload size to 10kb from 1kb Increase default payload size threshold from 1KB to 10KB Feb 7, 2026
Copilot AI requested a review from lpcox February 7, 2026 16:40
@lpcox lpcox marked this pull request as ready for review February 7, 2026 16:44
Copilot AI review requested due to automatic review settings February 7, 2026 16:44
@lpcox lpcox merged commit f4aca19 into main Feb 7, 2026
5 checks passed
@lpcox lpcox deleted the copilot/increase-default-max-payload-size branch February 7, 2026 16:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the gateway’s default inline-vs-disk payload cutoff to allow larger tool responses to be returned inline before falling back to on-disk storage, while keeping the threshold configurable via existing flag/env/config mechanisms.

Changes:

  • Increased the default payload size threshold from 1024 bytes (1KB) to 10240 bytes (10KB).
  • Updated inline documentation/comments to reflect the new 10KB default.
  • Updated CLI flag default test expectations for the new threshold.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
internal/config/config_payload.go Bumps DefaultPayloadSizeThreshold to 10240 and updates the default comment.
internal/config/config_core.go Updates GatewayConfig.PayloadSizeThreshold default comment to 10KB.
internal/cmd/flags_logging.go Bumps CLI default defaultPayloadSizeThreshold to 10240.
internal/cmd/flags_logging_test.go Updates default-threshold test assertion to 10240.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 8 to +11
// DefaultPayloadSizeThreshold is the default size threshold (in bytes) for storing payloads to disk.
// Payloads larger than this threshold are stored to disk, smaller ones are returned inline.
// Default: 1024 bytes (1KB)
const DefaultPayloadSizeThreshold = 1024
// Default: 10240 bytes (10KB)
const DefaultPayloadSizeThreshold = 10240
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default threshold is now documented as 10KB here, but there are other repo docs/examples still stating the default is 1024 bytes (e.g., PAYLOAD_THRESHOLD_IMPLEMENTATION.md and config.example-payload-threshold.toml). Please update those references in the same PR to keep documentation consistent with the new default.

Copilot uses AI. Check for mistakes.
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.

2 participants