Skip to content

fix: call after_run and on_error middleware in iter() #17#18

Merged
DEENUU1 merged 2 commits intomainfrom
issue/17
Mar 12, 2026
Merged

fix: call after_run and on_error middleware in iter() #17#18
DEENUU1 merged 2 commits intomainfrom
issue/17

Conversation

@DEENUU1
Copy link
Copy Markdown
Member

@DEENUU1 DEENUU1 commented Mar 12, 2026

[0.2.3] - 2026-03-11

Fixed

  • MiddlewareAgent.iter() now calls after_run and on_error middleware — previously only before_run was invoked, making middleware unusable for post-processing (e.g. audit logging, cost tracking) when using iter() / run_stream(). after_run is called in reverse order after iteration completes, on_error is called when an exception propagates out of the async with block. (#17)

@DEENUU1 DEENUU1 merged commit 3d6351f into main Mar 12, 2026
9 checks passed
@DEENUU1 DEENUU1 deleted the issue/17 branch March 12, 2026 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant