Conversation
Contributor
PR TriagePossible duplicate: The following open PRs also reference the same issue(s):
If this is intentional, please explain in your PR description why this approach is preferred. Otherwise, consider collaborating on the existing PR instead. This PR has been automatically closed. There is already an open PR addressing this issue. If you believe your contribution is valuable, please comment on the original issue explaining your approach and why it might be preferred. A maintainer can reopen this PR if appropriate. |
16 tasks
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.
Summary
Fixes #8400 by routing streaming model chunks that contain
reasoning_contentorredacted_reasoning_contentthrough Agno's native reasoning event pipeline whenstream_events=True.On current
main, a model stream chunk with onlyreasoning_contentupdatesrun_response.reasoning_content, but it is emitted as a genericRunContentevent. That means/runsand downstream/aguiconsumers do not receiveReasoningContentDelta/REASONING_MESSAGE_CONTENTevents for OpenAI-compatible models that expose reasoning text in streaming chunks.This PR emits
ReasoningContentDeltafor reasoning deltas during event streaming, while preserving the existing non-event-streaming behavior where reasoning content remains attached to the run content event.Root cause
handle_model_response_chunk()already accumulatesmodel_response_event.reasoning_contentonto the run response, but the event emission branch treated reasoning-only chunks as ordinary run content. Native reasoning delta events were only emitted by provider-specific stream helpers, soOpenAILikechunks withreasoning_contentdid not enter the common reasoning event path.Validation
Reproduced on current
origin/mainbefore the fix:Validation after rebasing onto current
origin/main:AI assistance was used to prepare this patch; I reviewed the diff and validation evidence before opening the PR.