@dingtalk-real-ai/dingtalk-connector 0.8.12 → 0.8.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/README.en.md +31 -6
- package/README.md +31 -6
- package/docs/RELEASE_NOTES_V0.7.10.md +40 -0
- package/docs/RELEASE_NOTES_V0.7.2.md +143 -0
- package/docs/RELEASE_NOTES_V0.7.3.md +149 -0
- package/docs/RELEASE_NOTES_V0.7.4.md +206 -0
- package/docs/RELEASE_NOTES_V0.7.5.md +267 -0
- package/docs/RELEASE_NOTES_V0.7.6.md +219 -0
- package/docs/RELEASE_NOTES_V0.7.7.md +122 -0
- package/docs/RELEASE_NOTES_V0.7.8.md +101 -0
- package/docs/RELEASE_NOTES_V0.7.9.md +65 -0
- package/docs/RELEASE_NOTES_V0.8.0.md +53 -0
- package/docs/RELEASE_NOTES_V0.8.1.md +47 -0
- package/docs/RELEASE_NOTES_V0.8.10.md +49 -0
- package/docs/RELEASE_NOTES_V0.8.11.md +51 -0
- package/docs/RELEASE_NOTES_V0.8.12.md +63 -0
- package/docs/RELEASE_NOTES_V0.8.13-beta.0.md +69 -0
- package/docs/RELEASE_NOTES_V0.8.13.md +62 -0
- package/docs/RELEASE_NOTES_V0.8.2.md +55 -0
- package/docs/RELEASE_NOTES_V0.8.3.md +63 -0
- package/docs/RELEASE_NOTES_V0.8.4.md +45 -0
- package/docs/RELEASE_NOTES_V0.8.7.md +49 -0
- package/docs/RELEASE_NOTES_V0.8.8.md +63 -0
- package/docs/RELEASE_NOTES_V0.8.9.md +81 -0
- package/docs/RELEASE_NOTES_v0.7.0.md +142 -0
- package/docs/RELEASE_NOTES_v0.7.1.md +74 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +13 -2
- package/src/channel.ts +18 -6
- package/src/config/schema.ts +2 -2
- package/src/core/connection.ts +9 -6
- package/src/core/message-handler.ts +30 -10
- package/src/reply-dispatcher.ts +4 -3
- package/src/services/media/file.ts +7 -2
- package/src/services/media.ts +19 -12
- package/src/services/messaging/card.ts +1 -2
- package/src/services/messaging.ts +29 -16
- package/src/utils/http-client.ts +2 -1
- package/docs/images/dingtalk.svg +0 -1
- package/docs/images/image-1.png +0 -0
- package/docs/images/image-2.png +0 -0
- package/docs/images/image-3.png +0 -0
- package/docs/images/image-4.png +0 -0
- package/docs/images/image-5.png +0 -0
- package/docs/images/image-6.png +0 -0
- package/docs/images/image-7.png +0 -0
- package/install-beta.sh +0 -438
- package/install-npm.sh +0 -167
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# Release Notes - v0.7.4
|
|
2
|
+
|
|
3
|
+
## 🎉 功能增强版本 / Feature Enhancement Release
|
|
4
|
+
|
|
5
|
+
本次更新主要新增了按会话区分 Session 的功能,支持单聊、群聊、不同群分别维护独立会话,并提供了记忆隔离/共享的配置选项,让会话管理更加灵活和精细。
|
|
6
|
+
|
|
7
|
+
This update primarily adds session separation by conversation feature, supporting separate sessions for direct chat, group chat, and different groups, and provides memory isolation/sharing configuration options for more flexible and fine-grained session management.
|
|
8
|
+
|
|
9
|
+
## ✨ 新增功能 / Added Features
|
|
10
|
+
|
|
11
|
+
### 1. 按会话区分 Session / Session by Conversation
|
|
12
|
+
|
|
13
|
+
**功能描述 / Feature Description**:
|
|
14
|
+
支持按单聊、群聊、不同群分别维护独立会话,单聊与群聊、不同群之间的对话上下文互不干扰。
|
|
15
|
+
Support separate sessions for direct chat, group chat, and different groups; conversation context is isolated between DMs, group chats, and different groups.
|
|
16
|
+
|
|
17
|
+
**使用场景 / Use Cases**:
|
|
18
|
+
- ✅ 同一机器人在多个群中服务,希望每个群的对话互不干扰
|
|
19
|
+
Same bot serves multiple groups, with isolated conversations per group
|
|
20
|
+
- ✅ 用户既在私聊也在群聊中使用机器人,希望私聊与群聊上下文分离
|
|
21
|
+
Users interact with bot in both DMs and group chats, with separated contexts
|
|
22
|
+
- ✅ 不同群之间的对话历史完全隔离
|
|
23
|
+
Complete isolation of conversation history between different groups
|
|
24
|
+
|
|
25
|
+
**配置方式 / Configuration**:
|
|
26
|
+
```json5
|
|
27
|
+
{
|
|
28
|
+
"channels": {
|
|
29
|
+
"dingtalk-connector": {
|
|
30
|
+
"separateSessionByConversation": true // 默认:true
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**影响范围 / Impact**:
|
|
37
|
+
默认启用,所有用户自动获得会话隔离能力。如需兼容旧行为(按用户维度维护 session),可设置 `separateSessionByConversation: false`。
|
|
38
|
+
Enabled by default, all users automatically get session isolation capability. To maintain old behavior (session per user), set `separateSessionByConversation: false`.
|
|
39
|
+
|
|
40
|
+
### 2. 记忆隔离/共享配置 / Memory Isolation/Sharing Configuration
|
|
41
|
+
|
|
42
|
+
**功能描述 / Feature Description**:
|
|
43
|
+
新增 `sharedMemoryAcrossConversations` 配置,控制单 Agent 场景下是否在不同会话间共享记忆;默认 `false` 实现群聊与私聊、不同群之间的记忆隔离。
|
|
44
|
+
Added `sharedMemoryAcrossConversations` option to control whether memory is shared across conversations in single-Agent mode; default `false` isolates memory between DMs, group chats, and different groups.
|
|
45
|
+
|
|
46
|
+
**配置选项 / Configuration Options**:
|
|
47
|
+
- `false`(默认):不同群聊、群聊与私聊之间的记忆隔离,AI 不会混淆不同场景下的对话历史
|
|
48
|
+
`false` (default): Memory isolated between different groups and between DMs and groups, AI won't confuse conversation history across scenarios
|
|
49
|
+
- `true`:单 Agent 场景下,同一用户在不同会话间共享记忆
|
|
50
|
+
`true`: In single-Agent mode, same user shares memory across different sessions
|
|
51
|
+
|
|
52
|
+
**配置方式 / Configuration**:
|
|
53
|
+
```json5
|
|
54
|
+
{
|
|
55
|
+
"channels": {
|
|
56
|
+
"dingtalk-connector": {
|
|
57
|
+
"sharedMemoryAcrossConversations": false // 默认:false
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**影响范围 / Impact**:
|
|
64
|
+
默认关闭,确保不同场景下的记忆隔离。如需跨会话共享记忆,可设置 `sharedMemoryAcrossConversations: true`。
|
|
65
|
+
Disabled by default, ensuring memory isolation across scenarios. To share memory across sessions, set `sharedMemoryAcrossConversations: true`.
|
|
66
|
+
|
|
67
|
+
### 3. Gateway Session 格式增强 / Gateway Session Format Enhancement
|
|
68
|
+
|
|
69
|
+
**功能描述 / Feature Description**:
|
|
70
|
+
Session key 支持 `group:conversationId` 格式,便于 Gateway 识别群聊场景。
|
|
71
|
+
Session key supports `group:conversationId` format for Gateway to identify group chat scenarios.
|
|
72
|
+
|
|
73
|
+
**技术细节 / Technical Details**:
|
|
74
|
+
- 单聊会话:使用 `direct:{userId}` 格式
|
|
75
|
+
Direct chat sessions: Use `direct:{userId}` format
|
|
76
|
+
- 群聊会话:使用 `group:{conversationId}` 格式
|
|
77
|
+
Group chat sessions: Use `group:{conversationId}` format
|
|
78
|
+
- Gateway 可以根据 Session key 格式识别会话类型
|
|
79
|
+
Gateway can identify session type based on Session key format
|
|
80
|
+
|
|
81
|
+
**影响范围 / Impact**:
|
|
82
|
+
内部实现改进,不影响用户使用,但提高了 Gateway 对会话类型的识别能力。
|
|
83
|
+
Internal implementation improvement, does not affect user usage, but improves Gateway's ability to identify session types.
|
|
84
|
+
|
|
85
|
+
### 4. X-OpenClaw-Memory-User 支持 / X-OpenClaw-Memory-User Support
|
|
86
|
+
|
|
87
|
+
**功能描述 / Feature Description**:
|
|
88
|
+
向 Gateway 传递记忆归属用户标识,支持 Gateway 侧记忆管理。
|
|
89
|
+
Pass memory user identifier to Gateway for memory management.
|
|
90
|
+
|
|
91
|
+
**技术细节 / Technical Details**:
|
|
92
|
+
- 在请求 Gateway 时,自动添加 `X-OpenClaw-Memory-User` header
|
|
93
|
+
Automatically add `X-OpenClaw-Memory-User` header when requesting Gateway
|
|
94
|
+
- Header 值为发送消息的用户 ID,便于 Gateway 进行记忆归属管理
|
|
95
|
+
Header value is the user ID who sent the message, facilitating Gateway's memory ownership management
|
|
96
|
+
|
|
97
|
+
**影响范围 / Impact**:
|
|
98
|
+
内部实现改进,支持 Gateway 侧更精细的记忆管理能力。
|
|
99
|
+
Internal implementation improvement, supporting Gateway-side fine-grained memory management capabilities.
|
|
100
|
+
|
|
101
|
+
## 📋 配置变更 / Configuration Changes
|
|
102
|
+
|
|
103
|
+
### 新增配置项 / New Configuration Options
|
|
104
|
+
|
|
105
|
+
| 配置项 | 类型 | 默认值 | 说明 |
|
|
106
|
+
|--------|------|--------|------|
|
|
107
|
+
| `separateSessionByConversation` | `boolean` | `true` | 是否按单聊/群聊/群区分 session |
|
|
108
|
+
| `sharedMemoryAcrossConversations` | `boolean` | `false` | 是否在不同会话间共享记忆 |
|
|
109
|
+
|
|
110
|
+
### 配置示例 / Configuration Example
|
|
111
|
+
|
|
112
|
+
```json5
|
|
113
|
+
{
|
|
114
|
+
"channels": {
|
|
115
|
+
"dingtalk-connector": {
|
|
116
|
+
"enabled": true,
|
|
117
|
+
"clientId": "dingxxxxxxxxx",
|
|
118
|
+
"clientSecret": "your_secret_here",
|
|
119
|
+
"separateSessionByConversation": true, // 按会话区分 Session
|
|
120
|
+
"sharedMemoryAcrossConversations": false // 记忆隔离(默认)
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## 📥 安装升级 / Installation & Upgrade
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
# 通过 npm 安装最新版本 / Install latest version via npm
|
|
130
|
+
openclaw plugins install @dingtalk-real-ai/dingtalk-connector
|
|
131
|
+
|
|
132
|
+
# 或升级现有版本 / Or upgrade existing version
|
|
133
|
+
openclaw plugins update dingtalk-connector
|
|
134
|
+
|
|
135
|
+
# 通过 Git 安装 / Install via Git
|
|
136
|
+
openclaw plugins install https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector.git
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## ⚠️ 升级注意事项 / Upgrade Notes
|
|
140
|
+
|
|
141
|
+
### 兼容性说明 / Compatibility Notes
|
|
142
|
+
|
|
143
|
+
- **向下兼容**:本次更新完全向下兼容,现有配置无需修改即可正常工作
|
|
144
|
+
**Backward Compatible**: This update is fully backward compatible, existing configurations work without modification
|
|
145
|
+
- **默认行为变更**:默认启用 `separateSessionByConversation`,会话将按单聊/群聊/群区分
|
|
146
|
+
**Default Behavior Change**: `separateSessionByConversation` is enabled by default, sessions will be separated by direct/group/different groups
|
|
147
|
+
- **如需旧行为**:如需保持按用户维度维护 session 的旧行为,可设置 `separateSessionByConversation: false`
|
|
148
|
+
**For Old Behavior**: To maintain old behavior of session per user, set `separateSessionByConversation: false`
|
|
149
|
+
|
|
150
|
+
### 迁移指南 / Migration Guide
|
|
151
|
+
|
|
152
|
+
升级到此版本后:
|
|
153
|
+
After upgrading to this version:
|
|
154
|
+
|
|
155
|
+
1. **默认启用会话隔离**:无需任何配置,会话将自动按单聊/群聊/群区分
|
|
156
|
+
**Session isolation enabled by default**: No configuration needed, sessions will automatically be separated by direct/group/different groups
|
|
157
|
+
2. **检查会话行为**:确认新的会话隔离行为是否符合预期
|
|
158
|
+
**Check session behavior**: Verify that the new session isolation behavior meets expectations
|
|
159
|
+
3. **配置记忆共享**:如需跨会话共享记忆,可设置 `sharedMemoryAcrossConversations: true`
|
|
160
|
+
**Configure memory sharing**: To share memory across sessions, set `sharedMemoryAcrossConversations: true`
|
|
161
|
+
4. **恢复旧行为**:如需恢复按用户维度维护 session 的旧行为,设置 `separateSessionByConversation: false`
|
|
162
|
+
**Restore old behavior**: To restore old behavior of session per user, set `separateSessionByConversation: false`
|
|
163
|
+
|
|
164
|
+
## 📋 技术细节 / Technical Details
|
|
165
|
+
|
|
166
|
+
### 内部实现变更 / Internal Implementation Changes
|
|
167
|
+
|
|
168
|
+
**变更前 / Before**:
|
|
169
|
+
- Session key 使用用户 ID:`{userId}`
|
|
170
|
+
- 所有会话共享同一个 Session,不区分单聊/群聊
|
|
171
|
+
- 记忆在所有会话间共享
|
|
172
|
+
|
|
173
|
+
**变更后 / After**:
|
|
174
|
+
- Session key 支持格式:
|
|
175
|
+
- 单聊:`direct:{userId}`
|
|
176
|
+
- 群聊:`group:{conversationId}`
|
|
177
|
+
- 默认按单聊/群聊/群区分 Session
|
|
178
|
+
- 默认记忆隔离,可通过配置共享
|
|
179
|
+
|
|
180
|
+
### 相关代码位置 / Related Code Locations
|
|
181
|
+
|
|
182
|
+
主要修改文件:
|
|
183
|
+
- `plugin.ts` - 核心逻辑修改
|
|
184
|
+
|
|
185
|
+
关键变更点:
|
|
186
|
+
- Session key 生成逻辑
|
|
187
|
+
- `streamFromGateway` 函数中的 Session 处理
|
|
188
|
+
- 记忆用户标识传递
|
|
189
|
+
- 配置项解析和验证
|
|
190
|
+
|
|
191
|
+
## 🔗 相关链接 / Related Links
|
|
192
|
+
|
|
193
|
+
- [完整变更日志 / Full Changelog](https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector/blob/main/CHANGELOG.md)
|
|
194
|
+
- [使用文档 / Documentation](https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector/blob/main/README.md)
|
|
195
|
+
- [问题反馈 / Issue Feedback](https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector/issues)
|
|
196
|
+
|
|
197
|
+
## 🙏 致谢 / Acknowledgments
|
|
198
|
+
|
|
199
|
+
感谢所有贡献者和用户的支持与反馈!
|
|
200
|
+
Thanks to all contributors and users for their support and feedback!
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
**发布日期 / Release Date**:2026-03-09
|
|
205
|
+
**版本号 / Version**:v0.7.4
|
|
206
|
+
**兼容性 / Compatibility**:OpenClaw Gateway 0.4.0+
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
# Release Notes - v0.7.5
|
|
2
|
+
|
|
3
|
+
## 🔧 稳定性修复与架构优化版本 / Stability Fixes & Architecture Optimization Release
|
|
4
|
+
|
|
5
|
+
本次更新主要修复了 Stream 客户端频繁重连和连接关闭不完整的问题,并重构了会话管理机制,采用 OpenClaw Gateway 统一的 session.dmScope 机制,提升了系统的稳定性和可维护性。
|
|
6
|
+
|
|
7
|
+
This update primarily fixes Stream client frequent reconnection and incomplete connection closure issues, and refactors the session management mechanism to use OpenClaw Gateway's unified session.dmScope mechanism, improving system stability and maintainability.
|
|
8
|
+
|
|
9
|
+
## 🐛 修复 / Fixes
|
|
10
|
+
|
|
11
|
+
### 1. Stream 客户端频繁重连问题修复 / Stream Client Frequent Reconnection Fix
|
|
12
|
+
|
|
13
|
+
**问题描述 / Issue Description**:
|
|
14
|
+
`DWClient` 内置的 `autoReconnect` 与框架的 health-monitor 重连机制冲突,导致客户端频繁重连,影响系统稳定性。
|
|
15
|
+
`DWClient` built-in `autoReconnect` conflicts with framework's health-monitor reconnection mechanism, causing frequent client reconnections and affecting system stability.
|
|
16
|
+
|
|
17
|
+
**修复内容 / Fix**:
|
|
18
|
+
- 禁用 `DWClient` 内置的 `autoReconnect`
|
|
19
|
+
Disabled `DWClient` built-in `autoReconnect`
|
|
20
|
+
- 由框架的 health-monitor 统一管理重连逻辑
|
|
21
|
+
Reconnection is now managed by framework's health-monitor
|
|
22
|
+
- 避免双重重连机制冲突
|
|
23
|
+
Avoid dual reconnection mechanism conflict
|
|
24
|
+
|
|
25
|
+
**影响范围 / Impact**:
|
|
26
|
+
影响所有使用 Stream 模式的用户。修复后,重连逻辑更加稳定,不再出现频繁重连的问题。
|
|
27
|
+
Affects all users using Stream mode. After the fix, reconnection logic is more stable, no longer experiencing frequent reconnection issues.
|
|
28
|
+
|
|
29
|
+
### 2. 连接关闭不完整问题修复 / Incomplete Connection Closure Fix
|
|
30
|
+
|
|
31
|
+
**问题描述 / Issue Description**:
|
|
32
|
+
`stop()` 方法未正确关闭 WebSocket 连接,导致资源泄漏和连接状态异常。
|
|
33
|
+
`stop()` method did not correctly close WebSocket connection, causing resource leaks and connection state anomalies.
|
|
34
|
+
|
|
35
|
+
**修复内容 / Fix**:
|
|
36
|
+
- `stop()` 方法现在正确调用 `client.disconnect()` 关闭 WebSocket 连接
|
|
37
|
+
`stop()` method now correctly calls `client.disconnect()` to close WebSocket connection
|
|
38
|
+
- 确保连接资源正确释放
|
|
39
|
+
Ensure connection resources are properly released
|
|
40
|
+
|
|
41
|
+
**影响范围 / Impact**:
|
|
42
|
+
影响所有使用连接器的用户。修复后,连接关闭更加完整,避免资源泄漏。
|
|
43
|
+
Affects all users using the connector. After the fix, connection closure is more complete, avoiding resource leaks.
|
|
44
|
+
|
|
45
|
+
### 3. Gateway 端口连接修复 / Gateway Port Connection Fix
|
|
46
|
+
|
|
47
|
+
**问题描述 / Issue Description**:
|
|
48
|
+
修改 gateway 端口后无法连接的问题。
|
|
49
|
+
Issue where connection fails after modifying gateway port.
|
|
50
|
+
|
|
51
|
+
**修复内容 / Fix**:
|
|
52
|
+
- 修复端口配置更新后的连接逻辑
|
|
53
|
+
Fixed connection logic after port configuration update
|
|
54
|
+
- 确保端口变更后能够正确连接
|
|
55
|
+
Ensure correct connection after port changes
|
|
56
|
+
|
|
57
|
+
**影响范围 / Impact**:
|
|
58
|
+
影响修改了 Gateway 端口的用户。修复后,端口变更后能够正常连接。
|
|
59
|
+
Affects users who modified Gateway port. After the fix, connection works normally after port changes.
|
|
60
|
+
|
|
61
|
+
## 🔄 重构 / Refactoring
|
|
62
|
+
|
|
63
|
+
### 1. OpenClaw session.dmScope 机制 / OpenClaw session.dmScope Mechanism
|
|
64
|
+
|
|
65
|
+
**重构内容 / Refactoring**:
|
|
66
|
+
- 会话管理由 OpenClaw Gateway 统一处理
|
|
67
|
+
Session management is now handled by OpenClaw Gateway
|
|
68
|
+
- 插件不再内部管理会话超时
|
|
69
|
+
Plugin no longer manages session timeout internally
|
|
70
|
+
- 使用 Gateway 的 `session.reset.idleMinutes` 配置控制会话超时
|
|
71
|
+
Use Gateway's `session.reset.idleMinutes` configuration to control session timeout
|
|
72
|
+
|
|
73
|
+
**优势 / Benefits**:
|
|
74
|
+
- ✅ 统一会话管理,减少重复逻辑
|
|
75
|
+
Unified session management, reducing duplicate logic
|
|
76
|
+
- ✅ 配置更加集中和标准化
|
|
77
|
+
More centralized and standardized configuration
|
|
78
|
+
- ✅ 降低插件复杂度,提高可维护性
|
|
79
|
+
Reduce plugin complexity, improve maintainability
|
|
80
|
+
|
|
81
|
+
**影响范围 / Impact**:
|
|
82
|
+
架构层面的改进,不影响用户使用,但提高了系统的可维护性和一致性。
|
|
83
|
+
Architecture-level improvement, does not affect user usage, but improves system maintainability and consistency.
|
|
84
|
+
|
|
85
|
+
### 2. SessionContext 标准化 / SessionContext Standardization
|
|
86
|
+
|
|
87
|
+
**重构内容 / Refactoring**:
|
|
88
|
+
- 使用 OpenClaw 标准的 SessionContext JSON 格式传递会话上下文
|
|
89
|
+
Use OpenClaw standard SessionContext JSON format for session context
|
|
90
|
+
- 统一会话上下文的数据结构
|
|
91
|
+
Unify session context data structure
|
|
92
|
+
- 提高与 Gateway 的兼容性
|
|
93
|
+
Improve compatibility with Gateway
|
|
94
|
+
|
|
95
|
+
**优势 / Benefits**:
|
|
96
|
+
- ✅ 标准化格式,便于 Gateway 解析和处理
|
|
97
|
+
Standardized format, easier for Gateway to parse and process
|
|
98
|
+
- ✅ 提高数据一致性和可预测性
|
|
99
|
+
Improve data consistency and predictability
|
|
100
|
+
- ✅ 便于未来扩展和维护
|
|
101
|
+
Facilitate future expansion and maintenance
|
|
102
|
+
|
|
103
|
+
**影响范围 / Impact**:
|
|
104
|
+
内部实现改进,不影响用户使用,但提高了与 Gateway 的兼容性和数据一致性。
|
|
105
|
+
Internal implementation improvement, does not affect user usage, but improves compatibility with Gateway and data consistency.
|
|
106
|
+
|
|
107
|
+
## 📋 配置变更 / Configuration Changes
|
|
108
|
+
|
|
109
|
+
### 新增配置项 / New Configuration Options
|
|
110
|
+
|
|
111
|
+
| 配置项 | 类型 | 默认值 | 说明 |
|
|
112
|
+
|--------|------|--------|------|
|
|
113
|
+
| `groupSessionScope` | `'group'` \| `'group_sender'` | `'group'` | 群聊会话隔离策略(仅当 separateSessionByConversation=true 时生效):`group`=群共享,`group_sender`=群内用户独立 |
|
|
114
|
+
|
|
115
|
+
### 废弃配置项 / Deprecated Configuration Options
|
|
116
|
+
|
|
117
|
+
| 配置项 | 状态 | 替代方案 | 说明 |
|
|
118
|
+
|--------|------|----------|------|
|
|
119
|
+
| `sessionTimeout` | ⚠️ 已废弃 | Gateway 的 `session.reset.idleMinutes` | 会话超时由 OpenClaw Gateway 统一管理,详见 [Gateway 配置文档](https://docs.openclaw.ai/gateway/configuration) |
|
|
120
|
+
|
|
121
|
+
### 配置示例 / Configuration Example
|
|
122
|
+
|
|
123
|
+
```json5
|
|
124
|
+
{
|
|
125
|
+
"channels": {
|
|
126
|
+
"dingtalk-connector": {
|
|
127
|
+
"enabled": true,
|
|
128
|
+
"clientId": "dingxxxxxxxxx",
|
|
129
|
+
"clientSecret": "your_secret_here",
|
|
130
|
+
"separateSessionByConversation": true,
|
|
131
|
+
"groupSessionScope": "group", // 新增:群聊会话隔离策略
|
|
132
|
+
// "sessionTimeout": 30 // ⚠️ 已废弃,请使用 Gateway 配置
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
// Gateway 配置示例
|
|
136
|
+
"gateway": {
|
|
137
|
+
"session": {
|
|
138
|
+
"reset": {
|
|
139
|
+
"idleMinutes": 30 // 会话超时配置
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### 群聊会话隔离策略说明 / Group Session Scope Explanation
|
|
147
|
+
|
|
148
|
+
`groupSessionScope` 配置仅在 `separateSessionByConversation=true` 时生效:
|
|
149
|
+
|
|
150
|
+
- **`group`**(默认):整个群共享一个会话,群内所有用户共用同一个对话上下文
|
|
151
|
+
**`group`** (default): Entire group shares one session, all users in the group share the same conversation context
|
|
152
|
+
- **`group_sender`**:群内每个用户独立会话,不同用户的对话上下文互不干扰
|
|
153
|
+
**`group_sender`**: Each user in the group has an independent session, conversation contexts of different users do not interfere
|
|
154
|
+
|
|
155
|
+
## 📥 安装升级 / Installation & Upgrade
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
# 通过 npm 安装最新版本 / Install latest version via npm
|
|
159
|
+
openclaw plugins install @dingtalk-real-ai/dingtalk-connector
|
|
160
|
+
|
|
161
|
+
# 或升级现有版本 / Or upgrade existing version
|
|
162
|
+
openclaw plugins update dingtalk-connector
|
|
163
|
+
|
|
164
|
+
# 通过 Git 安装 / Install via Git
|
|
165
|
+
openclaw plugins install https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector.git
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## ⚠️ 升级注意事项 / Upgrade Notes
|
|
169
|
+
|
|
170
|
+
### 兼容性说明 / Compatibility Notes
|
|
171
|
+
|
|
172
|
+
- **向下兼容**:本次更新完全向下兼容,现有配置无需修改即可正常工作
|
|
173
|
+
**Backward Compatible**: This update is fully backward compatible, existing configurations work without modification
|
|
174
|
+
- **sessionTimeout 废弃**:旧配置 `sessionTimeout` 仍可使用,但会打印废弃警告日志,建议迁移到 Gateway 配置
|
|
175
|
+
**sessionTimeout Deprecated**: Old config `sessionTimeout` still works but will print deprecation warning, recommend migrating to Gateway configuration
|
|
176
|
+
- **推荐升级**:使用 Stream 模式的用户强烈建议升级到此版本,以修复重连和连接关闭问题
|
|
177
|
+
**Recommended Upgrade**: Users using Stream mode are strongly recommended to upgrade to this version to fix reconnection and connection closure issues
|
|
178
|
+
|
|
179
|
+
### 迁移指南 / Migration Guide
|
|
180
|
+
|
|
181
|
+
升级到此版本后:
|
|
182
|
+
After upgrading to this version:
|
|
183
|
+
|
|
184
|
+
1. **检查重连行为**:确认重连逻辑是否正常,不再出现频繁重连
|
|
185
|
+
**Check reconnection behavior**: Verify reconnection logic is normal, no longer experiencing frequent reconnections
|
|
186
|
+
2. **迁移 sessionTimeout**:如有使用 `sessionTimeout` 配置,建议迁移到 Gateway 的 `session.reset.idleMinutes` 配置
|
|
187
|
+
**Migrate sessionTimeout**: If using `sessionTimeout` configuration, recommend migrating to Gateway's `session.reset.idleMinutes` configuration
|
|
188
|
+
3. **配置群聊会话隔离**:如需群内用户独立会话,可设置 `groupSessionScope: "group_sender"`
|
|
189
|
+
**Configure group session isolation**: To have independent sessions per user in group, set `groupSessionScope: "group_sender"`
|
|
190
|
+
4. **验证连接关闭**:确认 `stop()` 方法能够正确关闭连接
|
|
191
|
+
**Verify connection closure**: Verify that `stop()` method correctly closes connection
|
|
192
|
+
|
|
193
|
+
### sessionTimeout 迁移步骤 / sessionTimeout Migration Steps
|
|
194
|
+
|
|
195
|
+
**迁移前 / Before**:
|
|
196
|
+
```json5
|
|
197
|
+
{
|
|
198
|
+
"channels": {
|
|
199
|
+
"dingtalk-connector": {
|
|
200
|
+
"sessionTimeout": 30 // ⚠️ 已废弃
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
**迁移后 / After**:
|
|
207
|
+
```json5
|
|
208
|
+
{
|
|
209
|
+
"channels": {
|
|
210
|
+
"dingtalk-connector": {
|
|
211
|
+
// 移除 sessionTimeout 配置
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
"gateway": {
|
|
215
|
+
"session": {
|
|
216
|
+
"reset": {
|
|
217
|
+
"idleMinutes": 30 // 使用 Gateway 配置
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
## 📋 技术细节 / Technical Details
|
|
225
|
+
|
|
226
|
+
### 内部实现变更 / Internal Implementation Changes
|
|
227
|
+
|
|
228
|
+
**变更前 / Before**:
|
|
229
|
+
- `DWClient` 启用 `autoReconnect`,与框架重连机制冲突
|
|
230
|
+
- 插件内部管理会话超时
|
|
231
|
+
- `stop()` 方法未正确关闭 WebSocket 连接
|
|
232
|
+
- SessionContext 格式不统一
|
|
233
|
+
|
|
234
|
+
**变更后 / After**:
|
|
235
|
+
- `DWClient` 禁用 `autoReconnect`,由框架统一管理重连
|
|
236
|
+
- 会话超时由 Gateway 统一管理
|
|
237
|
+
- `stop()` 方法正确调用 `client.disconnect()` 关闭连接
|
|
238
|
+
- SessionContext 使用 OpenClaw 标准格式
|
|
239
|
+
|
|
240
|
+
### 相关代码位置 / Related Code Locations
|
|
241
|
+
|
|
242
|
+
主要修改文件:
|
|
243
|
+
- `plugin.ts` - 核心逻辑修改
|
|
244
|
+
|
|
245
|
+
关键变更点:
|
|
246
|
+
- `DWClient` 初始化时的 `autoReconnect` 配置
|
|
247
|
+
- `stop()` 方法中的连接关闭逻辑
|
|
248
|
+
- SessionContext 格式标准化
|
|
249
|
+
- 会话超时配置移除
|
|
250
|
+
|
|
251
|
+
## 🔗 相关链接 / Related Links
|
|
252
|
+
|
|
253
|
+
- [完整变更日志 / Full Changelog](https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector/blob/main/CHANGELOG.md)
|
|
254
|
+
- [使用文档 / Documentation](https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector/blob/main/README.md)
|
|
255
|
+
- [Gateway 配置文档 / Gateway Configuration](https://docs.openclaw.ai/gateway/configuration)
|
|
256
|
+
- [问题反馈 / Issue Feedback](https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector/issues)
|
|
257
|
+
|
|
258
|
+
## 🙏 致谢 / Acknowledgments
|
|
259
|
+
|
|
260
|
+
感谢所有贡献者和用户的支持与反馈!
|
|
261
|
+
Thanks to all contributors and users for their support and feedback!
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
**发布日期 / Release Date**:2026-03-10
|
|
266
|
+
**版本号 / Version**:v0.7.5
|
|
267
|
+
**兼容性 / Compatibility**:OpenClaw Gateway 0.4.0+
|