a2aproject / a2aproject/a2a-rs
[Bug]: Duplicate/Aggregated artifacts when using the same context id but different task ids and artifact ID's?
- Lingua principale
- Rust
- Stelle
- 75
- Fork
- 19
- Merge medio
- 11h 27m
- PR unite (30g)
- 21
Descrizione
### 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
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- rust
- Ambito
- api, backend
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Attiva
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 55/100