Status
Accepted
Date
2025-11-29
We need a unified Run API that maps cleanly to A2A message.send and message.stream while covering new and existing Tasks.
- Expose RunOptions with
mode: "send" | "stream",threadId, optionaltaskId, optionalmessage(A2A-shaped), and optionalstate. mode: "stream", taskId: undefined→ A2Amessage.streamcreates a new Task and a long-lived AG-UI Run subscription.mode: "send", taskId: undefined→ A2Amessage.sendcreates a new Task and returns when the Task reaches completion; the Run is short-lived or synchronous.mode: "send", taskId: existing→ A2Amessage.sendas injection/control; short-lived control Run, while the subscription Run for that Task stays open.mode: "stream", taskId: existing→ optional secondary subscription to an existing Task.- For backwards compatibility,
mode: "send", taskId: undefinedmirrors the current one-shot behavior (single message, blocking or short-lived run); richer modes add streaming/subscription without changing that baseline.
- Clear mapping between UI invocation modes and A2A semantics.
- Supports both synchronous one-offs and long-lived streaming jobs.
- Enables injections without disrupting primary subscriptions.