Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
7a57927
docs: subagent support design spec
mme Jul 7, 2026
431f3b1
docs: subagent support implementation plan
mme Jul 7, 2026
1bb7368
feat(python): add optional subagent_id to message types
mme Jul 7, 2026
2bcccbb
feat(core): add optional subagentId to message schemas
mme Jul 7, 2026
36e74f7
feat(core): add optional subagentId to creation/standalone events
mme Jul 7, 2026
343a03d
feat(core): add SUBAGENT_STARTED/FINISHED/ERROR lifecycle events
mme Jul 7, 2026
2d97dab
feat(python): add subagent_id to events and SUBAGENT_* lifecycle events
mme Jul 7, 2026
70b7619
feat(client): add subagent lifecycle subscriber hooks
mme Jul 7, 2026
1ce794c
feat(client): propagate subagentId through chunk transform
mme Jul 7, 2026
236936f
feat(client): enforce subagent lifecycle consistency in verifier
mme Jul 7, 2026
1408a2a
feat(client): dispatch subagent lifecycle subscriber hooks
mme Jul 7, 2026
ad9a85e
test(client): strengthen subagent tests + drop dead field (CR round 1)
mme Jul 7, 2026
be5cd8b
chore: format and lint fixes for subagent support
mme Jul 7, 2026
4e80c92
feat: add optional subagentId to REASONING_MESSAGE_CHUNK
mme Jul 7, 2026
81ce523
test: make subagent attribution assertions non-vacuous
mme Jul 7, 2026
6212b08
test(python): guard remaining subagent_id event assertions via by-ali…
mme Jul 7, 2026
36b0a27
docs: plan for subagent backward-compatibility shim
mme Jul 7, 2026
c2a3c27
feat(client): add version-gated subagent backward-compat shim (0.0.57)
mme Jul 7, 2026
4370f8c
test(client): e2e verify 0.0.57 shim strips subagents through run pip…
mme Jul 7, 2026
5c8eeab
docs: correct subagent Phase 2 backward-compat rationale
mme Jul 7, 2026
f1c6b0b
fix(client): strip subagentId from RUN_STARTED.input echo + harden 0.…
mme Jul 7, 2026
b71bac1
fix(client): make 0.0.57 shim warn-test env-independent + correct docs
mme Jul 7, 2026
703bb7e
docs: deepagents subagent attribution demo (step 1) design
mme Jul 7, 2026
31ac667
docs: deepagents subagent demo implementation plan
mme Jul 7, 2026
c4f451a
docs: fold spike findings into deepagents demo plan (detection signal…
mme Jul 7, 2026
3caf759
chore(langgraph): bump langchain/langgraph to deepagents-compatible v…
mme Jul 7, 2026
72b79c3
spike(langgraph): document deepagents subagent event surfacing
mme Jul 7, 2026
3fcd6c2
feat(langgraph): derive deepagents subagent context from nested check…
mme Jul 7, 2026
1c4ce10
feat(langgraph): emit SUBAGENT_STARTED/FINISHED/ERROR at subagent bou…
mme Jul 7, 2026
9c078ce
fix(python-sdk): export SUBAGENT_STARTED/FINISHED/ERROR events from a…
mme Jul 7, 2026
0a4f562
feat(langgraph): stamp subagentId on creation events while in a subagent
mme Jul 7, 2026
4065217
feat(langgraph-examples): add deepagents 3-subagent attribution demo …
mme Jul 7, 2026
51842f7
fix(langgraph): emit one SUBAGENT_STARTED/FINISHED per subagent under…
mme Jul 7, 2026
58a88cb
feat(dojo): add deepagents subagent-attribution demo page + wiring
mme Jul 7, 2026
074bf3d
fix(dojo): scope deepagents_subagents demo to the python-backed integ…
mme Jul 7, 2026
37c6449
chore: override CopilotKit's @ag-ui deps to workspace so subagentId r…
mme Jul 7, 2026
4727cf4
chore(langgraph-examples): temporarily reduce deepagents demo to one …
mme Jul 7, 2026
bddd9ba
fix(langgraph): include subagent messages (with subagentId) in MESSAG…
mme Jul 7, 2026
53f9102
feat(langgraph): subagent tool-call snapshot + name/description; inli…
mme Jul 8, 2026
a36c69b
chore(temp): flip integration @ag-ui deps to workspace:* for pkg.pr.n…
mme Jul 8, 2026
557ca11
Revert workspace:* flip — breaks pkg-pr-new pack (pnpm pack cannot re…
mme Jul 8, 2026
39a4865
docs: update BEFORE-MERGE (pkg.pr.new url path abandoned; use @ag-ui …
mme Jul 8, 2026
e503a7a
chore: undo pkg.pr.new preview plumbing
mme Jul 8, 2026
35fc222
feat(dojo): subagent attribution UI — name via useSubagent + tool-cal…
mme Jul 8, 2026
b6feeb1
feat(dojo): group subagent messages into one reasoning-style collapsible
mme Jul 8, 2026
fed8fee
feat(subagents): finish subagent on task-end + reasoning-style collap…
mme Jul 8, 2026
3738b68
refactor(dojo): render subagent groups via renderCustomMessages + mul…
mme Jul 9, 2026
b77cb96
demo(deepagents): run 3 subagents in parallel and restore tool-call a…
mme Jul 9, 2026
3d55805
feat(dojo): show a subtle checkmark when a subagent finishes
mme Jul 9, 2026
acec0b6
fix(dojo): collapse subagent group immediately, animate only on open
mme Jul 9, 2026
8d8dd47
refactor(dojo): own the subagent header as a standalone component
mme Jul 9, 2026
a7d6c92
fix(langgraph): drop subagent-attributed messages from run input
mme Jul 9, 2026
bdfd42b
feat(langgraph): persist subagent messages across turns via the snapshot
mme Jul 9, 2026
85ff694
chore: remove superpowers plans and specs from the branch
mme Jul 14, 2026
c69e3bd
chore: remove subagent spike/investigation notes from the demo dir
mme Jul 14, 2026
4f6e141
fix(subagents): terminal events on error + fix failing test (CR round)
mme Jul 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat(python): add optional subagent_id to message types
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
  • Loading branch information
mme and claude committed Jul 7, 2026
commit 1bb7368ccb43e31b701a49fb495ebde58c30c9db
4 changes: 4 additions & 0 deletions sdks/python/ag_ui/core/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class BaseMessage(ConfiguredBaseModel):
content: Optional[str] = None
name: Optional[str] = None
encrypted_value: Optional[str] = None
subagent_id: Optional[str] = None


class DeveloperMessage(BaseMessage):
Expand Down Expand Up @@ -199,6 +200,7 @@ class ToolMessage(ConfiguredBaseModel):
tool_call_id: str
error: Optional[str] = None
encrypted_value: Optional[str] = None
subagent_id: Optional[str] = None


class ActivityMessage(ConfiguredBaseModel):
Expand All @@ -210,6 +212,7 @@ class ActivityMessage(ConfiguredBaseModel):
role: Literal["activity"] = "activity" # pyright: ignore[reportIncompatibleVariableOverride]
activity_type: str
content: Dict[str, Any]
subagent_id: Optional[str] = None


class ReasoningMessage(ConfiguredBaseModel):
Expand All @@ -221,6 +224,7 @@ class ReasoningMessage(ConfiguredBaseModel):
role: Literal["reasoning"] = "reasoning" # pyright: ignore[reportIncompatibleVariableOverride]
content: str
encrypted_value: Optional[str] = None
subagent_id: Optional[str] = None


Message = Annotated[
Expand Down
24 changes: 24 additions & 0 deletions sdks/python/tests/test_subagent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import unittest

from ag_ui.core.types import AssistantMessage, ToolMessage, ReasoningMessage


class TestSubagentMessageAttribution(unittest.TestCase):
def test_assistant_message_accepts_subagent_id(self):
msg = AssistantMessage(id="m1", role="assistant", content="hi", subagent_id="sub-1")
self.assertEqual(msg.subagent_id, "sub-1")
self.assertEqual(msg.model_dump(by_alias=True)["subagentId"], "sub-1")

def test_tool_and_reasoning_messages_accept_subagent_id(self):
tool = ToolMessage(id="t1", role="tool", content="ok", tool_call_id="tc1", subagent_id="sub-2")
self.assertEqual(tool.subagent_id, "sub-2")
reasoning = ReasoningMessage(id="r1", role="reasoning", content="x", subagent_id="sub-3")
self.assertEqual(reasoning.subagent_id, "sub-3")

def test_subagent_id_optional(self):
msg = AssistantMessage(id="m2", role="assistant", content="hi")
self.assertIsNone(msg.subagent_id)


if __name__ == "__main__":
unittest.main()