You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Gateway spec.server.timeouts and spec.mcp.timeouts.request are accepted but never applied #358
The Gateway CRD accepts spec.server.timeouts.read, .write and .idle (defaults 60s, 60s, 300s) and spec.mcp.timeouts.request (default 10s), and examples/gateway-complete/gateway.yaml sets all four. buildContainer in internal/controller/gateway_controller.go never reads them, so the gateway keeps its own defaults. The gateway does have the matching settings: SERVER_READ_TIMEOUT, SERVER_WRITE_TIMEOUT and SERVER_IDLE_TIMEOUT (defaults 30s, 30s, 120s) and MCP_REQUEST_TIMEOUT (default 5s). Found by reading the code - not reproduced on a cluster.
Steps to Reproduce
In a namespace labeled inference-gateway.com/managed=true, apply a Gateway with spec.server.timeouts: {read: 5s, write: 5s, idle: 10s} and spec.mcp: {enabled: true, timeouts: {request: 2s}}.
List the env of the generated Deployment: kubectl get deployment <name> -o jsonpath='{.spec.template.spec.containers[0].env[*].name}'.
Look for SERVER_READ_TIMEOUT, SERVER_WRITE_TIMEOUT, SERVER_IDLE_TIMEOUT and MCP_REQUEST_TIMEOUT.
Expected Behavior
The four values reach the gateway container as SERVER_READ_TIMEOUT, SERVER_WRITE_TIMEOUT, SERVER_IDLE_TIMEOUT and MCP_REQUEST_TIMEOUT, the way spec.mcp.timeouts.client, .dial, .tlsHandshake and .responseHeader already become MCP_CLIENT_TIMEOUT, MCP_DIAL_TIMEOUT, MCP_TLS_HANDSHAKE_TIMEOUT and MCP_RESPONSE_HEADER_TIMEOUT. Otherwise the fields are removed from the CRD and from examples/gateway-complete/gateway.yaml.
Actual Behavior
None of the four variables is set. grep -n "SERVER_READ_TIMEOUT\|SERVER_WRITE_TIMEOUT\|SERVER_IDLE_TIMEOUT\|MCP_REQUEST_TIMEOUT" internal/controller/gateway_controller.go returns nothing, and ServerTimeouts and MCPTimeouts.Request are referenced only by the API types, the generated deepcopy and one test fixture. The CRD defaults never take effect either: the gateway runs with 30s, 30s, 120s and 5s whatever the spec says.
internal/controller/gateway_controller.go: the new serverTimeoutEnv function sits next to clientTLSEnv and turns the three server timeouts into env vars. Inside the MCP block, MCP_REQUEST_TIMEOUT is set when request has a value. Empty fields are skipped, the same way the A2A timeouts already work, so the gateway keeps its own default for any field left unset.
internal/controller/gateway_controller_test.go: one test checks that all four values reach the container. Another checks that unset fields produce no env var.
The CRD did not change, so there are no regenerated manifests.
I confirmed that the gateway reads all four variables: they appear in its Configurations.md.
The skills were only lightly useful here. This is a mapping from the spec to the gateway's env vars inside the existing controller, so there was nothing new to model. I kept the env names exactly as the gateway's own config uses them.
Behavior change: if spec.server.timeouts is set, its CRD defaults now take effect: 60s/60s/300s replace the gateway's own 30s/30s/120s. Likewise, if spec.mcp.timeouts is set, request becomes 10s instead of 5s. If the timeouts block is left out, nothing changes. I did not test this on a cluster.
Not done: the existing MCP timeouts (MCP_CLIENT_TIMEOUT and the others) still send an empty string if timeouts is set but a field is empty. I left that alone because it is outside this issue.
Activity
edenreich commentedon Nov 17, 2026
@claude can you work on this? use /domain-driven-design /clean-architecture /ponytail:ponytail
inference-gateway-maintainer commentedon Nov 17, 2026
Claude finished @edenreich's task in 3m 29s —— View job •
fix/issue-358-20261117-0700• [Create PR ➔](https://github.com/inference-gateway/operator/compare/main...fix/issue-358-20261117-0700?quick_pull=1&title=Issue%20%23358%3A%20Changes%20from%20Claude&body=This%20PR%20addresses%20issue%20%23358%0A%0AGenerated%20with%20%5BClaude%20Code%5D(https%3A%2F%2Fclaude.ai%2Fcode)Fixed #358 - PR #363
buildContainer, the API types and the testsspec.server.timeoutsto the gateway asSERVER_READ_TIMEOUT,SERVER_WRITE_TIMEOUTandSERVER_IDLE_TIMEOUTspec.mcp.timeouts.requestto the gateway asMCP_REQUEST_TIMEOUTtask fmt,vet,lint(0 issues) andtest- all passWhat changed
internal/controller/gateway_controller.go: the newserverTimeoutEnvfunction sits next toclientTLSEnvand turns the three server timeouts into env vars. Inside the MCP block,MCP_REQUEST_TIMEOUTis set whenrequesthas a value. Empty fields are skipped, the same way the A2A timeouts already work, so the gateway keeps its own default for any field left unset.internal/controller/gateway_controller_test.go: one test checks that all four values reach the container. Another checks that unset fields produce no env var.I confirmed that the gateway reads all four variables: they appear in its
Configurations.md.The skills were only lightly useful here. This is a mapping from the spec to the gateway's env vars inside the existing controller, so there was nothing new to model. I kept the env names exactly as the gateway's own config uses them.
Behavior change: if
spec.server.timeoutsis set, its CRD defaults now take effect:60s/60s/300sreplace the gateway's own30s/30s/120s. Likewise, ifspec.mcp.timeoutsis set,requestbecomes10sinstead of5s. If thetimeoutsblock is left out, nothing changes. I did not test this on a cluster.Not done: the existing MCP timeouts (
MCP_CLIENT_TIMEOUTand the others) still send an empty string iftimeoutsis set but a field is empty. I left that alone because it is outside this issue.inference-gateway-releaser commentedon Nov 17, 2026
🎉 This issue has been resolved in version 0.37.1 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