edict icon indicating copy to clipboard operation
edict copied to clipboard

openclaw4.5,旨意只能在太子执行,无法正确的流转

Open chick-liu opened this issue 7 months ago • 5 comments

环境

  • OpenClaw 版本:2026.4.5 (3e72c03)
  • 操作系统:Darwin 24.6.0 (x64) / macOS
  • Python 版本:3.9.6

问题描述

无法正确的使用旨意传递链条 在测试“三省六部旨意传递链条”时,需要通过 sessions_send 以 sessionKey 精确投递到指定代理(如 agent:zhongshu:main)。
但在调用 sessions_send(sessionKey=...) 时,系统报错:
Provide either sessionKey or label (not both)。
这意味着即便只传 sessionKey,工具层仍被判定“同时传了 label”。

为绕过该校验,我显式传 label="unused",使校验逻辑放行。
该方式可投递,说明当前版本对 label 的处理存在冲突:只要 label 不为 "unused" 即视为“同时传 label”。

同时,在派发 subagent 时,出现:
streamTo is only supported for runtime=acp; got runtime=subagent
显示 subagent 流程被注入了 ACP 专属参数,导致 subagent 派发失败。

复现步骤

  1. 调用 sessions_send(sessionKey="agent:zhongshu:main", message="...")
    → 报错 Provide either sessionKey or label (not both)
  2. 改为 sessions_send(sessionKey="agent:zhongshu:main", label="unused", ...)
    → 可投递,说明 label 校验与 sessionKey 存在冲突
  3. 尝试 sessions_spawn(runtime="subagent")
    → 报错 streamTo is only supported for runtime=acp

期望行为

  • sessions_send 仅传 sessionKey 时不应被判定携带 label。
  • subagent 不应被注入 ACP 专属参数(如 streamTo)。

实际行为

  • sessions_send 报错“sessionKey/label 互斥”。
  • subagent 被注入 ACP 参数导致失败。

错误日志

Provide either sessionKey or label (not both) streamTo is only supported for runtime=acp; got runtime=subagent

证据/文件路径:

  • /Users/user/.npm-global/lib/node_modules/openclaw/dist/pi-embedded-DWASRjxE.js(label/sessionKey 校验逻辑)

阻塞项:

  • label 与 sessionKey 互斥校验导致无法稳定投递
  • subagent 参数注入导致派发失败

chick-liu avatar Apr 08 '26 12:04 chick-liu

我也是这个问题搞了好久,退回3.28可以了

fffants avatar Apr 09 '26 00:04 fffants

感谢非常详细的 bug 报告!

这个问题的根源在 openclaw CLI 运行时(pi-embedded-DWASRjxE.js 中的 sessions_send 校验逻辑),不在本仓库的代码范围内。具体来说:

  1. sessions_send 的 sessionKey / label 互斥校验在 openclaw 4.5 版本有回归
  2. subagent 运行时被注入 ACP 参数也是 openclaw CLI 层的问题

从评论区也可以看到 @fffants 确认退回 3.28 版本可以正常工作,说明是 openclaw 新版引入的问题。

建议:

  • 临时方案:使用 openclaw 3.28 版本(npm install -g [email protected])
  • 长期方案:向 openclaw 官方提 issue 反馈此回归

标记为 upstream 问题。本仓库的 agent 配置和 prompt 本身没有问题,是运行时的 session 路由逻辑出了回归。

cft0808 avatar Apr 09 '26 17:04 cft0808

请问,这个问题openclaw 4.8解决问题了吗

donatellofang avatar Apr 12 '26 01:04 donatellofang

📜 此 Issue 已超过 60 天没有活动。 如果问题仍然存在,请回复更新状态;否则此 Issue 将在 30 天后自动关闭。 感谢你的贡献!

github-actions[bot] avatar Jun 15 '26 03:06 github-actions[bot]

🏛️ 此 Issue 因长期无活动已自动关闭。 如需重新讨论,欢迎随时重新打开或创建新 Issue。

github-actions[bot] avatar Jul 20 '26 03:07 github-actions[bot]