Repository navigation
Description
Summary
Submitting an A2A task to a (mock) agent and letting it complete leaves nothing in /tasks: the task shows while running, then disappears on completion. The default a2a.task.completed_task_retention: 5 should keep the last 5 completed A2A tasks, but none are retained.
Root cause: the only place that populates the A2A retention service is retainTaskFromResult (internal/services/a2acoord/coordinator.go:199-219), called from taskCompletedCmds. It retains a task only when BOTH:
result.Datatype-asserts totools.A2ASubmitTaskResult(:204), andsubmitResult.Task != nil(:209).
For a backgrounded A2A submission - the "delegated, you'll be notified when it completes" flow used for async / mock agents - the submit result is built at internal/agent/tools/a2a_task.go:264-278 with no Task field set (only TaskID / ContextID / AgentURL / State / ...). So when completion is handled, submitResult.Task == nil and the task is never added to the retention service. It is already gone from the active poller (it finished), so it vanishes from /tasks entirely.
Two fragilities in the same gate:
result.Data.(tools.A2ASubmitTaskResult)is a concrete-type assertion that also silently fails if the result has been through a JSON round-trip (Data becomesmap[string]any) - the same class of issue noted elsewhere in the codebase for tool-resultData.- Requiring a non-nil
*adk.Taskmeans the common background path (which only has the task id / polling state at submit time) is never retained.
Note: I could not locate where domain.A2ATaskCompletedEvent is constructed/emitted in a quick search (no inline struct literal in non-test code), so the maintainer should confirm whether the completion event carries the final Task; if it does not, that is the fix point.
This is independent of the new per-kind /tasks tables: the view reads completed A2A rows from taskRetentionService.GetTasks() and shows them in the default "All" tab; the retention service is simply never populated for backgrounded tasks.
Steps to Reproduce
- Configure an A2A (mock) agent; ensure
a2a.task.completed_task_retention: 5(default). - In chat, submit a task to the agent (backgrounded - "you will be notified when it completes").
- Open
/taskswhile it runs - it appears under active. - Wait for completion, reopen
/tasks.
Expected Behavior
The completed A2A task remains listed in /tasks (Completed / All tabs), up to the last 5 (completed_task_retention).
Actual Behavior
The task disappears from /tasks after completion; nothing is retained.
Suggested fix: retain completed A2A tasks by task id / polling state even when the final *adk.Task is not present (and make the result.Data extraction tolerant of the map[string]any round-trip), and/or ensure the completion event carries the final Task.
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsDone
Activity
fix(a2a): retain completed background tasks in /tasks (#691) (#701)
chore(release): 0.126.0 [skip ci]
inference-gateway-releaser commentedon Jun 30, 2026
🎉 This issue has been resolved in version 0.126.0 🎉
The release is available on:
Your semantic-release bot 📦🚀