Skip to content

wip: AG-UI issue #5813 local follow-up commits#7540

Draft
Mustafa-Esoofally wants to merge 4 commits intomainfrom
wip/cleanup-agui-5813-followup-20260415
Draft

wip: AG-UI issue #5813 local follow-up commits#7540
Mustafa-Esoofally wants to merge 4 commits intomainfrom
wip/cleanup-agui-5813-followup-20260415

Conversation

@Mustafa-Esoofally
Copy link
Copy Markdown
Contributor

Summary

Preserves local follow-up work on fix/agui-input-content-semantics that never made it to origin. PR #5469 was merged; these commits happened locally after the merge:

  • 2506edcc7 fix: extract last user message from AG-UI history to prevent message duplication (the original fix, likely covered by the merged PR)
  • 0853e8c89 Merge remote-tracking branch 'origin/main' into fix/agui-input-content-semantics
  • fbbc59aae refactor: remove unused convert_agui_messages_to_agno_messages
  • d06c37c69 fix: remove unused imports from utils.py after cleanup

Status

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.

Mustafa-Esoofally and others added 4 commits April 9, 2026 12:16
…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.
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