Skip to content

[Bug]:Qwen3.6-27B响应stop_reason=248044导致ReActAgent假死,不能未正确结束 #1446

@TaroFang

Description

@TaroFang

Qwen3.6-27B响应stop_reason=248044导致ReActAgent假死,不能未正确结束.

Describe the bug
模型返回的的chunk数据如下,ReActAgent 会假死,一直运行,不会结束

{"id":"chatcmpl-9ece88ab210de6a8","object":"chat.completion.chunk","created":1779251955,"model":"Qwen3.6-27B","choices":[{"index":0,"delta":{"role":"assistant","content":""},"logprobs":null,"finish_reason":null}],"prompt_token_ids":null}
{"id":"chatcmpl-9ece88ab210de6a8","object":"chat.completion.chunk","created":1779251955,"model":"Qwen3.6-27B","choices":[{"index":0,"delta":{"reasoning":""},"logprobs":null,"finish_reason":"stop","stop_reason":248044,"token_ids":null}]}
{"id": "chatcmpl-9ece88ab210de6a8", "object": "chat.completion.chunk", "created": 1779251955, "model": "Qwen3.6-27B", "choices": [], "usage": {"prompt_tokens": 21744, "total_tokens": 21745, "completion_tokens": 1, "completion_tokens_details": {"reasoning_tokens": 0}}}

To Reproduce
Steps to reproduce the behavior:

  1. 使用上面的数据模式LLM输出
  2. 使用如下代码进行测试
Model model = getModel(apiKey, baseUrl, modelName);

        ExecutionConfig modelExecutionConfig = ExecutionConfig.mergeConfigs(ExecutionConfig.MODEL_DEFAULTS, //
                ExecutionConfig.builder().timeout(Duration.ofSeconds(30L)).build());
        ReActAgent agent = ReActAgent.builder() //
                .sysPrompt(sysPrompt) //
                .model(model).modelExecutionConfig(modelExecutionConfig) //
                .build();

        AtomicReference<Boolean> finishedRef = new AtomicReference<>(Boolean.FALSE);
        StreamOptions options = StreamOptions.builder().eventTypes(EventType.ALL).incremental(true).build();
        List<Msg> msg = Lists.newArrayList( //
                Msg.builder().role(MsgRole.USER).content(TextBlock.builder().text(userPrompt).build()).build() //
        );
        agent.stream(msg, options) //
                .doOnNext(event -> {
                    System.out.println("event = " + event);
                }).doFinally(signalType -> {
                    finishedRef.set(Boolean.TRUE);
                    LOG.info("finished ===>");
                }).doOnError(error -> {
                    LOG.error("ERR: {}", error.getMessage(), error);
                }).subscribe(event -> {

                });
        modelTest.stop(finishedRef);

日志输出:

Image

可能原因:

Image

io.agentscope.core.ReActAgent#reasoning 方法中未发射任何数据到io.agentscope.core.agent.AgentBase#createEventStream , 导致 sink.complete(); 未执行

Expected behavior
希望能解决这个ReActAgent假死问题, 让其正常结束

Error messages
ReActAgent 假死,不能正常结束

Environment (please complete the following information):

  • AgentScope-Java Version: 1.0.11
  • Java Version: 21
  • OS: macos

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions