[Bug]: The `blockId ` within the generated text stream event is hardcoded as the fixed string "text"
Describe the bug ReActAgent Class in V2.
The blockId within the generated text stream event is hardcoded as the fixed string "text", which fails to comply with the documentation specifying that it should serve as the unique identifier for each text block.
- AgentScope-Java Version: 2.0.0 RC4
- Java Version: 17
Hi, I'd like to work on this issue.
Root cause: in ReActAgent#emitBlockEvents (and the block lifecycle flush path), text/thinking block events are emitted with hardcoded block ids ("text" / "thinking"), while tool-call block events in the same method already use the unique toolId.
Proposed fix: allocate a unique block id per started block in ModelCallBlockLifecycle (kept consistent across the Start/Delta/End events of the same block), following the existing tool-call precedent. I checked all in-repo consumers — none relies on the literal ids, so the change is behavior-compatible. Will submit a PR with unit tests shortly.
@yulindong Do you have any specific problems? This is not necessarily a bug. The current document description is really misleading. In the current ReActAgent design, in a model call:
At most one overall TextBlock life cycle;
At most one overall ThinkingBlock lifecycle;
There can be multiple tool calls, but each of them uses its own toolCallId;
The second independent text lifecycle does not appear under the same replyId;
I submitted a PR https://github.com/agentscope-ai/agentscope-java/pull/2016. You can review it again.