Skip to content

Wayflow MCP execution masks timeout with AttributeError #225

Open

Description

@JainSajal23

Description

Wayflow MCP execution does not complete when the configured MCP server fails to respond. After waiting approximately 60 seconds, the MCP request times out. During timeout handling, a secondary exception is raised:

AttributeError: 'str' object has no attribute 'message'

The failure is observed in the MCP execution tests, including:

  • tests/mcp/execution/test_valid_configs_agent_with_mcptool.py
  • tests/mcp/execution/test_valid_configs_agent_with_mcptoolbox.py
  • tests/mcp/execution/test_valid_configs_flow_with_mcptool.py

The CTS logs show that the MCP request waits for a ClientRequest response and eventually fails with a timeout. In at least one path, the MCP exception construction or propagation then attempts to access .message on a string, masking the original timeout.

The Wayflow CTS runtime currently delegates execution directly to:

self.conversation.execute()

in wayflowruntime/runtime.py:69-75. The runtime only translates normal Wayflow execution statuses in _transform_wayflow_execution_status_to_agentspec() and does not normalize MCP timeout or connection exceptions.

The loader enables unauthenticated MCP mode through:

enable_mcp_without_auth()

but there is no corresponding validation that the MCP endpoint is reachable before execution begins.

Expected behavior

When the MCP server is unavailable or does not respond within the configured timeout, the runtime should:

  • Preserve the original timeout or connection exception.
  • Return a clear MCP-specific failure.
  • Include the MCP endpoint and timeout duration where available.
  • Avoid raising a secondary AttributeError.
  • Avoid converting an infrastructure failure into an unrelated runtime failure.

If the MCP server is available, the tests should complete and return the expected user/session or flow output.

Relevant code

  • agent-spec/conformance_test_suite/runtimes/wayflowruntime/src/wayflowruntime/runtime.py:69-75
  • agent-spec/conformance_test_suite/runtimes/wayflowruntime/src/wayflowruntime/runtime.py:118-135
  • agent-spec/conformance_test_suite/runtimes/wayflowruntime/src/wayflowruntime/runtime.py:154-172
  • agent-spec/conformance_test_suite/tests/mcp/execution/test_valid_configs_agent_with_mcptool.py
  • agent-spec/conformance_test_suite/tests/mcp/execution/test_valid_configs_agent_with_mcptoolbox.py
  • agent-spec/conformance_test_suite/tests/mcp/execution/test_valid_configs_flow_with_mcptool.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions