feat(ag-ui): subagent cards over AG-UI via native ACTIVITY events (F5)#668
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Subagent cards over AG-UI via the protocol's native ACTIVITY events (activityType=subagent), not a private CUSTOM convention. Three layers: generic ACTIVITY reducer + subagent projection (libs/ag-ui); owned server-side LangGraphAgent.run() transform mapping subagent intent to ACTIVITY events; reference graph emits the intent. Reusable activity infra; CUSTOM->native migration of state/interrupt/a2ui deferred. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…+ stateless transform Override the bridge's 1:1 _dispatch_event to convert the subagent_activity custom event to an ACTIVITY event; the handler sends accumulated text_so_far (like A2uiPartialHandler's args_so_far) so the transform stays stateless. run()-wrap / custom-route are documented fallbacks. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…(8 tasks) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… ACTIVITY (_dispatch_event) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ot get_stream_writer) The installed ag_ui_langgraph bridge drives the graph with astream_events and converts on_custom_event callbacks to AG-UI CUSTOM events; get_stream_writer surfaces only as RAW. Correct L3 emission in spec + plan T2. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… value (review) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… via adispatch_custom_event Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…dling Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ble identity) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Unbounded growth + stale-binding if a tool-call-id is reused after a RUN_STARTED reset. Prune wrappers not present in the current activities. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ld text isolated Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…iew) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…cards Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…vent, not get_stream_writer) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Closes finding F5 from the Phase-2 capability audit: surface a live subagent card over the AG-UI transport. Spec: `docs/superpowers/specs/2026-06-15-ag-ui-subagent-cards-design.md`; plan: `docs/superpowers/plans/2026-06-15-ag-ui-subagent-cards.md`.
Approach — speak the protocol natively
AG-UI's wire is flat (no native subagent identity), and the LangGraph subgraph namespace the canonical adapter keys on doesn't survive the bridge. Rather than invent a private CUSTOM convention, this models a subagent run as the protocol's native ACTIVITY events (`activityType: "subagent"`) — so `@threadplane/ag-ui` consumes the protocol primitive and any compliant AG-UI server that emits subagent activities lights up the card, no private convention required. The generic activity infrastructure is reusable for future activity types.
Three layers + a cockpit capability
A T1 spike de-risked the load-bearing seam and corrected the emission API: this bridge drives the graph with `astream_events`, so `adispatch_custom_event` (on_custom_event → CUSTOM → `_dispatch_event`) is required — `get_stream_writer` surfaces only as RAW.
Consumer-visible surface change (`@threadplane/ag-ui`)
`AgUiAgent` now exposes a non-optional `subagents: Signal<Map<string, Subagent>>` (was inherited optional from `Agent`). `libs/ag-ui` has no CHANGELOG file (only `libs/chat` does, per repo convention) — flagging here so the next patch release documents the new `subagents` surface.
Verification
Out of scope (logged follow-ups)
Migrating the existing CUSTOM events (`state_update`/`on_interrupt`/`a2ui-partial`) to native `STATE_*`/HITL/`TOOL_CALL_ARGS` — a separate brainstorm; the L2 module is where they'd land. Plus the residual NG0956 during json-render spec assembly and a2ui icon-catalog support.
🤖 Generated with Claude Code