mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Python: preserve A2A message context_id (#4686)
* Python: forward A2A context_id * Avoid duplicating A2A context ids Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
Unverified
parent
414496dda7
commit
0fdcfd0f4c
@@ -486,13 +486,14 @@ class A2AAgent(AgentTelemetryLayer, BaseAgent):
|
||||
raise ValueError(f"Unknown content type: {content.type}")
|
||||
|
||||
# Exclude framework-internal keys (e.g. attribution) from wire metadata
|
||||
internal_keys = {"_attribution"}
|
||||
internal_keys = {"_attribution", "context_id"}
|
||||
metadata = {k: v for k, v in message.additional_properties.items() if k not in internal_keys} or None
|
||||
|
||||
return A2AMessage(
|
||||
role=A2ARole("user"),
|
||||
parts=parts,
|
||||
message_id=message.message_id or uuid.uuid4().hex,
|
||||
context_id=message.additional_properties.get("context_id"),
|
||||
metadata=metadata,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user