Skip to content

Commit bfe5ee7

Browse files
hiwepycursoragent
andcommitted
docs(wecom): add config set commands for text templates
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 45979cc commit bfe5ee7

2 files changed

Lines changed: 86 additions & 0 deletions

File tree

extensions/wecom/README.en.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,49 @@ JSON does not allow comments. Keys are ordered by role: **welcome & stream proto
558558
}
559559
```
560560

561+
### Per-Key Command Setup
562+
563+
Use `channels.wecom.<key>` for global default copy. In multi-account setups, replace the prefix with `channels.wecom.accounts.<accountId>.<key>` for account-level overrides, for example `channels.wecom.accounts.cs-assistant.thinkingText`. The Agent app currently supports a separate welcome override only: `channels.wecom.agent.welcomeText`; other runtime text templates still use the global or account-level flat `*Text` fields.
564+
565+
The sample values below use the Chinese copy from the JSON example; replace them with localized copy as needed. Keep placeholders such as `{toolName}`, `{elapsed}`, `{minutes}`, `{kind}`, `{detail}`, `{mediaUrl}`, `{reason}`, and `{emptyReply}` unchanged because runtime code replaces them.
566+
567+
```bash
568+
openclaw config set channels.wecom.welcomeText "您好!我是智能助手,发送消息即可开始对话。"
569+
openclaw config set channels.wecom.streamPlaceholderText "1"
570+
openclaw config set channels.wecom.thinkingText "🤔 正在思考…"
571+
openclaw config set channels.wecom.receivedText "📩 已收到…"
572+
openclaw config set channels.wecom.toolStatusText "正在调用 {toolName}…"
573+
openclaw config set channels.wecom.readingText "📎 正在阅读附件…"
574+
openclaw config set channels.wecom.generatingText "✍️ 正在输入…"
575+
openclaw config set channels.wecom.compactionText "📦 正在压缩…"
576+
openclaw config set channels.wecom.emptyReplyText "⚠️ 未能生成可展示的回复,请稍后重试或发送文字消息。"
577+
openclaw config set channels.wecom.finishFooterText "⏱ {elapsed}s · 已完成"
578+
openclaw config set channels.wecom.cardSentText "📋 卡片消息已发送。"
579+
openclaw config set channels.wecom.mediaSentText "📎 文件已发送,请查收。"
580+
openclaw config set channels.wecom.mediaParseFailedText "⚠️ 未能解析该媒体并生成回复。{emptyReply}"
581+
openclaw config set channels.wecom.mediaDeliveredText "✅ 文件已发送。"
582+
openclaw config set channels.wecom.processedCompleteText "✅ 已处理完成。"
583+
openclaw config set channels.wecom.timeoutText "⚠️ 处理超时(约 {minutes} 分钟),请稍后重试或发送文字消息。"
584+
openclaw config set channels.wecom.dispatchErrorText "⚠️ 回复生成失败({kind}):{detail}"
585+
openclaw config set channels.wecom.mediaErrorNoAccessText $'⚠️ 文件发送失败:没有权限访问路径 {mediaUrl}\n请在 openclaw.json 的 mediaLocalRoots 中添加该路径的父目录后重启生效。'
586+
openclaw config set channels.wecom.mediaErrorReasonText "⚠️ 文件发送失败:{reason}"
587+
openclaw config set channels.wecom.mediaErrorGenericText "⚠️ 文件发送失败:无法处理文件 {mediaUrl},请稍后再试。"
588+
openclaw config set channels.wecom.queuedText "⏳ 排队中…"
589+
openclaw config set channels.wecom.mergedQueuedText "⏳ 已合并排队…"
590+
openclaw config set channels.wecom.mergedDoneText "✅ 已合并处理完成,请查看上一条回复。"
591+
openclaw config set channels.wecom.sessionResetText "✅ 已重置会话。"
592+
openclaw config set channels.wecom.sessionNewText "✅ 已开启新会话。"
593+
openclaw gateway restart
594+
```
595+
596+
`mediaErrorNoAccessText` contains a newline. zsh/bash users should use ANSI-C quoting as shown above (`$'...\n...'`). If your shell does not support it, write the value through JSON/file-based config instead so `\n` is stored as an actual newline.
597+
598+
For an Agent app welcome message, set the dedicated override:
599+
600+
```bash
601+
openclaw config set channels.wecom.agent.welcomeText "欢迎使用自建应用,我会尽快回复您。"
602+
```
603+
561604
## Streaming Output
562605

563606
Only **Bot WebSocket** and **Bot Webhook** support WeCom `stream` / `replyStream`. **Agent inbound chat does not use Bot-style streaming**; outbound delivery is primarily one-shot Markdown / media via the Agent API.

extensions/wecom/README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,49 @@ JSON 不支持注释;下方按职责分组排列:**欢迎与流式协议**
562562
}
563563
```
564564

