v0.4.0
Added
-
Cancelling a run is now handled explicitly (AG-UI has no server-side
cancel route — the client aborts the streaming request and the server
observes the disconnect). The view's event stream is wrapped in a
teardown-aware guard that, onCancelledError/GeneratorExit:- guarantees provider teardown — the innermost event generator (whose
context manager owns the model provider's streaming request) is closed
explicitly rather than left to garbage-collection order, so no orphaned
upstream generation keeps billing after the client stopped listening; - persists the partial exchange — with a non-null
CONVERSATION_STORE, the truncated conversation (client history plus
the assistant text and completed tool calls streamed so far, dropping
partially streamed tool calls) is saved with the same thread/owner
scoping as a completed run; - audits the cancellation — the configured
AuditLoggerreceives a
run-levelAuditEventwithtool_name="agent.run",success=False,
and anerrorstarting with"cancelled:", riding the existing
record()surface so custom loggers keep working unchanged; - re-raises the cancellation — persist/audit failures are logged,
never substituted for theCancelledError.
No new settings and no new endpoint: cancellation stays transport-level,
and partial persistence follows the store you already configured. - guarantees provider teardown — the innermost event generator (whose