A2A streaming task history can lose or reorder concurrently written events

Abierto
#1,069 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@123XieC ya está trabajando en esto.

Desde el 14/11/2026.

  • #1070 de @123XieC — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
Medio día
Aptitud para principiantes
38/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
go
Área
backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Go
Estrellas
843
Forks
398
Merge medio
1 d 13 h
PR fusionados (30 d)
4

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de cloudwego/eino-ext

Todos los issues de cloudwego/eino-ext

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.