Skip to content

Python: [A2A] Link follow-up messages to the existing task via reference_task_ids #5938

@SergeyMenshykh

Description

@SergeyMenshykh

Context

A2A life-of-a-task expects refinements to carry referenceTaskIds. .NET sets this in A2AAgent.CreateA2AMessage:

a2aMessage.ReferenceTaskIds = typedSession.TaskId is not null ? [typedSession.TaskId] : null;

(Only when the prior task is not in InputRequired; see the companion input-required issue.)

Current Python state

_prepare_message_for_a2a (~L621) never sets reference_task_ids, so follow-up turns are not linked to the original task.

Proposed change

  • When the session has a completed (non-INPUT_REQUIRED) task_id, set a2a_message.reference_task_ids = [previous_task_id].
  • Coordinate with the input-required issue: INPUT_REQUIRED uses task_id instead.

Metadata

Metadata

Assignees

Labels

a2aIssue relates to A2Apython

Type

No type
No fields configured for issues without a type.

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions