-
Notifications
You must be signed in to change notification settings - Fork 20
📚 Documentation Reconciliation Report - 2026-04-04 #3151
Description
Summary
Found 1 discrepancy between documentation and implementation during nightly reconciliation check.
- Workflow Run: §23970492417
- Date: 2026-04-04
- Branch: main
Critical Issues 🔴
None.
Important Issues 🟡
None.
Minor Issues 🔵
1. MCP_GATEWAY_SESSION_TIMEOUT Environment Variable is Undocumented
Location: docs/ENVIRONMENT_VARIABLES.md (missing entry)
Problem: The MCP_GATEWAY_SESSION_TIMEOUT environment variable is used in the codebase to configure the session timeout for the unified mode HTTP transport, but it does not appear anywhere in the documentation.
Actual Behavior: When set, this env var overrides the default 2-hour session timeout for unified mode (/mcp endpoint). It accepts any Go duration string (e.g., 30m, 1h, 2h30m). Unified mode uses this value; routed mode has a hardcoded 30-minute timeout and is unaffected.
Impact: Users running in unified mode who need to tune session lifetime for either short-running tasks or very long-running workflows have no visibility into this knob. The variable is already tested in internal/envutil/envutil_test.go.
Suggested Fix: Add a row to the "Optional (Non-Containerized Mode)" table in docs/ENVIRONMENT_VARIABLES.md:
| `MCP_GATEWAY_SESSION_TIMEOUT` | Session timeout for unified mode (`/mcp`) stateful sessions. Accepts Go duration strings (e.g., `30m`, `1h`). Default is 2 hours to accommodate long-running agentic workflows. Routed mode is unaffected (hardcoded 30 min). | `2h` |Code Reference: internal/server/transport.go:41
SessionTimeout: envutil.GetEnvDuration("MCP_GATEWAY_SESSION_TIMEOUT", 2*time.Hour),Documentation Completeness
Missing Documentation
MCP_GATEWAY_SESSION_TIMEOUTis used in code (internal/server/transport.go) but not listed indocs/ENVIRONMENT_VARIABLES.mdorAGENTS.md
Accurate Sections ✅
- Docker quick start section —
"apiKey","mcpServers","type","container","env"fields all matchStdinGatewayConfig/StdinServerConfigJSON struct tags - TOML format (
config.example.toml) — field names (api_key,port,domain,startup_timeout,tool_timeout,command,args) matchGatewayConfig/ServerConfigTOML struct tags - Environment variables
MCP_GATEWAY_PORT,MCP_GATEWAY_DOMAIN,MCP_GATEWAY_API_KEY— all present and used ininternal/config/config_env.goandinternal/config/validation_env.go - Go version requirement (1.25.0) matches
go.mod - All documented
maketargets exist inMakefile:build,test,test-unit,test-integration,test-all,lint,coverage,install,format,clean,release,agent-finished - Binary name
awmgmatchesMakefileBINARY_NAME - Default port 3000 for direct binary (
--listen 127.0.0.1:3000) and 8000 forrun.shdefault are both accurate --config-stdinflag,--log-dir,--env,-v,--payload-dir,--payload-size-threshold— all registered ininternal/cmd/flags_*.go- Project structure in
CONTRIBUTING.md— all directories exist underinternal/ - JSON stdin
commandfield correctly omitted (only TOML supports it) DOCKER_API_VERSIONfallback to1.44for all architectures matchesrun.sh
Tested Commands
- ✅
make --dry-run build— matches:go build -o awmg . - ✅
make --dry-run test— alias fortest-unit - ✅
make --dry-run test-unit—go test -v ./internal/... - ✅
make --dry-run test-integration— auto-builds if needed, thengo test -v ./test/integration/... - ✅
make --dry-run test-all— builds thengo test -v ./... - ✅
make --dry-run lint—go vet,gofmt,golangci-lint - ✅
make --dry-run coverage—go test -coverprofile - ✅
make --dry-run install— checks Go/golangci-lint, runsgo mod download && verify ⚠️ make build— could not execute (Go 1.25.0 toolchain download blocked in sandbox); documented targets are structurally correct
Recommendations
Immediate Actions Required:
- Add
MCP_GATEWAY_SESSION_TIMEOUTtodocs/ENVIRONMENT_VARIABLES.md(see suggested fix above) - Consider adding
MCP_GATEWAY_SESSION_TIMEOUTto theAGENTS.mdenvironment variables table for completeness
Nice to Have:
- The
routed.go30-minute hardcoded session timeout (routedSessionTimeout) could also be mentioned in documentation, as it is not configurable and differs from unified mode's configurable 2-hour default.
Code References
- Session timeout:
internal/server/transport.go:41 - Routed mode hardcoded timeout:
internal/server/routed.go:102 - Env var utility:
internal/envutil/envutil.go:35(GetEnvDuration) - Env var test:
internal/envutil/envutil_test.go:115(testsMCP_GATEWAY_SESSION_TIMEOUT) - Documented env vars:
docs/ENVIRONMENT_VARIABLES.md
Generated by Nightly Documentation Reconciler · ◷
- expires on Apr 7, 2026, 3:43 AM UTC