Hi AgentScope Java team,
I am using io.agentscope:agentscope:1.0.11 in a Spring Boot application with a web chat UI.
Current flow:
- The frontend starts a streaming chat request through SSE.
- The backend runs
ReActAgent.call(...).block() in a background Reactor thread.
- We use hooks such as
ReasoningChunkEvent and SummaryChunkEvent to stream reasoning and answer chunks back to the browser.
- We already use
event.stopAgent() in a hook for human confirmation before sensitive tool execution. After the user confirms, we can call agent.call().block() to
continue from that checkpoint.
Now I want to implement a frontend button with this behavior:
- User clicks “Pause generating” while the agent is reasoning or streaming.
- The current generation should pause.
- No more chunks should be sent to the frontend while paused.
- Later, user clicks “Resume generating”.
- The same agent run should continue from where it paused, instead of starting a new user turn or regenerating from scratch.
- Session/memory should remain consistent.
Questions:
- Does AgentScope Java provide an official pause/resume mechanism for an in-flight
ReActAgent.call()?
- Is
event.stopAgent() intended only for stopping at hook checkpoints, or can it be used as a general pause checkpoint?
- After
event.stopAgent() is triggered by a custom pause hook, is calling agent.call().block() the correct way to resume the same run?
- Can AgentScope pause in the middle of model streaming, or only between framework events such as
PostReasoningEvent, PreActingEvent, and tool execution
boundaries?
- If true pause/resume is not supported, what is the recommended pattern for a web UI pause button?
- Should the backend keep the model run active and buffer chunks while the frontend is paused?
- Or should the app implement checkpoint-style pause through a custom Hook and resume through session state?
A simplified version of our backend flow:
Mono.fromCallable(() -> {
ChatTurnResult result = powerTradingAgent.chatDetailed(
conversationId,
userMessage,
streamingHookContext
);
return result.finalText();
})
.subscribeOn(Schedulers.boundedElastic())
.subscribe(...);
And our existing checkpoint logic uses:
event.stopAgent();
Then later resumes with:
agent.call().block();
I would like to know the recommended AgentScope Java design for user-driven pause and resume in a streaming web chat UI.
Thanks.
Hi AgentScope Java team,
I am using
io.agentscope:agentscope:1.0.11in a Spring Boot application with a web chat UI.Current flow:
ReActAgent.call(...).block()in a background Reactor thread.ReasoningChunkEventandSummaryChunkEventto stream reasoning and answer chunks back to the browser.event.stopAgent()in a hook for human confirmation before sensitive tool execution. After the user confirms, we can callagent.call().block()tocontinue from that checkpoint.
Now I want to implement a frontend button with this behavior:
Questions:
ReActAgent.call()?event.stopAgent()intended only for stopping at hook checkpoints, or can it be used as a general pause checkpoint?event.stopAgent()is triggered by a custom pause hook, is callingagent.call().block()the correct way to resume the same run?PostReasoningEvent,PreActingEvent, and tool executionboundaries?
A simplified version of our backend flow: