Repository navigation
Conversation
ssccinng
temporarily deployed
to
github-app-auth
October 25, 2026 09:38 — with
GitHub Actions
Inactive
ssccinng
temporarily deployed
to
github-app-auth
October 25, 2026 09:39 — with
GitHub Actions
Inactive
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation & Context
Agent and Chat middleware discarded MiddlewareTermination.result, returning None when context.result was unset.
Description & Review Guide
Both pipelines now use the exception result only when context.result is None. Existing context results retain precedence, and returned streams receive registered transforms and result hooks.
Regression coverage includes all eight combinations of middleware type, streaming mode, and pipeline or Agent.run execution, plus result precedence and stream hooks. Stream assertions respect the finalizer's aggregation of original updates. Test execution is pending.
Related Issue
N/A - localized bug fix.
AI Assistance
Implementation and regression tests were AI-assisted.
Contribution Checklist
Validation
The configured baseline checks passed before the change.
The regression test fails against the original code and passes after the fix.
cd python/packages/core && python -m pytest -q -m 'not integration' tests/core/test_middleware_context_result.py tests/core/test_middleware_with_agent.py tests/core/test_middleware_with_chat.py tests/core/test_middleware.py: passed.cd 'python/packages/core' && python -m pytest -q -m 'not integration' 'tests/core/test_middleware_context_result.py' 'tests/core/test_middleware_with_agent.py' 'tests/core/test_middleware_with_chat.py': passed.