a2aproject / a2aproject/a2a-rs

[Bug]: Duplicate/Aggregated artifacts when using the same context id but different task ids and artifact ID's?

Ouverte
#161 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Rust
Étoiles
75
Forks
19
Merge moyen
11 h 27 min
PR mergées (30 j)
21

Description

### What happened?

1. Start a new session (a2a-rs protocol version 0.11.0!)
2. client sends a new prompt to agent: 'yo'
3. new context id (A) and task id (T1) is created
4. agent queues artifact A1 and completes task
5. client sends a new prompt to agent: 'yo2'
6. context id A is re-used as expected. task id is new (T2)
7. agent queus artifact A2 and completes task.
8. client received task update with context id A, task id T2 and artifacts A1 AND A2

I'm not 100% sure but is (8) now a bug or is this how it's supposed to be and I'm doing something wrong? I interpreted the spec that when a new task is created it should only contain the artifacts related to the task and not the aggregate of the whole context_id. I end-up now client-side with all the duplicates.

Does anyone know? Thanks a lot.

### Relevant log output

```shell
2026-09-07T08:12:41.344030Z DEBUG a2a_protocol_server::handler::messaging: creating task task_id=ddf997f4-d94a-49e3-a425-dc26db9b9279 context_id=45e13205-3df7-4e84-ad5e-d8df06a76187
2026-09-07T08:12:41.344133Z DEBUG a2a_protocol_server::store::task_store::in_memory: saving task task_id=ddf997f4-d94a-49e3-a425-dc26db9b9279 state=Submitted
2026-09-07T08:12:41.344263Z DEBUG a2a_protocol_server::handler::messaging: executor started task_id=ddf997f4-d94a-49e3-a425-dc26db9b9279

2026-09-07T08:12:41.344313Z DEBUG coordinator::executor: context 45e13205-3df7-4e84-ad5e-d8df06a76187 task ddf997f4-d94a-49e3-a425-dc26db9b9279 : Handling request yo

2026-09-07T08:12:41.344320Z DEBUG a2a_protocol_server::store::task_store::in_memory: fetching task task_id=ddf997f4-d94a-49e3-a425-dc26db9b9279
2026-09-07T08:12:41.344384Z DEBUG a2a_protocol_server::store::task_store::in_memory: saving task task_id=ddf997f4-d94a-49e3-a425-dc26db9b9279 state=Working
2026-09-07T08:12:41.344555Z DEBUG a2a_protocol_server::store::task_store::in_memory: saving task task_id=ddf997f4-d94a-49e3-a425-dc26db9b9279 state=Working
2026-09-07T08:12:41.344578Z DEBUG a2a_protocol_server::store::task_store::in_memory: saving task task_id=ddf997f4-d94a-49e3-a425-dc26db9b9279 state=Completed

2026-09-07T08:15:41.118167Z DEBUG a2a_protocol_server::handler::messaging: creating task task_id=67a20697-583f-4212-9af5-8bb782dbd34a context_id=45e13205-3df7-4e84-ad5e-d8df06a76187
2026-09-07T08:15:41.118268Z DEBUG a2a_protocol_server::store::task_store::in_memory: saving task task_id=67a20697-583f-4212-9af5-8bb782dbd34a state=Submitted
2026-09-07T08:15:41.118492Z DEBUG a2a_protocol_server::handler::messaging: executor started task_id=67a20697-583f-4212-9af5-8bb782dbd34a

2026-09-07T08:15:41.118531Z DEBUG coordinator::executor: context 45e13205-3df7-4e84-ad5e-d8df06a76187 task 67a20697-583f-4212-9af5-8bb782dbd34a : Handling request yo2

2026-09-07T08:15:41.118530Z DEBUG a2a_protocol_server::store::task_store::in_memory: fetching task task_id=67a20697-583f-4212-9af5-8bb782dbd34a
2026-09-07T08:15:41.118593Z DEBUG a2a_protocol_server::store::task_store::in_memory: saving task task_id=67a20697-583f-4212-9af5-8bb782dbd34a state=Working
2026-09-07T08:15:41.118764Z DEBUG a2a_protocol_server::store::task_store::in_memory: applied artifact delta in place task_id=67a20697-583f-4212-9af5-8bb782dbd34a
2026-09-07T08:15:41.118812Z DEBUG a2a_protocol_server::store::task_store::in_memory: saving task task_id=67a20697-583f-4212-9af5-8bb782dbd34a state=Completed
```

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Look at the task store implementation, likely in a2a_protocol_server::store::task_store::in_memory. The logs show 'applied artifact delta in place' for the second task. Examine how artifacts are associated with tasks and contexts, and check the logic for sending task updates to the client. The fix should ensure a task update only includes artifacts created within that specific task.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
rust
Domaine
api, backend
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
Active
Clarté
Plutôt claire
Accessibilité débutants
55/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.