Repository navigation
Description
Description
Wayflow fails the multiple-output remote-tool execution even though the remote endpoint returns a valid JSON object matching the Agent Spec output schema.
The failure is observed in:
tests/remotetools/validation/test_valid_configs_agent_with_1_remotetool_multiple_outputs.pytest_valid_configuration_agent_with_1_remotetool_multiple_outputs_can_be_executed
The remote tool is configured with two outputs:
outputs:
- title: sum
type: number
- title: product
type: numberThe test invokes sum_multiply_tool with a=3 and b=6. The CTS test server returns:
{"sum": 9, "product": 18}This is the expected response for the declared output schema.
However, the Wayflow log reports:
Expected multiple outputs in a dictionary as result of tool sum_multiply_tool,
but an object of type <class 'str'> was returned.
This indicates that the response is likely being converted from a dictionary:
{"sum": 9, "product": 18}to a string:
'{"sum": 9, "product": 18}'somewhere in Wayflow’s remote-tool execution or output-mapping path. Wayflow then validates the converted value, sees a str instead of a dict, and rejects the multiple-output result.
The failure occurs before the expected values can be returned to the agent. The final agent message contains the validation error instead of 9 and 18.
The Wayflow CTS wrapper does not appear to perform this conversion. It passes WayflowFinishedStatus.output_values directly into the CTS result:
AgentSpecFinishedExecutionStatus(
outputs=execution_status.output_values,
agent_messages=last_agent_messages,
)at wayflowruntime/runtime.py:126-129.
Therefore, the likely defect is in Wayflow’s RemoteTool response deserialization, result normalization, or output-schema mapping—not in the CTS assertion itself.
Expected behavior
For the endpoint response:
{"sum": 9, "product": 18}Wayflow should preserve the response as a dictionary:
{
"sum": 9,
"product": 18
}It should then map the values to the declared Agent Spec outputs and allow the agent to return both 9 and 18.
If the endpoint returns an invalid response, Wayflow should report:
- Remote tool name.
- HTTP status.
- Response content type.
- Response body or a safely truncated response.
- Expected output schema.
- Actual received data type.
- Whether the value was parsed as JSON or retained as text.
Relevant code
agent-spec/conformance_test_suite/tests/common_server.py:27-35agent-spec/conformance_test_suite/tests/remotetools/valid_configs/agent_with_1_remotetool_multiple_outputs.yamlagent-spec/conformance_test_suite/tests/remotetools/validation/test_valid_configs_agent_with_1_remotetool_multiple_outputs.pyagent-spec/conformance_test_suite/runtimes/wayflowruntime/src/wayflowruntime/runtime.py:69-75agent-spec/conformance_test_suite/runtimes/wayflowruntime/src/wayflowruntime/runtime.py:118-135agent-spec/pyagentspec/src/pyagentspec/adapters/_tools_common.py:33-92
Activity
fix(tools): map JSON responses onto RemoteTool outputs when several a…