mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-08 15:48:29 +00:00
fix: Rebuild AgentResponse model in multi-turn A2A flows to support skill IDs
In multi-turn A2A conversations, the AgentResponse model was only rebuilt in _execute_task_with_a2a() but not in subsequent turns handled by _handle_agent_response_and_continue(). This meant that if the LLM returned a skill ID on a later turn, it would fail validation. This commit rebuilds the model in _handle_agent_response_and_continue() using extract_agent_identifiers_from_cards() to include both endpoints and skill IDs, ensuring all turns support skill ID resolution. Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
@@ -386,6 +386,9 @@ def _handle_agent_response_and_continue(
|
||||
if "agent_card" in a2a_result and agent_id not in agent_cards_dict:
|
||||
agent_cards_dict[agent_id] = a2a_result["agent_card"]
|
||||
|
||||
agent_identifiers = extract_agent_identifiers_from_cards(a2a_agents, agent_cards_dict)
|
||||
agent_response_model = create_agent_response_model(agent_identifiers)
|
||||
|
||||
task.description = _augment_prompt_with_a2a(
|
||||
a2a_agents=a2a_agents,
|
||||
task_description=original_task_description,
|
||||
|
||||
Reference in New Issue
Block a user