agentscope-ai / agentscope-ai/agentscope-java

DashScopeChatModel: Qwen3.5-plus thinking chunks may be emitted only via SummaryChunkEvent instead of ReasoningChunkEvent

Abierto
#1,152 2 comentarios 0 reacciones 0 asignados Ver en GitHub
area/core/model bug
Lenguaje dominante
Java
Estrellas
5.6k
Forks
1.3k
Merge medio
4 d 12 h
PR fusionados (30 d)
77

Descripción

When using DashScopeChatModel with qwen3.5-plus in thinking mode, reasoning output is not always emitted as
ReasoningChunkEvent.

In my case, the model does return reasoning content, but sometimes it is only present inside the incremental Msg carried by
SummaryChunkEvent as ThinkingBlock, while no separate ReasoningChunkEvent is fired.

This causes an integration problem for streaming UIs and hooks that follow the current event contract literally:

- ReasoningChunkEvent -> render reasoning/thinking
- SummaryChunkEvent -> render final answer text

With qwen3.5-plus, this assumption can fail, because reasoning may be mixed into SummaryChunkEvent. As a result, the
frontend may appear to receive no reasoning at all unless it additionally parses ThinkingBlock from SummaryChunkEvent.

Environment:

- AgentScope Java: 1.0.10
- DashScope SDK: 2.0.0
- Model: qwen3.5-plus
- Streaming: true
- Thinking: true
- Additional body params:
- result_format=message
- incremental_output=true

Simplified setup:

DashScopeChatModel chatModel = DashScopeChatModel.builder()
.apiKey(apiKey)
.baseUrl("https://dashscope.aliyuncs.com/compatible-mode/v1")
.modelName("qwen3.5-plus")
.stream(true)
.enableThinking(true)
.defaultOptions(GenerateOptions.builder()
.additionalBodyParam("result_format", "message")
.additionalBodyParam("incremental_output", true)
.build())
.build();

Observed behavior:

- Some reasoning text is only available from:
- SummaryChunkEvent#getIncrementalChunk()
- Msg#getContentBlocks(ThinkingBlock.class)
- No corresponding ReasoningChunkEvent is emitted for that same reasoning delta

Expected behavior:

- If an incremental chunk contains ThinkingBlock, AgentScope should emit a ReasoningChunkEvent for it
- Or, if this is intentional, the documentation should explicitly state that reasoning may arrive via SummaryChunkEvent and
consumers must inspect ThinkingBlock manually

Why this looks like a bug:

- Other model/provider paths are easier to consume because reasoning arrives as ReasoningChunkEvent
- For qwen3.5-plus, downstream consumers need model-specific workaround logic
- This breaks the abstraction promised by hook event types

Current workaround on my side:

- Continue handling ReasoningChunkEvent
- Also inspect SummaryChunkEvent#getIncrementalChunk() and manually split:
- ThinkingBlock -> reasoning stream
- TextBlock -> normal text stream

It would be great if AgentScope could unify this behavior at the framework level.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.