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
需求:希望尽快规划开发统一 IM 网关层,快捷对接钉钉等主流 IM 实现消息收发;
现存问题:用户连续发消息,上一轮 Harness 响应未结束时新消息进入直接报错;手动调用 interrupt () 无法中断异步执行中的会话任务;
疑问与建议:会话被用户主动中断后,未完成对话是否存入上下文,是否增加中断状态标记;希望优化异步中断逻辑,增加会话并发消息处理策略,适配 IM 实时聊天场景。
Feature Issue (English Standard Format for AgentScope-Java)
Title
Support IM Gateway Access & Optimize Concurrent Chat Message Handling + Harness Interrupt Mechanism
Is your feature request related to a problem? Please describe.
We need to quickly connect mainstream IM platforms such as DingTalk to receive and send chat messages, there is no unified IM gateway layer currently.
In actual chat scenarios, users often send continuous messages. When the previous Agent response is not finished yet and a new message comes in, Harness will throw errors directly.
We tried to interrupt the ongoing conversation by calling harness.interrupt() to make new messages preempt execution, but it does not work normally, which is suspected to be caused by asynchronous execution logic.
There is no unified rule whether to save incomplete interrupted conversation content into context memory, and there is no status mark for user active interruption.
Describe the solution you'd like
Plan to build a unified IM gateway layer to easily integrate DingTalk, WeCom and other IM platforms for message receiving and sending.
Optimize the internal asynchronous interrupt mechanism of Harness, make interrupt() take effect stably to terminate running conversation tasks.
Provide configurable concurrent message strategies: support new message interrupt old task and serial queue execution two modes for chat scene.
Standardize context persistence rules after interruption: support saving incomplete dialogue records and add dedicated status flag for user active interruption.
Describe alternatives you've considered
Manually add session lock control in business code to limit single-session serial message processing, but it lacks flexibility and cannot realize preemption interruption.
Custom encapsulate thread stop logic to terminate tasks, which is strongly coupled with business and easy to cause thread resource leakage.
Discard unfinished conversation data directly after interruption, resulting in lost user dialogue records and poor experience.
Additional context
This optimization is very necessary for online customer service, group chat and real-time IM dialogue business scenarios, which can greatly improve the stability and user experience of Agent conversation interaction.
Activity
wuxianjun66 commentedon May 19, 2026
Feature Issue (English Standard Format for AgentScope-Java)
Title
Support IM Gateway Access & Optimize Concurrent Chat Message Handling + Harness Interrupt Mechanism
Is your feature request related to a problem? Please describe.
harness.interrupt()to make new messages preempt execution, but it does not work normally, which is suspected to be caused by asynchronous execution logic.Describe the solution you'd like
interrupt()take effect stably to terminate running conversation tasks.Describe alternatives you've considered
Additional context
This optimization is very necessary for online customer service, group chat and real-time IM dialogue business scenarios, which can greatly improve the stability and user experience of Agent conversation interaction.