Skip to content

fix(cowork): 修复 OpenClaw 服务端代理请求缺失 session_id#1713

Closed
flowell wants to merge 1 commit intonetease-youdao:mainfrom
flowell:fix/cowork-openclaw-session-id
Closed

fix(cowork): 修复 OpenClaw 服务端代理请求缺失 session_id#1713
flowell wants to merge 1 commit intonetease-youdao:mainfrom
flowell:fix/cowork-openclaw-session-id

Conversation

@flowell
Copy link
Copy Markdown

@flowell flowell commented Apr 17, 2026

背景

当前 OpenClaw runtime 支持多个 cowork session 并发运行,但在默认的 OpenClaw + lobsterai-server 请求链路中,请求会经过 openclawTokenProxy 转发到 LobsterAI 服务端。

此前这条链路没有把当前 cowork session id 写入请求体,导致转发到 /api/proxy/v1/chat/completions 的请求缺少顶层 session_id 字段,服务端无法稳定识别请求来源于哪个 cowork 会话。

修复内容

  • 在 OpenClaw runtime 发起 turn 时,为 LobsterAI 服务端模型的 outbound message 添加隐藏的 cowork session 标记。
  • openclawTokenProxy 转发请求前:
    • 从 OpenAI-compatible 请求体的 messages 中提取 cowork session id;
    • 注入为顶层 session_id
    • 移除隐藏标记,避免该标记继续传给服务端模型。
  • 新增单测覆盖两种请求体形态:
    • messages[].content 为字符串;
    • messages[].content 为 OpenAI array text content。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant