agentscope-ai / agentscope-ai/agentscope-java

[Bug]:When integrating with agentscope-studio in a web service, after the request ends, the observed request in agentscope-studio remains in the running state.

Đang mở
#750 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
area/ext/integration bug
Ngôn ngữ chính
Java
Star
5.6k
Fork
1.3k
Merge trung bình
4 ngày 12 giờ
Pull request đã merge (30 ngày)
77

Mô tả

**AgentScope-Java is an open-source project. To involve a broader community, we recommend asking your questions in English.**

**Describe the bug**

When integrating with agentscope-studio in a web service, after the request ends, the observed request in agentscope-studio remains in the running state.

Unless I terminate the entire web service, but this is clearly not feasible just because of a single request.

**To Reproduce**
Steps to reproduce the behavior:

1. You code

``` java
@GetMapping("demo")
public SseEmitter demo(String userMessage) {
SseEmitter sseEmitter = new SseEmitter(-1L);
// 初始化studio
StudioManager.init()
.studioUrl("http://localhost:3000")
.project("testAgent")
.runName("testAgent" + System.currentTimeMillis())
.initialize()
.block();
DashScopeChatModel model = DashScopeChatModel.builder()
.apiKey("sk-xxxxxxx")
.modelName("qwen3-max")
.build();

ReActAgent reActAgent = ReActAgent.builder().name("AI助手").sysPrompt("你是一个乐于助人的AI助手")
.model(model).hooks(List.of(new StudioMessageHook(StudioManager.getClient())))
.build();
Flux stream = reActAgent.stream(Msg.builder().role(MsgRole.USER).textContent(userMessage).build());
stream.subscribe(msg -> {
try {
sseEmitter.send(msg);
} catch (IOException e) {
throw new RuntimeException(e);
}
}, e -> {
log.error("error", e);
}, () -> {
sseEmitter.complete();
StudioManager.getClient().shutdown();
}
);
return sseEmitter;

}
```
3. How to execute
postman
5. See error**Expected behavior**
A clear and concise description of what you expected to happen.

**Error messages**
Detailed error messages.

**Environment (please complete the following information):**

- AgentScope-Java 1.0.8
- Java Version: 17
- OS: macos

**Additional context**
Add any other context about the problem here.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.