Skip to content

tools.timeout makes MCP Gateway fail to start: runtime writes gateway.toolTimeout as a string #68368

Done

Description

@mason-tim

tools.timeout makes the MCP Gateway fail to start: runtime writes gateway.toolTimeout as a string ("900s")

Summary

Any workflow that sets tools.timeout fails at Start MCP Gateway on gh-aw v0.91.8 (still present in v0.91.10 and main). The gateway rejects its config because gateway.toolTimeout is a string, but the schema requires an integer. The agent never starts.

Evidence

Failing step log (MCP Gateway v0.4.30, gh-aw v0.91.8, Copilot engine):

config:validation_schema Schema validation failed ...:
- at '/gateway/toolTimeout': got string, want integer
failed to load config: Configuration validation error (MCP Gateway version: v0.4.30):
    Location: /gateway/toolTimeout
    Error: got string, want integer
##[error]Process completed with exit code 1.

Minimal frontmatter:

tools:
  timeout: 900

The compiled lock sets GH_AW_TOOL_TIMEOUT: 900 on the "Start MCP Gateway" step. The compiled MCP config JSON contains no toolTimeout, so compile-time checks pass and the failure only shows in a live run.

Removing tools.timeout and recompiling removes GH_AW_TOOL_TIMEOUT from the lock; that is the workaround I'm using.

Root cause

actions/setup/js/tool_timeouts.cjs, applyGatewayRuntimeTimeouts (line ~33):

if (tool !== undefined && !config.gateway.toolTimeout) config.gateway.toolTimeout = `${tool / 1000}s`;

This writes a string such as "900s". It is called from actions/setup/js/start_mcp_gateway.cjs (applyGatewayRuntimeTimeouts(configObj, process.env)) just before the config is piped to the gateway.

docs/public/schemas/mcp-gateway-config.schema.json defines gateway.toolTimeout as "type": "integer", minimum: 1, in seconds.

Related

This is the same class of bug as #30994, fixed by #31007 for the compile-time renderer (pkg/workflow/mcp_renderer.go, which now emits integer seconds). The runtime path in tool_timeouts.cjs was not covered. A workflow that sets engine.mcp.tool-timeout skips the broken line because config.gateway.toolTimeout is already set. Only tools.timeout without it triggers the bug.

Proposed fix and plan

  1. In actions/setup/js/tool_timeouts.cjs, change the line to emit integer seconds: config.gateway.toolTimeout = tool / 1000;. timeoutMilliseconds already guarantees a whole, positive number of seconds, so the result is a valid integer of at least 1.
  2. In actions/setup/js/tool_timeouts.test.cjs, update any assertion that expects "<n>s". Add a test that GH_AW_TOOL_TIMEOUT=900 produces config.gateway.toolTimeout === 900 (number type), and that an existing engine.mcp.tool-timeout value is not overwritten.
  3. Add a test that validates the patched config against docs/public/schemas/mcp-gateway-config.schema.json, so renderer and runtime types cannot drift again.
  4. Run make agent-finish.

Acceptance criterion: a workflow with tools.timeout: 900 and no engine.mcp.tool-timeout starts the MCP Gateway successfully, and the gateway receives "toolTimeout": 900.

Environment

  • gh-aw v0.91.8 compiler (also reproduced by reading v0.91.10 and main source)
  • MCP Gateway v0.4.30
  • Engine: Copilot
  • Not reproduced on v0.89.21, which has no tool_timeouts.cjs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions