You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A backward-compatible API shape could keep the existing text delta event and add an explicit semantic envelope rather than asking adapters to infer intent. For example, each stream item could carry phase (MODEL_OUTPUT, TOOL_CALL, TOOL_RESULT, FINAL), turnId, and visibility (INTERNAL, USER), while preserving raw provider events for observability. The framework should buffer only the current model turn until its stop reason is known; if the turn contains a tool call, reclassify its text as intermediate, otherwise emit it as final text incrementally. Adapters such as AG-UI and Agent Protocol can then map the same envelope consistently, and consumers can choose a full-trace or final-answer projection. It would be useful to specify whether text emitted after a tool result starts a new turn or remains part of the same assistant message.
Feasibility. The classification you want is expressible in the framework, but requirement 2 (a final-answer-only mode) and requirement 3 (stay incremental) cannot both hold unconditionally. Text is only known to be "not the final answer" once a tool call appears in the same round, which happens after the deltas have already been emitted. The existing implementation states this explicitly: agentscope-core/src/main/java/io/agentscope/core/middleware/FinalAnswerFilterMiddleware.java:36-38 documents that text events are buffered until the model call completes and are suppressed if a tool call was produced, and the mechanism is in handle() at :80-84 (buffer deltas), :93-98 (a ToolCallStartEvent clears the buffer) and :100-108 (ModelCallEndEvent either drops or replays the buffered text). So a strict final-only stream inherently costs latency; the way to keep incremental delivery is to emit provisional text plus a later reclassification/retraction signal, which pushes complexity into the consumer.
Scope.agentscope-core event model and stream orchestration (agentscope-core/src/main/java/io/agentscope/core/agent/EventType.java:40,52,91 expose REASONING / TOOL_RESULT / SUMMARY, and message/ThinkingBlock.java distinguishes provider thinking but not intermediate vs. final plain text; the round loop lives in agent/ReActAgent.java), plus the agent-protocol / AGUI serializers and RemoteAgentEvent in the harness.
Minimal seam. Attach an immutable per-round classification to the text block lifecycle events (TextBlockStartEvent / TextBlockDeltaEvent / TextBlockEndEvent) — e.g. PROCESS / FINAL / PROVISIONAL — decided at the end of each reasoning round, and propagate it through the protocol adapters so every channel agrees. Additive field with a legacy default keeps full-stream behaviour for existing consumers, which is why the compatibility risk is manageable once the client contract is fixed.
Recommendation. Decide the client contract first, then implement: either (1) allow provisional text plus a round-finalization/retraction event, which buys true incremental streaming, or (2) keep buffering for a strict final-only mode and accept the added latency. Those two are the real tradeoff; "incremental and never shows process text" is not achievable at the framework layer. A full-stream mode (requirement 2, first variant) needs no new mechanism at all — it is today's behaviour, it just needs to be an explicit, documented option rather than an accident.
Prior work: the open PR #3013 ("feat(streaming): add semantic text output disposition events") is already an attempt at this same seam, and #2926 shipped the buffering FinalAnswerFilterMiddleware that this request would generalize. Reviewing and converging on #3013 is preferable to a parallel implementation, so no new pull request is proposed here — the design question to settle on this issue is which of the two contracts above maintainers want.
Activity
CryoThrust commentedon Sep 4, 2026
A backward-compatible API shape could keep the existing text delta event and add an explicit semantic envelope rather than asking adapters to infer intent. For example, each stream item could carry
phase(MODEL_OUTPUT, TOOL_CALL, TOOL_RESULT, FINAL),turnId, andvisibility(INTERNAL, USER), while preserving raw provider events for observability. The framework should buffer only the current model turn until its stop reason is known; if the turn contains a tool call, reclassify its text as intermediate, otherwise emit it as final text incrementally. Adapters such as AG-UI and Agent Protocol can then map the same envelope consistently, and consumers can choose a full-trace or final-answer projection. It would be useful to specify whether text emitted after a tool result starts a new turn or remains part of the same assistant message.wxh2010zd commentedon Sep 4, 2026
如果打造Agent Ui,这是必须的。感觉可以参考类似于市面上Trae,workBuddy等输出包装形式,增加语义层面的内容。
oss-maintainer commentedon Sep 13, 2026
Issue Evaluation
Category:
enhancement| Status: Evaluated — needs discussion | Feasibility: needs-discussionAssessed against
main@39cd304a.Feasibility. The classification you want is expressible in the framework, but requirement 2 (a final-answer-only mode) and requirement 3 (stay incremental) cannot both hold unconditionally. Text is only known to be "not the final answer" once a tool call appears in the same round, which happens after the deltas have already been emitted. The existing implementation states this explicitly:
agentscope-core/src/main/java/io/agentscope/core/middleware/FinalAnswerFilterMiddleware.java:36-38documents that text events are buffered until the model call completes and are suppressed if a tool call was produced, and the mechanism is inhandle()at:80-84(buffer deltas),:93-98(aToolCallStartEventclears the buffer) and:100-108(ModelCallEndEventeither drops or replays the buffered text). So a strict final-only stream inherently costs latency; the way to keep incremental delivery is to emit provisional text plus a later reclassification/retraction signal, which pushes complexity into the consumer.Scope.
agentscope-coreevent model and stream orchestration (agentscope-core/src/main/java/io/agentscope/core/agent/EventType.java:40,52,91exposeREASONING/TOOL_RESULT/SUMMARY, andmessage/ThinkingBlock.javadistinguishes provider thinking but not intermediate vs. final plain text; the round loop lives inagent/ReActAgent.java), plus the agent-protocol / AGUI serializers andRemoteAgentEventin the harness.Minimal seam. Attach an immutable per-round classification to the text block lifecycle events (
TextBlockStartEvent/TextBlockDeltaEvent/TextBlockEndEvent) — e.g.PROCESS/FINAL/PROVISIONAL— decided at the end of each reasoning round, and propagate it through the protocol adapters so every channel agrees. Additive field with a legacy default keeps full-stream behaviour for existing consumers, which is why the compatibility risk is manageable once the client contract is fixed.Recommendation. Decide the client contract first, then implement: either (1) allow provisional text plus a round-finalization/retraction event, which buys true incremental streaming, or (2) keep buffering for a strict final-only mode and accept the added latency. Those two are the real tradeoff; "incremental and never shows process text" is not achievable at the framework layer. A full-stream mode (requirement 2, first variant) needs no new mechanism at all — it is today's behaviour, it just needs to be an explicit, documented option rather than an accident.
Prior work: the open PR #3013 ("feat(streaming): add semantic text output disposition events") is already an attempt at this same seam, and #2926 shipped the buffering
FinalAnswerFilterMiddlewarethat this request would generalize. Reviewing and converging on #3013 is preferable to a parallel implementation, so no new pull request is proposed here — the design question to settle on this issue is which of the two contracts above maintainers want.Automated evaluation by github-manager-bot