Open
"[BUG]" 过滤 stop message 时不要只判断 stopReason,还需要检查其中是否存在非空 text 内容 #71
布鲁塞尔松饼Add on  May 15
布鲁塞尔松饼
布鲁塞尔松饼
May 15 Create

OpenClaw stop message 可能携带最终 assistant 文本

问题

在 OpenClaw 的事件日志中,发现部分 session.message 事件虽然带有:

"stopReason": "stop"
但其 message.content 中仍然包含有效的 assistant 最终文本,例如下面是日志中的一条:{"type":"message","id":"d6a5e13b","parentId":"187758c0","timestamp":"2026-04-22T09:00:24.289Z","message":{"role":"assistant","content":[{"type":"thinking","thinking":"The user received a system message about an async command completing. But looking at the context, this appears to be from a previous session (delta-nu, code 0) that completed. The main result I already provided was from the generate_report action which completed successfully.\n\nThe system message just mentions some git log entries about "iommu: Reserve extra KABI entry" - this seems to be unrelated to the current conversation which was about the DRM/hisilicon hibmc commits.\n\nI should not relay this system message to the user unless there's something actionable. This looks like a stale/background notification from a previous command that already completed. The main task (generate_report) was already done and delivered.\n\nSince there's nothing new to respond to and the previous task was already completed, I should just acknowledge or stay quiet. Actually, looking at the instructions - if I have nothing to say, I should respond with just NO_REPLY.\n\nBut wait - is this a new user message asking me to do something? No, it's just a system message about an async command completing. The user hasn't asked me anything new.\n\nI should probably just stay quiet since the main task was already completed and delivered. There's no new user request here."},{"type":"text","text":"NO_REPLY"}],"api":"openai-completions","provider":"MiniMax","model":"MiniMax-M2.7-highspeed","usage":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"totalTokens":0,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"stop","timestamp":1776848408048,"responseId":"0637c1184d5817250e32dbfe125e14e4"}}

如果网关层仅根据 stopReason == "stop" 过滤整条 session.message,会误丢最终 assistant 输出,导致前端或上层服务收不到完整结果。

过滤 stop message 时不要只判断 stopReason,还需要检查其中是否存在非空 text 内容

likedislike
openeuler-ci-botopeneuler-ci-botCollaborators
May 15 Added label: sig/sig-intelligence
openeuler-ci-bot
openeuler-ci-botCollaborators
May 15 Comments:

Welcome To openEuler Community

Hey @shenyue_ustc , thanks for your contribution to the community.

Bot Usage Manual

I'm the Bot here serving you. You can find the instructions on how to interact with me at Here . That means you can comment below every pull request or issue to trigger Bot Commands.

Contact Guide

If you have any questions, please contact the SIG: sig-intelligence ,
and any of the maintainers: @fromhsc, @gogoxiaoxiao, @huzhengce, @kaitiandu, @liumiao27, @lyhu, @wqianli ,
and any of the committers: @ftboy, @lipingEmmaSiguyi, @randy1568 .

likedislike