Commit f4aca19
authored
Increase default payload size threshold from 1KB to 10KB (#807)
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]
>
> <details>
> <summary>Firewall rules blocked me from connecting to one or more
addresses (expand for details)</summary>
>
> #### 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:
>
> - Configure [Actions setup
steps](https://gh.io/copilot/actions-setup-steps) to set up my
environment, which run before the firewall is enabled
> - Add the appropriate URLs or hosts to the custom allowlist in this
repository's [Copilot coding agent
settings](https://github.com/github/gh-aw-mcpg/settings/copilot/coding_agent)
(admins only)
>
> </details>
<!-- START COPILOT CODING AGENT TIPS -->
---
💡 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](https://gh.io/copilot-coding-agent-tips) in the docs.4 files changed
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
| 10 | + | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
0 commit comments