565+
### 逐项命令设置
566+
567+
全局默认文案使用 `channels.wecom.<key>`。多账号场景下,账号级覆盖可将前缀替换为 `channels.wecom.accounts.<accountId>.<key>`,例如 `channels.wecom.accounts.cs-assistant.thinkingText`。自建应用当前仅支持独立覆盖欢迎语:`channels.wecom.agent.welcomeText`;其他运行中文案仍使用全局或账号级平铺 `*Text` 字段。
568+
569+
下面命令可直接复制执行;包含 `{toolName}``{elapsed}``{minutes}``{kind}``{detail}``{mediaUrl}``{reason}``{emptyReply}` 的占位符需要原样保留,由运行时替换。
570+
571+
```bash
572+
openclaw config set channels.wecom.welcomeText "您好!我是智能助手,发送消息即可开始对话。"
573+
openclaw config set channels.wecom.streamPlaceholderText "1"
574+
openclaw config set channels.wecom.thinkingText "🤔 正在思考…"
575+
openclaw config set channels.wecom.receivedText "📩 已收到…"
576+
openclaw config set channels.wecom.toolStatusText "正在调用 {toolName}…"
577+
openclaw config set channels.wecom.readingText "📎 正在阅读附件…"
578+
openclaw config set channels.wecom.generatingText "✍️ 正在输入…"
579+
openclaw config set channels.wecom.compactionText "📦 正在压缩…"
580+
openclaw config set channels.wecom.emptyReplyText "⚠️ 未能生成可展示的回复,请稍后重试或发送文字消息。"
581+
openclaw config set channels.wecom.finishFooterText "⏱ {elapsed}s · 已完成"
582+
openclaw config set channels.wecom.cardSentText "📋 卡片消息已发送。"
583+
openclaw config set channels.wecom.mediaSentText "📎 文件已发送,请查收。"
584+
openclaw config set channels.wecom.mediaParseFailedText "⚠️ 未能解析该媒体并生成回复。{emptyReply}"
585+
openclaw config set channels.wecom.mediaDeliveredText "✅ 文件已发送。"
586+
openclaw config set channels.wecom.processedCompleteText "✅ 已处理完成。"
587+
openclaw config set channels.wecom.timeoutText "⚠️ 处理超时(约 {minutes} 分钟),请稍后重试或发送文字消息。"
588+
openclaw config set channels.wecom.dispatchErrorText "⚠️ 回复生成失败({kind}):{detail}"
589+
openclaw config set channels.wecom.mediaErrorNoAccessText $'⚠️ 文件发送失败:没有权限访问路径 {mediaUrl}\n请在 openclaw.json 的 mediaLocalRoots 中添加该路径的父目录后重启生效。'
590+
openclaw config set channels.wecom.mediaErrorReasonText "⚠️ 文件发送失败:{reason}"
591+
openclaw config set channels.wecom.mediaErrorGenericText "⚠️ 文件发送失败:无法处理文件 {mediaUrl},请稍后再试。"
592+
openclaw config set channels.wecom.queuedText "⏳ 排队中…"
593+
openclaw config set channels.wecom.mergedQueuedText "⏳ 已合并排队…"
594+
openclaw config set channels.wecom.mergedDoneText "✅ 已合并处理完成,请查看上一条回复。"
595+
openclaw config set channels.wecom.sessionResetText "✅ 已重置会话。"
596+
openclaw config set channels.wecom.sessionNewText "✅ 已开启新会话。"
597+
openclaw gateway restart
598+
```
599+
600+
`mediaErrorNoAccessText` 含换行,zsh/bash 推荐使用上面的 ANSI-C quoting(`$'...\n...'`)。如果你的 shell 不支持该写法,请改用 JSON/文件方式写入配置,避免把 `\n` 写成普通文本。
601+
602+
自建应用欢迎语可单独覆盖:
603+
604+
```bash
605+
openclaw config set channels.wecom.agent.welcomeText "欢迎使用自建应用,我会尽快回复您。"
606+
```
607+
565608
## 流式输出
566609

567610
**Bot WebSocket****Bot Webhook** 支持企业微信 `stream` / `replyStream` 流式载体;**Agent 自建应用入站对话不支持 Bot 式流式**,出站以 `sendMessage` 一次性 Markdown / 媒体为主。

0 commit comments

Comments
 (0)