wip: AG-UI issue #5813 local follow-up commits#7540
Draft
Mustafa-Esoofally wants to merge 4 commits intomainfrom
Draft
wip: AG-UI issue #5813 local follow-up commits#7540Mustafa-Esoofally wants to merge 4 commits intomainfrom
Mustafa-Esoofally wants to merge 4 commits intomainfrom
Conversation
…duplication AG-UI frontends (CopilotKit, Mastra) send the full conversation history on every request per protocol spec. The router was passing all messages to agent.arun(input=messages), causing: - Duplicated messages in session DB (N+(N+1) growth per run) - Agent UI showing first user message for every run - AG-UI message IDs dropped during conversion - Doubled context when add_history_to_context=True Fix: extract only the last user message as a string and pass to arun(input=string), matching the REST API pattern. The agent manages history via its own session DB. Additional improvements over the original PR: - Safe empty-string fallback (no dangerous or-messages fallback) - AG-UI message IDs preserved in convert_agui_messages_to_agno_messages - Multimodal UserMessage.content handling (Union[str, List[InputContent]]) - run_team parameter renamed from input to run_input (avoids builtin shadow) - 7 unit tests added Fixes #5813 Co-authored-by: RowanLane <jstd000@proton.me>
The router now uses extract_agui_user_input() exclusively. convert_agui_messages_to_agno_messages() had no remaining callers in production code — remove it and its tests to avoid confusion.
Message and log_debug were only used by the removed convert_agui_messages_to_agno_messages function.
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
Preserves local follow-up work on
fix/agui-input-content-semanticsthat never made it to origin. PR #5469 was merged; these commits happened locally after the merge:2506edcc7fix: extract last user message from AG-UI history to prevent message duplication (the original fix, likely covered by the merged PR)0853e8c89Merge remote-tracking branch 'origin/main' into fix/agui-input-content-semanticsfbbc59aaerefactor: remove unused convert_agui_messages_to_agno_messagesd06c37c69fix: remove unused imports from utils.py after cleanupStatus
Saved from a worktree cleanup pass. The refactor + unused-imports commits are follow-up cleanup that may be worth landing as a small independent PR — triage before closing.