#2755·ag-ui

claude-agent-sdk integration: Task tool calls never emit ActivitySnapshotEvent/ActivityDeltaEvent

Author: Dolat-HamzaCreated Sep 14, 2026Updated Sep 14, 2026

Summary

integrations/claude-agent-sdk/python (PyPI: ag-ui-claude-sdk==0.1.5) never translates the Claude Agent SDK's native Task tool (subagent orchestration) into the protocol's ActivitySnapshotEvent/ActivityDeltaEvent. A Task tool call streams through as a plain generic tool call — identical to Bash or Read — via the same ToolCallStartEvent/ToolCallArgsEvent/ToolCallEndEvent/ToolCallResultEvent path every other tool uses.

Evidence

Read the installed ag_ui_claude_sdk==0.1.5 wheel directly. handlers.py's entire AG-UI event surface:

python
from ag_ui.core import (
    EventType,
    BaseEvent,
    ToolCallStartEvent,
    ToolCallArgsEvent,
    ToolCallEndEvent,
    ToolCallResultEvent,
    StateSnapshotEvent,
    CustomEvent,
)

No import of ActivitySnapshotEvent / ActivityDeltaEvent / ActivityMessage anywhere in the adapter (handlers.py, types.py, adapter.py), even though ag-ui-protocol>=0.1.15 (this adapter's own dependency) defines all three — confirmed present in ag_ui.core for ag-ui-protocol==0.1.22.

handle_tool_use_block in handlers.py dispatches on block.name for a few special cases (state-management tools) but has no branch for "Task".

Impact

Frontends that want to render Claude Code's native subagent orchestration (Task tool calls) via CopilotKit's useRenderActivityMessage / native activity messages have no data to render — the wire protocol supports it, this adapter just never emits it.

Ask

Translate Task tool-use blocks (and their results) into ActivitySnapshotEvent/ActivityDeltaEvent instead of (or alongside) the generic ToolCall* events, so consumers get native activity semantics for subagent runs.

Environment

  • ag-ui-claude-sdk 0.1.5
  • ag-ui-protocol 0.1.22
  • claude-agent-sdk 0.2.149