fix(a2a): return long_running_tool_ids from the message and artifact update converters - #6989
fix(a2a): return long_running_tool_ids from the message and artifact update converters#6989Yatsuiii wants to merge 2 commits into
Conversation
…update converters _convert_a2a_parts_to_adk_parts recovers long-running function call ids from the is_long_running part marker for all four inbound converters. convert_a2a_message_to_event and convert_a2a_artifact_update_to_event discarded that result and never passed it to _create_event, so the returned Event had long_running_tool_ids=None, while convert_a2a_task_to_event and convert_a2a_status_update_to_event populate it from the same marker. Both are defaults on A2aRemoteAgentConfig, so on the new integration extension path a long-running call arrived looking complete and _should_pause_invocation did not pause. Adds coverage across all four converters. Fixes google#6988
0054de6 to
f9b865d
Compare
|
The same discard is still on line 510, in output_parts, _ = _convert_a2a_parts_to_adk_parts(
artifact_parts, part_converter
)The There is a second reason to cover it. The repair looks like the one you already wrote twice: bind the ids at 510 and |
convert_a2a_task_to_event has two branches. The status branch already merged the ids recovered by _convert_a2a_parts_to_adk_parts; the artifact branch discarded them, so a task carrying the long-running call in an artifact still lost it. That also reached _create_mock_function_call_for_required_user_input, which synthesises a call under a fresh uuid only when no ids survived. An input-required task with a genuine pending call was handed a fabricated id rather than its own. The parametrised task case never covered this: its fixture builds a task with a status message and no artifacts, so it took the status branch that was already correct. Adds a task_artifact case that routes through the artifact branch, and a test pinning that a real call is not replaced.
|
Good catch, thanks. Confirmed both parts. Line 510 was a third discard site, and my parametrised The synthesis point holds too. With the ids dropped there, an input-required task falls past the early return in Fixed in 2a32cc9, same shape as the other three sites. Added a @llalitkumarrr flagging that the commit you tested was missing this third site, so it is worth re-running before review. |
_convert_a2a_parts_to_adk_partsrecovers long-running function call ids fromthe
is_long_runningpart marker for all four inbound converters. Two of themdiscard the result before building the Event.
_create_eventconvert_a2a_task_to_eventconvert_a2a_status_update_to_eventconvert_a2a_message_to_eventconvert_a2a_artifact_update_to_eventBoth failing sites now keep the ids and pass them positionally, matching the
two that already worked.
Behaviour change
Both are defaults on
A2aRemoteAgentConfig. On the new integration extensionpath
_should_pause_invocationsaw an emptylong_running_tool_idsand didnot pause, so a long-running call ran on as if it had completed. It now pauses,
matching the legacy
event_converterpath.Tests
One parametrized case across all four converters. Without the source change it
fails on
messageandartifact_updateand passes on the other two.tests/unittests/a2ais green: 460 passed, 48 skipped.Fixes #6988