Skip to content

feat: Expose MCP gateway keepalive_interval in workflow config schema #24219

@lpcox

Description

@lpcox

Summary

gh-aw-mcpg#3079 adds a keepalive_interval setting to the MCP gateway config that sends periodic pings to HTTP MCP backends, preventing session expiry during long-running agent tasks. This fixes the safeoutputs session timeout bug (gh-aw#23153).

However, there is currently no way for workflow authors to control this setting — it is a gateway-level config (GatewayConfig.keepalive_interval) that gh-aw passes via stdin JSON when launching the gateway. Workflow frontmatter has no corresponding field.

What needs to change

  1. Add keepalive-interval to the gateway config schema that gh-aw generates when launching the MCP gateway, so it can be set per-repo or per-workflow

  2. Expose it in the appropriate config layer — either:

    • A repo-level setting (e.g., in .github/aw/config.yml or similar) — most likely, since this is an infrastructure concern not a per-workflow concern
    • Or a workflow frontmatter field (e.g., under gateway: or mcp:) — if per-workflow control is desired
  3. Pass it through to the stdin JSON config that gh-aw sends to the gateway on startup:

    {
      "gateway": {
        "keepaliveInterval": 1500
      }
    }

Accepted values (from gh-aw-mcpg#3079)

Value Behavior
unset / 0 Default: 1500 seconds (25 minutes)
> 0 Custom keepalive interval in seconds
-1 Disable keepalive pings entirely

Note: 0 is treated as "unset" and silently defaulted to 1500 due to Go zero-value semantics in the gateway. A comment has been left on gh-aw-mcpg#3079 suggesting pointer semantics to make 0 mean "disabled" instead of requiring the -1 sentinel.

Use cases

  • Long-running autoloop workflows (ML training, large builds): default 25-min keepalive is correct, no change needed
  • Short-lived workflows with external session management: may want to disable keepalive (-1)
  • Custom backends with different idle timeouts: may need shorter intervals (e.g., 300 seconds for a 10-min timeout)

References

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions