vllm_omni.engine.duplex.session.append_task ¶
One append in flight, and what its failure owes the session.
An append is not a call: it is a task queued behind the previous append, which may be cancelled, may find the session closed before it starts, and on any of those paths has to give back what it reserved --- the PCM bytes it took from the input budget, the committed audio it was going to consume, and the response it precreated.
That compensation is the reason this is an object. The five steps of an append all need the same eleven values, so as closures over _start_append they read as one function with five entry points and no way to test any of them. Named fields make the captured state explicit and the compensation a method.
AppendAttempt dataclass ¶
One queued append to the model, with the rollback each failure path owes.
on_append_accepted class-attribute instance-attribute ¶
retained_committed_payload instance-attribute ¶
clear_pending_silence ¶
Done-callback of a silence continuation: it is no longer pending.
discard_retained_audio ¶
Release the committed audio this append was going to consume.
Only if it is still the session's: a later commit may have replaced it, and that one belongs to the append that will carry it.
release_on_failure ¶
Done-callback: a cancelled or failed append must not hold the audio.