Skip to content

Commit cf1086d

Browse files
authored
Fix documentation discrepancies: payload threshold and internal directories (#889)
Nightly documentation reconciliation identified critical discrepancies between documented and actual default values, plus incomplete internal directory listings. ## Changes ### Critical: Payload Size Threshold Default Updated README.md (3 locations) to reflect actual implementation default of **10240 bytes (10KB)** instead of incorrectly documented 1024 bytes: - CLI flag description (line 206) - Flags usage table (line 281) - Environment variables table (line 319) Implementation sources: - `internal/cmd/flags_logging.go:14` - `defaultPayloadSizeThreshold = 10240` - `internal/config/config_payload.go:11` - `DefaultPayloadSizeThreshold = 10240` ### Minor: Complete Internal Directory Listings Added missing internal packages to project structure documentation: **CONTRIBUTING.md**: Added 9 missing directories (auth, difc, envutil, middleware, sys, testutil, version, tty, timeutil) to both tree diagram and Key Directories section **AGENTS.md**: Added 7 missing directories (difc, envutil, middleware, sys, testutil, tty, version) to project structure list All 16 internal directories now documented in alphabetical order: `auth`, `cmd`, `config`, `difc`, `envutil`, `guard`, `launcher`, `logger`, `mcp`, `middleware`, `server`, `sys`, `testutil`, `timeutil`, `tty`, `version` > [!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-build2370360416/b279/launcher.test /tmp/go-build2370360416/b279/launcher.test -test.testlogfile=/tmp/go-build2370360416/b279/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true 64/src/runtime/cgo git ache/go/1.25.6/x64/pkg/tool/linu-o --global r it 08.o -d go git x_amd64/vet e/REDACTED/work/gh/opt/hostedtoolcache/go/1.25.6/x64/pkg/tool/linux_amd64/vet 64/src/runtime/c-unsafeptr=false 64/bin/git x_amd64/vet` (dns block) > - `invalid-host-that-does-not-exist-12345.com` > - Triggering command: `/tmp/go-build2370360416/b264/config.test /tmp/go-build2370360416/b264/config.test -test.testlogfile=/tmp/go-build2370360416/b264/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true 64/src/runtime/cgo HEAD ache/go/1.25.6/x64/pkg/tool/linu-fmessage-length=0 get --global rgo/bin/git 06.o -d 1.2.0/auth/auth.go git x_amd64/compile get --global .12/x64/which x_amd64/compile` (dns block) > - `nonexistent.local` > - Triggering command: `/tmp/go-build2370360416/b279/launcher.test /tmp/go-build2370360416/b279/launcher.test -test.testlogfile=/tmp/go-build2370360416/b279/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true 64/src/runtime/cgo git ache/go/1.25.6/x64/pkg/tool/linu-o --global r it 08.o -d go git x_amd64/vet e/REDACTED/work/gh/opt/hostedtoolcache/go/1.25.6/x64/pkg/tool/linux_amd64/vet 64/src/runtime/c-unsafeptr=false 64/bin/git x_amd64/vet` (dns block) > - `slow.example.com` > - Triggering command: `/tmp/go-build2370360416/b279/launcher.test /tmp/go-build2370360416/b279/launcher.test -test.testlogfile=/tmp/go-build2370360416/b279/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true 64/src/runtime/cgo git ache/go/1.25.6/x64/pkg/tool/linu-o --global r it 08.o -d go git x_amd64/vet e/REDACTED/work/gh/opt/hostedtoolcache/go/1.25.6/x64/pkg/tool/linux_amd64/vet 64/src/runtime/c-unsafeptr=false 64/bin/git x_amd64/vet` (dns block) > - `this-host-does-not-exist-12345.com` > - Triggering command: `/tmp/go-build2370360416/b288/mcp.test /tmp/go-build2370360416/b288/mcp.test -test.testlogfile=/tmp/go-build2370360416/b288/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true g_.a 64/src/internal/bisect/bisect.go--64 86_64/as --global abis p/bin/git ache/go/1.25.6/x/tmp/go-build2370360416/b059/vet.cfg -d ; then \ $GOPATH/bin/golangci-lint run --timeout=5m || echo &#34;��� Warning: golangci-lint failed /opt/hostedtoolcache/go/1.25.6/x64/pkg/tool/linux_amd64/link -wdcAJ1yv x_amd64/vet rt-size &#39;1280, 7/opt/hostedtoolcache/go/1.25.6/x64/pkg/tool/linux_amd64/vet` (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 ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> ---- *This section details on the original issue you should resolve* <issue_title>📚 Documentation Reconciliation Report - February 11, 2026</issue_title> <issue_description>## Summary Found **1 critical** and **2 minor** discrepancies between documentation and implementation during nightly reconciliation check. - Workflow Run: [§21890623217](https://github.com/github/gh-aw-mcpg/actions/runs/21890623217) - Date: February 11, 2026 - Branch: main ## Critical Issues 🔴 Issues that would cause user confusion or broken workflows if followed: ### 1. Payload Size Threshold Default Value Mismatch **Location:** README.md, lines 206, 281, 319 **Problem:** Documentation states the default payload size threshold is `1024` bytes (1KB), but the actual implementation uses `10240` bytes (10KB). **Actual Behavior:** - Code: `internal/cmd/flags_logging.go:14` defines `defaultPayloadSizeThreshold = 10240` - Code: `internal/config/config_payload.go:11` defines `DefaultPayloadSizeThreshold = 10240` - Tests: `internal/cmd/flags_logging_test.go` confirms default is 10240 bytes **Impact:** Users expecting the documented 1KB threshold will actually get a 10KB threshold, which could result in: - More payloads being stored inline than expected (up to 10KB instead of 1KB) - Less disk I/O than anticipated - Different memory usage patterns - Confusion when testing payload storage behavior **Suggested Fix:** Update README.md to reflect the actual default: ```markdown # Line 206 - CLI flag: `--payload-size-threshold (bytes)` (default: 10240) # Line 281 --payload-size-threshold int Size threshold (in bytes) for storing payloads to disk. Payloads larger than this are stored, smaller ones returned inline (default 10240) # Line 319 | `MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD` | Size threshold in bytes for payload storage (sets default for `--payload-size-threshold` flag) | `10240` | ``` **Code Reference:** - `internal/cmd/flags_logging.go:14` - `internal/config/config_payload.go:11` - `internal/cmd/flags_logging_test.go:46` ## Minor Issues 🔵 Small inconsistencies or missing details: ### 1. Internal Directory Structure Incomplete in CONTRIBUTING.md **Location:** CONTRIBUTING.md, lines 206-233 (Project Structure section) **Problem:** Documentation lists only 7 internal directories, but 16 actually exist. **Missing Directories:** - `internal/difc/` - Data Information Flow Control - `internal/envutil/` - Environment variable utilities - `internal/middleware/` - HTTP middleware (jq schema processing) - `internal/sys/` - System utilities - `internal/testutil/` - Test utilities and helpers - `internal/tty/` - Terminal detection utilities - `internal/version/` - Version management **Impact:** Developers may be unaware of these internal packages when working on the codebase, potentially duplicating functionality or missing useful utilities. **Suggested Fix:** Update the Project Structure section to include all internal directories with brief descriptions. **Code Reference:** Directory listing shows all 16 directories exist and contain working code. ### 2. Internal Directory Structure Incomplete in AGENTS.md **Location:** AGENTS.md, lines 12-20 (Project Structure section) **Problem:** Similar to CONTRIBUTING.md, lists only 9 internal directories instead of 16. **Missing Directories:** Same as above (difc, envutil, middleware, sys, testutil, tty, version) **Impact:** AI agents working with the codebase may not be aware of all available internal packages. **Suggested Fix:** Update the Project Structure section to include all internal directories. **Code Reference:** Same directory listing as above. ## Documentation Completeness ### Accurate Sections ✅ The following sections were verified and found to be accurate: - **Go Version Requirement** - Correctly documented as 1.25.0 (matches `go.mod`) - **Make Targets** - All 11 documented targets exist and work correctly: - `make build`, `test`, `test-unit`, `test-integration`, `test-all` - `make lint`, `coverage`, `install`, `agent-finished` - `make format`, `clean` - **Configuration Fields** - All documented fields match code struct definitions in `internal/config/` - **Environment Variables** - Correctly documented and extensively used (140+ references in code) - **External Links**: - MCP Gateway spec link is valid (returns HTTP 200) - GitHub token URL is valid (redirects properly) - **Feature Documentation**: - HTTP transport correctly marked as "fully supported" - Container field requirement for stdio servers matches validation code - Command field restriction for JSON stdin format accurately documented - Sequential launch flag exists and works as documented - **CLI Flags** - All documented flags exist and match actual implementation - **Docker Configuration Examples** - Format and field names match actual usage - **Configuration Validation** - Documented behavior matches `internal/config/validation*.go` ## Tested Commands All commands from CONTRIBUTING.... </details> <!-- START COPILOT CODING AGENT SUFFIX --> - Fixes #886
2 parents 432703b + 895dae4 commit cf1086d

3 files changed

Lines changed: 36 additions & 13 deletions

File tree

AGENTS.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,24 @@ Quick reference for AI agents working with MCP Gateway (Go-based MCP proxy serve
2121

2222
## Project Structure
2323

24+
- `internal/auth/` - Authentication header parsing and middleware
2425
- `internal/cmd/` - CLI (Cobra)
2526
- `internal/config/` - Config parsing (TOML/JSON) with validation
2627
- `validation.go` - Variable expansion and fail-fast validation
2728
- `validation_test.go` - 21 comprehensive validation tests
28-
- `internal/server/` - HTTP server (routed/unified modes)
29-
- `internal/mcp/` - MCP protocol types with enhanced error logging
30-
- `internal/launcher/` - Backend process management
29+
- `internal/difc/` - Data Information Flow Control
30+
- `internal/envutil/` - Environment variable utilities
3131
- `internal/guard/` - Security guards (NoopGuard active)
32-
- `internal/auth/` - Authentication header parsing and middleware
32+
- `internal/launcher/` - Backend process management
3333
- `internal/logger/` - Debug logging framework (micro logger)
34+
- `internal/mcp/` - MCP protocol types with enhanced error logging
35+
- `internal/middleware/` - HTTP middleware (jq schema processing)
36+
- `internal/server/` - HTTP server (routed/unified modes)
37+
- `internal/sys/` - System utilities
38+
- `internal/testutil/` - Test utilities and helpers
3439
- `internal/timeutil/` - Time formatting utilities
40+
- `internal/tty/` - Terminal detection utilities
41+
- `internal/version/` - Version management
3542

3643
## Key Tech
3744

CONTRIBUTING.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,26 +211,42 @@ awmg/
211211
├── Dockerfile # Container image
212212
├── Makefile # Build automation
213213
└── internal/
214+
├── auth/ # Authentication header parsing and middleware
214215
├── cmd/ # CLI commands (cobra)
215216
├── config/ # Configuration loading (TOML/JSON)
217+
├── difc/ # Data Information Flow Control
218+
├── envutil/ # Environment variable utilities
219+
├── guard/ # Security guards (NoopGuard active)
216220
├── launcher/ # Backend server management
221+
├── logger/ # Debug logging framework
217222
├── mcp/ # MCP protocol types & connection
223+
├── middleware/ # HTTP middleware (jq schema processing)
218224
├── server/ # HTTP server (routed/unified modes)
219-
├── guard/ # Security guards (NoopGuard active)
220-
├── logger/ # Debug logging framework
225+
├── sys/ # System utilities
226+
├── testutil/ # Test utilities and helpers
221227
├── timeutil/ # Time formatting utilities
222-
└── tty/ # Terminal detection utilities
228+
├── tty/ # Terminal detection utilities
229+
└── version/ # Version management
223230
```
224231

225232
### Key Directories
226233

234+
- **`internal/auth/`** - Authentication header parsing and middleware
227235
- **`internal/cmd/`** - CLI implementation using Cobra framework
228236
- **`internal/config/`** - Configuration parsing for TOML and JSON formats
229-
- **`internal/server/`** - HTTP server with routed and unified modes
230-
- **`internal/mcp/`** - MCP protocol types and JSON-RPC handling
231-
- **`internal/launcher/`** - Backend process management (Docker, stdio)
237+
- **`internal/difc/`** - Data Information Flow Control
238+
- **`internal/envutil/`** - Environment variable utilities
232239
- **`internal/guard/`** - Guard framework for resource labeling
240+
- **`internal/launcher/`** - Backend process management (Docker, stdio)
233241
- **`internal/logger/`** - Micro logger for debug output
242+
- **`internal/mcp/`** - MCP protocol types and JSON-RPC handling
243+
- **`internal/middleware/`** - HTTP middleware (jq schema processing)
244+
- **`internal/server/`** - HTTP server with routed and unified modes
245+
- **`internal/sys/`** - System utilities
246+
- **`internal/testutil/`** - Test utilities and helpers
247+
- **`internal/timeutil/`** - Time formatting utilities
248+
- **`internal/tty/`** - Terminal detection utilities
249+
- **`internal/version/`** - Version management
234250

235251
## Coding Conventions
236252

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ See **[Configuration Specification](https://github.com/github/gh-aw/blob/main/do
202202

203203
**Configuration Alternatives**:
204204
- **`payloadSizeThreshold`** is not supported in JSON stdin format. Use:
205-
- CLI flag: `--payload-size-threshold <bytes>` (default: 1024)
205+
- CLI flag: `--payload-size-threshold <bytes>` (default: 10240)
206206
- Environment variable: `MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD=<bytes>`
207207
- Payloads **larger** than this threshold are stored to disk and return metadata
208208
- Payloads **smaller than or equal** to this threshold are returned inline
@@ -278,7 +278,7 @@ Flags:
278278
-l, --listen string HTTP server listen address (default "127.0.0.1:3000")
279279
--log-dir string Directory for log files (falls back to stdout if directory cannot be created) (default "/tmp/gh-aw/mcp-logs")
280280
--payload-dir string Directory for storing large payload files (segmented by session ID) (default "/tmp/jq-payloads")
281-
--payload-size-threshold int Size threshold (in bytes) for storing payloads to disk. Payloads larger than this are stored, smaller ones returned inline (default 1024)
281+
--payload-size-threshold int Size threshold (in bytes) for storing payloads to disk. Payloads larger than this are stored, smaller ones returned inline (default 10240)
282282
--routed Run in routed mode (each backend at /mcp/<server>)
283283
--sequential-launch Launch MCP servers sequentially during startup (parallel launch is default)
284284
--unified Run in unified mode (all backends at /mcp)
@@ -316,7 +316,7 @@ When running locally (`run.sh`), these variables are optional (warnings shown if
316316
| `MODE` | Gateway mode flag | `--routed` |
317317
| `MCP_GATEWAY_LOG_DIR` | Log file directory (sets default for `--log-dir` flag) | `/tmp/gh-aw/mcp-logs` |
318318
| `MCP_GATEWAY_PAYLOAD_DIR` | Large payload storage directory (sets default for `--payload-dir` flag) | `/tmp/jq-payloads` |
319-
| `MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD` | Size threshold in bytes for payload storage (sets default for `--payload-size-threshold` flag) | `1024` |
319+
| `MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD` | Size threshold in bytes for payload storage (sets default for `--payload-size-threshold` flag) | `10240` |
320320

321321
### Docker Configuration
322322

0 commit comments

Comments
 (0)