Skip to content

[BUG]Second A2A delegation fails — task is in terminal state (“completed”) #4166

@tangriraghav

Description

@tangriraghav

Description

Description:
When a single agent is configured with multiple A2A endpoints for sequential delegation, the first A2A agent runs fine. On delegating to the second agent, I get this error:

a2a.client.errors.A2AClientJSONRPCError: JSON-RPC Error code=-32602 data=None message='Task is in terminal state: completed'

This suggests the task context from the first delegate is being marked completed and not propagated correctly for the second A2A call, so the second agent never gets a valid task context.

Steps to Reproduce

Create an agent with two A2AConfig endpoints.

Run a task that should delegate sequentially to both.

First A2A call works; second fails with terminal state error.

Expected behavior

Both remote agents should receive valid task contexts and execute in order per the A2A protocol.

Screenshots/Code snippets

a2a=[A2AConfig(endpoint=ENDPOINT,timeout=WORKER_TIMEOUT),
A2AConfig(endpoint=ENDPOINT,timeout=WORKER_TIMEOUT,trust_remote_completion_status=True
)]

Operating System

macOS Sonoma

Python Version

3.10

crewAI Version

1.7.2

crewAI Tools Version

1.7.2

Virtual Environment

Venv

Evidence

a2a.client.errors.A2AClientJSONRPCError: JSON-RPC Error code=-32602 data=None message='Task 102224fb-4179-4baa-bd2f-73497e74b9b0 is in
terminal state: completed'

Possible Solution

task id for should not be marked as completed when first agent execution is completed.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions