Skip to content

fix(agui): assign per-tool result message ids - #2908

Merged
jujn merged 5 commits into
agentscope-ai:mainfrom
steven-ji:agent/fix-agui-tool-result-message-id
Aug 31, 2026
Merged

jujn merged 5 commits into
agentscope-ai:mainfrom
steven-ji:agent/fix-agui-tool-result-message-id

Conversation

@steven-ji

@steven-ji steven-ji commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

AgentScope-Java Version

2.0.3-SNAPSHOT

Description

AguiStreamContext reused the parent reply ID for every TOOL_CALL_RESULT in a multi-tool reply. AG-UI clients materialize those results as separate tool messages, so the duplicate IDs caused earlier results to be deduplicated in the UI.

This change derives each result message ID from both the reply ID and tool call ID, with the tool call ID as a fallback when the reply ID is blank. It also adds regression coverage for two tool results emitted from the same reply. The legacy adapter is unchanged.

Fixes #2907

Testing:

  • mvn -B -pl agentscope-extensions/agentscope-extensions-protocol/agentscope-extensions-agui -am -Dtest=AguiAgentAdapterV2Test -Dsurefire.failIfNoSpecifiedTests=false test
  • mvn -B -pl agentscope-extensions/agentscope-extensions-protocol/agentscope-extensions-agui -am test
  • mvn -B test
  • mvn -B -pl agentscope-extensions/agentscope-extensions-protocol/agentscope-extensions-agui spotless:apply
  • git diff --check

Checklist

  • Code formatted with mvn spotless:apply
  • All tests passing (mvn test)
  • Javadoc complete (no public API changes)
  • Related documentation updated (no documentation changes required)
  • Code ready for review

@codecov

codecov Bot commented Aug 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@steven-ji
steven-ji marked this pull request as ready for review August 30, 2026 12:59
@jujn
jujn merged commit 4350720 into agentscope-ai:main Aug 31, 2026
5 checks passed
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.

[Bug]: AG-UI TOOL_CALL_RESULT reuses replyId as messageId, causing duplicate tool-message IDs when multiple tools are called in one reply

2 participants