Skip to content

v0.4.0

Choose a tag to compare

@github-actions github-actions released this 14 Jun 10:45
29a17f7

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, on CancelledError/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 AuditLogger receives a
      run-level AuditEvent with tool_name="agent.run", success=False,
      and an error starting 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 the CancelledError.

    No new settings and no new endpoint: cancellation stays transport-level,
    and partial persistence follows the store you already configured.