Repository navigation
refactor(agent): convert ReActAgent to synchronous execution and add tool streaming support - #14
Merged
Conversation
…cution with real-time streaming
Simplify ReActAgent implementation by removing complex reactive composition chains
and using straightforward synchronous code. The doCall() layer remains the only
sync-to-async conversion point using Mono.fromCallable().
Key changes:
- executeReActLoop(): Convert from recursive Mono to simple for loop
- reasoning(): Use Flux.toIterable() for real-time chunk streaming to hooks
instead of collectList().block() which batches all chunks
- acting(): Execute tools synchronously with .block() on results
- Message ordering: Only save text messages when no tool calls exist,
preventing DashScope API validation errors
Change-Id: I482dc2b7a94c0034d9b63ef0f48432fef13183c5
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
JGoP-L
pushed a commit
to JGoP-L/agentscope-java
that referenced
this pull request
Dec 29, 2025
…tool streaming support (agentscope-ai#14)
LiangshouX
added a commit
to LiangshouX/agentscope-java
that referenced
this pull request
Sep 8, 2026
- agentscope-ai#1: Fix search() to use prefix matching (gte/lt range query) with \u001F separator - agentscope-ai#2: Make parseValue() fail-fast on JSON decode errors and unexpected types - agentscope-ai#3: Add validateKey/namespacePath validation; change separator from \0 to \u001F - agentscope-ai#4: Use compound Document _id {user, session} instead of ":" delimited string - agentscope-ai#5: Move state keys into states sub-document to avoid reserved field collisions - agentscope-ai#6: Delete contradictory test; introduce Testcontainers 1.21.4 for CI contract tests - agentscope-ai#7: Use aggregate + \$size for O(1) list count instead of full array transfer - agentscope-ai#8: Use 2-thread pool for renewal; guard implements AutoCloseable with cascading close - agentscope-ai#9: Extract MongoIndexUtils.createIndexWithMigration using listIndexes() for actual names - agentscope-ai#10: Read database name from connection string in fromConnectionString and Builder - agentscope-ai#11: Use UUID token for lock renew/release instead of non-unique owner (pid) - agentscope-ai#12: Use convertValue instead of JSON string round-trip for serialization - agentscope-ai#13: Centralize default names in MongoConstants - agentscope-ai#14: Add EN/ZH MongoDB integration docs and update capability matrices - agentscope-ai#15: Use full SHA-256 digest for lock IDs (no truncation) - agentscope-ai#16: Apply error-85 migration to all indexes via unified createIndexWithMigration Additional fixes: - Atomic findOneAndUpdate for saveIfVersion UNVERSIONED path - Move FIELD_KEY/FIELD_NAMESPACE to setOnInsert in put() - Rename validateKey to validateStateKey in MongoAgentStateStore Tests: 124 passing (104 unit + 20 contract), 0 failures, 0 errors
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.
Simplify ReActAgent implementation by removing complex reactive composition chains
and using straightforward synchronous code. The doCall() layer remains the only
sync-to-async conversion point using Mono.fromCallable().
Additionally, introduce ToolEmitter interface to enable tools to send streaming
progress updates during execution.
ReActAgent Synchronization:
instead of collectList().block() which batches all chunks
preventing DashScope API validation errors
Tool Streaming (ToolEmitter):