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
The root cause: ReActAgent#streamEvents(List, RuntimeContext) hard-codes this::doCall, and buildAgentStream(...) is private, so there was no way to inject the structured-output variants (doCall(m, schema) / doCall(m, structuredModel)) that already back the non-streaming call(msgs, schema/class, ctx).
#2919 adds the missing fine-grained overloads (JsonNode + Class, on both ReActAgent and HarnessAgent) by routing through the same buildAgentStream core, so:
Category: enhancement (area/core/agent) | Status: Evaluated — request is still unmet on main, and the shape is a maintainer call | Feasibility: feasible (plumbing already exists)
Verified against main @ 3c1c29c0 (engine-assisted static read; this issue sat below the newest-open scan window, so this is its first evaluation).
1. The gap is real today — no streamEvents overload takes a schema.
Item
Result
Evidence
ReActAgent.streamEvents(...) overloads carry no structured-output parameter
streamEvents(List, RuntimeContext) hard-codes the plain call target
TRUE
ReActAgent.java:1149 → buildAgentStream(msgs, context, this::doCall), while the structured variants doCall(m, Class) (:1240) and doCall(m, JsonNode) (:1245) exist but are unreachable from the stream path
buildAgentStream(...) is still private
TRUE
ReActAgent.java:1038 — the only reachable wrapper is callInternal (:1012), which cannot inject a structured doCall
HarnessAgent adds no structured streaming either
TRUE
agentscope-harness/src/main/java/io/agentscope/harness/agent/HarnessAgent.java:861, :869, :881, :889, :901, :920; :923 just delegates to delegate.streamEvents(msgs, effective)
Repo-wide, no Flux<AgentEvent> streamEvents(..., Class/JsonNode/schema) in any src/main
TRUE
0 matches — PR #2919 is not merged (state: OPEN, reviewDecision: APPROVED, last updated 2026-09-16)
2. Why "already implemented per #2919" is not yet true for users of main. Structured output today is reachable only through the non-streaming call(List, Class, RuntimeContext) (ReActAgent.java:853) / call(List, JsonNode, RuntimeContext) (:857), which route to doStructuredCall (:1254) → doNativeStructuredCall (:1302) / doFallbackStructuredCall (:1358) and return Mono<Msg>: callInternal (:1014-1019) filters the pipeline down to AgentResultEvent and takeLast(1), discarding the event stream. The 1.0-style structured streaming survives only in the @Deprecated(forRemoval = true)stream(..., Class/JsonNode) overloads (ReActAgent.java:982, :995; StreamableAgent.java:68, :124, :139, :197, :210) — whose own javadoc tells users to migrate to the API that lacks the feature. So the migration path advertised by the deprecation is currently a downgrade.
3. The useful finding: the work is wiring, not new machinery. The structured doCall variants already bind the per-subscription event sink (EVENT_SINK_KEY, ReActAgent.java:1308-1319), i.e. the events are produced internally and then thrown away by callInternal. Exposing them needs no change to the structured-output execution itself.
Shape decision this issue still needs (three separate asks have landed in-thread, which is why no patch was generated here):
Which inputs: only List<Msg>, or also Msg / String convenience overloads?
Which schema carriers: both Class<?> and JsonNode, or JsonNode only?
Scope: agentscope-core only, or HarnessAgent in the same change (its six overloads at :861-:923 would need the matching delegate, and agentscope-core interface changes cascade to harness / distribution / extensions)?
@Letter2025#2919 already answers these implicitly by its chosen surface — since it is approved and green, converging on it is cheaper than a parallel implementation. If a core owner confirms the shape there, this issue can be closed from the PR rather than from a new one. If instead the team prefers the overload set to be decided before merge, say so on #2919 and reply /approve or /revise <shape> here and a patch against the agreed surface will be generated.
Testability. Yes, no external services needed — extend the existing structured-output tests to assert that the streamed events from a structured call reach the subscriber (partial AgentResultEvent/chunk sequence plus a final message parsed into the target type), and that the deprecated stream(..., Class) behaviour is reproduced by streamEvents(...). No test today asserts anything about structured output on the streamEvents path.
Status: no automated PR will be generated — this proposal window here is closed.
The 72-hour feedback window opened by the evaluation comment above (5824400015,
2026-09-25T00:10:12Z) expired at 2026-09-28T00:10:12Z with no community reply carrying
an approval, a revision request or a rejection, so we skip PR generation.
This is not a judgement about the request itself. The implementation path for
structured output in streamEvents is already owned by community PR #2919
(Letter2025, open, unmerged, head d036339270 at the time of writing), which remains
the place to review, extend or comment on that work. If the maintainers would rather
see this change tracked separately from #2919, please say so on this issue and the
evaluation will be re-opened as a fresh proposal with a new window.
Activity
[-]streamEvents增加结构化输出参数[/-][+]2.0版本streamEvents增加结构化输出参数[/+]liyujiang-gzu commentedon Aug 7, 2026
很需要这个特性,目前我是
@Tool定义结构化输出工具给大模型调用+结构化输出Middleware兜底重试。。Letter2025 commentedon Aug 31, 2026
Just noting this is now implemented — see #2919.
The root cause:
ReActAgent#streamEvents(List, RuntimeContext)hard-codesthis::doCall, andbuildAgentStream(...)isprivate, so there was no way to inject the structured-output variants (doCall(m, schema)/doCall(m, structuredModel)) that already back the non-streamingcall(msgs, schema/class, ctx).#2919 adds the missing fine-grained overloads (
JsonNode+Class, on bothReActAgentandHarnessAgent) by routing through the samebuildAgentStreamcore, so:response_format(strictjson_schema) →TextBlockDeltaEventJSON deltas;generate_responsetool →ToolCallStartEvent/ToolCallDeltaEventin the stream;AgentResultEventcarries aMsgwithhasStructuredData() == trueplus aggregatedusage, identical tocall(...).Tests cover both overloads on both paths (native + fallback) and verify semantic equivalence with
call(...).dargoner commentedon Sep 12, 2026
补充一个信息:这个诉求已经有对应 PR——#2919(feat(agent): support structured output in streamEvents),目前两个人工 approve、CI 全绿,但还挂在未合并状态。
如果对期望形状有倾向,建议直接写到 #2919 里一起收敛,例如:
这样才能一次定形状,避免再开一个 PR 重复讨论。相关讨论:#2919 (comment)
feat(agent): support structured output in streamEvents
oss-maintainer commentedon Sep 25, 2026
Issue Evaluation
Category:
enhancement(area/core/agent) | Status: Evaluated — request is still unmet onmain, and the shape is a maintainer call | Feasibility: feasible (plumbing already exists)Verified against
main@3c1c29c0(engine-assisted static read; this issue sat below the newest-open scan window, so this is its first evaluation).1. The gap is real today — no
streamEventsoverload takes a schema.ReActAgent.streamEvents(...)overloads carry no structured-output parameteragentscope-core/src/main/java/io/agentscope/core/ReActAgent.java:1123,:1133,:1148,:1160,:1170,:1182— none acceptsClass/JsonNodestreamEvents(List, RuntimeContext)hard-codes the plain call targetReActAgent.java:1149→buildAgentStream(msgs, context, this::doCall), while the structured variantsdoCall(m, Class)(:1240) anddoCall(m, JsonNode)(:1245) exist but are unreachable from the stream pathbuildAgentStream(...)is stillprivateReActAgent.java:1038— the only reachable wrapper iscallInternal(:1012), which cannot inject a structureddoCallHarnessAgentadds no structured streaming eitheragentscope-harness/src/main/java/io/agentscope/harness/agent/HarnessAgent.java:861,:869,:881,:889,:901,:920;:923just delegates todelegate.streamEvents(msgs, effective)Flux<AgentEvent> streamEvents(..., Class/JsonNode/schema)in anysrc/mainstate: OPEN,reviewDecision: APPROVED, last updated 2026-09-16)2. Why "already implemented per #2919" is not yet true for users of
main. Structured output today is reachable only through the non-streamingcall(List, Class, RuntimeContext)(ReActAgent.java:853) /call(List, JsonNode, RuntimeContext)(:857), which route todoStructuredCall(:1254) →doNativeStructuredCall(:1302) /doFallbackStructuredCall(:1358) and returnMono<Msg>:callInternal(:1014-1019) filters the pipeline down toAgentResultEventandtakeLast(1), discarding the event stream. The 1.0-style structured streaming survives only in the@Deprecated(forRemoval = true)stream(..., Class/JsonNode)overloads (ReActAgent.java:982,:995;StreamableAgent.java:68,:124,:139,:197,:210) — whose own javadoc tells users to migrate to the API that lacks the feature. So the migration path advertised by the deprecation is currently a downgrade.3. The useful finding: the work is wiring, not new machinery. The structured
doCallvariants already bind the per-subscription event sink (EVENT_SINK_KEY,ReActAgent.java:1308-1319), i.e. the events are produced internally and then thrown away bycallInternal. Exposing them needs no change to the structured-output execution itself.Shape decision this issue still needs (three separate asks have landed in-thread, which is why no patch was generated here):
List<Msg>, or alsoMsg/Stringconvenience overloads?Class<?>andJsonNode, orJsonNodeonly?agentscope-coreonly, orHarnessAgentin the same change (its six overloads at:861-:923would need the matching delegate, andagentscope-coreinterface changes cascade to harness / distribution / extensions)?@Letter2025 #2919 already answers these implicitly by its chosen surface — since it is approved and green, converging on it is cheaper than a parallel implementation. If a core owner confirms the shape there, this issue can be closed from the PR rather than from a new one. If instead the team prefers the overload set to be decided before merge, say so on #2919 and reply
/approveor/revise <shape>here and a patch against the agreed surface will be generated.Testability. Yes, no external services needed — extend the existing structured-output tests to assert that the streamed events from a structured call reach the subscriber (partial
AgentResultEvent/chunk sequence plus a final message parsed into the target type), and that the deprecatedstream(..., Class)behaviour is reproduced bystreamEvents(...). No test today asserts anything about structured output on thestreamEventspath.Automated evaluation by github-manager-bot
oss-maintainer commentedon Sep 28, 2026
Status: no automated PR will be generated — this proposal window here is closed.
The 72-hour feedback window opened by the evaluation comment above (
5824400015,2026-09-25T00:10:12Z) expired at 2026-09-28T00:10:12Z with no community reply carrying
an approval, a revision request or a rejection, so we skip PR generation.
This is not a judgement about the request itself. The implementation path for
structured output in
streamEventsis already owned by community PR #2919(
Letter2025, open, unmerged, headd036339270at the time of writing), which remainsthe place to review, extend or comment on that work. If the maintainers would rather
see this change tracked separately from #2919, please say so on this issue and the
evaluation will be re-opened as a fresh proposal with a new window.
feat(agent): support structured output in streamEvents
feat(agent): support structured output in streamEvents (agentscope-ai…