A2A: Various usage cleanups in Kagent harness - #2385
Merged
Conversation
|
Warning Testing pausedMonthly snapshot limit reached. Update your plan for additional snapshots and to resume testing. |
supreme-gg-gg
force-pushed
the
jetc/feat/a2a-cleanup
branch
from
August 3, 2026 17:43
403b90a to
43b8108
Compare
supreme-gg-gg
marked this pull request as ready for review
August 3, 2026 17:44
supreme-gg-gg
marked this pull request as draft
August 3, 2026 17:44
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors kagent’s A2A “task output” handling to follow the A2A spec: canonical outputs stream via TaskArtifactUpdateEvent / Task.Artifacts, while TaskStatusUpdateEvent is reserved for lifecycle/progress/HITL/error/auth signals. It updates the UI, CLI (TUI), Go ADK harness, Python runtimes/converters, and E2E/tests accordingly.
Changes:
- UI transcript reconstruction and streaming now consume artifacts (plus dedicated WORKING progress text), and “finished reply” chrome is derived from terminal task status rather than message metadata.
- Go ADK executor delegates to upstream
adka2a.Executorconfigured forOutputArtifactPerEvent; Go E2E assertions now validate artifact output for sync/streaming. - Python converters/executors (ADK/OpenAI/LangGraph/CrewAI) shift from status-message output to artifact events; legacy “result aggregation” helpers are removed.
Reviewed changes
Copilot reviewed 32 out of 32 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| ui/src/lib/messageHandlers.ts | Rebuild transcript/streaming around artifact updates; add terminal-task + per-task token-stat derivation. |
| ui/src/lib/tests/messageHandlers.test.ts | Update/add tests for artifact-based transcript, HITL anchoring, and token stat collection. |
| ui/src/components/chat/ToolCallDisplay.tsx | Stop deriving subagent session id from function_call metadata; rely on function_response/tool-result path. |
| ui/src/components/chat/StatusDisplay.tsx | Allow showing transient WORKING progress text separate from chat transcript. |
| ui/src/components/chat/ChatMessage.tsx | Move reply actions/token tooltip gating to derived terminal-task state instead of message metadata. |
| ui/src/components/chat/ChatInterface.tsx | Wire terminal task tracking + per-task token stats; plumb WORKING status progress text. |
| ui/src/components/chat/tests/ChatInterface.sendGuard.test.tsx | Update send-guard mock streams/tasks to reflect artifacts-as-output. |
| ui/playwright/mocks/server.mjs | Update mock SSE stream to emit artifact update + terminal status (no assistant message in status). |
| python/packages/kagent-openai/src/kagent/openai/_event_converter.py | Convert OpenAI agent events (including handoffs) into artifact updates instead of WORKING status messages. |
| python/packages/kagent-openai/src/kagent/openai/_agent_executor.py | Emit artifact output (including fallback final output) and always send terminal completed status. |
| python/packages/kagent-langgraph/src/kagent/langgraph/_executor.py | Remove task-result aggregation; publish a single terminal completed status after streaming. |
| python/packages/kagent-langgraph/src/kagent/langgraph/_converters.py | Convert LangGraph messages/tool responses into artifact updates (not status-update messages). |
| python/packages/kagent-crewai/tests/test_executor.py | Update tests to record events and assert a content-bearing closing artifact is emitted. |
| python/packages/kagent-crewai/src/kagent/crewai/_listeners.py | Emit tool/agent events as artifacts; keep WORKING status for progress-only updates. |
| python/packages/kagent-core/src/kagent/core/a2a/_task_store.py | Remove partial-history filtering now that outputs are artifact-based. |
| python/packages/kagent-core/src/kagent/core/a2a/_task_result_aggregator.py | Remove legacy status-message-based result aggregation helper. |
| python/packages/kagent-core/src/kagent/core/a2a/init.py | Stop exporting removed aggregator. |
| python/packages/kagent-adk/tests/unittests/test_artifact_streaming.py | New tests for splitting HITL parts out of artifacts into status. |
| python/packages/kagent-adk/tests/unittests/converters/test_event_converter.py | Update converter tests for artifact emission + OutputArtifactPerEvent semantics. |
| python/packages/kagent-adk/src/kagent/adk/converters/event_converter.py | Emit TaskArtifactUpdateEvent (append/replace + last_chunk) rather than WORKING status messages. |
| python/packages/kagent-adk/src/kagent/adk/_agent_executor.py | Implement artifact streaming + HITL/auth status handling; remove TaskResultAggregator usage. |
| go/core/test/e2e/remotemcpserver_tls_test.go | Update helper callsites to new runSyncTest signature (artifact-based validation). |
| go/core/test/e2e/invoke_api_test.go | Make sync/streaming E2E assertions validate final artifact output consistently. |
| go/core/cli/internal/tui/chat.go | Buffer/commit artifact text according to append/lastChunk; treat status messages as control-plane. |
| go/core/cli/internal/tui/chat_test.go | Add tests for artifact buffering, replacement, tool-part processing, and task snapshot rendering. |
| go/adk/pkg/taskstore/store.go | Stop stripping partial events/artifacts before persistence. |
| go/adk/pkg/README.md | Update docs to reflect upstream executor usage and artifact-based output. |
| go/adk/pkg/models/openai_adk.go | Populate TotalTokenCount in usage metadata. |
| go/adk/pkg/a2a/executor.go | Replace custom executor flow with upstream adka2a.Executor configured for OutputArtifactPerEvent. |
| go/adk/pkg/a2a/executor_test.go | Rewrite tests to validate decision-transform delegation, cleanup forwarding, and artifact streaming semantics. |
| go/adk/pkg/a2a/converter.go | Add GenAI→A2A part converter hook for upstream executor while preserving kagent filtering. |
| go/adk/pkg/a2a/converter_test.go | Update tests for converter behavior and long-running tool metadata preservation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
supreme-gg-gg
commented
Aug 3, 2026
supreme-gg-gg
force-pushed
the
jetc/feat/a2a-cleanup
branch
from
August 6, 2026 01:20
43b8108 to
714e526
Compare
supreme-gg-gg
force-pushed
the
jetc/feat/a2a-cleanup
branch
from
August 6, 2026 02:30
714e526 to
8df6d52
Compare
supreme-gg-gg
marked this pull request as ready for review
August 6, 2026 02:45
supreme-gg-gg
force-pushed
the
jetc/feat/a2a-cleanup
branch
2 times, most recently
from
August 6, 2026 15:51
6fbc14b to
5f9e3ca
Compare
EItanya
force-pushed
the
jetc/feat/a2a-cleanup
branch
from
August 6, 2026 20:38
5f9e3ca to
df11ef6
Compare
EItanya
approved these changes
Aug 6, 2026
Signed-off-by: Jet Chiang <pokyuen.jetchiang-ext@solo.io>
… executor to use artifact-based a2a streaming protocol Signed-off-by: Jet Chiang <pokyuen.jetchiang-ext@solo.io>
Signed-off-by: Jet Chiang <pokyuen.jetchiang-ext@solo.io>
Signed-off-by: Jet Chiang <pokyuen.jetchiang-ext@solo.io>
Signed-off-by: Jet Chiang <pokyuen.jetchiang-ext@solo.io>
Signed-off-by: Jet Chiang <pokyuen.jetchiang-ext@solo.io>
Signed-off-by: Jet Chiang <pokyuen.jetchiang-ext@solo.io>
supreme-gg-gg
force-pushed
the
jetc/feat/a2a-cleanup
branch
from
August 7, 2026 14:20
df11ef6 to
8cb3e6b
Compare
EItanya
approved these changes
Aug 7, 2026
peterj
approved these changes
Aug 7, 2026
2 tasks
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.
This PR changes A2A output to be now artifact-based rather than assistant-message/history-based. Consumers should render
Task.Artifacts; transient progress remains in task status updates.Motivation
This refactor aligns kagent’s A2A usage with the protocol’s separation between task state and task output, as A2A protocol specification noted:
Previously, streamed assistant text and tool data were carried in
WORKINGstatus messages, with an artifact emitted only at the end of the task. That made status updates serve two roles and required clients to reconstruct the response from transient state. Task output is now emitted asTaskArtifactUpdateEventsthroughout execution. Status updates communicate only task lifecycle, HITL, failures, etc. A terminal status closes the task, whilelastChunkcloses an individual artifact.This is a breaking wire-level change for consumers that read assistant output from status messages or task history. Consumers should instead render
Task.Artifactsand process artifact updates as they arrive.Change surfaces
ADK/BYO:
OutputArtifactPerEvent, so ADK events become A2A artifact updates. Subsequently, cleanup all kagent specific partial event handling logic since upstream supports it now. Partial events and emitted as artifacts withappend=true.UI/CLI: