Skip to content

feat: Expose MCP gateway keepalive-interval in workflow config schema#24220

Merged
pelikhan merged 3 commits intomainfrom
copilot/add-keepalive-interval-to-gateway-config-schema
Apr 3, 2026
Merged

feat: Expose MCP gateway keepalive-interval in workflow config schema#24220
pelikhan merged 3 commits intomainfrom
copilot/add-keepalive-interval-to-gateway-config-schema

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 3, 2026

HTTP MCP backend sessions can expire during long-running agent tasks if the gateway's keepalive ping interval isn't tunable. This adds keepalive-interval as a first-class frontmatter field under sandbox.mcp, wiring it through to the keepaliveInterval field in the gateway's stdin JSON config.

Changes

  • MCPGatewayRuntimeConfig: Added KeepaliveInterval int field (yaml:"keepalive-interval")
  • Frontmatter extraction: Accepts both keepaliveInterval (camelCase) and keepalive-interval (kebab-case); breaks on key presence (not value) to correctly handle explicit 0
  • buildMCPGatewayConfig: Propagates KeepaliveInterval from frontmatter config into the built gateway config
  • MCP renderer: Emits "keepaliveInterval": N in the gateway JSON section when non-zero
  • JSON schemas: Added keepaliveInterval (min: -1) to both mcp-gateway-config.schema.json and the main workflow schema's sandbox.mcp object
  • Docs: Updated gateway spec table, added section 4.1.3.5, and changelog entry (v1.10.0)

Usage

sandbox:
  mcp:
    keepalive-interval: 300    # custom 5-min interval
    # keepalive-interval: -1   # disable keepalive entirely
    # omit / 0                 # gateway default: 1500s (25 min)

Compiles to:

