Skip to content

Support importing engine.mcp.tool-timeout from shared workflows #30634

@lpcox

Description

@lpcox

Problem

Shared workflows that wrap slow HTTP MCP servers (e.g., Repo Mind Light) cannot propagate the engine.mcp.tool-timeout setting to their consumers. This forces every consumer to manually add:

engine:
  mcp:
    tool-timeout: "10m"

...even though the shared workflow author knows the correct timeout for their MCP server.

Today, tools.timeout and tools.startup-timeout are merged during shared workflow import, but engine.mcp.tool-timeout lives under the engine: section which is not imported.

Context

Proposed Solution

Make engine.mcp.tool-timeout importable from shared workflows during the import merge phase.

When a consumer imports a shared workflow that declares engine.mcp.tool-timeout, the compiler should merge that value into the consumer's effective configuration — following the same precedence rules as other imported settings (consumer explicitly set > imported value > default).

Example

Shared workflow (shared/repo-mind-light.md):

---
description: "Repo Mind Light shared component"
mcp-servers:
  repo-mind:
    url: http://127.0.0.1:8000/mcp
    allowed:
      - query

engine:
  mcp:
    tool-timeout: "10m"

tools:
  timeout: 600
  startup-timeout: 600
---

Consumer workflow:

---
imports:
  - shared/repo-mind-light.md
engine: copilot
---

Expected behavior: The compiled workflow uses tool-timeout: "10m" from the shared workflow without the consumer needing to specify it.

Override behavior: If the consumer explicitly sets engine.mcp.tool-timeout, their value takes precedence:

---
imports:
  - shared/repo-mind-light.md
engine:
  mcp:
    tool-timeout: "5m"  # Consumer override wins
---

Implementation Notes

  • The import merge logic lives in pkg/workflow/compiler_orchestrator_tools.go and related import resolution code
  • engine.mcp.tool-timeout extraction is in pkg/workflow/engine.go
  • Validation is in pkg/workflow/engine_validation.go (10s–600s bounds)
  • Gateway config propagation is in pkg/workflow/mcp_gateway_config.go
  • Need to extend the import merge to include engine.mcp settings (at minimum tool-timeout and session-timeout)

Acceptance Criteria

  • Shared workflows can declare engine.mcp.tool-timeout and have it propagated to consumers
  • Consumer-specified engine.mcp.tool-timeout takes precedence over imported value
  • Validation (10s–600s) applies to imported values
  • Existing tools.timeout and tools.startup-timeout import behavior is unchanged
  • Tests cover: import without override, import with consumer override, validation of imported value

Related

Metadata

Metadata

Labels

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