feat(memory-proxy): 支持 OpenClaw/Hermes 无 Task 接入与会话自动续接 - #1256
Open
llyb wants to merge 6 commits into
Open
Conversation
Collaborator
|
Thank you so much for your attention and contribution! We will arrange an internal review for this PR shortly, and all feedback will be shared right here in the discussion. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
OpenClaw / Hermes 无法响应 Memory Proxy 的交互式 Session 初始化表单,并且部分请求无法稳定携带自定义 Header,导致:
x-task-idx-conversation-id本 PR 增加 OpenClaw Provider Bridge,并调整 Proxy 的 Session 初始化和会话续接逻辑,使 OpenClaw / Hermes 可以通过
team + agent直接接入。主要变更
1. OpenClaw Provider Bridge 插件
新增
MemoryProxy/openclaw-provider-bridge:请求路径:
2. Header-only Session 初始化
新增共享的 Header-only Session 模块,覆盖:
openclawhermes分流逻辑:
Header-only 客户端仅执行:
Claude Code 和 CodeBuddy 原有表单初始化流程保持不变。
3.
x-task-id可选化Session 直接注册条件由:
调整为:
新增配置:
支持以下行为:
taskMissingPolicyskipdefaultdefaultTaskIdrejectonMismatch处理onMismatch处理,不会静默忽略4. Conversation ID 自动管理
新增配置:
具体行为:
x-conversation-id始终优先per-key-msg策略,降低多窗口会话误合并风险Claude Code / CodeBuddy 已有的 SDK Session ID 不受影响。
5. Streaming 对话回流修复
修复客户端提前取消流式响应时,后台 Memory Recorder 无法完成 flush 的问题:
6. OpenClaw 启动与部署脚本
新增或调整以下脚本:
install-openclaw-provider-bridge.shstart-openclaw-stack.shstart-memory-core.sh其中:
start-openclaw-stack.sh仅负责启动 OpenClaw Gatewaygateway.mode时自动设置为localdocker run失败时直接显示原始错误,不再被No such container覆盖向后兼容
x-task-id时,继续绑定指定 Taskx-conversation-id时,继续使用该 Conversation IDtaskMissingPolicy: reject恢复 Task 必填行为autoConversationId.enabled: false关闭自动会话管理x-task-id仍按onMismatch处理验证结果
自动化测试
OpenClaw 端到端验证
已完成真实 OpenClaw Gateway 验证:
关键日志:
部署验证
在 Windows Git Bash 中重新执行
start-all.sh:健康检查结果:
验收标准
x-task-id按onMismatch处理