{
  "gateway": {
    "port": 8080,
    "domain": "${MCP_GATEWAY_DOMAIN}",
    "apiKey": "${MCP_GATEWAY_API_KEY}",
    "keepaliveInterval": 300
  }
}
Value Behavior
unset / 0 Gateway default (1500s = 25 min)
> 0 Custom interval in seconds
-1 Disable keepalive pings

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw LX_5t3Gid 64/pkg/tool/linu--show-toplevel git rev-�� --show-toplevel 64/pkg/tool/linux_amd64/compile /usr/bin/git g_.a GO111MODULE ache/go/1.25.0/x--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw GOMOD GOMODCACHE go env -json GO111MODULE tions/setup/js/nGOMODCACHE GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw GOMOD GOMODCACHE go env -json GO111MODULE tions/node_modulGOMODCACHE GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/orgs/test-owner/actions/secrets
    • Triggering command: /usr/bin/gh gh api /orgs/test-owner/actions/secrets --jq .secrets[].name ./cmd/... ./pkg/... 64/bin/go tierignore **/*.cjs 64/bin/go go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/actions/ai-inference/git/ref/tags/v1
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha --show-toplevel x_amd64/compile /usr/bin/git ub/workflows GO111MODULE x_amd64/compile git rev-�� --show-toplevel x_amd64/compile /opt/hostedtoolcache/node/24.14.1/x64/bin/node -json GO111MODULE x_amd64/compile /opt/hostedtoolcache/node/24.14.1/x64/bin/node (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha -bool l /usr/lib/git-core/git-upload-pack -errorsas -ifaceassert -nilfunc git-upload-pack /tmp�� -stringintconv -tests /usr/bin/git --check scripts/**/*.js 64/bin/go git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v5
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha _.a 386Z3nCOv 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env rtcfg gUjZuIMaZ ck GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/x64/pkg/tool/linuorigin (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha download 12346 /usr/bin/git test-logs/run-12git GO111MODULE 64/pkg/tool/linu--show-toplevel git rev-�� --show-toplevel 64/pkg/tool/linux_amd64/compile /usr/bin/git _.a @v1.1.3/cpu/arm6rev-parse 64/pkg/tool/linu--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha --show-toplevel ache/go/1.25.0/x64/pkg/tool/linux_amd64/compile /usr/bin/git 858680/b254/_pkggit SRNX/fmCsvP9Fmyprev-parse 858680/b254=> git rev-�� --show-toplevel /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linuTest User /usr/bin/git auto-triage-issugit =main /opt/hostedtoolc--show-toplevel git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha -c go /usr/bin/git cp .github/aw/acgit GO111MODULE x_amd64/compile git remo�� remove origin /usr/bin/git -json GO111MODULE x_amd64/compile git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha /tmp/shared-actions-test3746585806 config /usr/bin/git remote.origin.urgit GO111MODULE x_amd64/compile git rev-�� --show-toplevel x_amd64/compile /usr/bin/git -json GO111MODULE x_amd64/compile git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha --show-toplevel ache/go/1.25.0/x64/pkg/tool/linutest@example.com /usr/bin/git 3284923167 dcfg ache/go/1.25.0/x--show-toplevel git rev-�� --show-toplevel ache/go/1.25.0/x64/pkg/tool/linux_amd64/compile /usr/bin/git 858680/b001/_pkggit GO111MODULE 1/x64/bin/node git (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha go1.25.0 -c=4 -nolocalimports -importcfg /tmp/go-build145858680/b249/importcfg -pack /home/REDACTED/work/gh-aw/gh-aw/pkg/fileutil/fileutil.go -o /tmp/go-build565-p -trimpath 64/bin/go -p github.com/githu-o -lang=go1.25 go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha -json context/xcontext.go 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE x_amd64/asm GOINSECURE GOMOD GOMODCACHE x_amd64/asm (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha --show-toplevel go /usr/bin/git -json GO111MODULE x_amd64/compile git rev-�� --show-toplevel x_amd64/compile /usr/bin/git -json GO111MODULE x_amd64/compile git (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha --show-toplevel go /usr/bin/git cli/install.sh..git GO111MODULE x_amd64/compile git rev-�� --show-toplevel MEyT6qO/ilPel1urx6TpxZ0rej1L /usr/bin/git Gitbranch_with_hgit Gitbranch_with_hrev-parse x_amd64/compile git (http block)
  • https://api.github.com/repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq .object.sha -json GO111MODULE de_modules/.bin/GOMODCACHE GOINSECURE GOMOD GOMODCACHE go tion�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw --jq .visibility -json GO111MODULE r: $owner, name: $name) { hasDiscussionsEnabled } } GOINSECURE GOMOD GOMODCACHE go env ck '**/*.cjs' '**/*.ts' '**/*.jsGOINSECURE GO111MODULE r: $owner, name: $name) { hasDiscussionsEnabled } } GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0 --jq .object.sha -json GO111MODULE $name) { hasDiscussionsEnabled } } GOINSECURE GOMOD GOMODCACHE go tion�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v0.1.2
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0.1.2 --jq .object.sha /tmp/TestCompileErrorFormatting3645188481/001 rev-parse /usr/bin/git -json GO111MODULE x_amd64/compile git rese�� HEAD .github/workflows/test.md /usr/bin/git -json GO111MODULE x_amd64/compile git (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.0.0 --jq .object.sha licyBlockedUsersApprovalLabelsCompiledOutput985359087/001 -trimpath /opt/hostedtoolcache/go/1.25.0/x64/bin/go -p log/slog -lang=go1.25 go test�� -v -parallel=4 /usr/bin/git -run=^Test ./... -short git (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.2.3
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.2.3 --jq .object.sha 3627-31354/test-3284923167 -trimpath /bin/sh l github.com/goccyrev-parse -lang=go1.21 /bin/sh -c echo " Copy wasm_exec.js from: $(go env GOROOT)/lib/wasm/wasm_exec.js (or misc/wasm/ for Go <1.git -dwarf=false 1/x64/bin/node go1.25.0 -c=4 -nolocalimports 1/x64/bin/node (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/1/artifacts
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 GO111MODULE 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile env 3363874145/.github/workflows GO111MODULE 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12345/artifacts
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 GO111MODULE 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile env _.a @v1.1.3/cpu/x86/x86.go 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12346/artifacts
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 GO111MODULE 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile env _.a @v1.1.3/cpu/arm64/arm64.go 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/2/artifacts
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 GO111MODULE 64/pkg/tool/linu-nilfunc sm); \ wasm-optgit GOMOD GOMODCACHE 64/pkg/tool/linu-tests env 3363874145/.github/workflows 0/internal/tag/tag.go 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/3/artifacts
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 49c66f0a:go.mod 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile env 3363874145/.github/workflows 0/internal/language/common.go 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/4/artifacts
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 GO111MODULE 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile env 3363874145/.github/workflows 0/internal/language/compact/compact.go 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/5/artifacts
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 GO111MODULE 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile env 3363874145/.github/workflows 0/internal/stringset/set.go x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (http block)
  • https://api.github.com/repos/github/gh-aw/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path -json GOMOD 64/bin/go tierignore **/*.cjs 64/bin/go go env -json onrpc.go 64/bin/go GOINSECURE GOMOD sm.s go (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 100 GOMOD GOMODCACHE go env -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE r1aaYBq/C-J3tWYhrev-parse (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 6 GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile env _.a GO111MODULE 64/pkg/tool/linux_amd64/compile GOINSECURE eutil GOMODCACHE 64/pkg/tool/linux_amd64/compile (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v0.47.4
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v0.47.4 --jq .object.sha --show-toplevel 64/pkg/tool/linux_amd64/asm /usr/bin/git -json GO111MODULE 64/pkg/tool/linu--show-toplevel git rev-�� --show-toplevel 64/pkg/tool/linutest@example.com /usr/bin/git _.a GO111MODULE x_amd64/compile git (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha LsRemoteWithReal--detach LsRemoteWithRealGitcustom_branch3473384256/001' 64/pkg/tool/linux_amd64/compile GOINSECURE go-sdk/oauthex GOMODCACHE 64/pkg/tool/linux_amd64/compile env _.a GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.2.3
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD s go env -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v2.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v3.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile (http block)
  • https://api.github.com/repos/githubnext/agentics/git/ref/tags/
    • Triggering command: /usr/bin/gh gh api /repos/githubnext/agentics/git/ref/tags/# --jq .object.sha */*.ts' '**/*.jsGOINSECURE GO111MODULE $name) { hasDiscussionsEnabled } } GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/nonexistent/action/git/ref/tags/v999.999.999
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha _.a GO111MODULE At,event,headBranch,headSha,displayTitle GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile env _.a c0vawJUPE 64/pkg/tool/linux_amd64/vet GOINSECURE obyte GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
  • https://api.github.com/repos/nonexistent/repo/actions/runs/12345
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile env y_only_defaults_repo2685394849/001 vueU9NHe3 64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/compile (http block)
  • https://api.github.com/repos/owner/repo/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/bin/go -d **/*.cjs 64/bin/go go env -json d.go 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/bin/go -d **/*.cjs 64/bin/go go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/owner/repo/contents/file.md
    • Triggering command: /tmp/go-build2333851238/b396/cli.test /tmp/go-build2333851238/b396/cli.test -test.testlogfile=/tmp/go-build2333851238/b396/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true -nolocalimports -importcfg /tmp/go-build145858680/b206/importcfg -pack run ./cmd/... ./pkg/... 64/bin/go tierignore **/*.cjs 64/bin/go go (http block)
  • https://api.github.com/repos/test-owner/test-repo/actions/secrets
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name go1.25.0 -c=4 -nolocalimports -importcfg /tmp/go-build2333851238/b396/importcfg -pack /tmp/go-build2333851238/b396/_testmain.go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Adds `keepalive-interval` / `keepaliveInterval` configuration support to
the MCP gateway, allowing workflow authors to control keepalive ping
frequency for HTTP MCP backends to prevent session expiry during
long-running agent tasks.

Changes:
- Add `KeepaliveInterval` field to `MCPGatewayRuntimeConfig` struct
- Add frontmatter extraction for `keepaliveInterval`/`keepalive-interval`
- Pass through keepalive interval in `buildMCPGatewayConfig`
- Emit `keepaliveInterval` in gateway JSON when set (non-zero)
- Update MCP gateway config JSON schema with `keepaliveInterval` field
- Update main workflow schema with `keepalive-interval` in sandbox.mcp
- Add tests for extraction and propagation
- Document in MCP gateway spec (table, section 4.1.3.5, changelog)

Closes #N/A (relates to gh-aw-mcpg#3079 and gh-aw#23153)

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/888a3ba5-2273-4afb-9f70-15385a5994b1

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot AI changed the title [WIP] Add keepalive interval to MCP gateway config schema feat: Expose MCP gateway keepalive-interval in workflow config schema Apr 3, 2026
Copilot AI requested a review from lpcox April 3, 2026 03:43
Copilot finished work on behalf of lpcox April 3, 2026 03:43
@lpcox
Copy link
Copy Markdown
Collaborator

lpcox commented Apr 3, 2026

@pelikhan please take a look

Tests asserted 'integrity check failed' but the error message was
changed to 'is outdated or unverifiable' in #24198. Updated all 6
assertions to match the current production error format.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lpcox lpcox marked this pull request as ready for review April 3, 2026 03:59
Copilot AI review requested due to automatic review settings April 3, 2026 03:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a configurable MCP gateway keepalive ping interval to workflow frontmatter, propagating it into the generated gateway JSON config to prevent HTTP MCP backend sessions expiring during long-running tasks.

Changes:

  • Adds sandbox.mcp.keepalive-interval to workflow frontmatter config and wires it through MCPGatewayRuntimeConfig.
  • Renders "keepaliveInterval": <int> into the gateway JSON config when non-zero.
  • Updates JSON schemas and MCP gateway reference docs accordingly.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/workflow/tools_types.go Adds KeepaliveInterval to the MCP gateway runtime config type.
pkg/workflow/frontmatter_extraction_security.go Extracts keepalive interval from frontmatter (camelCase + kebab-case).
pkg/workflow/mcp_gateway_config.go Propagates extracted keepalive interval into the gateway config used by renderers.
pkg/workflow/mcp_renderer.go Emits keepaliveInterval in the generated gateway JSON section.
pkg/workflow/mcp_gateway_config_test.go Adds unit tests ensuring keepalive interval propagation in buildMCPGatewayConfig.
pkg/workflow/frontmatter_extraction_security_test.go Adds unit tests for keepalive interval extraction from frontmatter.
pkg/workflow/schemas/mcp-gateway-config.schema.json Adds keepaliveInterval to the gateway JSON schema.
pkg/parser/schemas/main_workflow_schema.json Adds keepalive-interval under sandbox.mcp in the workflow schema.
docs/src/content/docs/reference/mcp-gateway.md Documents keepaliveInterval and adds a new spec section + changelog entry.
docs/public/schemas/mcp-gateway-config.schema.json Mirrors the gateway JSON schema update for docs publishing.
actions/setup/js/check_workflow_timestamp_api.test.cjs Updates assertions to match the current “outdated” failure messaging.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +500 to +516
for _, key := range []string{"keepaliveInterval", "keepalive-interval"} {
if keepaliveVal, hasKeepalive := mcpObj[key]; hasKeepalive {
switch v := keepaliveVal.(type) {
case int:
mcpConfig.KeepaliveInterval = v
case int64:
mcpConfig.KeepaliveInterval = int(v)
case uint:
mcpConfig.KeepaliveInterval = int(v)
case uint64:
mcpConfig.KeepaliveInterval = int(v)
case float64:
mcpConfig.KeepaliveInterval = int(v)
}
// Break when the key exists (even if value is 0, to avoid picking up a second key variant)
break
}
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The loop breaks as soon as either key exists, even if the value is an unsupported type (e.g. string/bool). That prevents falling back to the other key variant, and can silently ignore a valid value under the second spelling. Consider only breaking once a value has been successfully parsed as a number (including explicit 0), and emit a warning/error when the key is present but not a valid integer. Also consider enforcing the documented constraint of >= -1 (reject values < -1) before propagating to the gateway config.

Copilot uses AI. Check for mistakes.
Comment on lines +3234 to 3239
"keepalive-interval": {
"type": "integer",
"description": "Keepalive ping interval in seconds for HTTP MCP backends. Sends periodic pings to prevent session expiry during long-running agent tasks. Set to -1 to disable keepalive pings. Unset or 0 uses the gateway default (1500 seconds = 25 minutes).",
"minimum": -1,
"examples": [-1, 300, 600, 1500]
}
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The compiler explicitly accepts both keepaliveInterval (camelCase) and keepalive-interval (kebab-case) in frontmatter, but this schema only allows keepalive-interval (and additionalProperties: false will reject the camelCase variant). Either add keepaliveInterval to the schema as an allowed alias (optionally marked deprecated) or drop camelCase support in extraction to keep validation/intellisense aligned with actual accepted inputs.

Copilot uses AI. Check for mistakes.
@pelikhan pelikhan merged commit c0865b8 into main Apr 3, 2026
125 checks passed
@pelikhan pelikhan deleted the copilot/add-keepalive-interval-to-gateway-config-schema branch April 3, 2026 04:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Expose MCP gateway keepalive_interval in workflow config schema

4 participants