A2A streaming task history can lose or reorder concurrently written events

Aperta
#1,069 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@123XieC ci sta già lavorando.

Dal 14/11/2026.

  • #1070 di @123XieC — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
Mezza giornata
Idoneità per principianti
38/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go
Ambito
backend

Direzione di ricerca

Work on the feat/a2a branch at the commit named in the issue. Read ResponseEventWriter.Write on streamResponseWriter: the append to the events slice happens after the lock is released, and the best-effort push-notification goroutine writes the named return error. Run the streaming test with go test -race to see the reported race, then confirm the fix by comparing the delivered message IDs against the history saved by TaskEventsConsolidator. Note the reporter says a fix and regression test are already in hand, so coordinate before starting.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Describe the bug

On feat/a2a at ecdc69cc724cb921018f5c67c014ed7f5e3687cc, an A2A streaming handler can emit several response events successfully but the task saved by the server can lose or reorder some of them. I reproduced this locally with the in-memory queue and task store, using one request and no model calls.

Reproduce

Register an A2A server with a MessageStreamingHandler that starts several goroutines, each calling ResponseEventWriter.Write with a distinct message ID, and waits for all writes before returning. Have TaskEventsConsolidator save the supplied message events in task history. Consume the streaming response and compare its message IDs with the saved history. A local test with 32 events delivered all 32 events, but the baseline failed the history comparison and go test -race reported concurrent access to streamResponseWriter.events.

Expected behavior

The consolidator receives the successfully queued events in delivery order. Push notifications remain best-effort and their errors are handled by the notification goroutine.

Cause

Write appends to its events slice after unlocking, allowing concurrent appends. The best-effort push-notification goroutine also assigns to the named return error of Write.

I have a focused fix with a regression test through the registered streaming handler and will link it here. AI assisted with the investigation and test.

Lingua principale
Go
Stelle
843
Fork
398
Merge medio
1g 13h
PR unite (30g)
4

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cloudwego/eino-ext

Tutte le issue di cloudwego/eino-ext

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.