Skip to content

feat: surface team member activity in AG-UI via ACTIVITY_SNAPSHOT - #9253

Open
ProgrammerPlus1998 wants to merge 2 commits into
agno-agi:mainfrom
ProgrammerPlus1998:feat/agui-team-member-activity
Open

feat: surface team member activity in AG-UI via ACTIVITY_SNAPSHOT#9253
ProgrammerPlus1998 wants to merge 2 commits into
agno-agi:mainfrom
ProgrammerPlus1998:feat/agui-team-member-activity

Conversation

@ProgrammerPlus1998

@ProgrammerPlus1998 ProgrammerPlus1998 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Team runs streamed through AG-UI previously folded every member's output into a single assistant message (with a "Team member: " prefix), so clients could not tell which member produced which content — see #9243.

This change surfaces each team member's live progress through AG-UI's native Activity channel instead of flattening:

  • Member chunks emit ACTIVITY_SNAPSHOT events (activity_type: "agno.team_member"), keyed by a stable per-member message_id.
  • Each snapshot carries agentId, agentName, runId, parentRunId, a status lifecycle (running → tool_calling → completed), currentTool, and the member's accumulated text.
  • The leader's own output continues to stream as TEXT_MESSAGE_*; member text is no longer folded into the leader's message.
  • No new config: member activity is emitted whenever member events are present (stream_member_events=True). Hiding member output is still controlled upstream via stream_member_events=False.

Fixes #9243

Why Activity instead of separate text messages

AG-UI's ACTIVITY_* events are the protocol-native mechanism for "what each agent is doing" as a side-channel, decoupled from the main chat bubbles. Each member gets an addressable message_id, so interleaved/parallel member execution (nested teams) can't corrupt a single shared message — the failure mode a "one text message per member" approach has on frontends that assume a single active text bubble.

Implementation

  • StreamState: per-member message_id + mutable snapshot content tracking (get_or_create_member).
  • handlers: _is_member_chunk() discriminator (agent-level event with non-None parent_run_id, set by team delegation); member run_content / tool_call_started / tool_call_completed / run_content_completedACTIVITY_SNAPSHOT; leader path unchanged.
  • Removed the member_responses folding and the "Team member: " prefix from _extract_team_response_chunk_content.

Type of change

  • New feature

Checklist

  • Code complies with style guidelines
  • Ran format/validation scripts (./scripts/format.sh and ./scripts/validate.sh)
  • Self-review completed
  • Documentation updated (comments, docstrings)
  • Examples and guides: Relevant cookbook examples have been included or updated (research_team.py + TEST_LOG.md)
  • Tested in clean environment
  • Tests added/updated (test_agui_member_activity.py — 7 tests)

Additional Notes

Validation performed:

  • 7 new unit tests + full existing AG-UI suite (70 tests) pass.
  • End-to-end through the real pipeline (run_entity → event translation): member chunks produce per-member ACTIVITY_SNAPSHOTs reaching status="completed"; member text never appears in leader TEXT_MESSAGE_CONTENT; leader final summary appears only in the leader message. Confirmed with both a mocked model and a real model, including a member that calls a tool (observed tool_calling snapshots).

@ProgrammerPlus1998
ProgrammerPlus1998 requested a review from a team as a code owner July 29, 2026 09:46
@ProgrammerPlus1998
ProgrammerPlus1998 force-pushed the feat/agui-team-member-activity branch from 048504c to abe6fcb Compare July 29, 2026 09:48
@ProgrammerPlus1998
ProgrammerPlus1998 deleted the feat/agui-team-member-activity branch July 29, 2026 09:55
@ProgrammerPlus1998
ProgrammerPlus1998 restored the feat/agui-team-member-activity branch July 29, 2026 09:58
@lucabecchetti

Copy link
Copy Markdown

any news to merge this?

Team runs streamed through AG-UI previously folded every member's output
into a single assistant message (prefixed "Team member: "), so clients
could not tell which member produced what.

Member chunks now emit AG-UI ACTIVITY_SNAPSHOT events (activity_type
"agno.team_member") keyed by a stable per-member message_id, carrying
agentId/agentName/runId/parentRunId, a status lifecycle
(running -> tool_calling -> completed), currentTool, and accumulated
member text. The leader's own output continues to stream as TEXT_MESSAGE_*;
member text is no longer folded into it.

- StreamState: per-member message_id + snapshot content tracking
- handlers: _is_member_chunk discriminator (agent event with parent_run_id),
  member run_content/tool_call/content_completed -> ACTIVITY_SNAPSHOT
- remove member_responses folding and "Team member: " prefix
- cookbook research_team example + TEST_LOG updated

Validated with unit tests, a mocked-model harness, and a real
OpenAI-compatible model run through the full AG-UI pipeline.

Fixes agno-agi#9243
The member branch bound the member snapshot dict to `content`, which the
non-member path later reassigns to a JSON string, tripping a mypy
assignment-type error after the rebase onto latest main.
@ProgrammerPlus1998
ProgrammerPlus1998 force-pushed the feat/agui-team-member-activity branch from 6b92b1f to 4a795db Compare August 25, 2026 08:15
@ProgrammerPlus1998

Copy link
Copy Markdown
Contributor Author

Hi @kausmeows @ysolanky — rebased onto v3.0.0. The bundled ag-ui-protocol already supports ACTIVITY_SNAPSHOT, and the os/interfaces suite passes (92 tests, including the new member-activity coverage).

Ready for review, thanks!

@lucabecchetti

Copy link
Copy Markdown

any news for a timeline?

@lucabecchetti

Copy link
Copy Markdown

Hi, I saw that 3.0.1 has been released, but #9253 is not included. Is there anything still blocking the merge, or is the fix planned for a future release?

Just trying to understand the expected timeline. Thanks!

@ProgrammerPlus1998

Copy link
Copy Markdown
Contributor Author

I suspect the developers still have some P0 issues caused by major version changes to fix, and haven't had time to address these functional problems yet. You can ask the developers for help.

@lucabecchetti

Copy link
Copy Markdown

Hi @kausmeows @ysolanky, just following up on #9253.

Since 3.0.2, 3.0.3, 3.04 and 3.0.5 have now been released and #9253 is still not included, is there any specific blocker preventing the review/merge?

The fix is still relevant for us because we need to preserve the Team member identity in the AG-UI stream.

Thanks!

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.

[Feature Request] Preserve team member identity in AG-UI streamed responses

2 participants