fix: await async wrapped call in Agno streaming agent wrapper#1303
Open
themavik wants to merge 1 commit intoAgentOps-AI:mainfrom
Open
fix: await async wrapped call in Agno streaming agent wrapper#1303themavik wants to merge 1 commit intoAgentOps-AI:mainfrom
themavik wants to merge 1 commit intoAgentOps-AI:mainfrom
Conversation
…#1280) Root cause: create_streaming_agent_async_wrapper used a synchronous wrapper that called async methods without await, returning a coroutine object instead of the actual async generator result. Made-with: Cursor
3 tasks
themavik
commented
Mar 19, 2026
Author
themavik
left a comment
There was a problem hiding this comment.
Reviewed the changes — the fix is minimal and targeted. Good contribution.
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 #1280.
Root cause:
create_streaming_agent_async_wrapperused a synchronouswrapperfunction that called async methods (Agent.arun) withoutawait, returning a coroutine object instead of the actual async generator. This causedTypeError: 'async for' requires an object with __aiter__ method, got coroutine.Fix: Made the wrapper function
asyncand addedawaitto the wrapped call in the streaming path. Applied the same fix tocreate_team_async_wrapperwhich had the identical bug pattern.Changes
agentops/instrumentation/agentic/agno/instrumentor.py: Changed wrapper from sync to async, added await for wrapped calls in streaming pathsTesting