Skip to content

fix(a2a): prefer completed task artifacts over status messages - #3775

Merged
jujn merged 1 commit into
agentscope-ai:mainfrom
guslegend0510:fix/a2a-task-artifact-result
Oct 26, 2026
Merged

jujn merged 1 commit into
agentscope-ai:mainfrom
guslegend0510:fix/a2a-task-artifact-result

Conversation

@guslegend0510

Copy link
Copy Markdown
Contributor

AgentScope-Java Version

2.1.0-SNAPSHOT

Description

A completed A2A task can contain both a status message such as done and output artifacts. The client currently returns the status message first, hiding the actual task result.

This change makes completed tasks prefer non-empty artifacts while preserving the status-message fallback and the existing behavior for failed terminal states.

Changes

  • Prefer artifacts when a TaskEvent is COMPLETED and contains output artifacts.
  • Fall back to the status message when a completed task has no artifacts.
  • Keep failed task status messages ahead of partial artifacts.
  • Add public A2aAgent.call() regression coverage for all three cases.

Testing

  • mvn -T1C -pl agentscope-extensions/agentscope-extensions-protocol/agentscope-extensions-a2a/agentscope-extensions-a2a-client -am -Dtest=A2aAgentTest -Dsurefire.failIfNoSpecifiedTests=false test
  • mvn -T1C -pl agentscope-extensions/agentscope-extensions-protocol/agentscope-extensions-a2a/agentscope-extensions-a2a-client -am test
  • mvn -B -T1C clean verify
  • git diff --check

Checklist

  • Code has been formatted with mvn spotless:apply
  • All tests are passing (mvn test)
  • Javadoc comments are complete and follow project conventions (no public API changes)
  • Related documentation has been updated (not applicable; behavior fix is covered by regression tests)
  • Code is ready for review

@jujn
jujn merged commit 6e1ee68 into agentscope-ai:main Oct 26, 2026
4 checks passed
chickenlj pushed a commit that referenced this pull request Nov 13, 2026
Backport the verified fix to the 2.0.x implementation and retain its existing public contracts where the upstream kernel differs.

(cherry picked from commit 6e1ee68)
Backport-review-patch: 325554b494ab014e7d618091f62dde610f5d7884
Constraint: No AgentScope Service or SDK migration
Confidence: high
Not-tested: Whole-repository verification pending after lane integration
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.

3 participants