a2a_protocol_server/handler/limits/terminal.rs
1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2026 Tom F. <[email protected]> (https://github.com/tomtom215)
3
4//! [`TerminalConfirmation`]: what a stream is told of a terminal event the store
5//! did not confirm.
6
7/// What a streaming client is told when the task store does not confirm a
8/// terminal event the executor emitted.
9///
10/// A terminal event is unconfirmed when its write failed and a read back shows
11/// the task is not in that state, when the store did not answer within the
12/// queue's write timeout, or when the processor that writes it had stopped.
13/// See [`HandlerLimits::terminal_confirmation`](super::HandlerLimits::terminal_confirmation).
14#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
15#[non_exhaustive]
16pub enum TerminalConfirmation {
17 /// The stream ends with an `UNAVAILABLE` error: the completion could not
18 /// be confirmed, and `GetTask` says what the store holds. A client is
19 /// never told a task finished that the store does not record as finished.
20 /// The default.
21 #[default]
22 Required,
23 /// The terminal event is delivered as the executor emitted it whether or
24 /// not the store confirmed it, as every release before 0.16.0 did. The
25 /// stream and `GetTask` can then disagree. For a deployment that prefers
26 /// an answer to a truthful one.
27 BestEffort,
28}