Problem
The MCP gateway has a hardcoded default toolTimeout of 60 seconds. Workflows using slow MCP backends (e.g., Repo Mind Light which requires full-text search over large indexes) hit this timeout even when GH_AW_TOOL_TIMEOUT is set much higher (e.g., 600s).
Root cause: GH_AW_TOOL_TIMEOUT is an env var consumed by the agent container (Copilot CLI), but the MCP gateway — which proxies tool calls between the agent and backend MCP servers — enforces its own independent 60s timeout that is not configurable from the workflow frontmatter.
Evidence: github/pull-requests run 25225648212 shows:
GH_AW_TOOL_TIMEOUT: 600 (agent env)
- Gateway:
toolTimeout=60 (gateway internal default)
- Result:
net/http: timeout awaiting response headers on repo-mind query after ~60s
Proposed Solution
Add engine.mcp.tool-timeout to the workflow frontmatter schema, following the same pattern as engine.mcp.session-timeout (PR #29354):
engine:
mcp:
tool-timeout: 120 # seconds (or duration string like "2m")
session-timeout: 6h # already supported
Implementation
- Schema: Add
engine.mcp.tool-timeout property to the JSON schema (integer seconds or duration string)
- Parsing: Add
MCPToolTimeout field to EngineConfig in ExtractEngineConfig
- Validation: Add
validateEngineMCPToolTimeout (bounds: 10s–600s) in engine_validation.go
- Config propagation: In
buildMCPGatewayConfig, propagate to MCPGatewayRuntimeConfig.ToolTimeout
- Rendering: Pass
toolTimeout in the gateway stdin JSON config (requires mcpg support — see companion issue)
- Default: When not specified, omit from config (gateway uses its own default of 60s)
Frontmatter example
engine:
mcp:
tool-timeout: 120
Depends On
- github/gh-aw-mcpg companion issue: mcpg must accept
toolTimeout in its stdin JSON config and apply it to HTTP backend requests
Related
Problem
The MCP gateway has a hardcoded default
toolTimeoutof 60 seconds. Workflows using slow MCP backends (e.g., Repo Mind Light which requires full-text search over large indexes) hit this timeout even whenGH_AW_TOOL_TIMEOUTis set much higher (e.g., 600s).Root cause:
GH_AW_TOOL_TIMEOUTis an env var consumed by the agent container (Copilot CLI), but the MCP gateway — which proxies tool calls between the agent and backend MCP servers — enforces its own independent 60s timeout that is not configurable from the workflow frontmatter.Evidence: github/pull-requests run 25225648212 shows:
GH_AW_TOOL_TIMEOUT: 600(agent env)toolTimeout=60(gateway internal default)net/http: timeout awaiting response headerson repo-mind query after ~60sProposed Solution
Add
engine.mcp.tool-timeoutto the workflow frontmatter schema, following the same pattern asengine.mcp.session-timeout(PR #29354):Implementation
engine.mcp.tool-timeoutproperty to the JSON schema (integer seconds or duration string)MCPToolTimeoutfield toEngineConfiginExtractEngineConfigvalidateEngineMCPToolTimeout(bounds: 10s–600s) inengine_validation.gobuildMCPGatewayConfig, propagate toMCPGatewayRuntimeConfig.ToolTimeouttoolTimeoutin the gateway stdin JSON config (requires mcpg support — see companion issue)Frontmatter example
Depends On
toolTimeoutin its stdin JSON config and apply it to HTTP backend requestsRelated
engine.mcp.session-timeout#29354 —engine.mcp.session-timeout(same pattern)