a2a message:send stalls for long-output agent turns (O(n²) write amplification in taskstore)

Author: SummerSweetyCreated Sep 24, 2026Updated Sep 24, 2026

Problem

Synchronous POST /a2a/message:send stalls by minutes for long-output agent turns (multi-tool, thousands of streamed token events). The agent finishes and its result is persisted, but the HTTP response arrives long after typical client timeouts.

Root cause: taskupdate persists the entire merged Task on every event (DeepCopy + store.Update) — O(n²) write amplification in event count × task size. Measured ~5000 events ≈ 383s of executor stall on a Redis-backed store (the default 32-slot eventqueue fills behind the slow consumer as a multiplier; raising it to 1024 does not fix the delay — only reducing event count does).

Proposed fix in PR #3413: coalesce artifact deltas in a 200ms window (~30:1 event reduction) + cache the per-task user lookup in the Redis store.

Upstream SDK discussion: a2aproject/a2a-go#443.