content
large_stringlengths
3
20.5k
url
large_stringlengths
54
193
branch
large_stringclasses
4 values
source
large_stringclasses
42 values
embeddings
listlengths
384
384
score
float64
-0.21
0.65
# Tlon(插件) Tlon 是一个基于 Urbit 构建的去中心化即时通讯工具。OpenClaw 连接到你的 Urbit ship,可以响应私信和群聊消息。群组回复默认需要 @ 提及,并可通过允许列表进一步限制。 状态:通过插件支持。支持私信、群组提及、话题回复和纯文本媒体回退(URL 附加到说明文字)。不支持表情回应、投票和原生媒体上传。 ## 需要插件 Tlon 作为插件提供,不包含在核心安装中。 通过 CLI 安装(npm 仓库): ```bash openclaw plugins install @openclaw/tlon ``` 本地检出(从 git 仓库运行时): ```bash openclaw plugins install ./extensions/tlon ``` 详情:[插件](/plugin) ## 设置 1. 安装 Tlon 插件。 2. 获取你的 ship URL 和登录代码。 3. 配置 `channels.tlon`。 4. 重启 Gateway 网关。 5. 私信机器人或在群组频道中提及它。 最小配置(单账户): ```json5 { channels: { tlon: { enabled: true, ship: "~sampel-palnet", url: "https://your-ship-host", code: "lidlut-tabwed-pillex-ridrup", }, }, } ``` ## 群组频道 默认启用自动发现。你也可以手动固定频道: ```json5 { channels: { tlon: { groupChannels: ["chat/~host-ship/general", "chat/~host-ship/support"], }, }, } ``` 禁用自动发现: ```json5 { channels: { tlon: { autoDiscoverChannels: false, }, }, } ``` ## 访问控制 私信允许列表(空 = 允许全部): ```json5 { channels: { tlon: { dmAllowlist: ["~zod", "~nec"], }, }, } ``` 群组授权(默认受限): ```json5 { channels: { tlon: { defaultAuthorizedShips: ["~zod"], authorization: { channelRules: { "chat/~host-ship/general": { mode: "restricted", allowedShips: ["~zod", "~nec"], }, "chat/~host-ship/announcements": { mode: "open", }, }, }, }, }, } ``` ## 投递目标(CLI/cron) 与 `openclaw message send` 或 cron 投递一起使用: - 私信:`~sampel-palnet` 或 `dm/~sampel-palnet` - 群组:`chat/~host-ship/channel` 或 `group:~host-ship/channel` ## 注意事项 - 群组回复需要提及(例如 `~your-bot-ship`)才能响应。 - 话题回复:如果入站消息在话题中,OpenClaw 会在话题内回复。 - 媒体:`sendMedia` 回退为文本 + URL(无原生上传)。
https://github.com/openclaw/openclaw/blob/main//docs/zh-CN/channels/tlon.md
main
opebclaw
[ -0.0423029400408268, 0.08446084707975388, -0.052840858697891235, -0.029328731819987297, -0.016769107431173325, -0.0940188616514206, 0.029691290110349655, 0.004989404696971178, 0.008384671062231064, -0.04135248810052872, 0.10408788919448853, -0.03788933530449867, 0.04631296917796135, -0.03789079934358597, 0.02901654876768589, 0.10735693573951721, -0.06723128259181976, 0.016339510679244995, -0.035462673753499985, -0.031156353652477264, -0.009726636111736298, 0.06096342206001282, 0.03668005391955376, 0.006440409459173679, -0.07177156209945679, 0.04817749187350273, -0.06474030017852783, 0.061102718114852905, -0.03927268087863922, -0.012104402296245098, -0.02866959013044834, 0.09946956485509872, 0.0011287936940789223, -0.0028664974961429834, 0.12502413988113403, 0.06665108352899551, -0.004821187350898981, -0.02406572736799717, -0.09007187932729721, -0.017575759440660477, 0.020928913727402687, -0.01526081096380949, -0.016917504370212555, -0.0374097041785717, -0.03380418196320534, -0.06154128909111023, -0.05799434334039688, -0.09095729142427444, -0.05252596735954285, -0.032202914357185364, -0.0879698097705841, -0.04784712567925453, -0.04255913570523262, -0.06052501127123833, 0.04456499218940735, -0.04160907492041588, -0.012328129261732101, -0.007898900657892227, -0.016131963580846786, -0.06681180000305176, 0.004413241520524025, 0.061244890093803406, -0.048975031822919846, 0.02920430712401867, -0.07074099034070969, -0.019301634281873703, -0.05023416876792908, -0.003632676089182496, -0.05557478219270706, -0.003307775128632784, -0.018537739291787148, -0.01865878514945507, -0.016522521153092384, 0.018924886360764503, -0.08572830259799957, -0.019541630521416664, 0.07528270781040192, 0.002132394118234515, -0.07591091096401215, -0.13432610034942627, -0.07409830391407013, -0.02873232401907444, 0.019542977213859558, 0.001689417171292007, -0.030548924580216408, 0.13649868965148926, -0.046038903295993805, 0.022004418075084686, 0.10547137260437012, 0.03354857861995697, 0.058164943009614944, -0.012906951829791069, 0.010653999634087086, -0.000549973628949374, 0.026332352310419083, -0.06707583367824554, 0.01904245838522911, 0.052049826830625534, -0.0715874582529068, 0.10678713023662567, 0.06573829054832458, -0.03329606354236603, -0.02776486799120903, -0.012167585082352161, -0.035283688455820084, 0.0028952741995453835, 0.026463359594345093, 0.04847908765077591, 0.04962017387151718, -0.003968206699937582, -0.020922672003507614, -0.10892236232757568, 0.0557350255548954, -0.12378715723752975, -0.06745019555091858, 0.04172677546739578, -0.06009908765554428, -0.0341360978782177, 0.045834414660930634, 0.02862975373864174, 0.049531202763319016, 0.003960176836699247, -0.09625840187072754, -0.04005547985434532, -0.00843894388526678, 0.016160722821950912, 0.08801557123661041, 3.196715744758932e-33, 0.03623751178383827, -0.027993064373731613, -0.023902704939246178, 0.0024325333070009947, 0.06575674563646317, -0.022571031004190445, -0.011130325496196747, -0.029382869601249695, -0.09784814715385437, 0.04210008680820465, -0.03710876405239105, 0.01570570096373558, -0.11050522327423096, 0.022378070279955864, 0.011236961930990219, -0.08555483818054199, -0.03787311166524887, -0.012895257212221622, 0.027036909013986588, -0.07553807646036148, 0.003245778614655137, 0.03510722517967224, -0.02272843010723591, -0.011774667538702488, -0.056035179644823074, 0.023675698786973953, 0.05231932923197746, -0.05749792978167534, -0.0005204273038543761, 0.06461568921804428, 0.061640117317438126, -0.017555344849824905, -0.024456674233078957, -0.005493528675287962, -0.0565255731344223, 0.03684510663151741, -0.054904308170080185, -0.03547095134854317, -0.09260117262601852, -0.043686360120773315, 0.002872617682442069, -0.015583991073071957, -0.04955446720123291, 0.05899209901690483, 0.04087898135185242, -0.015786346048116684, -0.07743805646896362, 0.003800332546234131, 0.05825541913509369, -0.024204974994063377, -0.04191538691520691, 0.04422266036272049, 0.03126312419772148, -0.008453700691461563, -0.028055287897586823, -0.003991530742496252, -0.04527417570352554, -0.0036473923828452826, -0.0009799989638850093, -0.0383901372551918, -0.012154811061918736, 0.0545395091176033, 0.05180254578590393, -0.012446120381355286, 0.10210049152374268, -0.003213264746591449, 0.021854950115084648, 0.0005904255085624754, -0.010213704779744148, -0.032668888568878174, -0.06499496847391129, -0.021325891837477684, 0.06406242400407791, 0.0316748172044754, -0.04408976808190346, 0.011589459143579006, 0.027020176872611046, -0.0395454578101635, 0.037756726145744324, -0.0896410197019577, -0.047218915075063705, -0.0709412470459938, -0.025478653609752655, -0.00007823681517038494, -0.02225693129003048, 0.03332012519240379, 0.06677190214395523, 0.018758075311779976, -0.024801837280392647, 0.05674399808049202, -0.11710236966609955, -0.010725552216172218, -0.06410587579011917, -0.021912788972258568, -0.05341189354658127, -6.740077426735664e-33, -0.019858622923493385, 0.025091763585805893, 0.00343898287974298, -0.006877390667796135, -0.0053968592546880245, -0.05418415740132332, -0.03975546360015869, -0.03508448228240013, 0.0459686703979969, 0.06688889116048813, -0.04296896234154701, 0.016743699088692665, 0.03553757816553116, -0.03473697602748871, 0.0834815576672554, 0.0014837800990790129, 0.0014274680288508534, 0.09441596269607544, -0.09215054661035538, 0.04716966673731804, -0.07386608421802521, 0.027383744716644287, -0.09090746939182281, 0.06692774593830109, -0.005656263325363398, 0.0836867243051529, 0.07935433834791183, -0.04339781031012535, -0.02941248193383217, -0.036586057394742966, 0.027221381664276123, 0.021279562264680862, -0.05593862384557724, 0.13530626893043518, -0.04243474081158638, 0.009779967367649078, 0.0005318282055668533, -0.013203480280935764, -0.02131953276693821, -0.011099186725914478, 0.023156296461820602, -0.01780744083225727, 0.010199837386608124, -0.00840750616043806, -0.05541403964161873, -0.012456174939870834, -0.05652230978012085, -0.07992427051067352, -0.0921114832162857, -0.023084823042154312, 0.044591937214136124, 0.01641334779560566, 0.04331901669502258, -0.03483707457780838, 0.06404190510511398, 0.022890347987413406, -0.040542952716350555, -0.1311195194721222, -0.10245271772146225, -0.090095154941082, 0.05077408254146576, 0.055146049708127975, -0.032556429505348206, 0.02911696955561638, 0.020523248240351677, -0.0564270094037056, -0.011286222375929356, 0.019602954387664795, -0.04049373045563698, -0.08738888055086136, 0.004846852272748947, 0.05274683237075806, -0.025637948885560036, -0.1227506697177887, 0.025127099826931953, 0.0199844092130661, -0.019341737031936646, 0.026980558410286903, -0.057952526956796646, 0.0305072870105505, -0.0007745142793282866, -0.048456404358148575, 0.05900179222226143, 0.09475883096456528, -0.06190643087029457, -0.04441139101982117, 0.02067357860505581, 0.10109248012304306, 0.05916254222393036, 0.016746761277318, -0.0360153429210186, 0.09038557857275009, 0.009588555432856083, 0.06757181882858276, 0.011698453687131405, -4.930862118612822e-8, -0.04545144364237785, -0.11452683061361313, -0.08213207870721817, 0.042448896914720535, 0.00410957308486104, -0.04011675715446472, -0.025746211409568787, 0.009574223309755325, -0.0606289878487587, -0.0020862084347754717, 0.04328618571162224, 0.007815168239176273, -0.1044761911034584, -0.006531470455229282, -0.0763980820775032, 0.03338620811700821, -0.02842194028198719, 0.025685204192996025, 0.02260570600628853, -0.09284844994544983, 0.0007080141804181039, 0.05154094099998474, 0.1202705055475235, -0.054682958871126175, -0.10412545502185822, 0.02421538531780243, -0.10315904766321182, 0.0013400210300460458, 0.008168966509401798, 0.023159291595220566, 0.05008048936724663, 0.0038335134740918875, 0.018649663776159286, -0.018903497606515884, 0.05870243161916733, 0.023378195241093636, 0.05820367857813835, -0.0032820329070091248, 0.006083657033741474, 0.0355672687292099, 0.02558770589530468, -0.04686480760574341, 0.006823721807450056, 0.04591374844312668, -0.010723276063799858, -0.01769294962286949, 0.037857796996831894, 0.048743922263383865, 0.024186665192246437, -0.06206822767853737, -0.001699316781014204, 0.039612580090761185, 0.017041638493537903, 0.007760994136333466, 0.019780326634645462, 0.08126410096883774, 0.052723415195941925, 0.026945145800709724, 0.006739710457623005, 0.09549111127853394, 0.025547495111823082, 0.04105541855096817, 0.05832590162754059, 0.02159789577126503 ]
0.121225
# Microsoft Teams(插件) > "进入此地者,放弃一切希望。" 更新时间:2026-01-21 状态:支持文本 + 私信附件;频道/群组文件发送需要 `sharePointSiteId` + Graph 权限(参见[在群聊中发送文件](#sending-files-in-group-chats))。投票通过 Adaptive Cards 发送。 ## 需要插件 Microsoft Teams 作为插件提供,不包含在核心安装中。 \*\*破坏性变更(2026.1.15):\*\* MS Teams 已从核心移出。如果你使用它,必须安装插件。 原因说明:保持核心安装更轻量,并让 MS Teams 依赖项可以独立更新。 通过 CLI 安装(npm 注册表): ```bash openclaw plugins install @openclaw/msteams ``` 本地检出(从 git 仓库运行时): ```bash openclaw plugins install ./extensions/msteams ``` 如果你在配置/新手引导过程中选择 Teams 并检测到 git 检出, OpenClaw 将自动提供本地安装路径。 详情:[插件](/plugin) ## 快速设置(初学者) 1. 安装 Microsoft Teams 插件。 2. 创建一个 \*\*Azure Bot\*\*(App ID + 客户端密钥 + 租户 ID)。 3. 使用这些凭证配置 OpenClaw。 4. 通过公共 URL 或隧道暴露 `/api/messages`(默认端口 3978)。 5. 安装 Teams 应用包并启动 Gateway 网关。 最小配置: ```json5 { channels: { msteams: { enabled: true, appId: "", appPassword: "", tenantId: "", webhook: { port: 3978, path: "/api/messages" }, }, }, } ``` 注意:群聊默认被阻止(`channels.msteams.groupPolicy: "allowlist"`)。要允许群组回复,请设置 `channels.msteams.groupAllowFrom`(或使用 `groupPolicy: "open"` 允许任何成员,需要提及才能触发)。 ## 目标 - 通过 Teams 私信、群聊或频道与 OpenClaw 交流。 - 保持路由确定性:回复始终返回到消息到达的渠道。 - 默认使用安全的渠道行为(除非另有配置,否则需要提及)。 ## 配置写入 默认情况下,Microsoft Teams 允许通过 `/config set|unset` 触发的配置更新写入(需要 `commands.config: true`)。 禁用方式: ```json5 { channels: { msteams: { configWrites: false } }, } ``` ## 访问控制(私信 + 群组) \*\*私信访问\*\* - 默认:`channels.msteams.dmPolicy = "pairing"`。未知发送者在获得批准之前将被忽略。 - `channels.msteams.allowFrom` 接受 AAD 对象 ID、UPN 或显示名称。当凭证允许时,向导会通过 Microsoft Graph 将名称解析为 ID。 \*\*群组访问\*\* - 默认:`channels.msteams.groupPolicy = "allowlist"`(除非添加 `groupAllowFrom`,否则被阻止)。使用 `channels.defaults.groupPolicy` 在未设置时覆盖默认值。 - `channels.msteams.groupAllowFrom` 控制哪些发送者可以在群聊/频道中触发(回退到 `channels.msteams.allowFrom`)。 - 设置 `groupPolicy: "open"` 允许任何成员(默认仍需提及才能触发)。 - 要\*\*不允许任何频道\*\*,设置 `channels.msteams.groupPolicy: "disabled"`。 示例: ```json5 { channels: { msteams: { groupPolicy: "allowlist", groupAllowFrom: ["user@org.com"], }, }, } ``` \*\*团队 + 频道允许列表\*\* - 通过在 `channels.msteams.teams` 下列出团队和频道来限定群组/频道回复的范围。 - 键可以是团队 ID 或名称;频道键可以是会话 ID 或名称。 - 当 `groupPolicy="allowlist"` 且存在团队允许列表时,仅接受列出的团队/频道(需要提及才能触发)。 - 配置向导接受 `Team/Channel` 条目并为你存储。 - 启动时,OpenClaw 将团队/频道和用户允许列表名称解析为 ID(当 Graph 权限允许时) 并记录映射;未解析的条目保持原样。 示例: ```json5 { channels: { msteams: { groupPolicy: "allowlist", teams: { "My Team": { channels: { General: { requireMention: true }, }, }, }, }, }, } ``` ## 工作原理 1. 安装 Microsoft Teams 插件。 2. 创建一个 \*\*Azure Bot\*\*(App ID + 密钥 + 租户 ID)。 3. 构建一个引用机器人并包含以下 RSC 权限的 \*\*Teams 应用包\*\*。 4. 将 Teams 应用上传/安装到团队中(或用于私信的个人范围)。 5. 在 `~/.openclaw/openclaw.json`(或环境变量)中配置 `msteams` 并启动 Gateway 网关。 6. Gateway 网关默认在 `/api/messages` 上监听 Bot Framework webhook 流量。 ## Azure Bot 设置(前提条件) 在配置 OpenClaw 之前,你需要创建一个 Azure Bot 资源。 ### 步骤 1:创建 Azure Bot 1. 前往[创建 Azure Bot](https://portal.azure.com/#create/Microsoft.AzureBot) 2. 填写\*\*基本信息\*\*选项卡: | 字段 | 值 | | ------------------ | --------------------------------------------------- | | \*\*Bot handle\*\* | 你的机器人名称,例如 `openclaw-msteams`(必须唯一) | | \*\*Subscription\*\* | 选择你的 Azure 订阅 | | \*\*Resource group\*\* | 新建或使用现有 | | \*\*Pricing tier\*\* | \*\*Free\*\* 用于开发/测试 | | \*\*Type of App\*\* | \*\*Single Tenant\*\*(推荐 - 见下方说明) | | \*\*Creation type\*\* | \*\*Create new Microsoft App ID\*\* | > \*\*弃用通知:\*\* 2025-07-31 之后已弃用创建新的多租户机器人。新机器人请使用 \*\*Single Tenant\*\*。 3. 点击 \*\*Review + create\*\* → \*\*Create\*\*(等待约 1-2 分钟) ### 步骤 2:获取凭证 1. 前往你的 Azure Bot 资源 → \*\*Configuration\*\* 2. 复制 \*\*Microsoft App ID\*\* → 这是你的 `appId` 3. 点击 \*\*Manage Password\*\* → 前往应用注册 4. 在 \*\*Certificates & secrets\*\* → \*\*New client secret\*\* → 复制 \*\*Value\*\* → 这是你的 `appPassword` 5. 前往 \*\*Overview\*\* → 复制 \*\*Directory (tenant) ID\*\* → 这是你的 `tenantId` ### 步骤 3:配置消息端点 1. 在 Azure Bot → \*\*Configuration\*\* 2. 将 \*\*Messaging endpoint\*\* 设置为你的 webhook URL: - 生产环境:`https://your-domain.com/api/messages` - 本地开发:使用隧道(见下方[本地开发](#local-development-tunneling)) ### 步骤 4:启用 Teams 渠道 1. 在 Azure Bot → \*\*Channels\*\* 2. 点击 \*\*Microsoft Teams\*\* → Configure → Save 3. 接受服务条款 ## 本地开发(隧道) Teams 无法访问 `localhost`。本地开发请使用隧道: \*\*选项 A:ngrok\*\* ```bash ngrok http 3978 # 复制 https URL,例如 https://abc123.ngrok.io # 将消息端点设置为:https://abc123.ngrok.io/api/messages ``` \*\*选项 B:Tailscale Funnel\*\* ```bash tailscale funnel 3978 # 使用你的 Tailscale funnel URL 作为消息端点 ``` ## Teams 开发者门户(替代方案) 除了手动创建清单 ZIP,你可以使用 [Teams 开发者门户](https://dev.teams.microsoft.com/apps): 1. 点击 \*\*+ New app\*\* 2. 填写基本信息(名称、描述、开发者信息) 3. 前往 \*\*App features\*\* → \*\*Bot\*\* 4. 选择 \*\*Enter a bot ID manually\*\* 并粘贴你的 Azure Bot App ID 5. 勾选范围:\*\*Personal\*\*、\*\*Team\*\*、\*\*Group Chat\*\* 6. 点击 \*\*Distribute\*\* → \*\*Download app package\*\* 7. 在 Teams 中:\*\*Apps\*\* → \*\*Manage your apps\*\* → \*\*Upload a custom app\*\* → 选择 ZIP 这通常比手动编辑 JSON 清单更容易。 ## 测试机器人 \*\*选项 A:Azure Web Chat(先验证 webhook)\*\* 1. 在 Azure 门户 →
https://github.com/openclaw/openclaw/blob/main//docs/zh-CN/channels/msteams.md
main
opebclaw
[ -0.050131332129240036, 0.04472716525197029, -0.05564630404114723, -0.015736576169729233, 0.021417126059532166, -0.034098390489816666, -0.010060913860797882, -0.015537002123892307, 0.025119798257946968, 0.025114312767982483, 0.1120123341679573, -0.03075353614985943, 0.06089352071285248, 0.020390570163726807, 0.02768385224044323, 0.08000274002552032, -0.0956139862537384, -0.04182218760251999, -0.012773645110428333, 0.01815025694668293, -0.04614807665348053, -0.049244798719882965, -0.0049964189529418945, 0.022693784907460213, 0.008176644332706928, 0.02801753208041191, -0.1259288489818573, 0.09081646054983139, -0.019910335540771484, -0.014238097704946995, -0.043451618403196335, 0.10210534185171127, 0.0686318650841713, 0.05018044263124466, 0.12205203622579575, 0.09085073322057724, 0.011879771947860718, -0.02348387986421585, -0.09374118596315384, 0.011483537033200264, -0.03116772510111332, 0.016333481296896935, 0.005996262189000845, -0.022405529394745827, -0.020246921107172966, 0.009046599268913269, -0.07290936261415482, -0.039887432008981705, -0.0911620557308197, 0.02053823694586754, -0.11310631781816483, -0.06111713871359825, -0.027414673939347267, -0.014433677308261395, 0.07437735050916672, -0.03634817898273468, -0.06398899108171463, 0.0076520987786352634, 0.013016507029533386, -0.07859260588884354, 0.08484906703233719, -0.004193464759737253, -0.04429198428988457, 0.02150404080748558, -0.09297021478414536, 0.0095767667517066, -0.024390442296862602, 0.0462198480963707, -0.031840816140174866, -0.038026176393032074, -0.01304655522108078, -0.007785265799611807, -0.06397289782762527, -0.05281393975019455, -0.008064915426075459, 0.09080570191144943, 0.010084860026836395, 0.031170513480901718, -0.06301752477884293, -0.16585522890090942, -0.05544841289520264, -0.01481587067246437, 0.0411040261387825, 0.02445584535598755, -0.04099886491894722, 0.13077443838119507, -0.045610781759023666, -0.03709638491272926, 0.03813346102833748, -0.006159706972539425, -0.02042306959629059, 0.04145295172929764, 0.035780277103185654, 0.06045755743980408, 0.02640446648001671, -0.02705211006104946, 0.02081792987883091, 0.05112612992525101, -0.03570190444588661, 0.071571484208107, 0.03677136078476906, -0.0019446266815066338, -0.03380613029003143, -0.04847170412540436, -0.03661873936653137, -0.02621391788125038, -0.006482966244220734, 0.038050275295972824, 0.004057245794683695, 0.002298315055668354, -0.02406999282538891, -0.03332184627652168, -0.0399775430560112, -0.1116769015789032, -0.09534215927124023, 0.02137112058699131, -0.06633033603429794, -0.027112582698464394, -0.007791572716087103, 0.027055250480771065, 0.08755120635032654, -0.002071340335533023, -0.10046705603599548, -0.050928015261888504, -0.040093183517456055, 0.06110281124711037, 0.07841736078262329, -3.0701061869677406e-33, 0.05777966231107712, -0.02401287853717804, -0.02350281924009323, 0.022586867213249207, 0.08253685384988785, -0.05458032712340355, -0.024693595245480537, -0.02956443466246128, -0.10068931430578232, -0.010453577153384686, -0.06484784185886383, 0.020645219832658768, -0.04623888060450554, 0.03349180892109871, 0.04885530099272728, -0.10784563422203064, -0.003872549394145608, 0.0009352947818115354, 0.03744281455874443, -0.044205114245414734, -0.02052682638168335, -0.015265986323356628, -0.004149535205215216, -0.041203297674655914, -0.012687714770436287, 0.10147834569215775, 0.036959029734134674, -0.06449656188488007, 0.05392145738005638, 0.022255847230553627, 0.03857480734586716, 0.006918466649949551, -0.04204670712351799, 0.0026322652120143175, -0.09336285293102264, -0.023999324068427086, -0.07880066335201263, -0.02377646416425705, -0.028865592554211617, 0.024683788418769836, -0.02367849089205265, -0.0267392098903656, -0.06743059307336807, -0.021608565002679825, 0.0922236517071724, -0.04515650123357773, -0.09750299900770187, -0.060785725712776184, 0.09418188035488129, -0.04242787882685661, -0.05458635464310646, 0.050808120518922806, -0.005053234286606312, 0.03381640464067459, -0.00921042449772358, -0.05950430780649185, 0.009383485652506351, -0.006782563403248787, -0.04262854531407356, -0.036338839679956436, 0.02056368626654148, 0.03737026825547218, 0.03253303840756416, -0.026250431314110756, 0.09213816374540329, -0.020092986524105072, 0.02958868257701397, -0.006173775065690279, -0.004287384916096926, -0.03397751972079277, -0.0557231530547142, -0.03344129025936127, 0.08918669819831848, 0.05648497864603996, -0.03971029445528984, -0.04523565620183945, -0.07299963384866714, 0.012179849669337273, 0.003919277805835009, -0.03828425705432892, -0.10228143632411957, -0.06070701777935028, -0.07962875813245773, -0.07497639209032059, -0.06262251734733582, 0.04592207819223404, 0.07538772374391556, 0.027959875762462616, -0.018955623731017113, 0.05002569034695625, -0.07005549222230911, 0.004683862440288067, -0.050377342849969864, 0.00686822971329093, -0.04363841190934181, -2.255716904891344e-33, -0.02806529402732849, -0.0011694784043356776, -0.01585332490503788, -0.0029220874421298504, 0.021499570459127426, -0.030284840613603592, -0.018862731754779816, -0.027084577828645706, 0.05940794572234154, 0.08933915942907333, -0.044319309294223785, 0.0350261814892292, -0.03680029883980751, -0.012414241209626198, 0.03145549073815346, 0.01760292798280716, 0.03630632534623146, 0.03947586193680763, -0.0483870804309845, 0.026552384719252586, 0.0026055637281388044, 0.023410748690366745, -0.09293609857559204, 0.08556137979030609, 0.06590109318494797, 0.04384612664580345, 0.02903054654598236, -0.07724588364362717, 0.018743714317679405, -0.006290393881499767, 0.0029239088762551546, -0.007190098986029625, -0.07760462909936905, 0.0771147757768631, 0.008394017815589905, -0.028281021863222122, -0.011757737025618553, -0.03718957677483559, 0.00494150398299098, -0.02489299140870571, 0.029998358339071274, -0.027047980576753616, -0.05744972452521324, 0.033272430300712585, 0.011419829912483692, 0.010443919338285923, -0.05922140181064606, -0.06867735087871552, -0.10813689231872559, 0.04180295020341873, 0.07351414859294891, 0.02346297912299633, 0.00746631296351552, -0.063102126121521, 0.028013991191983223, 0.023688022047281265, -0.02506311982870102, -0.07100037485361099, -0.08054889738559723, -0.11611350625753403, 0.060977354645729065, 0.016364172101020813, -0.05844821035861969, 0.01702258549630642, -0.014948076568543911, 0.060981061309576035, -0.0036356111522763968, 0.0023331926204264164, -0.02279733307659626, -0.04606679826974869, -0.026087196543812752, 0.09136389195919037, -0.03744731843471527, -0.07857488095760345, 0.02887534908950329, 0.030481655150651932, -0.043650683015584946, 0.08169727772474289, -0.052574917674064636, 0.02406069077551365, -0.015202385373413563, 0.021439213305711746, 0.09306931495666504, 0.13301542401313782, -0.017579687759280205, -0.006809611804783344, 0.03678048402070999, 0.10298417508602142, -0.04449883848428726, -0.010428385809063911, -0.036277301609516144, 0.03576720878481865, 0.04522612318396568, 0.09064503759145737, 0.03591258078813553, -5.280853798694807e-8, -0.07851295173168182, -0.0868515595793724, -0.09853029251098633, -0.0038027188275009394, -0.009892359375953674, -0.0378156378865242, -0.031200045719742775, 0.02889714017510414, 0.03226698189973831, 0.013702078722417355, 0.04565717652440071, -0.025704866275191307, -0.08856216818094254, -0.018861761316657066, -0.058662936091423035, -0.014968092553317547, -0.06739992648363113, 0.034425038844347, 0.02274353615939617, -0.07542767375707626, 0.03627730906009674, 0.061630528420209885, 0.042007215321063995, -0.023130852729082108, -0.05371667817234993, -0.027596984058618546, -0.05871362239122391, -0.0054816389456391335, -0.07795468717813492, -0.02245825156569481, 0.06220495328307152, -0.045004166662693024, 0.05130801722407341, 0.023342611268162727, 0.08568567037582397, 0.05363005772233009, 0.08837912976741791, 0.017717642709612846, -0.0024966581258922815, 0.0031498437747359276, 0.023645617067813873, -0.059494536370038986, -0.06530696898698807, 0.009989544749259949, 0.05627240985631943, -0.05071863532066345, -0.024486564099788666, 0.016385765746235847, -0.020288972184062004, -0.1018121987581253, -0.0103744026273489, 0.009959378279745579, -0.00739864120259881, 0.04898443445563316, 0.027293747290968895, 0.04812346398830414, 0.005684071220457554, -0.014108537696301937, 0.05894911661744118, 0.06146296486258507, -0.023456623777747154, 0.07988249510526657, -0.004385457839816809, 0.02262887731194496 ]
0.144533
a bot ID manually\*\* 并粘贴你的 Azure Bot App ID 5. 勾选范围:\*\*Personal\*\*、\*\*Team\*\*、\*\*Group Chat\*\* 6. 点击 \*\*Distribute\*\* → \*\*Download app package\*\* 7. 在 Teams 中:\*\*Apps\*\* → \*\*Manage your apps\*\* → \*\*Upload a custom app\*\* → 选择 ZIP 这通常比手动编辑 JSON 清单更容易。 ## 测试机器人 \*\*选项 A:Azure Web Chat(先验证 webhook)\*\* 1. 在 Azure 门户 → 你的 Azure Bot 资源 → \*\*Test in Web Chat\*\* 2. 发送一条消息 - 你应该看到响应 3. 这确认你的 webhook 端点在 Teams 设置之前正常工作 \*\*选项 B:Teams(应用安装后)\*\* 1. 安装 Teams 应用(侧载或组织目录) 2. 在 Teams 中找到机器人并发送私信 3. 检查 Gateway 网关日志中的传入活动 ## 设置(最小纯文本) 1. \*\*安装 Microsoft Teams 插件\*\* - 从 npm:`openclaw plugins install @openclaw/msteams` - 从本地检出:`openclaw plugins install ./extensions/msteams` 2. \*\*机器人注册\*\* - 创建一个 Azure Bot(见上文)并记录: - App ID - 客户端密钥(App password) - 租户 ID(单租户) 3. \*\*Teams 应用清单\*\* - 包含一个 `bot` 条目,其中 `botId = `。 - 范围:`personal`、`team`、`groupChat`。 - `supportsFiles: true`(个人范围文件处理所需)。 - 添加 RSC 权限(见下文)。 - 创建图标:`outline.png`(32x32)和 `color.png`(192x192)。 - 将三个文件一起打包:`manifest.json`、`outline.png`、`color.png`。 4. \*\*配置 OpenClaw\*\* ```json { "msteams": { "enabled": true, "appId": "", "appPassword": "", "tenantId": "", "webhook": { "port": 3978, "path": "/api/messages" } } } ``` 你也可以使用环境变量代替配置键: - `MSTEAMS\_APP\_ID` - `MSTEAMS\_APP\_PASSWORD` - `MSTEAMS\_TENANT\_ID` 5. \*\*机器人端点\*\* - 将 Azure Bot Messaging Endpoint 设置为: - `https://:3978/api/messages`(或你选择的路径/端口)。 6. \*\*运行 Gateway 网关\*\* - 当插件已安装且 `msteams` 配置存在并有凭证时,Teams 渠道会自动启动。 ## 历史上下文 - `channels.msteams.historyLimit` 控制将多少条最近的频道/群组消息包含到提示中。 - 回退到 `messages.groupChat.historyLimit`。设置 `0` 禁用(默认 50)。 - 私信历史可以通过 `channels.msteams.dmHistoryLimit`(用户轮次)限制。每用户覆盖:`channels.msteams.dms[""].historyLimit`。 ## 当前 Teams RSC 权限(清单) 这些是我们 Teams 应用清单中\*\*现有的 resourceSpecific 权限\*\*。它们仅适用于安装了应用的团队/聊天内部。 \*\*对于频道(团队范围):\*\* - `ChannelMessage.Read.Group`(Application)- 无需 @提及即可接收所有频道消息 - `ChannelMessage.Send.Group`(Application) - `Member.Read.Group`(Application) - `Owner.Read.Group`(Application) - `ChannelSettings.Read.Group`(Application) - `TeamMember.Read.Group`(Application) - `TeamSettings.Read.Group`(Application) \*\*对于群聊:\*\* - `ChatMessage.Read.Chat`(Application)- 无需 @提及即可接收所有群聊消息 ## Teams 清单示例(已脱敏) 包含必需字段的最小有效示例。请替换 ID 和 URL。 ```json { "$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.23/MicrosoftTeams.schema.json", "manifestVersion": "1.23", "version": "1.0.0", "id": "00000000-0000-0000-0000-000000000000", "name": { "short": "OpenClaw" }, "developer": { "name": "Your Org", "websiteUrl": "https://example.com", "privacyUrl": "https://example.com/privacy", "termsOfUseUrl": "https://example.com/terms" }, "description": { "short": "OpenClaw in Teams", "full": "OpenClaw in Teams" }, "icons": { "outline": "outline.png", "color": "color.png" }, "accentColor": "#5B6DEF", "bots": [ { "botId": "11111111-1111-1111-1111-111111111111", "scopes": ["personal", "team", "groupChat"], "isNotificationOnly": false, "supportsCalling": false, "supportsVideo": false, "supportsFiles": true } ], "webApplicationInfo": { "id": "11111111-1111-1111-1111-111111111111" }, "authorization": { "permissions": { "resourceSpecific": [ { "name": "ChannelMessage.Read.Group", "type": "Application" }, { "name": "ChannelMessage.Send.Group", "type": "Application" }, { "name": "Member.Read.Group", "type": "Application" }, { "name": "Owner.Read.Group", "type": "Application" }, { "name": "ChannelSettings.Read.Group", "type": "Application" }, { "name": "TeamMember.Read.Group", "type": "Application" }, { "name": "TeamSettings.Read.Group", "type": "Application" }, { "name": "ChatMessage.Read.Chat", "type": "Application" } ] } } } ``` ### 清单注意事项(必填字段) - `bots[].botId` \*\*必须\*\*与 Azure Bot App ID 匹配。 - `webApplicationInfo.id` \*\*必须\*\*与 Azure Bot App ID 匹配。 - `bots[].scopes` 必须包含你计划使用的界面(`personal`、`team`、`groupChat`)。 - `bots[].supportsFiles: true` 是个人范围文件处理所需的。 - `authorization.permissions.resourceSpecific` 如果你需要频道流量,必须包含频道读取/发送权限。 ### 更新现有应用 要更新已安装的 Teams 应用(例如,添加 RSC 权限): 1. 使用新设置更新你的 `manifest.json` 2. \*\*增加 `version` 字段\*\*(例如,`1.0.0` → `1.1.0`) 3. \*\*重新打包\*\*清单和图标(`manifest.json`、`outline.png`、`color.png`) 4. 上传新的 zip: - \*\*选项 A(Teams 管理中心):\*\* Teams 管理中心 → Teams apps → Manage apps → 找到你的应用 → Upload new version - \*\*选项 B(侧载):\*\* 在 Teams 中 → Apps → Manage your apps → Upload a custom app 5. \*\*对于团队频道:\*\* 在每个团队中重新安装应用以使新权限生效 6. \*\*完全退出并重新启动 Teams\*\*(不仅仅是关闭窗口)以清除缓存的应用元数据 ## 功能:仅 RSC 与 Graph ### 仅使用 \*\*Teams RSC\*\*(应用已安装,无 Graph API 权限) 可用: - 读取频道消息\*\*文本\*\*内容。 - 发送频道消息\*\*文本\*\*内容。 - 接收\*\*个人(私信)\*\*文件附件。 不可用: - 频道/群组\*\*图片或文件内容\*\*(负载仅包含 HTML 存根)。 - 下载存储在 SharePoint/OneDrive 中的附件。 - 读取消息历史(超出实时 webhook 事件)。 ### 使用 \*\*Teams RSC + Microsoft Graph Application 权限\*\* 增加: - 下载托管内容(粘贴到消息中的图片)。 - 下载存储在 SharePoint/OneDrive 中的文件附件。 - 通过 Graph 读取频道/聊天消息历史。 ### RSC 与 Graph API 对比 | 功能 | RSC 权限 | Graph API | | -------------- | ------------------ | ------------------------- | | \*\*实时消息\*\* | 是(通过 webhook) | 否(仅轮询) | | \*\*历史消息\*\* | 否 | 是(可查询历史) | | \*\*设置复杂度\*\* | 仅应用清单 | 需要管理员同意 + 令牌流程 | | \*\*离线工作\*\* | 否(必须运行) | 是(随时查询) | \*\*结论:\*\* RSC 用于实时监听;Graph API 用于历史访问。要在离线时补上错过的消息,你需要带有 `ChannelMessage.Read.All` 的 Graph API(需要管理员同意)。 ## 启用 Graph 的媒体 + 历史(频道所需) 如果你需要\*\*频道\*\*中的图片/文件或想要获取\*\*消息历史\*\*,你必须启用 Microsoft Graph 权限并授予管理员同意。 1. 在 Entra ID(Azure AD)\*\*App Registration\*\* 中,添加 Microsoft Graph \*\*Application 权限\*\*:
https://github.com/openclaw/openclaw/blob/main//docs/zh-CN/channels/msteams.md
main
opebclaw
[ -0.0954347774386406, 0.023191820830106735, -0.028220780193805695, -0.04973871633410454, -0.0007228410104289651, 0.0054396577179431915, 0.0834401473402977, -0.05791417509317398, 0.03723224252462387, 0.10407082736492157, 0.12399381399154663, -0.11042023450136185, 0.10430832207202911, 0.026253756135702133, 0.09367750585079193, 0.048275843262672424, -0.032459236681461334, -0.04317576065659523, -0.06462780386209488, -0.03845062851905823, -0.03452659770846367, -0.02197195589542389, -0.010619299486279488, -0.004971741233021021, 0.004725371953099966, -0.065009206533432, -0.07710572332143784, 0.06125452741980553, -0.005206683184951544, -0.03212074562907219, -0.053266026079654694, 0.06450382620096207, 0.03948167711496353, 0.08128365874290466, 0.1369895040988922, 0.024786489084362984, -0.010153288953006268, -0.005468990653753281, -0.007706219330430031, 0.03705431520938873, 0.015688933432102203, -0.006959635764360428, -0.0004405400832183659, 0.001396278734318912, 0.005263392813503742, 0.04132278636097908, -0.07621560245752335, 0.036508817225694656, -0.0495828315615654, 0.06329916417598724, -0.08065581321716309, -0.007746930234134197, 0.0004125201085116714, 0.08627822250127792, -0.01021711714565754, 0.019706565886735916, 0.0016834971029311419, 0.025580501183867455, 0.05918790400028229, -0.012049896642565727, 0.015907717868685722, -0.0478203184902668, 0.016601135954260826, 0.02256390079855919, -0.059606872498989105, 0.027591265738010406, -0.07237059623003006, -0.012562116608023643, -0.023720717057585716, -0.023920422419905663, -0.031911469995975494, 0.027193542569875717, -0.08837700635194778, 0.022967755794525146, -0.04265348240733147, -0.004617441911250353, 0.013339442200958729, 0.015735752880573273, -0.06889235973358154, -0.04078361392021179, -0.05482584983110428, -0.0037840334698557854, 0.0924236997961998, 0.07657454162836075, -0.08224882185459137, 0.06924223899841309, -0.05294245481491089, -0.0266344603151083, 0.017464473843574524, 0.02238723263144493, -0.0376335047185421, 0.024887505918741226, 0.10967683792114258, 0.02159762941300869, -0.0012425349559634924, -0.032399315387010574, 0.017879966646432877, 0.029557356610894203, -0.03620973974466324, 0.03664252907037735, 0.012997663579881191, -0.03427969291806221, -0.0595347061753273, -0.08582720905542374, 0.00577680254355073, -0.04723186418414116, 0.0045980229042470455, -0.014657281339168549, 0.07969377189874649, 0.03600401431322098, -0.09178069978952408, -0.0405166931450367, -0.0026160895358771086, -0.10119645297527313, -0.0218859501183033, 0.05870198458433151, 0.02552727423608303, 0.07905082404613495, -0.010985764674842358, 0.01639995537698269, 0.12360797822475433, -0.0412667877972126, -0.059390660375356674, -0.08446067571640015, 0.016520662233233452, -0.011197134852409363, 0.08253421634435654, -8.456152793155328e-34, 0.05133068934082985, -0.008967233821749687, -0.050483353435993195, -0.003339904360473156, 0.07404321432113647, -0.06527013331651688, 0.05668926611542702, -0.011080056428909302, -0.08691073954105377, -0.07601293921470642, -0.09330155700445175, 0.004648388829082251, -0.03944395110011101, 0.04309457540512085, 0.0024616813752800226, -0.005830403417348862, 0.01624378189444542, 0.04174928367137909, 0.07325445115566254, 0.02950594574213028, 0.043635863810777664, -0.01147919986397028, 0.029362142086029053, -0.00726656150072813, -0.03068099170923233, 0.0882333442568779, 0.05936477705836296, -0.018745437264442444, 0.04762434586882591, 0.012822977267205715, 0.006285122595727444, -0.0019647255539894104, -0.08189833164215088, 0.047961264848709106, -0.02641209214925766, -0.015446210280060768, -0.04541914537549019, 0.024083735421299934, -0.04873747006058693, 0.04004815220832825, -0.03946471959352493, -0.03600266948342323, -0.06448867917060852, -0.021845901384949684, 0.025142330676317215, -0.044707026332616806, -0.08336804062128067, -0.12675894796848297, 0.069412000477314, -0.07147379964590073, -0.06538163125514984, 0.053901951760053635, -0.006780048366636038, 0.039393309503793716, 0.002555888844653964, -0.1213122233748436, 0.007296095602214336, -0.028790287673473358, -0.08417712152004242, -0.034699276089668274, 0.005159779917448759, -0.052238527685403824, -0.04485432431101799, 0.06540041416883469, 0.05885583162307739, -0.01742115058004856, 0.06948469579219818, -0.05609622970223427, 0.04540497809648514, -0.058162443339824677, -0.006210735999047756, -0.021506020799279213, 0.09910830855369568, 0.020813770592212677, -0.09268753230571747, -0.04618976265192032, 0.0025239211972802877, 0.04018307104706764, -0.011809865944087505, -0.034933216869831085, -0.061860691756010056, -0.06440907716751099, -0.04175052046775818, -0.022284431383013725, -0.11222271621227264, 0.03919514641165733, 0.03186728432774544, -0.006451315246522427, -0.01837327517569065, 0.016991272568702698, -0.138274684548378, 0.01092718169093132, -0.005981848109513521, -0.0348493866622448, -0.08325543999671936, -2.9002114374304184e-33, -0.03751688450574875, 0.06999831646680832, -0.06847995519638062, -0.0022477037273347378, 0.04436429217457771, -0.04138264060020447, 0.12241377681493759, 0.056636106222867966, 0.051323357969522476, 0.07674660533666611, -0.030864868313074112, -0.014731681905686855, -0.011971136555075645, 0.060674797743558884, 0.019014764577150345, 0.08413201570510864, 0.04757499694824219, 0.00207816855981946, -0.03530343621969223, -0.007355721201747656, -0.03570995479822159, 0.027594778686761856, -0.10613743215799332, 0.03158543258905411, 0.0530845932662487, -0.02281496673822403, -0.007167596835643053, -0.029036032035946846, 0.02600708045065403, -0.01827206090092659, 0.022429194301366806, 0.01393547561019659, -0.11154497414827347, 0.03081425465643406, -0.015320701524615288, -0.05979602411389351, -0.04782392084598541, 0.03948431462049484, -0.02913549542427063, 0.02109496481716633, 0.05774538218975067, -0.10373731702566147, -0.06740885972976685, 0.0016124018002301455, 0.054736070334911346, 0.010562332347035408, -0.04681112989783287, -0.061508674174547195, -0.06552979350090027, 0.05878373980522156, 0.04570591822266579, 0.054671429097652435, -0.007916297763586044, -0.008139178156852722, -0.02145550027489662, 0.020036475732922554, 0.05177805945277214, -0.02418585680425167, -0.0712565928697586, -0.08462156355381012, 0.03994857892394066, -0.014290481805801392, -0.02431415393948555, 0.04876907169818878, 0.013046544045209885, 0.058644022792577744, -0.0024230321869254112, 0.04728392884135246, -0.030352190136909485, -0.07375506311655045, -0.03620174527168274, 0.01377936452627182, -0.03633587807416916, -0.027447067201137543, 0.002044071676209569, -0.005505638662725687, -0.018188899382948875, 0.03531559184193611, 0.010392832569777966, 0.019045554101467133, -0.04239446297287941, 0.06402802467346191, 0.058002643287181854, 0.11056506633758545, -0.0326230488717556, -0.0404047816991806, 0.05819094926118851, 0.08779829740524292, -0.058286916464567184, 0.03558739274740219, -0.03747696802020073, 0.012626065872609615, 0.003390433033928275, 0.045472852885723114, -0.011253634467720985, -4.180773416351258e-8, 0.002752633299678564, -0.07427165657281876, -0.03424616903066635, 0.000855075370054692, -0.006823659408837557, 0.006554581690579653, -0.04768870770931244, 0.040762368589639664, 0.08135812729597092, -0.013171433471143246, -0.0659496858716011, 0.0010511439759284258, -0.050744134932756424, 0.03161105886101723, -0.026712173596024513, 0.016839124262332916, -0.07513629645109177, 0.045618098229169846, 0.02124573476612568, -0.10258806496858597, 0.012851051054894924, 0.04121861606836319, -0.005620655603706837, -0.025970157235860825, -0.034020330756902695, 0.04068389907479286, -0.06227215752005577, 0.007524437271058559, -0.09237109124660492, -0.02022230625152588, 0.015574824996292591, -0.031754087656736374, -0.012209790758788586, -0.05770811811089516, 0.03670300915837288, 0.06542288511991501, 0.0004586380673572421, -0.05725770443677902, 0.02383539453148842, 0.0492301769554615, -0.012229790911078453, -0.024473942816257477, 0.000649825728032738, 0.0055730086751282215, 0.07903400808572769, -0.09108977764844894, -0.03407558053731918, -0.0924229621887207, 0.038468144834041595, -0.011480841785669327, -0.044819556176662445, -0.017796393483877182, 0.04032176360487938, -0.005460328888148069, 0.031044943258166313, 0.05491194501519203, 0.020219944417476654, -0.08359692245721817, 0.05265354737639427, 0.1236458420753479, 0.07578307390213013, 0.08383864164352417, 0.02905377745628357, -0.014468506909906864 ]
0.109103
否 | 是(可查询历史) | | \*\*设置复杂度\*\* | 仅应用清单 | 需要管理员同意 + 令牌流程 | | \*\*离线工作\*\* | 否(必须运行) | 是(随时查询) | \*\*结论:\*\* RSC 用于实时监听;Graph API 用于历史访问。要在离线时补上错过的消息,你需要带有 `ChannelMessage.Read.All` 的 Graph API(需要管理员同意)。 ## 启用 Graph 的媒体 + 历史(频道所需) 如果你需要\*\*频道\*\*中的图片/文件或想要获取\*\*消息历史\*\*,你必须启用 Microsoft Graph 权限并授予管理员同意。 1. 在 Entra ID(Azure AD)\*\*App Registration\*\* 中,添加 Microsoft Graph \*\*Application 权限\*\*: - `ChannelMessage.Read.All`(频道附件 + 历史) - `Chat.Read.All` 或 `ChatMessage.Read.All`(群聊) 2. 为租户\*\*授予管理员同意\*\*。 3. 提升 Teams 应用\*\*清单版本\*\*,重新上传,并\*\*在 Teams 中重新安装应用\*\*。 4. \*\*完全退出并重新启动 Teams\*\* 以清除缓存的应用元数据。 ## 已知限制 ### Webhook 超时 Teams 通过 HTTP webhook 传递消息。如果处理时间过长(例如,LLM 响应缓慢),你可能会看到: - Gateway 网关超时 - Teams 重试消息(导致重复) - 丢失的回复 OpenClaw 通过快速返回并主动发送回复来处理这个问题,但非常慢的响应仍可能导致问题。 ### 格式化 Teams markdown 比 Slack 或 Discord 更有限: - 基本格式化有效:\*\*粗体\*\*、\_斜体\_、`代码`、链接 - 复杂的 markdown(表格、嵌套列表)可能无法正确渲染 - 支持 Adaptive Cards 用于投票和任意卡片发送(见下文) ## 配置 关键设置(共享渠道模式见 `/gateway/configuration`): - `channels.msteams.enabled`:启用/禁用渠道。 - `channels.msteams.appId`、`channels.msteams.appPassword`、`channels.msteams.tenantId`:机器人凭证。 - `channels.msteams.webhook.port`(默认 `3978`) - `channels.msteams.webhook.path`(默认 `/api/messages`) - `channels.msteams.dmPolicy`:`pairing | allowlist | open | disabled`(默认:pairing) - `channels.msteams.allowFrom`:私信允许列表(AAD 对象 ID、UPN 或显示名称)。当 Graph 访问可用时,向导在设置期间将名称解析为 ID。 - `channels.msteams.textChunkLimit`:出站文本分块大小。 - `channels.msteams.chunkMode`:`length`(默认)或 `newline` 在长度分块之前按空行(段落边界)分割。 - `channels.msteams.mediaAllowHosts`:入站附件主机允许列表(默认为 Microsoft/Teams 域名)。 - `channels.msteams.mediaAuthAllowHosts`:在媒体重试时附加 Authorization 头的允许列表(默认为 Graph + Bot Framework 主机)。 - `channels.msteams.requireMention`:在频道/群组中需要 @提及(默认 true)。 - `channels.msteams.replyStyle`:`thread | top-level`(见[回复样式](#reply-style-threads-vs-posts))。 - `channels.msteams.teams..replyStyle`:每团队覆盖。 - `channels.msteams.teams..requireMention`:每团队覆盖。 - `channels.msteams.teams..tools`:当缺少频道覆盖时使用的默认每团队工具策略覆盖(`allow`/`deny`/`alsoAllow`)。 - `channels.msteams.teams..toolsBySender`:默认每团队每发送者工具策略覆盖(支持 `"\*"` 通配符)。 - `channels.msteams.teams..channels..replyStyle`:每频道覆盖。 - `channels.msteams.teams..channels..requireMention`:每频道覆盖。 - `channels.msteams.teams..channels..tools`:每频道工具策略覆盖(`allow`/`deny`/`alsoAllow`)。 - `channels.msteams.teams..channels..toolsBySender`:每频道每发送者工具策略覆盖(支持 `"\*"` 通配符)。 - `channels.msteams.sharePointSiteId`:用于群聊/频道文件上传的 SharePoint 站点 ID(见[在群聊中发送文件](#sending-files-in-group-chats))。 ## 路由和会话 - 会话键遵循标准智能体格式(见 [/concepts/session](/concepts/session)): - 私信共享主会话(`agent::`)。 - 频道/群组消息使用会话 ID: - `agent::msteams:channel:` - `agent::msteams:group:` ## 回复样式:话题 vs 帖子 Teams 最近在相同的底层数据模型上引入了两种频道 UI 样式: | 样式 | 描述 | 推荐的 `replyStyle` | | ----------------------- | ------------------------------ | ------------------- | | \*\*Posts\*\*(经典) | 消息显示为卡片,下方有话题回复 | `thread`(默认) | | \*\*Threads\*\*(类 Slack) | 消息线性流动,更像 Slack | `top-level` | \*\*问题:\*\* Teams API 不暴露频道使用的 UI 样式。如果你使用错误的 `replyStyle`: - 在 Threads 样式频道中使用 `thread` → 回复嵌套显示很别扭 - 在 Posts 样式频道中使用 `top-level` → 回复显示为单独的顶级帖子而不是在话题中 \*\*解决方案:\*\* 根据频道的设置方式为每个频道配置 `replyStyle`: ```json { "msteams": { "replyStyle": "thread", "teams": { "19:abc...@thread.tacv2": { "channels": { "19:xyz...@thread.tacv2": { "replyStyle": "top-level" } } } } } } ``` ## 附件和图片 \*\*当前限制:\*\* - \*\*私信:\*\* 图片和文件附件通过 Teams bot file API 工作。 - \*\*频道/群组:\*\* 附件存储在 M365 存储(SharePoint/OneDrive)中。webhook 负载仅包含 HTML 存根,而非实际文件字节。\*\*需要 Graph API 权限\*\*才能下载频道附件。 没有 Graph 权限,带图片的频道消息将作为纯文本接收(机器人无法访问图片内容)。 默认情况下,OpenClaw 仅从 Microsoft/Teams 主机名下载媒体。使用 `channels.msteams.mediaAllowHosts` 覆盖(使用 `["\*"]` 允许任何主机)。 Authorization 头仅附加到 `channels.msteams.mediaAuthAllowHosts` 中的主机(默认为 Graph + Bot Framework 主机)。保持此列表严格(避免多租户后缀)。 ## 在群聊中发送文件 机器人可以使用 FileConsentCard 流程在私信中发送文件(内置)。但是,\*\*在群聊/频道中发送文件\*\*需要额外设置: | 上下文 | 文件发送方式 | 所需设置 | | ---------------------- | --------------------------------------- | ------------------------------------ | | \*\*私信\*\* | FileConsentCard → 用户接受 → 机器人上传 | 开箱即用 | | \*\*群聊/频道\*\* | 上传到 SharePoint → 共享链接 | 需要 `sharePointSiteId` + Graph 权限 | | \*\*图片(任何上下文)\*\* | Base64 编码内联 | 开箱即用 | ### 为什么群聊需要 SharePoint 机器人没有个人 OneDrive 驱动器(`/me/drive` Graph API 端点对应用程序身份不起作用)。要在群聊/频道中发送文件,机器人上传到 \*\*SharePoint 站点\*\*并创建共享链接。 ### 设置 1. \*\*在 Entra ID(Azure AD)→ App Registration 中添加 Graph API 权限\*\*: - `Sites.ReadWrite.All`(Application)- 上传文件到 SharePoint - `Chat.Read.All`(Application)- 可选,启用每用户共享链接 2. 为租户\*\*授予管理员同意\*\*。 3. \*\*获取你的 SharePoint 站点 ID:\*\* ```bash # 通过 Graph Explorer 或带有效令牌的 curl: curl -H "Authorization: Bearer $TOKEN" \ "https://graph.microsoft.com/v1.0/sites/{hostname}:/{site-path}" # 示例:对于 "contoso.sharepoint.com/sites/BotFiles" 的站点 curl -H "Authorization: Bearer $TOKEN" \ "https://graph.microsoft.com/v1.0/sites/contoso.sharepoint.com:/sites/BotFiles" # 响应包含:"id": "contoso.sharepoint.com,guid1,guid2" ``` 4. \*\*配置 OpenClaw:\*\* ```json5 { channels: { msteams: { // ... 其他配置 ... sharePointSiteId: "contoso.sharepoint.com,guid1,guid2", }, }, } ``` ### 共享行为 | 权限 | 共享行为 | | --------------------------------------- | ------------------------------------------ | | 仅 `Sites.ReadWrite.All` | 组织范围共享链接(组织中任何人都可以访问) | | `Sites.ReadWrite.All` + `Chat.Read.All` | 每用户共享链接(仅聊天成员可以访问) | 每用户共享更安全,因为只有聊天参与者才能访问文件。如果缺少 `Chat.Read.All` 权限,机器人回退到组织范围共享。 ### 回退行为 | 场景 | 结果 | | --------------------------------------- | ------------------------------------------------ | | 群聊 + 文件 + 已配置 `sharePointSiteId` | 上传到 SharePoint,发送共享链接 | | 群聊 + 文件 + 无 `sharePointSiteId` | 尝试 OneDrive 上传(可能失败),仅发送文本 | | 个人聊天 + 文件 | FileConsentCard 流程(无需 SharePoint 即可工作) | | 任何上下文 + 图片 | Base64 编码内联(无需 SharePoint 即可工作) | ### 文件存储位置 上传的文件存储在配置的 SharePoint 站点默认文档库中的 `/OpenClawShared/` 文件夹中。 ## 投票(Adaptive Cards) OpenClaw 将 Teams 投票作为 Adaptive Cards 发送(没有原生 Teams 投票 API)。 - CLI:`openclaw message poll --channel msteams --target conversation: ...` - 投票由 Gateway 网关记录在 `~/.openclaw/msteams-polls.json` 中。 - Gateway 网关必须保持在线才能记录投票。 - 投票尚不自动发布结果摘要(如需要请检查存储文件)。 ## Adaptive Cards(任意) 使用 `message`
https://github.com/openclaw/openclaw/blob/main//docs/zh-CN/channels/msteams.md
main
opebclaw
[ -0.08712512999773026, 0.017238371074199677, -0.04572270065546036, -0.08455313742160797, -0.0026887734420597553, -0.03460129350423813, 0.02488337643444538, 0.028494827449321747, 0.009201574139297009, 0.011291978880763054, 0.13503624498844147, -0.043886203318834305, 0.08912128210067749, 0.0609641969203949, 0.08407483994960785, 0.06945424526929855, -0.06940891593694687, -0.01436499785631895, -0.006405990105122328, -0.00926706101745367, 0.028888599947094917, -0.07687841355800629, -0.034356918185949326, -0.04676579311490059, 0.058950673788785934, -0.024631360545754433, -0.010638338513672352, 0.05218607559800148, 0.03870358690619469, -0.02013075165450573, -0.05205472186207771, 0.07969219237565994, 0.009096446447074413, 0.04619678854942322, 0.03536367416381836, 0.03824695199728012, -0.021969253197312355, -0.022848688066005707, 0.00841772835701704, 0.010699641890823841, -0.0025123797822743654, 0.004837819840759039, -0.0032746349461376667, -0.028766611590981483, 0.029688768088817596, -0.0016639137174934149, -0.10491630434989929, 0.0520235113799572, -0.06865323334932327, -0.002941695274785161, -0.07385670393705368, 0.008285271003842354, -0.048470981419086456, 0.014004766941070557, 0.02686714008450508, -0.004148019943386316, -0.01583890989422798, -0.015701862052083015, 0.03460240364074707, 0.005573522299528122, 0.020494315773248672, 0.0026129812467843294, -0.029999541118741035, 0.020797517150640488, -0.029549311846494675, 0.027488647028803825, -0.012309673242270947, -0.003779516089707613, -0.03826358541846275, 0.04747018218040466, -0.025649257004261017, -0.004079093225300312, -0.07227998971939087, 0.03674831986427307, 0.022140856832265854, 0.006512876134365797, 0.023560281842947006, 0.08271373063325882, -0.07033942639827728, -0.1785670816898346, 0.00013706380559597164, 0.038688044995069504, 0.02115185186266899, 0.07180052250623703, -0.0343816913664341, 0.07663064450025558, -0.07207122445106506, -0.04377297684550285, 0.08254960179328918, 0.024304255843162537, -0.010007904842495918, 0.056503526866436005, -0.0326685830950737, 0.0266893170773983, 0.032674193382263184, -0.004891316872090101, 0.039778001606464386, 0.04701049253344536, -0.023861199617385864, 0.003227877663448453, 0.011736758053302765, -0.05361011624336243, -0.0532064326107502, -0.03088265284895897, 0.0001843160280259326, -0.044305019080638885, -0.013643788173794746, 0.01334958616644144, 0.040158793330192566, 0.06449976563453674, -0.05525340884923935, -0.0016349987126886845, 0.04507987201213837, -0.028310678899288177, -0.027275322005152702, 0.03419526666402817, 0.0009531488176435232, -0.04045482352375984, 0.017643969506025314, -0.02112261950969696, 0.02001665160059929, 0.021250860765576363, -0.1006750836968422, -0.044418346136808395, -0.10355743765830994, -0.048268090933561325, 0.07058200985193253, 8.973078155844982e-35, 0.00328361289575696, 0.02651866152882576, -0.012062589637935162, -0.05925089120864868, 0.00711568258702755, -0.014036421664059162, -0.07170392572879791, -0.04184088483452797, -0.05053790286183357, -0.004029370844364166, -0.1164214015007019, 0.07390785962343216, -0.047142043709754944, 0.09819047898054123, -0.01869044452905655, -0.02839774824678898, 0.05900944024324417, 0.001359280664473772, 0.02009063959121704, -0.04092341661453247, 0.038633011281490326, 0.006498089525848627, -0.009485330432653427, 0.024772200733423233, 0.000015779014574945904, 0.11870485544204712, 0.036121588200330734, 0.0159800685942173, 0.041163571178913116, 0.01654229499399662, -0.009233996272087097, -0.020289631560444832, -0.004714053589850664, 0.028441155329346657, -0.04657706990838051, -0.016270430758595467, -0.005314583890140057, -0.014138181693851948, 0.010093527846038342, -0.0262308269739151, -0.055270202457904816, 0.05599053204059601, -0.007400193717330694, -0.053562115877866745, -0.049318887293338776, 0.007173080462962389, -0.05550505220890045, -0.059623610228300095, 0.05286093056201935, -0.0215885192155838, -0.06303078681230545, 0.03290661424398422, -0.0453617163002491, 0.04793974384665489, 0.00036427570739760995, -0.04954145848751068, 0.03708621859550476, 0.000592011958360672, -0.08147600293159485, 0.025712216272950172, 0.005570448935031891, -0.040245041251182556, 0.023778390139341354, 0.006767519284039736, 0.007682399824261665, 0.07720457762479782, -0.056259382516145706, -0.0600142776966095, -0.001952780643478036, -0.07067197561264038, -0.09855049103498459, 0.030825162306427956, 0.020770510658621788, -0.017676938325166702, -0.016336245462298393, -0.07438770681619644, -0.06426200270652771, -0.00040668511064723134, -0.022288456559181213, -0.017536234110593796, -0.1678047627210617, -0.07004044950008392, -0.03983452543616295, -0.014390303753316402, -0.07333235442638397, 0.021123260259628296, 0.07853201776742935, -0.0015162555500864983, 0.0005939342081546783, -0.02514651231467724, -0.0892249122262001, 0.012252725660800934, -0.0033246814273297787, 0.031062915921211243, -0.0025211821775883436, -5.3620733172575285e-33, -0.08848719298839569, 0.05832720175385475, 0.02813214249908924, 0.007666828576475382, -0.051118168979883194, -0.05260210484266281, 0.09547360241413116, 0.0322875902056694, 0.02032245695590973, 0.07455148547887802, 0.01747508905827999, -0.07408851385116577, -0.04940620809793472, 0.02573898807168007, 0.052349235862493515, -0.0009814276127144694, 0.0015057732816785574, 0.06812971830368042, -0.07318192720413208, 0.03775501996278763, -0.00109171646181494, 0.06299009174108505, -0.16802476346492767, 0.004779476672410965, 0.06757082790136337, 0.05491435527801514, 0.017920972779393196, -0.04968620091676712, 0.016476714983582497, -0.008218898437917233, -0.021728292107582092, -0.03523094579577446, -0.0701708048582077, 0.06821083277463913, 0.006227157544344664, -0.038841888308525085, 0.08047537505626678, -0.015622501261532307, -0.05582786351442337, -0.016797730699181557, 0.00998204480856657, -0.025324279442429543, -0.08417536318302155, 0.0016442693304270506, 0.026303628459572792, 0.07702777534723282, -0.028274960815906525, 0.05740518495440483, -0.10387785732746124, 0.004186561796814203, 0.05872276425361633, 0.021559469401836395, 0.03077182173728943, -0.021056903526186943, -0.03891986608505249, -0.01676209643483162, 0.0647149458527565, 0.0029966190923005342, -0.06315341591835022, -0.1366378217935562, -0.007813132368028164, -0.008496133610606194, -0.060298241674900055, 0.0003148953546769917, -0.016600098460912704, 0.03882885351777077, 0.06099780276417732, -0.04089551419019699, 0.005381905473768711, -0.0877518281340599, 0.037412386387586594, 0.05374843254685402, -0.04291636496782303, -0.07080575823783875, 0.06561599671840668, 0.01687869243323803, -0.08400779217481613, 0.05235528200864792, -0.05165737122297287, 0.030711431056261063, -0.06580150872468948, 0.06855059415102005, 0.09862934052944183, 0.13077524304389954, -0.02191617339849472, -0.0228168535977602, -0.04212138429284096, 0.04119940474629402, -0.038458846509456635, 0.03436918556690216, 0.0045150332152843475, 0.0411309115588665, -0.05046907067298889, 0.12552320957183838, 0.023960307240486145, -4.6954426125012105e-8, -0.07677698135375977, -0.04576506093144417, -0.043028559535741806, -0.09695490449666977, -0.03631610795855522, -0.02265230193734169, 0.04232868552207947, 0.01812056452035904, 0.056065380573272705, -0.0015335162170231342, 0.014937336556613445, 0.0030023620929569006, -0.11800500750541687, 0.002603965112939477, -0.061037663370370865, -0.017936181277036667, -0.02925463765859604, 0.01272315252572298, 0.025094732642173767, -0.07803136110305786, -0.05903603136539459, 0.009944552555680275, -0.024437926709651947, 0.017007984220981598, -0.05339505523443222, -0.06157217547297478, -0.08220028877258301, 0.020177362486720085, -0.050221577286720276, -0.029018666595220566, -0.010030962526798248, -0.0245522428303957, 0.10762856900691986, 0.013425692915916443, 0.018465226516127586, 0.06816699355840683, 0.0788693055510521, -0.02562784031033516, 0.02323395200073719, 0.09249702841043472, 0.019458746537566185, -0.05552397295832634, -0.029309898614883423, 0.006741593591868877, 0.14999324083328247, -0.006824173964560032, 0.07719269394874573, -0.016716673970222473, 0.10970557481050491, -0.02432897686958313, -0.0449141189455986, -0.06041552126407623, -0.005362662486732006, -0.13185521960258484, -0.014047385193407536, 0.0023089975584298372, -0.07908191531896591, -0.042830903083086014, 0.022224659100174904, 0.07880305498838425, 0.03615337237715721, 0.04067942127585411, 0.019066069275140762, -0.05325939133763313 ]
0.100697
Base64 编码内联(无需 SharePoint 即可工作) | ### 文件存储位置 上传的文件存储在配置的 SharePoint 站点默认文档库中的 `/OpenClawShared/` 文件夹中。 ## 投票(Adaptive Cards) OpenClaw 将 Teams 投票作为 Adaptive Cards 发送(没有原生 Teams 投票 API)。 - CLI:`openclaw message poll --channel msteams --target conversation: ...` - 投票由 Gateway 网关记录在 `~/.openclaw/msteams-polls.json` 中。 - Gateway 网关必须保持在线才能记录投票。 - 投票尚不自动发布结果摘要(如需要请检查存储文件)。 ## Adaptive Cards(任意) 使用 `message` 工具或 CLI 向 Teams 用户或会话发送任意 Adaptive Card JSON。 `card` 参数接受 Adaptive Card JSON 对象。当提供 `card` 时,消息文本是可选的。 \*\*智能体工具:\*\* ```json { "action": "send", "channel": "msteams", "target": "user:", "card": { "type": "AdaptiveCard", "version": "1.5", "body": [{ "type": "TextBlock", "text": "Hello!" }] } } ``` \*\*CLI:\*\* ```bash openclaw message send --channel msteams \ --target "conversation:19:abc...@thread.tacv2" \ --card '{"type":"AdaptiveCard","version":"1.5","body":[{"type":"TextBlock","text":"Hello!"}]}' ``` 参见 [Adaptive Cards 文档](https://adaptivecards.io/)了解卡片模式和示例。目标格式详情见下方[目标格式](#target-formats)。 ## 目标格式 MSTeams 目标使用前缀来区分用户和会话: | 目标类型 | 格式 | 示例 | | ----------------- | -------------------------------- | ------------------------------------------------- | | 用户(按 ID) | `user:` | `user:40a1a0ed-4ff2-4164-a219-55518990c197` | | 用户(按名称) | `user:` | `user:John Smith`(需要 Graph API) | | 群组/频道 | `conversation:` | `conversation:19:abc123...@thread.tacv2` | | 群组/频道(原始) | `` | `19:abc123...@thread.tacv2`(如果包含 `@thread`) | \*\*CLI 示例:\*\* ```bash # 按 ID 发送给用户 openclaw message send --channel msteams --target "user:40a1a0ed-..." --message "Hello" # 按显示名称发送给用户(触发 Graph API 查找) openclaw message send --channel msteams --target "user:John Smith" --message "Hello" # 发送到群聊或频道 openclaw message send --channel msteams --target "conversation:19:abc...@thread.tacv2" --message "Hello" # 向会话发送 Adaptive Card openclaw message send --channel msteams --target "conversation:19:abc...@thread.tacv2" \ --card '{"type":"AdaptiveCard","version":"1.5","body":[{"type":"TextBlock","text":"Hello"}]}' ``` \*\*智能体工具示例:\*\* ```json { "action": "send", "channel": "msteams", "target": "user:John Smith", "message": "Hello!" } ``` ```json { "action": "send", "channel": "msteams", "target": "conversation:19:abc...@thread.tacv2", "card": { "type": "AdaptiveCard", "version": "1.5", "body": [{ "type": "TextBlock", "text": "Hello" }] } } ``` 注意:没有 `user:` 前缀时,名称默认解析为群组/团队。按显示名称定位人员时始终使用 `user:`。 ## 主动消息 - 主动消息仅在用户交互\*\*之后\*\*才可能,因为我们在那时存储会话引用。 - 有关 `dmPolicy` 和允许列表控制,请参见 `/gateway/configuration`。 ## 团队和频道 ID(常见陷阱) Teams URL 中的 `groupId` 查询参数\*\*不是\*\*用于配置的团队 ID。请从 URL 路径中提取 ID: \*\*团队 URL:\*\* ``` https://teams.microsoft.com/l/team/19%3ABk4j...%40thread.tacv2/conversations?groupId=... └────────────────────────────┘ 团队 ID(URL 解码此部分) ``` \*\*频道 URL:\*\* ``` https://teams.microsoft.com/l/channel/19%3A15bc...%40thread.tacv2/ChannelName?groupId=... └─────────────────────────┘ 频道 ID(URL 解码此部分) ``` \*\*用于配置:\*\* - 团队 ID = `/team/` 后的路径段(URL 解码,例如 `19:Bk4j...@thread.tacv2`) - 频道 ID = `/channel/` 后的路径段(URL 解码) - \*\*忽略\*\* `groupId` 查询参数 ## 私有频道 机器人在私有频道中的支持有限: | 功能 | 标准频道 | 私有频道 | | ------------------- | -------- | ---------------- | | 机器人安装 | 是 | 有限 | | 实时消息(webhook) | 是 | 可能不工作 | | RSC 权限 | 是 | 行为可能不同 | | @提及 | 是 | 如果机器人可访问 | | Graph API 历史 | 是 | 是(有权限) | \*\*如果私有频道不工作的变通方法:\*\* 1. 使用标准频道进行机器人交互 2. 使用私信 - 用户始终可以直接给机器人发消息 3. 使用 Graph API 进行历史访问(需要 `ChannelMessage.Read.All`) ## 故障排除 ### 常见问题 - \*\*频道中图片不显示:\*\* 缺少 Graph 权限或管理员同意。重新安装 Teams 应用并完全退出/重新打开 Teams。 - \*\*频道中无响应:\*\* 默认需要提及;设置 `channels.msteams.requireMention=false` 或按团队/频道配置。 - \*\*版本不匹配(Teams 仍显示旧清单):\*\* 移除 + 重新添加应用并完全退出 Teams 以刷新。 - \*\*来自 webhook 的 401 Unauthorized:\*\* 在没有 Azure JWT 的情况下手动测试时属于预期情况 - 意味着端点可达但认证失败。使用 Azure Web Chat 正确测试。 ### 清单上传错误 - \*\*"Icon file cannot be empty":\*\* 清单引用的图标文件为 0 字节。创建有效的 PNG 图标(`outline.png` 为 32x32,`color.png` 为 192x192)。 - \*\*"webApplicationInfo.Id already in use":\*\* 应用仍安装在另一个团队/聊天中。先找到并卸载它,或等待 5-10 分钟让其传播。 - \*\*上传时"Something went wrong":\*\* 改为通过 https://admin.teams.microsoft.com 上传,打开浏览器 DevTools(F12)→ Network 选项卡,检查响应正文中的实际错误。 - \*\*侧载失败:\*\* 尝试"Upload an app to your org's app catalog"而不是"Upload a custom app" - 这通常可以绕过侧载限制。 ### RSC 权限不工作 1. 验证 `webApplicationInfo.id` 与你的机器人 App ID 完全匹配 2. 重新上传应用并在团队/聊天中重新安装 3. 检查你的组织管理员是否阻止了 RSC 权限 4. 确认你使用的是正确的范围:团队使用 `ChannelMessage.Read.Group`,群聊使用 `ChatMessage.Read.Chat` ## 参考资料 - [创建 Azure Bot](https://learn.microsoft.com/en-us/azure/bot-service/bot-service-quickstart-registration) - Azure Bot 设置指南 - [Teams 开发者门户](https://dev.teams.microsoft.com/apps) - 创建/管理 Teams 应用 - [Teams 应用清单模式](https://learn.microsoft.com/en-us/microsoftteams/platform/resources/schema/manifest-schema) - [使用 RSC 接收频道消息](https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/conversations/channel-messages-with-rsc) - [RSC 权限参考](https://learn.microsoft.com/en-us/microsoftteams/platform/graph-api/rsc/resource-specific-consent) - [Teams 机器人文件处理](https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/bots-filesv4)(频道/群组需要 Graph) - [主动消息](https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/conversations/send-proactive-messages)
https://github.com/openclaw/openclaw/blob/main//docs/zh-CN/channels/msteams.md
main
opebclaw
[ -0.0289497971534729, 0.0007966517005115747, -0.08891195803880692, -0.020514866337180138, -0.005637232214212418, -0.07204386591911316, -0.029861995950341225, -0.006404770538210869, 0.04673897102475166, -0.0839235708117485, 0.07700887322425842, -0.021561242640018463, 0.044701457023620605, -0.022164223715662956, 0.09772808104753494, 0.043844662606716156, -0.018999144434928894, -0.02171703800559044, 0.02351752109825611, 0.026067281141877174, -0.02889968641102314, 0.023726828396320343, 0.01583859883248806, 0.012382002547383308, 0.013870998285710812, -0.044261690229177475, -0.0977703407406807, 0.10875816643238068, 0.002286307280883193, -0.005546738393604755, 0.03433362394571304, 0.10190252959728241, 0.06746502220630646, 0.05346840247511864, 0.08096866309642792, -0.009343639947474003, 0.03235137462615967, -0.05921122431755066, -0.051115863025188446, 0.01455252431333065, -0.0365278460085392, -0.0023622175212949514, -0.029728690162301064, -0.015906870365142822, -0.02509322017431259, -0.03920530900359154, -0.06288252025842667, -0.011831792071461678, -0.11345110833644867, 0.04805401340126991, -0.10487634688615799, -0.0760507583618164, -0.028821876272559166, 0.00247741537168622, 0.02976531721651554, 0.006479685194790363, -0.14949172735214233, 0.048652950674295425, 0.017710695043206215, 0.00536961667239666, 0.06163586676120758, -0.022904550656676292, -0.026823611930012703, 0.043866995722055435, -0.1776948869228363, -0.00047490274300798774, -0.0050400434993207455, 0.03245897218585014, 0.02316734567284584, -0.06856662780046463, -0.040844276547431946, -0.005044163204729557, -0.05089709907770157, 0.029357759281992912, -0.0012199063785374165, 0.11326079815626144, -0.0030723491217941046, -0.011351054534316063, -0.03593234717845917, -0.13305681943893433, -0.11183956265449524, -0.07818669080734253, 0.021398859098553658, 0.026328643783926964, 0.032112084329128265, 0.11257457733154297, -0.03570475056767464, 0.021369952708482742, 0.018177565187215805, -0.048810891807079315, -0.06118372082710266, -0.03755635395646095, 0.023813340812921524, 0.036754533648490906, 0.014865504577755928, 0.0007426600786857307, 0.0059873550198972225, -0.016469191759824753, -0.06999672949314117, 0.058025505393743515, -0.011514794081449509, 0.0015196517342701554, -0.006362351588904858, 0.037343911826610565, -0.05252337083220482, -0.019421810284256935, -0.006505052093416452, 0.10975409299135208, 0.011844850145280361, -0.013327573426067829, -0.03173594921827316, 0.02145799621939659, -0.017162339761853218, -0.1326298862695694, -0.09904827922582626, 0.034459326416254044, -0.06478207558393478, -0.04663235694169998, 0.037502385675907135, 0.06135652959346771, 0.0448356494307518, -0.048972081393003464, -0.07555022090673447, -0.020636430010199547, 0.004576543811708689, -0.004880717024207115, 0.08589828759431839, -2.3079303435739546e-33, 0.03739702329039574, 0.012890411540865898, 0.00977112352848053, 0.010058245621621609, 0.10156328231096268, -0.06307441741228104, 0.03332972899079323, -0.05725827440619469, -0.08952448517084122, -0.0056597162038087845, -0.023641936480998993, 0.051169537007808685, -0.010280545800924301, 0.05014226213097572, 0.03821580484509468, -0.06239625811576843, -0.06262887269258499, 0.03142329677939415, 0.08495420962572098, 0.0070492359809577465, -0.0005556209362111986, 0.038709454238414764, 0.03037000261247158, -0.025639338418841362, 0.016282478347420692, 0.0916667953133583, -0.006893581710755825, -0.039140164852142334, 0.053702596575021744, 0.04228201135993004, 0.061311688274145126, -0.06851605325937271, -0.056651853024959564, -0.030534859746694565, 0.008787328377366066, -0.03708014637231827, -0.027908669784665108, -0.03207704424858093, -0.10093673318624496, -0.010406233370304108, 0.019631026312708855, -0.004008669871836901, -0.07536498457193375, -0.04669738560914993, 0.0021374954376369715, -0.057599518448114395, -0.08097393065690994, -0.04449426010251045, 0.05530192703008652, -0.03456682339310646, -0.049826446920633316, 0.016443956643342972, -0.016056949272751808, 0.01981014385819435, 0.01801583729684353, -0.12066636234521866, -0.028946764767169952, 0.05208100751042366, -0.07116538286209106, -0.060591764748096466, -0.009077917784452438, 0.018153153359889984, 0.010585797019302845, -0.023087769746780396, 0.12590335309505463, 0.013758216053247452, 0.021498240530490875, -0.05929733067750931, -0.03982093557715416, -0.028381921350955963, 0.002216143300756812, -0.008954841643571854, 0.027071107178926468, 0.0898330956697464, -0.05969791114330292, -0.038223300129175186, -0.08912236243486404, 0.05281810089945793, 0.03260369971394539, -0.02389010787010193, -0.05261410400271416, -0.013407466001808643, -0.14775842428207397, -0.022882025688886642, -0.022093065083026886, 0.059523727744817734, 0.04695245623588562, -0.038940057158470154, -0.013637117110192776, 0.07492401450872421, -0.05091438442468643, 0.035325221717357635, -0.03232124075293541, 0.018695317208766937, -0.04041775315999985, -2.9985995799102746e-33, -0.07812432944774628, 0.0030907439067959785, -0.010168040171265602, 0.03746873512864113, -0.011544901877641678, -0.04192560911178589, 0.0727568045258522, 0.017212064936757088, 0.07187973707914352, 0.013818668201565742, -0.061168916523456573, 0.01907495968043804, -0.026228144764900208, -0.018176184967160225, 0.017709821462631226, -0.04564182087779045, -0.023684704676270485, -0.007081571966409683, 0.012042015790939331, 0.014538588933646679, -0.018884388729929924, 0.056528497487306595, -0.08458178490400314, 0.08864955604076385, 0.035533927381038666, 0.01665533147752285, 0.0008186351042240858, 0.012639479711651802, 0.0288898516446352, -0.07334034889936447, 0.0005475208163261414, 0.004483596887439489, -0.050232116132974625, 0.07007905095815659, 0.025991303846240044, -0.01714014634490013, 0.026982806622982025, 0.04774397611618042, 0.042064763605594635, -0.028542857617139816, 0.07047474384307861, -0.06554119288921356, -0.07520347833633423, -0.015375372022390366, 0.02463974989950657, -0.026202304288744926, -0.030184630304574966, -0.0237315334379673, -0.04979778826236725, -0.036544445902109146, 0.06018071994185448, -0.010864732787013054, -0.0032166962046176195, -0.06500036269426346, 0.0030282537918537855, 0.05149628594517708, 0.026829522103071213, -0.05227327719330788, -0.014381726272404194, -0.10302317887544632, 0.041758302599191666, -0.058101121336221695, -0.011199322529137135, 0.018085144460201263, 0.03373195230960846, 0.028847623616456985, -0.03960989788174629, -0.006074379198253155, 0.00502250250428915, -0.06983394920825958, -0.057463716715574265, 0.013911855407059193, -0.002609186340123415, 0.016582919284701347, 0.05306415632367134, -0.024603158235549927, -0.027472957968711853, 0.00638576690107584, -0.027693282812833786, -0.020479485392570496, -0.07261980324983597, 0.01513449102640152, 0.046775978058576584, 0.13517515361309052, 0.08772138506174088, -0.024855010211467743, 0.04234517365694046, 0.06241908669471741, -0.0182660985738039, -0.0497400127351284, 0.014032799750566483, 0.0753837376832962, 0.0688701793551445, 0.1041683480143547, -0.002928058849647641, -5.029337657447286e-8, -0.044677190482616425, -0.1115155965089798, -0.10731416195631027, 0.04393189772963524, -0.02782892994582653, 0.01197600644081831, -0.04239857196807861, -0.07734598219394684, 0.02790658175945282, -0.06853687763214111, 0.06329178810119629, -0.0019035189179703593, -0.06895908713340759, -0.03197065740823746, -0.017205117270350456, -0.019818801432847977, -0.09275740385055542, 0.017474465072155, 0.011453799903392792, -0.06427288055419922, 0.029494332149624825, 0.05096103623509407, 0.01998811587691307, -0.028874993324279785, -0.03251215070486069, -0.019709628075361252, -0.00015226250980049372, 0.04246795177459717, -0.07359474152326584, -0.05953395739197731, 0.038209181278944016, -0.004410560708492994, 0.06190977990627289, -0.00043793339864350855, 0.06226205825805664, 0.012666457332670689, 0.058185875415802, 0.012407158501446247, 0.028737729415297508, 0.002672844799235463, 0.07292594760656357, -0.05071602761745453, -0.140708789229393, 0.002543787471950054, 0.0870528295636177, -0.006360379979014397, -0.017817635089159012, -0.010138159617781639, -0.018625155091285706, -0.06550624221563339, -0.0047082905657589436, 0.0045398264192044735, 0.0324505977332592, 0.01782655529677868, 0.013486849144101143, 0.0038173056673258543, 0.0066335322335362434, -0.04100039228796959, 0.07239615172147751, 0.048135098069906235, 0.026821576058864594, 0.1193084791302681, 0.03403009474277496, 0.02717137336730957 ]
0.124703
# Signal (signal-cli) 状态:外部 CLI 集成。Gateway 网关通过 HTTP JSON-RPC + SSE 与 `signal-cli` 通信。 ## 快速设置(初学者) 1. 为 bot 使用\*\*单独的 Signal 号码\*\*(推荐)。 2. 安装 `signal-cli`(需要 Java)。 3. 链接 bot 设备并启动守护进程: - `signal-cli link -n "OpenClaw"` 4. 配置 OpenClaw 并启动 Gateway 网关。 最小配置: ```json5 { channels: { signal: { enabled: true, account: "+15551234567", cliPath: "signal-cli", dmPolicy: "pairing", allowFrom: ["+15557654321"], }, }, } ``` ## 它是什么 - 通过 `signal-cli` 的 Signal 渠道(非嵌入式 libsignal)。 - 确定性路由:回复始终返回到 Signal。 - 私信共享智能体的主会话;群组是隔离的(`agent::signal:group:`)。 ## 配置写入 默认情况下,Signal 允许写入由 `/config set|unset` 触发的配置更新(需要 `commands.config: true`)。 禁用方式: ```json5 { channels: { signal: { configWrites: false } }, } ``` ## 号码模型(重要) - Gateway 网关连接到一个 \*\*Signal 设备\*\*(`signal-cli` 账户)。 - 如果你在\*\*个人 Signal 账户\*\*上运行 bot,它会忽略你自己的消息(循环保护)。 - 要实现"我发消息给 bot 然后它回复",请使用\*\*单独的 bot 号码\*\*。 ## 设置(快速路径) 1. 安装 `signal-cli`(需要 Java)。 2. 链接 bot 账户: - `signal-cli link -n "OpenClaw"` 然后在 Signal 中扫描二维码。 3. 配置 Signal 并启动 Gateway 网关。 示例: ```json5 { channels: { signal: { enabled: true, account: "+15551234567", cliPath: "signal-cli", dmPolicy: "pairing", allowFrom: ["+15557654321"], }, }, } ``` 多账户支持:使用 `channels.signal.accounts` 配置每个账户及可选的 `name`。共享模式请参见 [`gateway/configuration`](/gateway/configuration#telegramaccounts--discordaccounts--slackaccounts--signalaccounts--imessageaccounts)。 ## 外部守护进程模式(httpUrl) 如果你想自己管理 `signal-cli`(JVM 冷启动慢、容器初始化或共享 CPU),请单独运行守护进程并将 OpenClaw 指向它: ```json5 { channels: { signal: { httpUrl: "http://127.0.0.1:8080", autoStart: false, }, }, } ``` 这会跳过自动启动和 OpenClaw 内部的启动等待。对于自动启动时的慢启动,请设置 `channels.signal.startupTimeoutMs`。 ## 访问控制(私信 + 群组) 私信: - 默认:`channels.signal.dmPolicy = "pairing"`。 - 未知发送者会收到配对码;消息在批准前会被忽略(配对码 1 小时后过期)。 - 通过以下方式批准: - `openclaw pairing list signal` - `openclaw pairing approve signal ```` ` - 配对是 Signal 私信的默认令牌交换方式。详情:[配对](/start/pairing) - 仅有 UUID 的发送者(来自 `sourceUuid`)在 `channels.signal.allowFrom` 中存储为 `uuid:`。 群组: - `channels.signal.groupPolicy = open | allowlist | disabled`。 - 当设置为 `allowlist` 时,`channels.signal.groupAllowFrom` 控制谁可以在群组中触发。 ## 工作原理(行为) - `signal-cli` 作为守护进程运行;Gateway 网关通过 SSE 读取事件。 - 入站消息被规范化为共享渠道信封。 - 回复始终路由回同一号码或群组。 ## 媒体 + 限制 - 出站文本按 `channels.signal.textChunkLimit` 分块(默认 4000)。 - 可选换行分块:设置 `channels.signal.chunkMode="newline"` 在长度分块前按空行(段落边界)分割。 - 支持附件(从 `signal-cli` 获取 base64)。 - 默认媒体上限:`channels.signal.mediaMaxMb`(默认 8)。 - 使用 `channels.signal.ignoreAttachments` 跳过下载媒体。 - 群组历史上下文使用 `channels.signal.historyLimit`(或 `channels.signal.accounts.*.historyLimit`),回退到 `messages.groupChat.historyLimit`。设置 `0` 禁用(默认 50)。 ## 输入指示器 + 已读回执 - **输入指示器**:OpenClaw 通过 `signal-cli sendTyping` 发送输入信号,并在回复运行时刷新它们。 - **已读回执**:当 `channels.signal.sendReadReceipts` 为 true 时,OpenClaw 为允许的私信转发已读回执。 - Signal-cli 不暴露群组的已读回执。 ## 表情回应(message 工具) - 使用 `message action=react` 配合 `channel=signal`。 - 目标:发送者 E.164 或 UUID(使用配对输出中的 `uuid:`;裸 UUID 也可以)。 - `messageId` 是你要回应的消息的 Signal 时间戳。 - 群组表情回应需要 `targetAuthor` 或 `targetAuthorUuid`。 示例: ``` message action=react channel=signal target=uuid:123e4567-e89b-12d3-a456-426614174000 messageId=1737630212345 emoji=🔥 message action=react channel=signal target=+15551234567 messageId=1737630212345 emoji=🔥 remove=true message action=react channel=signal target=signal:group: targetAuthor=uuid: messageId=1737630212345 emoji=✅ ``` 配置: - `channels.signal.actions.reactions`:启用/禁用表情回应操作(默认 true)。 - `channels.signal.reactionLevel`:`off | ack | minimal | extensive`。 - `off`/`ack` 禁用智能体表情回应(message 工具 `react` 会报错)。 - `minimal`/`extensive` 启用智能体表情回应并设置指导级别。 - 每账户覆盖:`channels.signal.accounts..actions.reactions`、`channels.signal.accounts..reactionLevel`。 ## 投递目标(CLI/cron) - 私信:`signal:+15551234567`(或纯 E.164)。 - UUID 私信:`uuid:`(或裸 UUID)。 - 群组:`signal:group:`。 - 用户名:`username:`(如果你的 Signal 账户支持)。 ## 配置参考(Signal) 完整配置:[配置](/gateway/configuration) 提供商选项: - `channels.signal.enabled`:启用/禁用渠道启动。 - `channels.signal.account`:bot 账户的 E.164。 - `channels.signal.cliPath`:`signal-cli` 的路径。 - `channels.signal.httpUrl`:完整守护进程 URL(覆盖 host/port)。 - `channels.signal.httpHost`、`channels.signal.httpPort`:守护进程绑定(默认 127.0.0.1:8080)。 - `channels.signal.autoStart`:自动启动守护进程(如果未设置 `httpUrl` 则默认 true)。 - `channels.signal.startupTimeoutMs`:启动等待超时(毫秒)(上限 120000)。 - `channels.signal.receiveMode`:`on-start | manual`。 - `channels.signal.ignoreAttachments`:跳过附件下载。 - `channels.signal.ignoreStories`:忽略来自守护进程的动态。 - `channels.signal.sendReadReceipts`:转发已读回执。 - `channels.signal.dmPolicy`:`pairing | allowlist | open | disabled`(默认:pairing)。 - `channels.signal.allowFrom`:私信允许列表(E.164 或 `uuid:`)。`open` 需要 `"*"`。Signal 没有用户名;使用电话/UUID id。 - `channels.signal.groupPolicy`:`open | allowlist | disabled`(默认:allowlist)。 - `channels.signal.groupAllowFrom`:群组发送者允许列表。 - `channels.signal.historyLimit`:作为上下文包含的最大群组消息数(0 禁用)。 - `channels.signal.dmHistoryLimit`:私信历史限制(用户轮次)。每用户覆盖:`channels.signal.dms[""].historyLimit`。 - `channels.signal.textChunkLimit`:出站分块大小(字符)。 - `channels.signal.chunkMode`:`length`(默认)或 `newline` 在长度分块前按空行(段落边界)分割。 - `channels.signal.mediaMaxMb`:入站/出站媒体上限(MB)。 相关全局选项: - `agents.list[].groupChat.mentionPatterns`(Signal 不支持原生提及)。 - `messages.groupChat.mentionPatterns`(全局回退)。 - `messages.responsePrefix`。 ````
https://github.com/openclaw/openclaw/blob/main//docs/zh-CN/channels/signal.md
main
opebclaw
[ -0.11037386208772659, -0.01949666067957878, 0.003096525091677904, -0.08151112496852875, 0.015087691135704517, -0.08527430891990662, -0.04073959216475487, -0.021696222946047783, 0.010005266405642033, -0.058925215154886246, 0.08096156269311905, -0.03401349484920502, -0.011990214698016644, 0.00044910385622642934, 0.14600853621959686, 0.056663867086172104, -0.07347173243761063, -0.010716508142650127, -0.04078421741724014, -0.08819398283958435, -0.0024345763958990574, -0.03161029517650604, -0.006952176336199045, -0.04083922132849693, -0.023474102839827538, -0.04600897803902626, 0.04751686006784439, 0.05383950471878052, 0.01348130777478218, -0.003284521633759141, 0.029141340404748917, 0.06652780622243881, -0.010285633616149426, 0.010818170383572578, -0.0025671268813312054, 0.08798325061798096, 0.017021700739860535, -0.07461197674274445, 0.033755071461200714, 0.028164848685264587, 0.0022210930474102497, -0.014056408777832985, -0.038926802575588226, -0.06679492443799973, -0.013130398467183113, -0.06366731971502304, -0.08534663915634155, -0.05100889876484871, -0.04042401164770126, -0.02826377935707569, -0.08371913433074951, 0.01904432848095894, -0.015486227348446846, -0.009383452124893665, -0.008050767704844475, -0.03169962391257286, -0.08050184696912766, 0.055165424942970276, 0.07000789046287537, -0.008711989969015121, 0.027746446430683136, 0.007731916848570108, 0.017716912552714348, -0.00857953354716301, -0.12581895291805267, -0.016301345080137253, -0.01509149931371212, -0.023174386471509933, 0.03630179911851883, 0.04308875650167465, -0.00835086777806282, -0.036804549396038055, -0.0749492347240448, -0.000852501776535064, 0.004873983096331358, 0.01910802349448204, 0.007567193824797869, -0.01677267998456955, -0.05287695303559303, -0.06342819333076477, -0.07085210829973221, -0.05776417627930641, -0.06675536185503006, 0.0471997931599617, -0.03169882297515869, 0.15457989275455475, -0.057666320353746414, -0.02271188236773014, 0.011968964710831642, -0.0037034880369901657, -0.04524584487080574, -0.027097811922430992, -0.020833879709243774, 0.07056587934494019, -0.03215944394469261, 0.03074958547949791, -0.03405933454632759, 0.0010702012805268168, -0.08588625490665436, 0.0837073102593422, 0.016766665503382683, 0.023054154589772224, 0.03781706467270851, 0.07803534716367722, -0.045718539506196976, -0.01819985918700695, 0.00036046982859261334, 0.08752372860908508, 0.04644051566720009, -0.027566395699977875, 0.0170064065605402, -0.02534906379878521, 0.019755776971578598, -0.04927496984601021, -0.0700199082493782, 0.10543099790811539, -0.005321977194398642, 0.04071113094687462, 0.014732979238033295, 0.033625245094299316, 0.07818427681922913, -0.056552689522504807, -0.11396081745624542, 0.008885248564183712, 0.004428821615874767, -0.027198510244488716, 0.07325268536806107, 4.809603461998531e-33, 0.0582323893904686, 0.042287733405828476, -0.028767384588718414, -0.05338062345981598, 0.023494070395827293, -0.04677484929561615, -0.017628943547606468, 0.010637837462127209, -0.08924048393964767, 0.0718606486916542, -0.04345220327377319, 0.0028011812828481197, -0.0706116333603859, -0.017515024170279503, -0.011682567186653614, -0.059530314058065414, 0.014945480041205883, -0.025568071752786636, 0.025107862427830696, 0.030624769628047943, 0.04423055797815323, -0.03141254559159279, 0.006061822175979614, -0.02734973654150963, 0.0008116561803035438, 0.09742585569620132, -0.02034124545753002, 0.0029362787026911974, -0.009512633085250854, 0.032594650983810425, 0.07562509924173355, -0.019281435757875443, -0.04642961174249649, -0.005417457781732082, 0.02765042334794998, -0.06469782441854477, 0.018814967945218086, 0.0040876977145671844, -0.10727063566446304, -0.03376654535531998, 0.010840297676622868, -0.02079710178077221, -0.13196617364883423, -0.03386693820357323, 0.01159515418112278, -0.07353305071592331, -0.07208838313817978, -0.004654286429286003, 0.06437980383634567, 0.021366706117987633, -0.08103343099355698, 0.017470121383666992, -0.008463148958981037, 0.0021596059668809175, 0.01773957721889019, -0.018147174268960953, 0.00760540971532464, 0.049473073333501816, -0.05079829320311546, -0.00019204491400159895, 0.03033348359167576, 0.007428602781146765, 0.027968965470790863, -0.007662619464099407, 0.14289461076259613, 0.032619658857584, -0.03199993818998337, -0.040299247950315475, -0.009797940030694008, 0.0032178780529648066, -0.03811442479491234, 0.07913808524608612, 0.024210453033447266, 0.014153080992400646, -0.011379550211131573, -0.09772567451000214, -0.062158674001693726, 0.056843265891075134, 0.047829993069171906, 0.02692011184990406, 0.022903211414813995, -0.059596557170152664, -0.0017792137805372477, 0.008380758576095104, 0.00423363596200943, 0.10411638021469116, 0.027574392035603523, -0.0669398084282875, -0.03848563879728317, 0.042778000235557556, -0.09506777673959732, 0.08961363881826401, 0.037019532173871994, -0.006719091907143593, -0.08873575925827026, -8.860598705958021e-33, -0.037051063030958176, 0.043532080948352814, 0.007810310926288366, -0.03609798848628998, -0.03215310350060463, -0.049456577748060226, 0.035305555909872055, -0.019284963607788086, -0.004044216126203537, 0.11809518188238144, 0.019342979416251183, -0.049162641167640686, 0.04923779517412186, 0.00033654714934527874, 0.009761582128703594, 0.028523024171590805, -0.004405604675412178, -0.03745471313595772, -0.012573495507240295, 0.031158145517110825, -0.008268102072179317, 0.06120017170906067, -0.039473723620176315, 0.03755702078342438, 0.003141379915177822, -0.008440419100224972, 0.07562805712223053, 0.03657596930861473, -0.05805133283138275, -0.048285018652677536, 0.002027462236583233, 0.08866434544324875, -0.02692699246108532, 0.03967053443193436, 0.055530648678541183, -0.013331767171621323, 0.030434032902121544, 0.12311656028032303, -0.0006592347635887563, -0.02828393131494522, 0.06259633600711823, 0.025005994364619255, -0.03084021434187889, -0.0025271011982113123, -0.003989448305219412, -0.027265088632702827, -0.01756620965898037, 0.05310506001114845, -0.13642756640911102, -0.027127286419272423, 0.06037278100848198, 0.048633113503456116, 0.006791940424591303, -0.036830417811870575, 0.01134355179965496, 0.1046428382396698, 0.059610143303871155, -0.0041362387128174305, -0.0046729156747460365, -0.08956596255302429, 0.010795565322041512, -0.14974822103977203, -0.04784554988145828, 0.04107266291975975, 0.09743766486644745, 0.010212169028818607, -0.031078480184078217, 0.029363878071308136, 0.07027788460254669, -0.12346255779266357, 0.007251158356666565, -0.015343164093792439, 0.018661921843886375, -0.03779266029596329, 0.017956113442778587, -0.048226844519376755, -0.10175442695617676, -0.01810687780380249, 0.030843349173665047, 0.09065616130828857, -0.020107539370656013, 0.042630989104509354, -0.008170345798134804, 0.041592929512262344, 0.04902707040309906, 0.025531448423862457, -0.006644977256655693, 0.10617991536855698, -0.01870870403945446, -0.048908531665802, -0.005211849696934223, 0.11902201920747757, -0.006014564540237188, 0.05197897553443909, 0.005626257508993149, -5.461946273044305e-8, -0.04495161026716232, -0.09163744747638702, -0.11466003954410553, -0.026304366067051888, -0.0010396591387689114, -0.018412666395306587, -0.04341170936822891, -0.10841593146324158, 0.032360613346099854, -0.05342775583267212, 0.026769230142235756, 0.05955980345606804, -0.1105075404047966, 0.05765170231461525, -0.013232008554041386, -0.027274420484900475, -0.12313070148229599, 0.04427311196923256, 0.01914708875119686, -0.03518931195139885, 0.022790873423218727, -0.02701294794678688, 0.013135978952050209, 0.024340789765119553, -0.018609289079904556, -0.04287959635257721, 0.014675937592983246, 0.058287978172302246, -0.058738674968481064, -0.064447782933712, -0.047355618327856064, -0.02236216515302658, 0.04180704057216644, -0.05814460664987564, 0.0005700455512851477, 0.04266984760761261, 0.014657588675618172, -0.018449559807777405, 0.0017320106271654367, 0.0993083193898201, 0.02727939561009407, -0.020806655287742615, -0.07525573670864105, 0.01621372438967228, 0.039121709764003754, 0.0015077678253874183, 0.05920238047838211, 0.023805029690265656, 0.06605487316846848, -0.006897307001054287, -0.014399836771190166, -0.0503433533012867, 0.023955093696713448, -0.0960179790854454, -0.00629475386813283, -0.021704506129026413, -0.012474467977881432, -0.07413487136363983, -0.050820402801036835, 0.03032585047185421, 0.056469712406396866, 0.08975432068109512, 0.0031158558558672667, -0.06173059716820717 ]
0.082114
# Zalo (Bot API) 状态:实验性。仅支持私信;根据 Zalo 文档,群组即将推出。 ## 需要插件 Zalo 以插件形式提供,不包含在核心安装中。 - 通过 CLI 安装:`openclaw plugins install @openclaw/zalo` - 或在新手引导期间选择 \*\*Zalo\*\* 并确认安装提示 - 详情:[插件](/plugin) ## 快速设置(初学者) 1. 安装 Zalo 插件: - 从源代码检出:`openclaw plugins install ./extensions/zalo` - 从 npm(如果已发布):`openclaw plugins install @openclaw/zalo` - 或在新手引导中选择 \*\*Zalo\*\* 并确认安装提示 2. 设置 token: - 环境变量:`ZALO\_BOT\_TOKEN=...` - 或配置:`channels.zalo.botToken: "..."`。 3. 重启 Gateway 网关(或完成新手引导)。 4. 私信访问默认为配对模式;首次联系时批准配对码。 最小配置: ```json5 { channels: { zalo: { enabled: true, botToken: "12345689:abc-xyz", dmPolicy: "pairing", }, }, } ``` ## 它是什么 Zalo 是一款专注于越南市场的即时通讯应用;其 Bot API 让 Gateway 网关可以运行一个用于一对一对话的 bot。 它非常适合需要确定性路由回 Zalo 的支持或通知场景。 - 由 Gateway 网关拥有的 Zalo Bot API 渠道。 - 确定性路由:回复返回到 Zalo;模型不会选择渠道。 - 私信共享智能体的主会话。 - 群组尚不支持(Zalo 文档标注"即将推出")。 ## 设置(快速路径) ### 1)创建 bot token(Zalo Bot 平台) 1. 前往 \*\*https://bot.zaloplatforms.com\*\* 并登录。 2. 创建新 bot 并配置其设置。 3. 复制 bot token(格式:`12345689:abc-xyz`)。 ### 2)配置 token(环境变量或配置) 示例: ```json5 { channels: { zalo: { enabled: true, botToken: "12345689:abc-xyz", dmPolicy: "pairing", }, }, } ``` 环境变量选项:`ZALO\_BOT\_TOKEN=...`(仅适用于默认账户)。 多账户支持:使用 `channels.zalo.accounts` 配置每账户 token 和可选的 `name`。 3. 重启 Gateway 网关。当 token 被解析(环境变量或配置)时,Zalo 启动。 4. 私信访问默认为配对模式。当 bot 首次被联系时批准配对码。 ## 工作原理(行为) - 入站消息被规范化为带有媒体占位符的共享渠道信封。 - 回复始终路由回同一 Zalo 聊天。 - 默认使用长轮询;可通过 `channels.zalo.webhookUrl` 启用 webhook 模式。 ## 限制 - 出站文本按 2000 字符分块(Zalo API 限制)。 - 媒体下载/上传受 `channels.zalo.mediaMaxMb` 限制(默认 5)。 - 由于 2000 字符限制使流式传输效果不佳,默认阻止流式传输。 ## 访问控制(私信) ### 私信访问 - 默认:`channels.zalo.dmPolicy = "pairing"`。未知发送者会收到配对码;消息在批准前会被忽略(配对码 1 小时后过期)。 - 通过以下方式批准: - `openclaw pairing list zalo` - `openclaw pairing approve zalo `` ` - 配对是默认的令牌交换方式。详情:[配对](/start/pairing) - `channels.zalo.allowFrom` 接受数字用户 ID(无用户名查找功能)。 ## 长轮询与 webhook - 默认:长轮询(不需要公共 URL)。 - Webhook 模式:设置 `channels.zalo.webhookUrl` 和 `channels.zalo.webhookSecret`。 - Webhook secret 必须为 8-256 个字符。 - Webhook URL 必须使用 HTTPS。 - Zalo 发送事件时带有 `X-Bot-Api-Secret-Token` 头用于验证。 - Gateway 网关 HTTP 在 `channels.zalo.webhookPath` 处理 webhook 请求(默认为 webhook URL 路径)。 **注意:** 根据 Zalo API 文档,getUpdates(轮询)和 webhook 是互斥的。 ## 支持的消息类型 - **文本消息**:完全支持,2000 字符分块。 - **图片消息**:下载和处理入站图片;通过 `sendPhoto` 发送图片。 - **贴纸**:已记录但未完全处理(无智能体响应)。 - **不支持的类型**:已记录(例如来自受保护用户的消息)。 ## 功能 | 功能 | 状态 | | ------------ | ----------------------------- | | 私信 | ✅ 支持 | | 群组 | ❌ 即将推出(根据 Zalo 文档) | | 媒体(图片) | ✅ 支持 | | 表情回应 | ❌ 不支持 | | 主题 | ❌ 不支持 | | 投票 | ❌ 不支持 | | 原生命令 | ❌ 不支持 | | 流式传输 | ⚠️ 已阻止(2000 字符限制) | ## 投递目标(CLI/cron) - 使用聊天 id 作为目标。 - 示例:`openclaw message send --channel zalo --target 123456789 --message "hi"`。 ## 故障排除 **Bot 不响应:** - 检查 token 是否有效:`openclaw channels status --probe` - 验证发送者已被批准(配对或 allowFrom) - 检查 Gateway 网关日志:`openclaw logs --follow` **Webhook 未收到事件:** - 确保 webhook URL 使用 HTTPS - 验证 secret token 为 8-256 个字符 - 确认 Gateway 网关 HTTP 端点在配置的路径上可访问 - 检查 getUpdates 轮询未在运行(它们是互斥的) ## 配置参考(Zalo) 完整配置:[配置](/gateway/configuration) 提供商选项: - `channels.zalo.enabled`:启用/禁用渠道启动。 - `channels.zalo.botToken`:来自 Zalo Bot 平台的 bot token。 - `channels.zalo.tokenFile`:从文件路径读取 token。 - `channels.zalo.dmPolicy`:`pairing | allowlist | open | disabled`(默认:pairing)。 - `channels.zalo.allowFrom`:私信允许列表(用户 ID)。`open` 需要 `"*"`。向导会询问数字 ID。 - `channels.zalo.mediaMaxMb`:入站/出站媒体上限(MB,默认 5)。 - `channels.zalo.webhookUrl`:启用 webhook 模式(需要 HTTPS)。 - `channels.zalo.webhookSecret`:webhook secret(8-256 字符)。 - `channels.zalo.webhookPath`:Gateway 网关 HTTP 服务器上的 webhook 路径。 - `channels.zalo.proxy`:API 请求的代理 URL。 多账户选项: - `channels.zalo.accounts..botToken`:每账户 token。 - `channels.zalo.accounts..tokenFile`:每账户 token 文件。 - `channels.zalo.accounts..name`:显示名称。 - `channels.zalo.accounts..enabled`:启用/禁用账户。 - `channels.zalo.accounts..dmPolicy`:每账户私信策略。 - `channels.zalo.accounts..allowFrom`:每账户允许列表。 - `channels.zalo.accounts..webhookUrl`:每账户 webhook URL。 - `channels.zalo.accounts..webhookSecret`:每账户 webhook secret。 - `channels.zalo.accounts..webhookPath`:每账户 webhook 路径。 - `channels.zalo.accounts..proxy`:每账户代理 URL。 ``
https://github.com/openclaw/openclaw/blob/main//docs/zh-CN/channels/zalo.md
main
opebclaw
[ -0.11570243537425995, 0.017875663936138153, -0.09093905240297318, 0.009863026440143585, -0.019972488284111023, -0.09872768074274063, 0.015276182442903519, -0.002517060376703739, -0.03563753515481949, -0.0007809576345607638, 0.1110399067401886, -0.07150938361883163, 0.0959639698266983, 0.010078215971589088, 0.09607569128274918, 0.08689194172620773, 0.0009018494747579098, -0.012389141134917736, -0.04973030835390091, -0.0229086484760046, 0.054635584354400635, 0.04641386866569519, 0.033312469720840454, -0.023669768124818802, -0.04331208020448685, 0.0020105622243136168, -0.05993487313389778, 0.031612563878297806, 0.019069252535700798, -0.020684480667114258, 0.0296062920242548, 0.05960795655846596, -0.004596258979290724, -0.015493757091462612, 0.13569419085979462, 0.06213403865695, -0.003911348059773445, -0.0440976582467556, -0.06718021631240845, -0.007169809192419052, 0.0013452584389597178, -0.00020960680558346212, -0.07631326466798782, -0.02799266017973423, -0.03014640137553215, -0.008937764912843704, -0.034580256789922714, -0.06927277147769928, -0.0915457159280777, -0.03485831245779991, -0.07791674882173538, -0.0848199650645256, -0.015505283139646053, -0.0008790320134721696, 0.019724899902939796, -0.09415564686059952, -0.03949138894677162, -0.010986948385834694, 0.03380308300256729, -0.01837843284010887, 0.02532055228948593, 0.02913455292582512, -0.024661323055624962, 0.02698492258787155, -0.1282844990491867, 0.0015067503554746509, -0.0393219068646431, -0.05309200659394264, -0.03542530909180641, -0.05720481649041176, -0.031226545572280884, -0.02159862034022808, -0.023012181743979454, -0.026658538728952408, -0.051646217703819275, -0.008010848425328732, 0.0849030464887619, 0.007010347209870815, -0.09624460339546204, -0.1436000019311905, 0.0005066366866230965, -0.00828079879283905, 0.048558786511421204, 0.06075018644332886, 0.007777252234518528, 0.17863228917121887, -0.04366358369588852, -0.024969834834337234, 0.046990904957056046, 0.05301745980978012, 0.026131004095077515, -0.03773379698395729, 0.0325394831597805, 0.003129040589556098, 0.011533216573297977, -0.044480156153440475, 0.007932123728096485, 0.019023317843675613, -0.03939399868249893, 0.0949920043349266, 0.033668410032987595, -0.0428428128361702, -0.02589407004415989, -0.047059569507837296, -0.03816213458776474, 0.02473567984998226, -0.04529208317399025, 0.05035782232880592, 0.03765324130654335, 0.06013626605272293, -0.00043074163841083646, -0.06762795895338058, 0.024307742714881897, -0.14075496792793274, -0.0681658536195755, 0.07846152037382126, -0.023752950131893158, -0.010947042144834995, 0.044290248304605484, 0.058681320399045944, 0.08255214989185333, -0.005128026474267244, -0.0641232281923294, -0.028127329424023628, 0.002542176516726613, 0.024594709277153015, 0.08913817256689072, 4.0978100411649574e-33, 0.003148642834275961, 0.0014413695316761732, -0.07461492717266083, -0.026601511985063553, 0.008147579617798328, -0.001282739918678999, 0.02065107226371765, 0.040499646216630936, -0.10435272753238678, 0.021643538028001785, -0.005115082021802664, 0.036818668246269226, -0.07048116624355316, 0.053634095937013626, 0.004085914697498083, -0.020221594721078873, -0.0028971554711461067, -0.04172219708561897, 0.03165678679943085, -0.05270319804549217, 0.03472582995891571, 0.001178528880700469, -0.019789163023233414, 0.012241052463650703, -0.00394992483779788, 0.12650099396705627, 0.018364209681749344, -0.07568936049938202, 0.0018606348894536495, 0.03865581005811691, 0.10106905549764633, -0.04049009457230568, -0.06348343938589096, 0.07260303199291229, -0.05424269661307335, 0.021351512521505356, -0.08066079765558243, -0.03130156174302101, -0.060329560190439224, -0.08050292730331421, 0.007982073351740837, -0.0029538075905293226, -0.09635857492685318, -0.012430603615939617, 0.05587276816368103, -0.06661441922187805, -0.08603545278310776, -0.009629196487367153, 0.11284594237804413, -0.09097271412611008, -0.036468248814344406, 0.06450170278549194, -0.028623849153518677, 0.053196027874946594, -0.009258306585252285, -0.039771415293216705, -0.05053897947072983, -0.018548153340816498, -0.015714019536972046, -0.06481600552797318, 0.036820244044065475, 0.0200282521545887, 0.014552349224686623, 0.01831209287047386, 0.04549851268529892, -0.019884562119841576, 0.033650144934654236, 0.02980874478816986, 0.012124871835112572, -0.006411171052604914, -0.05480249598622322, -0.0045109763741493225, 0.05750684067606926, 0.048897650092840195, -0.09301483631134033, -0.06274531781673431, -0.004187465645372868, -0.027943003922700882, 0.08065693825483322, -0.016842585057020187, -0.028225654736161232, -0.0929802656173706, -0.013615051284432411, -0.014584419317543507, -0.011939792893826962, 0.050717420876026154, 0.008701718412339687, -0.01500637736171484, -0.007494098972529173, 0.019280796870589256, -0.07233727723360062, 0.0028760936111211777, -0.09910543262958527, -0.013335579074919224, -0.06086469814181328, -8.421701441455627e-33, -0.017431486397981644, 0.04095202311873436, -0.03273608535528183, -0.00686564901843667, -0.03889577463269234, -0.07310114800930023, -0.04377279803156853, -0.0416165292263031, 0.033080048859119415, 0.046082090586423874, -0.03328627347946167, 0.06298255920410156, 0.048183001577854156, -0.03415832296013832, 0.09283910691738129, 0.011125676333904266, -0.06134958192706108, 0.008084065280854702, 0.00781739130616188, 0.056621525436639786, -0.056831397116184235, 0.03076861798763275, -0.1008916050195694, 0.009074067696928978, 0.01755334436893463, 0.007717802654951811, 0.038095153868198395, -0.018352869898080826, 0.049693621695041656, 0.030481180176138878, -0.003293100278824568, 0.007798805367201567, -0.07355918735265732, 0.07170144468545914, -0.028989741578698158, -0.027071386575698853, -0.020222995430231094, 0.03508045896887779, -0.009953181259334087, -0.021258162334561348, 0.023473665118217468, -0.015993550419807434, -0.021895330399274826, -0.0398780032992363, -0.04044027253985405, 0.012099075131118298, -0.0800480917096138, -0.037113383412361145, -0.07356573641300201, -0.06309648603200912, 0.0916425809264183, 0.04347364604473114, -0.01276776846498251, -0.025526566430926323, 0.02492455020546913, 0.061941832304000854, 0.03976314514875412, -0.05368240550160408, -0.08435066044330597, -0.11319677531719208, 0.026906585320830345, -0.03793477267026901, -0.006668850779533386, 0.04097418487071991, 0.005026672501116991, 0.034060366451740265, 0.014521506614983082, -0.013988333754241467, -0.03137694671750069, -0.12107259035110474, 0.003222063882276416, 0.022017091512680054, -0.029479989781975746, -0.11039979010820389, -0.03419385105371475, 0.026990192010998726, -0.061338745057582855, 0.04062216356396675, -0.009815216064453125, 0.029825998470187187, 0.0077778929844498634, -0.008985417895019054, 0.0754425898194313, 0.08734884858131409, -0.03943007066845894, -0.060650233179330826, 0.0028573849704116583, 0.10873735696077347, 0.045969970524311066, -0.008514626882970333, -0.0014767817920073867, 0.08578241616487503, 0.022333232685923576, 0.07080351561307907, 0.004832856822758913, -5.249131973528165e-8, -0.06297118961811066, -0.11998027563095093, -0.07882573455572128, 0.04407775029540062, 0.013160555623471737, -0.03692508116364479, -0.0032955154310911894, -0.006991996429860592, -0.0703652873635292, 0.020124278962612152, 0.07770528644323349, 0.03459446504712105, -0.09489347040653229, 0.026420466601848602, -0.030046885833144188, 0.03854569047689438, -0.003981312271207571, 0.07566959410905838, 0.041896119713783264, -0.045345429331064224, -0.010061975568532944, 0.0371306873857975, 0.06314418464899063, -0.050888918340206146, -0.0938873142004013, -0.015646882355213165, -0.04013049602508545, 0.007737296633422375, -0.0426826998591423, -0.046550504863262177, 0.005946807097643614, -0.005288516171276569, 0.07694712281227112, -0.06734597682952881, 0.017740705981850624, 0.07052233070135117, 0.014080599881708622, -0.04140353202819824, -0.03808199614286423, 0.01861753687262535, 0.05856764316558838, -0.02819843403995037, -0.005940754897892475, -0.007896287366747856, -0.002421734156087041, 0.0002509174810256809, 0.015138356946408749, -0.07337994873523712, 0.07209216803312302, -0.03278861194849014, -0.015982087701559067, 0.017284845933318138, -0.0024894378148019314, 0.02995610423386097, 0.03461065888404846, 0.11461790651082993, -0.016485005617141724, -0.06311841309070587, 0.023715686053037643, 0.0744323804974556, -0.002632996765896678, 0.027394084259867668, 0.049491479992866516, 0.00829334743320942 ]
0.189477
# grammY 集成(Telegram Bot API) # 为什么选择 grammY - 以 TS 为核心的 Bot API 客户端,内置长轮询 + webhook 辅助工具、中间件、错误处理和速率限制器。 - 媒体处理辅助工具比手动编写 fetch + FormData 更简洁;支持所有 Bot API 方法。 - 可扩展:通过自定义 fetch 支持代理,可选的会话中间件,类型安全的上下文。 # 我们发布的内容 - \*\*单一客户端路径:\*\* 移除了基于 fetch 的实现;grammY 现在是唯一的 Telegram 客户端(发送 + Gateway 网关),默认启用 grammY throttler。 - \*\*Gateway 网关:\*\* `monitorTelegramProvider` 构建 grammY `Bot`,接入 mention/allowlist 网关控制,通过 `getFile`/`download` 下载媒体,并使用 `sendMessage/sendPhoto/sendVideo/sendAudio/sendDocument` 发送回复。通过 `webhookCallback` 支持长轮询或 webhook。 - \*\*代理:\*\* 可选的 `channels.telegram.proxy` 通过 grammY 的 `client.baseFetch` 使用 `undici.ProxyAgent`。 - \*\*Webhook 支持:\*\* `webhook-set.ts` 封装了 `setWebhook/deleteWebhook`;`webhook.ts` 托管回调,支持健康检查和优雅关闭。当设置了 `channels.telegram.webhookUrl` + `channels.telegram.webhookSecret` 时,Gateway 网关启用 webhook 模式(否则使用长轮询)。 - \*\*会话:\*\* 私聊折叠到智能体主会话(`agent::`);群组使用 `agent::telegram:group:`;回复路由回同一渠道。 - \*\*配置选项:\*\* `channels.telegram.botToken`、`channels.telegram.dmPolicy`、`channels.telegram.groups`(allowlist + mention 默认值)、`channels.telegram.allowFrom`、`channels.telegram.groupAllowFrom`、`channels.telegram.groupPolicy`、`channels.telegram.mediaMaxMb`、`channels.telegram.linkPreview`、`channels.telegram.proxy`、`channels.telegram.webhookSecret`、`channels.telegram.webhookUrl`。 - \*\*草稿流式传输:\*\* 可选的 `channels.telegram.streamMode` 在私有话题聊天中使用 `sendMessageDraft`(Bot API 9.3+)。这与渠道分块流式传输是分开的。 - \*\*测试:\*\* grammY mock 覆盖了私信 + 群组 mention 网关控制和出站发送;欢迎添加更多媒体/webhook 测试用例。 待解决问题 - 如果遇到 Bot API 429 错误,考虑使用可选的 grammY 插件(throttler)。 - 添加更多结构化媒体测试(贴纸、语音消息)。 - 使 webhook 监听端口可配置(目前固定为 8787,除非通过 Gateway 网关配置)。
https://github.com/openclaw/openclaw/blob/main//docs/zh-CN/channels/grammy.md
main
opebclaw
[ -0.09035661816596985, 0.03555402532219887, -0.024450689554214478, -0.03894814848899841, -0.018809404224157333, -0.052978526800870895, 0.09255415201187134, 0.014432072639465332, 0.03875043988227844, 0.019191978499293327, 0.08819078654050827, -0.08738811314105988, 0.08522149175405502, -0.038802370429039, 0.06417977064847946, 0.058111771941185, -0.0035428693518042564, -0.05969730019569397, -0.008194715715944767, -0.08995428681373596, 0.007477105595171452, 0.02222909778356552, -0.01773950457572937, 0.067897267639637, -0.05187098681926727, 0.009219624102115631, -0.14414076507091522, 0.009624121710658073, 0.008244143798947334, 0.008302426896989346, -0.018694709986448288, 0.00945940613746643, -0.0705990195274353, 0.05384042114019394, 0.0187445767223835, 0.05506366491317749, -0.02386736497282982, -0.04646521061658859, 0.017618970945477486, -0.00412619998678565, -0.04150865599513054, -0.05586854740977287, -0.03089751861989498, -0.04535975679755211, 0.016602659597992897, 0.018025442957878113, -0.05111512169241905, -0.011719945818185806, -0.06250094622373581, -0.05368916317820549, -0.10371316224336624, 0.0026148471515625715, 0.03619172424077988, 0.03253692388534546, 0.023823972791433334, -0.011155619286000729, -0.035370949655771255, 0.06398166716098785, 0.03771303594112396, 0.009412327781319618, -0.03407566621899605, -0.07507731765508652, 0.0077214315533638, -0.017307544127106667, -0.08241052180528641, 0.0208409633487463, -0.10902109742164612, 0.03300895169377327, 0.01298251748085022, 0.03925393149256706, -0.015279153361916542, 0.026662752032279968, -0.06241273134946823, -0.010066842660307884, -0.043824486434459686, -0.032656244933605194, 0.0364154614508152, 0.03934340178966522, -0.06183939799666405, -0.11093009263277054, 0.0010173378977924585, 0.01998959109187126, 0.051356300711631775, -0.0007706504547968507, -0.060891292989254, 0.07141388207674026, -0.03202614188194275, -0.04693078249692917, 0.05015432834625244, -0.032738082110881805, 0.01257757842540741, -0.003803456900641322, 0.04933113604784012, 0.07809780538082123, 0.007339993491768837, -0.012593223713338375, 0.019144371151924133, -0.053487569093704224, -0.04301074519753456, 0.0389590822160244, 0.0670199766755104, 0.007189656142145395, -0.07473607361316681, -0.029046649113297462, 0.009152828715741634, -0.03380218520760536, -0.029441451653838158, 0.061852745711803436, 0.11375119537115097, 0.0446871742606163, -0.04403950646519661, -0.003957728389650583, 0.009192388504743576, -0.0789160206913948, -0.056000445038080215, 0.08184511214494705, -0.017871474847197533, 0.025193877518177032, 0.017122430726885796, 0.007718296721577644, 0.052556466311216354, -0.038152702152729034, -0.06363940984010696, -0.07149294018745422, -0.006624013651162386, -0.06135835871100426, 0.16615013778209686, 3.928147635432915e-34, -0.010393824428319931, 0.019634462893009186, -0.05466507002711296, -0.05793294310569763, 0.013649683445692062, 0.0023356969468295574, 0.01738397404551506, 0.03185657039284706, -0.060730431228876114, -0.045617058873176575, -0.06812044978141785, -0.006163338199257851, -0.08623054623603821, 0.04754192382097244, -0.024081220850348473, -0.06986499577760696, -0.018744153901934624, 0.017592325806617737, 0.10137627273797989, -0.010972969233989716, 0.0617789588868618, -0.041938625276088715, 0.04945060983300209, 0.013334906660020351, 0.055418696254491806, 0.07079945504665375, -0.0047482154332101345, 0.031653814017772675, -0.021496927365660667, 0.034056443721055984, 0.020470881834626198, -0.016670210286974907, -0.04187804460525513, 0.011463133618235588, -0.012053320184350014, -0.07155457139015198, -0.00879674218595028, -0.02139609307050705, -0.06362175941467285, -0.018004801124334335, -0.05828787013888359, -0.011525957845151424, -0.0914575532078743, -0.061886630952358246, -0.005629425402730703, -0.010384014807641506, -0.10732647031545639, -0.04647291451692581, 0.07497482001781464, -0.03311484307050705, -0.08460849523544312, 0.03090314380824566, 0.02272726409137249, -0.0412718802690506, 0.0525885745882988, -0.08563078194856644, -0.042580537497997284, -0.049515314400196075, -0.04719151556491852, -0.045880064368247986, 0.007171532139182091, -0.06143559142947197, 0.016636565327644348, -0.032344285398721695, 0.08406113088130951, 0.029773129150271416, 0.052530430257320404, 0.04529477655887604, -0.009411273524165154, -0.011593625880777836, -0.06962715834379196, 0.031071187928318977, 0.031302981078624725, 0.0681275948882103, -0.033595871180295944, -0.09074636548757553, -0.04093143716454506, -0.00010165869753109291, 0.02612486109137535, -0.023317599669098854, -0.06692855805158615, -0.04695647582411766, -0.02996651642024517, 0.0019026420777663589, 0.025421354919672012, 0.07668054848909378, 0.023510482162237167, -0.017431937158107758, 0.003938588313758373, 0.07044479995965958, -0.16485020518302917, 0.04625294357538223, -0.037627656012773514, 0.007509164046496153, -0.09412804991006851, -6.101729260283452e-33, -0.04367663711309433, 0.030672790482640266, -0.03231063485145569, 0.005190296098589897, -0.011419673450291157, -0.023634085431694984, 0.06355489045381546, 0.043480224907398224, 0.05595586448907852, 0.1314496099948883, -0.05646631121635437, -0.008793807588517666, -0.02789839170873165, -0.03710209205746651, 0.07579214125871658, 0.009760397486388683, -0.03702738136053085, -0.006352976895868778, -0.04606696590781212, 0.0394325889647007, -0.02242504619061947, 0.04344722628593445, -0.18079794943332672, 0.021531598642468452, -0.012687155976891518, 0.021984461694955826, -0.009977270849049091, 0.026302333921194077, 0.02391824498772621, -0.04591580107808113, 0.039278045296669006, -0.0034631837625056505, -0.0903094932436943, 0.0795145109295845, 0.023293325677514076, -0.048523131757974625, 0.0343618243932724, 0.057109370827674866, 0.010407285764813423, 0.024132562801241875, 0.06698872148990631, -0.04470702260732651, -0.06006208434700966, -0.012119130231440067, 0.01816396601498127, -0.061792340129613876, -0.06945351511240005, 0.015609626658260822, -0.09804316610097885, -0.026938455179333687, 0.09687765687704086, -0.06483569741249084, 0.0118271354585886, 0.01964232698082924, -0.034824252128601074, 0.04352977126836777, 0.04181772843003273, -0.026658201590180397, -0.02188335545361042, -0.11040835082530975, 0.036681339144706726, -0.11054658889770508, -0.01564309373497963, 0.051171135157346725, 0.01707146130502224, -0.011945039965212345, 0.05880283564329147, 0.03951794654130936, 0.05619595944881439, -0.07467428594827652, 0.051311247050762177, 0.010721654631197453, 0.0214643906801939, -0.058806411921978, 0.04855028912425041, 0.032917626202106476, -0.05709850788116455, 0.04749872907996178, -0.011336280964314938, 0.03910665214061737, -0.0019576153717935085, 0.08857046812772751, 0.10115069150924683, 0.04223598167300224, -0.022217681631445885, -0.03716113045811653, 0.02448548749089241, 0.042105548083782196, -0.005811204668134451, -0.022918041795492172, -0.005367397330701351, 0.02625434473156929, 0.02955251932144165, 0.11590635776519775, 0.014423185028135777, -4.886884141797054e-8, -0.02391531690955162, -0.10977675020694733, -0.10469620674848557, 0.009040295146405697, -0.01450332347303629, 0.03911203518509865, -0.04133540019392967, -0.058108698576688766, -0.03707583248615265, -0.06684897094964981, 0.023120904341340065, -0.012271278537809849, -0.09055916219949722, 0.029603855684399605, -0.07193111628293991, -0.06390933692455292, -0.07545869797468185, 0.0322176069021225, 0.027122605592012405, -0.07980058342218399, 0.00404683593660593, -0.0036309489514678717, 0.017440564930438995, -0.09352083504199982, -0.007756455335766077, -0.036153361201286316, 0.007575241383165121, 0.045042507350444794, -0.07063387334346771, -0.04791831970214844, -0.013451850041747093, -0.04094612970948219, 0.03265419602394104, -0.06376993656158447, 0.05829388648271561, 0.054466404020786285, -0.0021941938903182745, -0.043962374329566956, 0.026647284626960754, 0.032117217779159546, 0.04645059257745743, -0.04529168829321861, -0.0247962549328804, 0.03072265163064003, 0.08847010880708694, -0.023341059684753418, -0.0240793339908123, -0.02527180314064026, 0.10413321107625961, -0.0025596392806619406, -0.00929664634168148, -0.06532548367977142, 0.05167010426521301, -0.01161990500986576, -0.001384065137244761, -0.0006121312617324293, -0.028040776029229164, -0.06937308609485626, -0.0010008577955886722, 0.05124099925160408, 0.0655897855758667, 0.04829001426696777, 0.06068399176001549, -0.0027798598166555166 ]
0.159856
# 聊天渠道 OpenClaw 可以在你已经使用的任何聊天应用上与你交流。每个渠道通过 Gateway 网关连接。 所有渠道都支持文本;媒体和表情回应的支持因渠道而异。 ## 支持的渠道 - [WhatsApp](/channels/whatsapp) — 最受欢迎;使用 Baileys,需要二维码配对。 - [Telegram](/channels/telegram) — 通过 grammY 使用 Bot API;支持群组。 - [Discord](/channels/discord) — Discord Bot API + Gateway;支持服务器、频道和私信。 - [Slack](/channels/slack) — Bolt SDK;工作区应用。 - [飞书](/channels/feishu) — 飞书(Lark)机器人(插件,需单独安装)。 - [Google Chat](/channels/googlechat) — 通过 HTTP webhook 的 Google Chat API 应用。 - [Mattermost](/channels/mattermost) — Bot API + WebSocket;频道、群组、私信(插件,需单独安装)。 - [Signal](/channels/signal) — signal-cli;注重隐私。 - [BlueBubbles](/channels/bluebubbles) — \*\*推荐用于 iMessage\*\*;使用 BlueBubbles macOS 服务器 REST API,功能完整(编辑、撤回、特效、回应、群组管理——编辑功能在 macOS 26 Tahoe 上目前不可用)。 - [iMessage(旧版)](/channels/imessage) — 通过 imsg CLI 的旧版 macOS 集成(已弃用,新设置请使用 BlueBubbles)。 - [Microsoft Teams](/channels/msteams) — Bot Framework;企业支持(插件,需单独安装)。 - [LINE](/channels/line) — LINE Messaging API 机器人(插件,需单独安装)。 - [Nextcloud Talk](/channels/nextcloud-talk) — 通过 Nextcloud Talk 的自托管聊天(插件,需单独安装)。 - [Matrix](/channels/matrix) — Matrix 协议(插件,需单独安装)。 - [Nostr](/channels/nostr) — 通过 NIP-04 的去中心化私信(插件,需单独安装)。 - [Tlon](/channels/tlon) — 基于 Urbit 的消息应用(插件,需单独安装)。 - [Twitch](/channels/twitch) — 通过 IRC 连接的 Twitch 聊天(插件,需单独安装)。 - [Zalo](/channels/zalo) — Zalo Bot API;越南流行的消息应用(插件,需单独安装)。 - [Zalo Personal](/channels/zalouser) — 通过二维码登录的 Zalo 个人账号(插件,需单独安装)。 - [WebChat](/web/webchat) — 基于 WebSocket 的 Gateway 网关 WebChat 界面。 ## 注意事项 - 渠道可以同时运行;配置多个渠道后,OpenClaw 会按聊天进行路由。 - 最快的设置方式通常是 \*\*Telegram\*\*(简单的机器人令牌)。WhatsApp 需要二维码配对, 并在磁盘上存储更多状态。 - 群组行为因渠道而异;参见[群组](/concepts/groups)。 - 为安全起见,私信配对和允许列表会被强制执行;参见[安全](/gateway/security)。 - Telegram 内部机制:[grammY 说明](/channels/grammy)。 - 故障排除:[渠道故障排除](/channels/troubleshooting)。 - 模型提供商单独记录;参见[模型提供商](/providers/models)。
https://github.com/openclaw/openclaw/blob/main//docs/zh-CN/channels/index.md
main
opebclaw
[ -0.0681602954864502, -0.054195236414670944, 0.042261119931936264, -0.06496448814868927, 0.049793027341365814, -0.08338630944490433, -0.003157661994919181, -0.021854449063539505, 0.06389510631561279, -0.009543525986373425, 0.07102292776107788, -0.058712854981422424, 0.015550992451608181, -0.009939637035131454, 0.10825268924236298, -0.001320693758316338, -0.03059513494372368, -0.02718874253332615, -0.044005151838064194, -0.05081690847873688, -0.014972214587032795, 0.0628494992852211, -0.0034042103216052055, 0.051360830664634705, 0.0036895542871207, -0.06519542634487152, -0.06665211915969849, 0.015009933151304722, 0.0027461331337690353, -0.003907821141183376, 0.009682998061180115, 0.024753091856837273, -0.006127281114459038, 0.0753881111741066, 0.020314881578087807, 0.044221680611371994, -0.014862563461065292, -0.0024749243166297674, 0.008359091356396675, 0.09768633544445038, -0.020548326894640923, -0.08506185561418533, -0.009969057515263557, -0.056993529200553894, 0.03557557612657547, 0.002545522293075919, -0.056578829884529114, -0.019256820902228355, -0.06378129869699478, 0.03968016058206558, -0.0427275076508522, -0.02955300360918045, -0.02058933861553669, 0.11496558785438538, -0.018625924363732338, 0.00014277605805546045, -0.11390037834644318, 0.11581769585609436, 0.10734160244464874, 0.011617685668170452, -0.015166126191616058, -0.02722088061273098, 0.009589326567947865, -0.01751898042857647, -0.08167820423841476, 0.026430116966366768, -0.0672798752784729, 0.025313299149274826, 0.012219760566949844, 0.013351377099752426, 0.002956083742901683, 0.035737112164497375, -0.06653905659914017, 0.022049756720662117, -0.009919627569615841, 0.014120267704129219, 0.019031256437301636, 0.04176894947886467, -0.0945841521024704, -0.07333794236183167, -0.012999706901609898, 0.007657239679247141, 0.04328359290957451, 0.03109591454267502, -0.0430171862244606, 0.08037131279706955, -0.028372570872306824, -0.018334170803427696, 0.0073602404445409775, -0.039708301424980164, -0.022793881595134735, -0.016242338344454765, 0.02849021553993225, 0.0709378719329834, 0.002553911879658699, 0.045908283442258835, -0.019498690962791443, 0.00026747267111204565, -0.06277795135974884, 0.04122625291347504, 0.01266152411699295, -0.030210673809051514, -0.04932209104299545, -0.023538941517472267, 0.01786837913095951, -0.00299569102935493, -0.026289744302630424, 0.0657043606042862, 0.1332041174173355, 0.04421216994524002, -0.03601153567433357, -0.05794766545295715, 0.0019161287928000093, -0.05994739383459091, -0.018223879858851433, 0.04449740797281265, -0.01940978690981865, -0.017014162614941597, 0.0607055202126503, 0.03441746160387993, 0.09098535031080246, -0.06732984632253647, -0.05085263028740883, -0.019650591537356377, -0.07042998820543289, -0.013498488813638687, 0.11408483237028122, 5.073289987433002e-33, 0.061086539179086685, 0.01419889647513628, -0.045658499002456665, -0.026979811489582062, 0.010422744788229465, -0.017863431945443153, 0.0005538740078918636, 0.004285327158868313, -0.08245045691728592, -0.019694123417139053, -0.05924074351787567, 0.013794924132525921, -0.07607582211494446, -0.008166707120835781, -0.01872248947620392, -0.0369391143321991, -0.007827814668416977, -0.0011110027553513646, 0.03976818919181824, -0.012812646105885506, -0.034519828855991364, 0.04614740610122681, -0.002522040391340852, 0.022975699976086617, 0.020982522517442703, 0.10306786000728607, 0.015060687437653542, -0.07972464710474014, -0.007536955643445253, 0.025936376303434372, -0.010495409369468689, -0.014268447645008564, -0.00944441743195057, 0.03873400762677193, 0.0024485031608492136, -0.03848053514957428, -0.07997392117977142, -0.017530987039208412, -0.08385433256626129, -0.01998482272028923, -0.04902997240424156, -0.03673970326781273, -0.13970068097114563, -0.05917106568813324, 0.006414265371859074, -0.01781386137008667, -0.09740682691335678, -0.08227434754371643, 0.04778305068612099, 0.0006384332664310932, -0.06562924385070801, 0.053736310452222824, 0.009847979992628098, 0.01225365325808525, 0.04013859108090401, -0.06948821991682053, -0.05520090460777283, -0.0053385961800813675, -0.014916522428393364, -0.05191708728671074, -0.006676838267594576, -0.020718077197670937, 0.04652746021747589, -0.019458778202533722, 0.06729330867528915, -0.002358828205615282, -0.01264117006212473, 0.04034138098359108, -0.0022035560104995966, -0.040254537016153336, -0.07533157616853714, 0.021464673802256584, 0.03471812605857849, 0.09391611069440842, -0.12189675122499466, -0.06890083849430084, -0.04816065728664398, 0.03682836890220642, 0.037791889160871506, 0.003762858919799328, -0.03449634462594986, -0.039585769176483154, -0.03590073063969612, -0.021720143035054207, -0.0036666220985352993, 0.02183394506573677, 0.05797777324914932, -0.07807178050279617, -0.04731189087033272, 0.08640837669372559, -0.17542286217212677, 0.09186016023159027, -0.010135800577700138, 0.021408284083008766, -0.06552974134683609, -7.721748187470711e-33, -0.015061303973197937, 0.05518784001469612, -0.02912994660437107, 0.027880853042006493, -0.024752071127295494, -0.04362916201353073, 0.08079641312360764, 0.011940849013626575, 0.021771002560853958, 0.1316862404346466, -0.01874316670000553, -0.02009620890021324, -0.012541295029222965, -0.06967496126890182, 0.041960325092077255, 0.024717388674616814, 0.00931321457028389, -0.040252599865198135, -0.058623362332582474, 0.007340976502746344, -0.011738987639546394, -0.011547710746526718, -0.14954224228858948, 0.03498777374625206, 0.020954547449946404, 0.032023340463638306, 0.06678645312786102, 0.04011793062090874, 0.001538243261165917, -0.06461329758167267, 0.043014831840991974, 0.02555379644036293, -0.06559965759515762, 0.047685716301202774, 0.033908355981111526, -0.010558398440480232, 0.020354224368929863, 0.10361886024475098, -0.0018115723505616188, -0.15092526376247406, 0.09300068020820618, -0.06353475898504257, -0.036615096032619476, -0.029155481606721878, -0.0022487270180135965, -0.001923175761476159, -0.05585024878382683, 0.05343646556138992, -0.13062742352485657, -0.016079097986221313, 0.12639261782169342, -0.04488862678408623, 0.03087622858583927, -0.02259254828095436, -0.018872510641813278, 0.07488979399204254, 0.04435243457555771, -0.03129294887185097, -0.03375709429383278, -0.13102349638938904, 0.023915564641356468, -0.12479499727487564, 0.01020957063883543, 0.05088689550757408, 0.02692706510424614, -0.034992069005966187, 0.01174337137490511, 0.0662384033203125, -0.013089672662317753, -0.023473449051380157, 0.06367077678442001, -0.02369033917784691, 0.01425162237137556, -0.05822502821683884, 0.03416122496128082, 0.012267034500837326, -0.0031608310528099537, -0.01144684012979269, -0.004822297487407923, 0.013298881240189075, -0.03257809951901436, 0.07956758886575699, 0.04345918446779251, 0.05371527746319771, 0.020512962713837624, 0.04200523719191551, 0.012578142806887627, 0.13291876018047333, -0.014311820268630981, -0.01870316080749035, 0.008737648837268353, 0.03072681836783886, 0.006919889710843563, 0.04864315316081047, 0.007496313191950321, -4.5219028521614746e-8, -0.035774294286966324, -0.06795486807823181, -0.10245244950056076, -0.01923753321170807, -0.01071475725620985, 0.0009674003813415766, 0.009596699848771095, -0.022049564868211746, 0.0018751958850771189, -0.022218165919184685, -0.00519204419106245, -0.002037565689533949, -0.07459604740142822, 0.05488508194684982, -0.038228366523981094, -0.07055176049470901, -0.08768363296985626, 0.008738882839679718, 0.031381428241729736, -0.05010399594902992, -0.020079391077160835, -0.0010884931543841958, 0.026018744334578514, -0.014612742699682713, -0.04637422040104866, -0.017958246171474457, 0.009018301963806152, 0.06883874535560608, -0.07839176803827286, -0.054464131593704224, -0.04779167100787163, -0.026569362729787827, 0.018067315220832825, -0.08877964317798615, 0.053197477012872696, 0.05971681699156761, -0.05620983615517616, -0.05625051632523537, -0.043482836335897446, 0.014795934781432152, 0.10916877537965775, -0.08601410686969757, 0.0521063432097435, 0.012362363748252392, 0.03221318498253822, -0.016571184620261192, 0.04083807021379471, 0.024190818890929222, 0.08197936415672302, 0.007231401279568672, -0.05677757412195206, -0.05907003581523895, 0.05189697444438934, -0.05013861134648323, 0.024370970204472542, -0.018721405416727066, 0.03420413285493851, -0.0574580654501915, -0.010883714072406292, 0.03919672593474388, 0.0498669259250164, 0.11003684997558594, 0.0040462929755449295, 0.026550957933068275 ]
0.092622
# WhatsApp(网页渠道) 状态:仅支持通过 Baileys 的 WhatsApp Web。Gateway 网关拥有会话。 ## 快速设置(新手) 1. 如果可能,使用\*\*单独的手机号码\*\*(推荐)。 2. 在 `~/.openclaw/openclaw.json` 中配置 WhatsApp。 3. 运行 `openclaw channels login` 扫描二维码(关联设备)。 4. 启动 Gateway 网关。 最小配置: ```json5 { channels: { whatsapp: { dmPolicy: "allowlist", allowFrom: ["+15551234567"], }, }, } ``` ## 目标 - 在一个 Gateway 网关进程中支持多个 WhatsApp 账户(多账户)。 - 确定性路由:回复返回到 WhatsApp,无模型路由。 - 模型能看到足够的上下文来理解引用回复。 ## 配置写入 默认情况下,WhatsApp 允许写入由 `/config set|unset` 触发的配置更新(需要 `commands.config: true`)。 禁用方式: ```json5 { channels: { whatsapp: { configWrites: false } }, } ``` ## 架构(谁拥有什么) - \*\*Gateway 网关\*\*拥有 Baileys socket 和收件箱循环。 - \*\*CLI / macOS 应用\*\*与 Gateway 网关通信;不直接使用 Baileys。 - 发送出站消息需要\*\*活跃的监听器\*\*;否则发送会快速失败。 ## 获取手机号码(两种模式) WhatsApp 需要真实手机号码进行验证。VoIP 和虚拟号码通常会被封锁。在 WhatsApp 上运行 OpenClaw 有两种支持的方式: ### 专用号码(推荐) 为 OpenClaw 使用\*\*单独的手机号码\*\*。最佳用户体验,清晰的路由,无自聊天怪异问题。理想设置:\*\*备用/旧 Android 手机 + eSIM\*\*。保持 Wi-Fi 和电源连接,通过二维码关联。 \*\*WhatsApp Business:\*\* 你可以在同一设备上使用不同号码的 WhatsApp Business。非常适合将个人 WhatsApp 分开——安装 WhatsApp Business 并在那里注册 OpenClaw 号码。 \*\*示例配置(专用号码,单用户允许列表):\*\* ```json5 { channels: { whatsapp: { dmPolicy: "allowlist", allowFrom: ["+15551234567"], }, }, } ``` \*\*配对模式(可选):\*\* 如果你想使用配对而不是允许列表,请将 `channels.whatsapp.dmPolicy` 设置为 `pairing`。未知发送者会收到配对码;使用以下命令批准: `openclaw pairing approve whatsapp ```` ` ### 个人号码(备选方案) 快速备选方案:在**你自己的号码**上运行 OpenClaw。给自己发消息(WhatsApp"给自己发消息")进行测试,这样就不会打扰联系人。在设置和实验期间需要在主手机上阅读验证码。**必须启用自聊天模式。** 当向导询问你的个人 WhatsApp 号码时,输入你将用于发送消息的手机(所有者/发送者),而不是助手号码。 **示例配置(个人号码,自聊天):** ```json { "whatsapp": { "selfChatMode": true, "dmPolicy": "allowlist", "allowFrom": ["+15551234567"] } } ``` 当设置了 `identity.name` 时,自聊天回复默认为 `[{identity.name}]`(否则为 `[openclaw]`), 前提是 `messages.responsePrefix` 未设置。明确设置它可以自定义或禁用 前缀(使用 `""` 来移除)。 ### 号码获取提示 - **本地 eSIM** 来自你所在国家的移动运营商(最可靠) - 奥地利:[hot.at](https://www.hot.at) - 英国:[giffgaff](https://www.giffgaff.com) — 免费 SIM 卡,无合约 - **预付费 SIM 卡** — 便宜,只需接收一条验证短信 **避免:** TextNow、Google Voice、大多数"免费短信"服务——WhatsApp 会积极封锁这些。 **提示:** 该号码只需要接收一条验证短信。之后,WhatsApp Web 会话通过 `creds.json` 持久化。 ## 为什么不用 Twilio? - 早期 OpenClaw 版本支持 Twilio 的 WhatsApp Business 集成。 - WhatsApp Business 号码不适合个人助手。 - Meta 强制执行 24 小时回复窗口;如果你在过去 24 小时内没有回复,商业号码无法发起新消息。 - 高频或"频繁"使用会触发激进的封锁,因为商业账户不适合发送大量个人助手消息。 - 结果:投递不可靠且频繁被封锁,因此该支持已被移除。 ## 登录 + 凭证 - 登录命令:`openclaw channels login`(通过关联设备扫描二维码)。 - 多账户登录:`openclaw channels login --account `(`` = `accountId`)。 - 默认账户(省略 `--account` 时):如果存在则为 `default`,否则为第一个配置的账户 id(排序后)。 - 凭证存储在 `~/.openclaw/credentials/whatsapp//creds.json`。 - 备份副本在 `creds.json.bak`(损坏时恢复)。 - 旧版兼容性:较旧的安装将 Baileys 文件直接存储在 `~/.openclaw/credentials/` 中。 - 登出:`openclaw channels logout`(或 `--account `)删除 WhatsApp 认证状态(但保留共享的 `oauth.json`)。 - 已登出的 socket => 错误提示重新关联。 ## 入站流程(私信 + 群组) - WhatsApp 事件来自 `messages.upsert`(Baileys)。 - 收件箱监听器在关闭时分离,以避免在测试/重启时累积事件处理器。 - 状态/广播聊天被忽略。 - 直接聊天使用 E.164;群组使用群组 JID。 - **私信策略**:`channels.whatsapp.dmPolicy` 控制直接聊天访问(默认:`pairing`)。 - 配对:未知发送者会收到配对码(通过 `openclaw pairing approve whatsapp ` 批准;码在 1 小时后过期)。 - 开放:需要 `channels.whatsapp.allowFrom` 包含 `"*"`。 - 你关联的 WhatsApp 号码是隐式信任的,因此自身消息会跳过 `channels.whatsapp.dmPolicy` 和 `channels.whatsapp.allowFrom` 检查。 ### 个人号码模式(备选方案) 如果你在**个人 WhatsApp 号码**上运行 OpenClaw,请启用 `channels.whatsapp.selfChatMode`(见上面的示例)。 行为: - 出站私信永远不会触发配对回复(防止打扰联系人)。 - 入站未知发送者仍遵循 `channels.whatsapp.dmPolicy`。 - 自聊天模式(allowFrom 包含你的号码)避免自动已读回执并忽略提及 JID。 - 非自聊天私信会发送已读回执。 ## 已读回执 默认情况下,Gateway 网关在接受入站 WhatsApp 消息后将其标记为已读(蓝色勾号)。 全局禁用: ```json5 { channels: { whatsapp: { sendReadReceipts: false } }, } ``` 按账户禁用: ```json5 { channels: { whatsapp: { accounts: { personal: { sendReadReceipts: false }, }, }, }, } ``` 注意事项: - 自聊天模式始终跳过已读回执。 ## WhatsApp 常见问题:发送消息 + 配对 **当我关联 WhatsApp 时,OpenClaw 会给随机联系人发消息吗?** 不会。默认私信策略是**配对**,因此未知发送者只会收到配对码,他们的消息**不会被处理**。OpenClaw 只会回复它收到的聊天,或你明确触发的发送(智能体/CLI)。 **WhatsApp 上的配对是如何工作的?** 配对是未知发送者的私信门控: - 来自新发送者的第一条私信返回一个短码(消息不会被处理)。 - 使用以下命令批准:`openclaw pairing approve whatsapp `(使用 `openclaw pairing list whatsapp` 列出)。 - 码在 1 小时后过期;每个渠道的待处理请求上限为 3 个。 **多个人可以在一个 WhatsApp 号码上使用不同的 OpenClaw 实例吗?** 可以,通过 `bindings` 将每个发送者路由到不同的智能体(peer `kind: "dm"`,发送者 E.164 如 `+15551234567`)。回复仍然来自**同一个 WhatsApp 账户**,直接聊天会折叠到每个智能体的主会话,因此**每人使用一个智能体**。私信访问控制(`dmPolicy`/`allowFrom`)是每个 WhatsApp 账户全局的。参见[多智能体路由](/concepts/multi-agent)。 **为什么向导会询问我的手机号码?** 向导使用它来设置你的**允许列表/所有者**,以便允许你自己的私信。它不会用于自动发送。如果你在个人 WhatsApp 号码上运行,请使用相同的号码并启用 `channels.whatsapp.selfChatMode`。 ## 消息规范化(模型看到的内容) - `Body` 是带有信封的当前消息正文。 - 引用回复上下文**始终附加**: ``` [Replying to +1555 id:ABC123] > [/Replying] ``` - 回复元数据也会设置: - `ReplyToId` = stanzaId - `ReplyToBody` = 引用正文或媒体占位符 - `ReplyToSender` = 已知时为 E.164 - 纯媒体入站消息使用占位符: - `` ## 群组 - 群组映射到 `agent::whatsapp:group:` 会话。 - 群组策略:`channels.whatsapp.groupPolicy = open|disabled|allowlist`(默认 `allowlist`)。 - 激活模式: - `mention`(默认):需要 @提及或正则匹配。 - `always`:始终触发。 - `/activation mention|always` 仅限所有者,必须作为独立消息发送。 - 所有者 = `channels.whatsapp.allowFrom`(如果未设置则为自身 E.164)。 - **历史注入**(仅待处理): - 最近*未处理*的消息(默认 50 条)插入在: `[Chat messages since your last reply - for context]`(已在会话中的消息不会重新注入) - 当前消息在: `[Current message - respond to this]` - 附加发送者后缀:`[from: Name (+E164)]` - 群组元数据缓存 5 分钟(主题 + 参与者)。 ## 回复投递(线程) - WhatsApp Web 发送标准消息(当前 Gateway 网关无引用回复线程)。 - 此渠道忽略回复标签。 ## 确认表情(收到时自动回应) WhatsApp 可以在收到传入消息时立即自动发送表情回应,在机器人生成回复之前。这为用户提供即时反馈,表明他们的消息已收到。 **配置:** ```json { "whatsapp": { "ackReaction": { "emoji": "👀", "direct": true, "group": "mentions" } } } ``` **选项:** - `emoji`(字符串):用于确认的表情(例如"👀"、"✅"、"📨")。为空或省略 = 功能禁用。 - `direct`(布尔值,默认:`true`):在直接/私信聊天中发送表情回应。 - `group`(字符串,默认:`"mentions"`):群聊行为: - `"always"`:对所有群消息做出回应(即使没有 @提及) - `"mentions"`:仅在机器人被 @提及时做出回应 - `"never"`:从不在群组中做出回应 **按账户覆盖:** ```json { "whatsapp": { "accounts": { "work": { "ackReaction": {
https://github.com/openclaw/openclaw/blob/main//docs/zh-CN/channels/whatsapp.md
main
opebclaw
[ -0.0869775265455246, 0.029325421899557114, 0.005282561760395765, -0.06064312160015106, 0.022416407242417336, -0.08961186558008194, -0.010202222503721714, -0.01994055137038231, 0.037726953625679016, -0.008528468199074268, 0.06531263887882233, 0.010283062234520912, -0.0038405132945626974, 0.031189899891614914, 0.10618598759174347, 0.05249201878905296, -0.11393050104379654, -0.05383201688528061, -0.07577168941497803, -0.03694191575050354, 0.02094675414264202, 0.05045314505696297, -0.0017098661046475172, 0.013164347037672997, -0.017470182850956917, -0.024873187765479088, -0.04045523703098297, 0.08156002312898636, -0.032313521951436996, 0.013551995158195496, 0.0096134589985013, 0.07365346699953079, -0.026276161894202232, 0.036043088883161545, 0.03386450558900833, -0.0018415754893794656, 0.042590342462062836, -0.040818922221660614, 0.05214560031890869, 0.061305463314056396, -0.011791686527431011, 0.01976187154650688, -0.037886276841163635, -0.040954750031232834, 0.05194685235619545, -0.05805715173482895, -0.07322116196155548, -0.044199977070093155, -0.05332217738032341, 0.009902924299240112, -0.0881117507815361, -0.011639357544481754, -0.026215456426143646, 0.007069863379001617, -0.030194470658898354, -0.014254509471356869, -0.1383449137210846, 0.06547253578901291, 0.06906820833683014, -0.003996135201305151, -0.014758163131773472, -0.04602168872952461, -0.012989369221031666, -0.004810293670743704, -0.13833525776863098, 0.010583429597318172, -0.058802295476198196, -0.027201510965824127, 0.019945627078413963, 0.03073209710419178, -0.030578117817640305, 0.0018724070396274328, -0.013617494143545628, 0.00803363136947155, -0.0036738321650773287, -0.02214769646525383, 0.02646857686340809, -0.024028446525335312, -0.11870045959949493, -0.07062792778015137, 0.0012757821241393685, -0.04966692253947258, -0.04333093762397766, 0.06496990472078323, -0.06354233622550964, 0.10542561113834381, -0.06695704907178879, -0.014212360605597496, 0.022007346153259277, -0.07398753613233566, -0.02203955501317978, -0.09864982217550278, -0.025886164978146553, 0.06589847803115845, -0.012460063211619854, 0.01836075633764267, 0.004637701902538538, -0.02601926401257515, -0.08506180346012115, 0.02831401489675045, 0.049861207604408264, -0.053972288966178894, 0.0299034733325243, 0.0012967379298061132, 0.024136586114764214, 0.003473376389592886, 0.031245118007063866, 0.10056641697883606, 0.08880938589572906, 0.03323880955576897, -0.037146732211112976, -0.01718132197856903, 0.006670182105153799, -0.07876928150653839, -0.08200877904891968, 0.0640648603439331, -0.02990257926285267, -0.05365082994103432, 0.012239188887178898, 0.00591830862686038, 0.13015149533748627, -0.03359292820096016, -0.07230621576309204, 0.028305070474743843, -0.05693529546260834, -0.020062604919075966, 0.120641328394413, 1.0656272305001632e-33, 0.018492648378014565, 0.00899558886885643, 0.011976792477071285, -0.045914825052022934, 0.05541403964161873, -0.06438376009464264, 0.022150637581944466, -0.006573495455086231, -0.05780702829360962, 0.03542282432317734, -0.01328584086149931, 0.020467642694711685, -0.07113149762153625, -0.033811233937740326, -0.03802647814154625, -0.02653019316494465, -0.04364416003227234, 0.02153927832841873, 0.08426224440336227, 0.027632111683487892, -0.019472643733024597, -0.012345314025878906, -0.0096711665391922, -0.02738640084862709, 0.03325514867901802, 0.07699457556009293, 0.05053270608186722, 0.00013516092440113425, 0.010977874509990215, 0.017769088968634605, 0.05525758117437363, -0.03231186419725418, -0.03599566966295242, -0.008802277036011219, 0.010420465841889381, 0.006454821676015854, -0.0265334602445364, 0.00952574610710144, -0.055265169590711594, -0.04654410481452942, -0.00040238990914076567, -0.02831379696726799, -0.12380620092153549, 0.03329801186919212, 0.043295297771692276, -0.017511844635009766, -0.10297372937202454, -0.011909514665603638, -0.008398927748203278, 0.0040032751858234406, -0.11683498322963715, 0.06844053417444229, -0.036182478070259094, 0.011024309322237968, 0.025552719831466675, -0.053559575229883194, -0.016403017565608025, 0.012169452384114265, -0.031888678669929504, -0.060366325080394745, 0.02033795416355133, -0.008106094785034657, 0.007109277416020632, -0.018052365630865097, 0.05770130455493927, -0.0005114785162732005, -0.032670628279447556, 0.015397853218019009, -0.03546826168894768, -0.029068388044834137, -0.05639450252056122, 0.0454847551882267, 0.07783540338277817, 0.07139700651168823, -0.09544990211725235, -0.040773093700408936, -0.01868872530758381, 0.12721224129199982, 0.08201660960912704, -0.03700719401240349, 0.03489977493882179, -0.051632270216941833, -0.06365300714969635, 0.0485975444316864, -0.020730439573526382, 0.0880018100142479, 0.0760708898305893, -0.05798891931772232, -0.053556106984615326, 0.059466853737831116, -0.10839788615703583, 0.08254151791334152, 0.053509537130594254, -0.00856297742575407, -0.04212568700313568, -4.9267297191144636e-33, -0.009985853917896748, 0.03643469139933586, -0.032402876764535904, -0.011638655327260494, -0.02682914026081562, -0.07155679911375046, 0.07697642594575882, 0.021068787202239037, 0.08407845348119736, 0.07682481408119202, -0.0018381736008450389, -0.01438335794955492, 0.010406741872429848, -0.05307931825518608, 0.040032628923654556, 0.01987294852733612, 0.011236182413995266, 0.01583409123122692, -0.01411501970142126, 0.029747141525149345, 0.013688793405890465, 0.04458841308951378, -0.07087142765522003, 0.07455091923475266, -0.0011953196953982115, 0.025690481066703796, 0.08786051720380783, -0.002722592791542411, -0.07057711482048035, -0.047017164528369904, 0.012665924616158009, -0.00830866303294897, -0.017199791967868805, 0.08847881108522415, 0.029121223837137222, -0.052427034825086594, 0.016738837584853172, 0.10700777173042297, 0.0342409685254097, -0.04987768828868866, 0.05423954874277115, -0.028059666976332664, -0.04409317299723625, -0.0048880609683692455, -0.01315365545451641, 0.014041239395737648, 0.0004736045957542956, 0.03844497352838516, -0.0793275386095047, -0.046350568532943726, 0.0795755535364151, -0.013559880666434765, -0.017677929252386093, -0.04397256299853325, 0.0397656224668026, 0.06681662797927856, 0.061896223574876785, -0.0627649575471878, 0.01900186948478222, -0.13714085519313812, 0.007647332269698381, -0.09347806870937347, -0.01925247348845005, 0.05455350875854492, 0.07315105199813843, -0.03243913874030113, -0.022361766546964645, -0.016560424119234085, 0.01835918053984642, -0.07602789252996445, -0.041444480419158936, -0.0679369643330574, 0.05867643654346466, -0.02898215502500534, 0.07545728981494904, 0.0008227544603869319, -0.05884000286459923, -0.02680412493646145, 0.013479155488312244, 0.07099821418523788, 0.003831445937976241, 0.01140053104609251, 0.0175639558583498, 0.053656645119190216, 0.03301495313644409, 0.0020741568878293037, 0.0009354751673527062, 0.10263106971979141, -0.020926566794514656, -0.017504451796412468, -0.026425795629620552, 0.05943461135029793, 0.02417309395968914, 0.016018573194742203, 0.026700561866164207, -4.4852559000219117e-8, -0.07389435172080994, -0.10928985476493835, -0.09733371436595917, -0.018175002187490463, -0.017339026555418968, -0.0122917415574193, -0.02528565749526024, -0.014302046038210392, 0.060964811593294144, -0.07405944913625717, 0.022832898423075676, 0.07034720480442047, -0.11755155771970749, 0.055553603917360306, -0.10308700054883957, -0.027786964550614357, -0.11601515859365463, -0.0016499157063663006, 0.038212429732084274, -0.011326049454510212, -0.006964735221117735, 0.023562166839838028, 0.053582314401865005, -0.029206465929746628, -0.00834126677364111, -0.008412138558924198, -0.028340118005871773, 0.04609374701976776, -0.08292955160140991, -0.03488658741116524, -0.05988878384232521, -0.05203872174024582, 0.019255882129073143, -0.04674769565463066, 0.004930512979626656, 0.003215985605493188, 0.03660650551319122, -0.033912453800439835, -0.03978870436549187, 0.03817596286535263, 0.09252716600894928, -0.057353585958480835, -0.03674144670367241, 0.013310297392308712, 0.03806034475564957, -0.033565741032361984, 0.05344759672880173, 0.03083697333931923, 0.09030679613351822, -0.04798666387796402, -0.04221741482615471, -0.0387689545750618, 0.08532273024320602, -0.08246029913425446, -0.002635268261656165, -0.02220991812646389, 0.03684239089488983, -0.010138311423361301, -0.021927600726485252, 0.06673391163349152, 0.041208188980817795, 0.11498845368623734, 0.030495120212435722, 0.0699588730931282 ]
-0.004376
此渠道忽略回复标签。 ## 确认表情(收到时自动回应) WhatsApp 可以在收到传入消息时立即自动发送表情回应,在机器人生成回复之前。这为用户提供即时反馈,表明他们的消息已收到。 **配置:** ```json { "whatsapp": { "ackReaction": { "emoji": "👀", "direct": true, "group": "mentions" } } } ``` **选项:** - `emoji`(字符串):用于确认的表情(例如"👀"、"✅"、"📨")。为空或省略 = 功能禁用。 - `direct`(布尔值,默认:`true`):在直接/私信聊天中发送表情回应。 - `group`(字符串,默认:`"mentions"`):群聊行为: - `"always"`:对所有群消息做出回应(即使没有 @提及) - `"mentions"`:仅在机器人被 @提及时做出回应 - `"never"`:从不在群组中做出回应 **按账户覆盖:** ```json { "whatsapp": { "accounts": { "work": { "ackReaction": { "emoji": "✅", "direct": false, "group": "always" } } } } } ``` **行为说明:** - 表情回应在消息收到时**立即**发送,在输入指示器或机器人回复之前。 - 在 `requireMention: false`(激活:always)的群组中,`group: "mentions"` 会对所有消息做出回应(不仅仅是 @提及)。 - 即发即忘:表情回应失败会被记录但不会阻止机器人回复。 - 群组表情回应会自动包含参与者 JID。 - WhatsApp 忽略 `messages.ackReaction`;请改用 `channels.whatsapp.ackReaction`。 ## 智能体工具(表情回应) - 工具:`whatsapp`,带有 `react` 动作(`chatJid`、`messageId`、`emoji`,可选 `remove`)。 - 可选:`participant`(群组发送者)、`fromMe`(对自己的消息做出回应)、`accountId`(多账户)。 - 表情移除语义:参见 [/tools/reactions](/tools/reactions)。 - 工具门控:`channels.whatsapp.actions.reactions`(默认:启用)。 ## 限制 - 出站文本按 `channels.whatsapp.textChunkLimit` 分块(默认 4000)。 - 可选换行分块:设置 `channels.whatsapp.chunkMode="newline"` 在长度分块之前按空行(段落边界)分割。 - 入站媒体保存受 `channels.whatsapp.mediaMaxMb` 限制(默认 50 MB)。 - 出站媒体项受 `agents.defaults.mediaMaxMb` 限制(默认 5 MB)。 ## 出站发送(文本 + 媒体) - 使用活跃的网页监听器;如果 Gateway 网关未运行则报错。 - 文本分块:每条消息最大 4k(可通过 `channels.whatsapp.textChunkLimit` 配置,可选 `channels.whatsapp.chunkMode`)。 - 媒体: - 支持图片/视频/音频/文档。 - 音频作为 PTT 发送;`audio/ogg` => `audio/ogg; codecs=opus`。 - 仅在第一个媒体项上添加标题。 - 媒体获取支持 HTTP(S) 和本地路径。 - 动画 GIF:WhatsApp 期望带有 `gifPlayback: true` 的 MP4 以实现内联循环。 - CLI:`openclaw message send --media --gif-playback` - Gateway 网关:`send` 参数包含 `gifPlayback: true` ## 语音消息(PTT 音频) WhatsApp 将音频作为**语音消息**(PTT 气泡)发送。 - 最佳效果:OGG/Opus。OpenClaw 将 `audio/ogg` 重写为 `audio/ogg; codecs=opus`。 - WhatsApp 忽略 `[[audio_as_voice]]`(音频已作为语音消息发送)。 ## 媒体限制 + 优化 - 默认出站上限:5 MB(每个媒体项)。 - 覆盖:`agents.defaults.mediaMaxMb`。 - 图片自动优化为上限以下的 JPEG(调整大小 + 质量扫描)。 - 超大媒体 => 错误;媒体回复降级为文本警告。 ## 心跳 - **Gateway 网关心跳**记录连接健康状态(`web.heartbeatSeconds`,默认 60 秒)。 - **智能体心跳**可以按智能体配置(`agents.list[].heartbeat`)或通过 `agents.defaults.heartbeat` 全局配置(当没有设置按智能体条目时的降级)。 - 使用配置的心跳提示词(默认:`Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not infer or repeat old tasks from prior chats. If nothing needs attention, reply HEARTBEAT_OK.`)+ `HEARTBEAT_OK` 跳过行为。 - 投递默认为最后使用的渠道(或配置的目标)。 ## 重连行为 - 退避策略:`web.reconnect`: - `initialMs`、`maxMs`、`factor`、`jitter`、`maxAttempts`。 - 如果达到 maxAttempts,网页监控停止(降级)。 - 已登出 => 停止并要求重新关联。 ## 配置快速映射 - `channels.whatsapp.dmPolicy`(私信策略:pairing/allowlist/open/disabled)。 - `channels.whatsapp.selfChatMode`(同手机设置;机器人使用你的个人 WhatsApp 号码)。 - `channels.whatsapp.allowFrom`(私信允许列表)。WhatsApp 使用 E.164 手机号码(无用户名)。 - `channels.whatsapp.mediaMaxMb`(入站媒体保存上限)。 - `channels.whatsapp.ackReaction`(消息收到时的自动回应:`{emoji, direct, group}`)。 - `channels.whatsapp.accounts..*`(按账户设置 + 可选 `authDir`)。 - `channels.whatsapp.accounts..mediaMaxMb`(按账户入站媒体上限)。 - `channels.whatsapp.accounts..ackReaction`(按账户确认回应覆盖)。 - `channels.whatsapp.groupAllowFrom`(群组发送者允许列表)。 - `channels.whatsapp.groupPolicy`(群组策略)。 - `channels.whatsapp.historyLimit` / `channels.whatsapp.accounts..historyLimit`(群组历史上下文;`0` 禁用)。 - `channels.whatsapp.dmHistoryLimit`(私信历史限制,按用户轮次)。按用户覆盖:`channels.whatsapp.dms[""].historyLimit`。 - `channels.whatsapp.groups`(群组允许列表 + 提及门控默认值;使用 `"*"` 允许全部) - `channels.whatsapp.actions.reactions`(门控 WhatsApp 工具表情回应)。 - `agents.list[].groupChat.mentionPatterns`(或 `messages.groupChat.mentionPatterns`) - `messages.groupChat.historyLimit` - `channels.whatsapp.messagePrefix`(入站前缀;按账户:`channels.whatsapp.accounts..messagePrefix`;已弃用:`messages.messagePrefix`) - `messages.responsePrefix`(出站前缀) - `agents.defaults.mediaMaxMb` - `agents.defaults.heartbeat.every` - `agents.defaults.heartbeat.model`(可选覆盖) - `agents.defaults.heartbeat.target` - `agents.defaults.heartbeat.to` - `agents.defaults.heartbeat.session` - `agents.list[].heartbeat.*`(按智能体覆盖) - `session.*`(scope、idle、store、mainKey) - `web.enabled`(为 false 时禁用渠道启动) - `web.heartbeatSeconds` - `web.reconnect.*` ## 日志 + 故障排除 - 子系统:`whatsapp/inbound`、`whatsapp/outbound`、`web-heartbeat`、`web-reconnect`。 - 日志文件:`/tmp/openclaw/openclaw-YYYY-MM-DD.log`(可配置)。 - 故障排除指南:[Gateway 网关故障排除](/gateway/troubleshooting)。 ## 故障排除(快速) **未关联 / 需要二维码登录** - 症状:`channels status` 显示 `linked: false` 或警告"Not linked"。 - 修复:在 Gateway 网关主机上运行 `openclaw channels login` 并扫描二维码(WhatsApp → 设置 → 关联设备)。 **已关联但断开连接 / 重连循环** - 症状:`channels status` 显示 `running, disconnected` 或警告"Linked but disconnected"。 - 修复:`openclaw doctor`(或重启 Gateway 网关)。如果问题持续,通过 `channels login` 重新关联并检查 `openclaw logs --follow`。 **Bun 运行时** - **不推荐** Bun。WhatsApp(Baileys)和 Telegram 在 Bun 上不可靠。 请使用 **Node** 运行 Gateway 网关。(参见入门指南运行时说明。) ````
https://github.com/openclaw/openclaw/blob/main//docs/zh-CN/channels/whatsapp.md
main
opebclaw
[ -0.09913221001625061, 0.03107708878815174, 0.028128935024142265, -0.00865066796541214, 0.032505374401807785, -0.027491172775626183, 0.061617009341716766, -0.0031888424418866634, 0.09568477421998978, -0.04445965960621834, 0.13897225260734558, -0.06520836055278778, 0.06890463829040527, 0.04105450585484505, 0.06933324784040451, 0.027829991653561592, -0.10409185290336609, -0.00017668417422100902, -0.09220860153436661, -0.07162046432495117, 0.011874761432409286, 0.04213236644864082, 0.06359639763832092, -0.009101904928684235, -0.021695854142308235, -0.00036841692053712904, -0.080101877450943, 0.0022597818169742823, -0.01916615664958954, -0.005136917810887098, -0.0548924058675766, 0.06234845891594887, -0.019974054768681526, 0.10565158724784851, -0.007520086597651243, 0.07020086795091629, 0.0005010941531509161, -0.009433131664991379, 0.07781325280666351, 0.058994174003601074, -0.04764643684029579, -0.0231922660022974, -0.0023621302098035812, -0.08245319128036499, 0.08061618357896805, 0.023333678022027016, -0.06445077806711197, 0.029169557616114616, -0.11038730293512344, 0.038217540830373764, -0.027605099603533745, -0.01403474248945713, -0.036579430103302, 0.08560831844806671, -0.004509276244789362, -0.014705453999340534, -0.13486053049564362, -0.007562092039734125, 0.041778285056352615, -0.01955084688961506, -0.04944179207086563, -0.027747318148612976, 0.0046027665957808495, -0.0032929005101323128, -0.09950357675552368, 0.011515544727444649, -0.0031443883199244738, 0.0015728631988167763, 0.03300962969660759, 0.03840506821870804, 0.0044222124852240086, 0.02043006382882595, -0.02199435792863369, 0.0032311887480318546, -0.022353462874889374, 0.04011623561382294, 0.02576454170048237, 0.00776983005926013, -0.07540684938430786, -0.0783422589302063, 0.004831844009459019, -0.04819157347083092, 0.023098528385162354, 0.05826195701956749, -0.05141371116042137, 0.05060281977057457, -0.0752868726849556, -0.05446648970246315, -0.04132084921002388, -0.04543641209602356, -0.0078897038474679, -0.03629493713378906, 0.07186932861804962, 0.024019895121455193, -0.0060148686170578, -0.00004055658064316958, 0.037697043269872665, 0.00382308941334486, -0.07725480943918228, 0.03684269264340401, 0.02812487818300724, -0.01319113653153181, -0.0016144263790920377, -0.0605500303208828, 0.018788764253258705, -0.035721711814403534, -0.007386432494968176, -0.057849153876304626, 0.04422765597701073, 0.04950646311044693, -0.0476638562977314, -0.013011694885790348, -0.042120158672332764, -0.12329447269439697, -0.049258507788181305, 0.020403563976287842, -0.03362247347831726, -0.031945839524269104, 0.07895220816135406, 0.00201806309632957, 0.07194161415100098, -0.02241414226591587, -0.08253148943185806, 0.04010883718729019, -0.05403682217001915, -0.03791894391179085, 0.04508994147181511, 8.714500921198135e-33, 0.028824103996157646, 0.03784657269716263, 0.0364132821559906, -0.08320047706365585, -0.021203679963946342, -0.06168074160814285, -0.04599519819021225, 0.028403813019394875, -0.08480481058359146, -0.010301914997398853, -0.02936859242618084, -0.007843809202313423, -0.04479775205254555, 0.04901993274688721, -0.08820963650941849, -0.03704693913459778, -0.001315813628025353, -0.020892517641186714, 0.053068939596414566, -0.00044329246156848967, -0.012268384918570518, 0.05349121242761612, -0.0061016078107059, -0.02196752093732357, -0.002410047920420766, 0.00017384243255946785, 0.06628908962011337, 0.004616947378963232, -0.020941227674484253, 0.018966643139719963, -0.017542509362101555, -0.013009296730160713, -0.013962757773697376, 0.002389698289334774, -0.005382949952036142, 0.00947083905339241, 0.006119181867688894, 0.006156337447464466, -0.019346436485648155, -0.012269378639757633, -0.02585548162460327, 0.0025558900088071823, -0.11460722237825394, -0.012670070864260197, 0.06376788020133972, 0.01263180747628212, -0.08441326767206192, -0.07514236867427826, -0.021056167781352997, -0.012748357839882374, -0.06815212219953537, 0.05702853202819824, -0.043593570590019226, 0.007792466785758734, 0.0399099625647068, -0.0828169509768486, -0.031007159501314163, 0.03418329358100891, 0.011305693536996841, -0.019536739215254784, 0.042683716863393784, -0.01707378402352333, 0.004606063012033701, 0.031103525310754776, 0.036629728972911835, 0.0170100387185812, -0.04831968620419502, -0.018466874957084656, 0.011072036810219288, -0.013247878290712833, -0.05099279060959816, 0.052651405334472656, 0.06091037020087242, 0.04471494257450104, -0.08624785393476486, -0.0528569221496582, -0.059294987469911575, 0.09661109000444412, 0.017451727762818336, 0.011919859796762466, -0.006926612462848425, -0.04082293063402176, -0.06715754419565201, -0.00207363348454237, -0.04727063328027725, 0.03598944470286369, 0.05439181253314018, -0.08246897906064987, -0.09280845522880554, 0.0033957615960389376, -0.10175253450870514, 0.06880073994398117, 0.077400341629982, 0.0021283242385834455, -0.05432483181357384, -1.2308638081658636e-32, 0.03389686718583107, 0.08111058175563812, -0.013545149937272072, 0.0004361528262961656, -0.009704474359750748, -0.07098133116960526, 0.05641304701566696, 0.08356395363807678, 0.08314947783946991, 0.11359000205993652, -0.04448011890053749, -0.05975303798913956, -0.021265164017677307, -0.02390464022755623, 0.0037819186691194773, 0.07102862745523453, 0.024670038372278214, 0.07733556628227234, 0.0012887605698779225, 0.032839130610227585, 0.013431183062493801, 0.02475934475660324, -0.09433916956186295, 0.08020741492509842, -0.009606868028640747, 0.007479566149413586, 0.06436945497989655, -0.026742497459053993, -0.03755257651209831, -0.019965779036283493, 0.0050666555762290955, -0.04063804820179939, -0.044879838824272156, 0.1274619698524475, -0.060955677181482315, -0.09170243889093399, -0.026188960298895836, 0.060661304742097855, 0.012421571649610996, -0.007126736454665661, 0.0740794911980629, -0.024882975965738297, -0.06594696640968323, 0.009293580427765846, 0.01243648398667574, -0.04336228221654892, -0.028278183192014694, -0.009825500659644604, -0.08252893388271332, -0.069517582654953, 0.027754509821534157, -0.03313501179218292, -0.037414245307445526, -0.06628449261188507, 0.044476211071014404, 0.04580927640199661, 0.045439403504133224, -0.06818747520446777, -0.05529920384287834, -0.09979018568992615, 0.03160391002893448, -0.07331772893667221, 0.004578958731144667, 0.01499936729669571, 0.05357236787676811, -0.05473534017801285, -0.017143243923783302, -0.0067499480210244656, 0.059262245893478394, -0.03950059041380882, 0.06857480853796005, -0.008393552154302597, -0.00827164575457573, -0.04692528396844864, 0.0706799104809761, 0.014009825885295868, -0.01078109536319971, 0.001675575040280819, -0.041707273572683334, 0.033019259572029114, -0.03084995411336422, -0.027743184939026833, -0.004318509716540575, 0.16901616752147675, -0.08038461208343506, 0.05265546217560768, 0.037427764385938644, 0.09063193202018738, -0.06661572307348251, 0.014111070893704891, -0.007794583681970835, 0.009089882485568523, 0.07429835945367813, 0.04842662438750267, 0.030534086748957634, -5.662041147047603e-8, -0.016574125736951828, -0.0937943309545517, -0.05786507576704025, 0.002097112825140357, -0.017663422971963882, -0.01274768728762865, -0.040953218936920166, -0.023542141541838646, 0.02814560756087303, -0.08628622442483902, 0.010576028376817703, 0.05276290699839592, -0.13219569623470306, -0.006836823187768459, -0.04586401954293251, -0.0566290058195591, -0.09239640831947327, 0.023051561787724495, 0.01762823946774006, -0.016677172854542732, 0.008963189087808132, 0.031095853075385094, 0.010276375338435173, -0.03221879526972771, -0.03052460588514805, 0.004256567917764187, -0.061106014996767044, 0.026607144623994827, -0.1111554354429245, 0.0022838127333670855, -0.025402668863534927, -0.05973105877637863, -0.011934878304600716, -0.06488804519176483, 0.01666462980210781, -0.063106007874012, 0.024538211524486542, -0.06729306280612946, -0.0009568181703798473, 0.039875857532024384, 0.1305229216814041, -0.043829333037137985, -0.04554496333003044, 0.05369704216718674, 0.10079988092184067, -0.02398473396897316, 0.10309450328350067, -0.06289996206760406, 0.03268725052475929, -0.07249259948730469, -0.005281995516270399, -0.0546271838247776, 0.0347386971116066, -0.03504034876823425, -0.02353992871940136, -0.021496256813406944, -0.005330240819603205, 0.05325627326965332, 0.03307820484042168, 0.02848212607204914, 0.11294464021921158, 0.10139643400907516, 0.0037052538245916367, 0.029276056215167046 ]
0.050348
# Matrix(插件) Matrix 是一个开放的去中心化消息协议。OpenClaw 以 Matrix \*\*用户\*\*身份连接到任意主服务器,因此你需要为机器人创建一个 Matrix 账户。登录后,你可以直接私信机器人或邀请它加入房间(Matrix"群组")。Beeper 也是一个有效的客户端选项,但它需要启用 E2EE。 状态:通过插件(@vector-im/matrix-bot-sdk)支持。支持私信、房间、话题、媒体、表情回应、投票(发送 + poll-start 作为文本)、位置和 E2EE(需要加密支持)。 ## 需要插件 Matrix 作为插件提供,不包含在核心安装中。 通过 CLI 安装(npm 仓库): ```bash openclaw plugins install @openclaw/matrix ``` 本地检出(从 git 仓库运行时): ```bash openclaw plugins install ./extensions/matrix ``` 如果你在配置/新手引导期间选择 Matrix 并检测到 git 检出,OpenClaw 将自动提供本地安装路径。 详情:[插件](/plugin) ## 设置 1. 安装 Matrix 插件: - 从 npm:`openclaw plugins install @openclaw/matrix` - 从本地检出:`openclaw plugins install ./extensions/matrix` 2. 在主服务器上创建 Matrix 账户: - 在 [https://matrix.org/ecosystem/hosting/](https://matrix.org/ecosystem/hosting/) 浏览托管选项 - 或自行托管。 3. 获取机器人账户的访问令牌: - 在你的主服务器上使用 `curl` 调用 Matrix 登录 API: ```bash curl --request POST \ --url https://matrix.example.org/\_matrix/client/v3/login \ --header 'Content-Type: application/json' \ --data '{ "type": "m.login.password", "identifier": { "type": "m.id.user", "user": "your-user-name" }, "password": "your-password" }' ``` - 将 `matrix.example.org` 替换为你的主服务器 URL。 - 或设置 `channels.matrix.userId` + `channels.matrix.password`:OpenClaw 会调用相同的登录端点,将访问令牌存储在 `~/.openclaw/credentials/matrix/credentials.json`,并在下次启动时重用。 4. 配置凭证: - 环境变量:`MATRIX\_HOMESERVER`、`MATRIX\_ACCESS\_TOKEN`(或 `MATRIX\_USER\_ID` + `MATRIX\_PASSWORD`) - 或配置:`channels.matrix.\*` - 如果两者都设置,配置优先。 - 使用访问令牌时:用户 ID 通过 `/whoami` 自动获取。 - 设置时,`channels.matrix.userId` 应为完整的 Matrix ID(示例:`@bot:example.org`)。 5. 重启 Gateway 网关(或完成新手引导)。 6. 从任何 Matrix 客户端(Element、Beeper 等;参见 https://matrix.org/ecosystem/clients/)与机器人开始私信或邀请它加入房间。Beeper 需要 E2EE,因此请设置 `channels.matrix.encryption: true` 并验证设备。 最小配置(访问令牌,用户 ID 自动获取): ```json5 { channels: { matrix: { enabled: true, homeserver: "https://matrix.example.org", accessToken: "syt\_\*\*\*", dm: { policy: "pairing" }, }, }, } ``` E2EE 配置(启用端到端加密): ```json5 { channels: { matrix: { enabled: true, homeserver: "https://matrix.example.org", accessToken: "syt\_\*\*\*", encryption: true, dm: { policy: "pairing" }, }, }, } ``` ## 加密(E2EE) 通过 Rust 加密 SDK \*\*支持\*\*端到端加密。 使用 `channels.matrix.encryption: true` 启用: - 如果加密模块加载成功,加密房间会自动解密。 - 发送到加密房间时,出站媒体会被加密。 - 首次连接时,OpenClaw 会向你的其他会话请求设备验证。 - 在另一个 Matrix 客户端(Element 等)中验证设备以启用密钥共享。 - 如果无法加载加密模块,E2EE 将被禁用,加密房间将无法解密;OpenClaw 会记录警告。 - 如果你看到缺少加密模块的错误(例如 `@matrix-org/matrix-sdk-crypto-nodejs-\*`),请允许 `@matrix-org/matrix-sdk-crypto-nodejs` 的构建脚本并运行 `pnpm rebuild @matrix-org/matrix-sdk-crypto-nodejs`,或使用 `node node\_modules/@matrix-org/matrix-sdk-crypto-nodejs/download-lib.js` 获取二进制文件。 加密状态按账户 + 访问令牌存储在 `~/.openclaw/matrix/accounts//\_\_//crypto/`(SQLite 数据库)。同步状态存储在同目录的 `bot-storage.json` 中。如果访问令牌(设备)更改,将创建新的存储,机器人必须重新验证才能访问加密房间。 \*\*设备验证:\*\* 启用 E2EE 时,机器人将在启动时向你的其他会话请求验证。打开 Element(或其他客户端)并批准验证请求以建立信任。验证后,机器人可以解密加密房间中的消息。 ## 路由模型 - 回复始终返回到 Matrix。 - 私信共享智能体的主会话;房间映射到群组会话。 ## 访问控制(私信) - 默认:`channels.matrix.dm.policy = "pairing"`。未知发送者会收到配对码。 - 通过以下方式批准: - `openclaw pairing list matrix` - `openclaw pairing approve matrix ```` ` - 公开私信:`channels.matrix.dm.policy="open"` 加上 `channels.matrix.dm.allowFrom=["*"]`。 - `channels.matrix.dm.allowFrom` 仅接受完整 Matrix 用户 ID(例如 `@user:server`)。向导仅在目录搜索得到唯一精确匹配时将显示名称解析为用户 ID。 ## 房间(群组) - 默认:`channels.matrix.groupPolicy = "allowlist"`(提及门控)。使用 `channels.defaults.groupPolicy` 在未设置时覆盖默认值。 - 使用 `channels.matrix.groups` 配置房间允许列表(房间 ID 或别名;名称仅在目录搜索得到唯一精确匹配时解析为 ID): ```json5 { channels: { matrix: { groupPolicy: "allowlist", groups: { "!roomId:example.org": { allow: true }, "#alias:example.org": { allow: true }, }, groupAllowFrom: ["@owner:example.org"], }, }, } ``` - `requireMention: false` 启用该房间的自动回复。 - `groups."*"` 可以设置跨房间的提及门控默认值。 - `groupAllowFrom` 限制哪些发送者可以在房间中触发机器人(需完整 Matrix 用户 ID)。 - 每个房间的 `users` 允许列表可以进一步限制特定房间内的发送者(需完整 Matrix 用户 ID)。 - 配置向导会提示输入房间允许列表(房间 ID、别名或名称),仅在精确且唯一匹配时解析名称。 - 启动时,OpenClaw 将允许列表中的房间/用户名称解析为 ID 并记录映射;未解析的条目不会参与允许列表匹配。 - 默认自动加入邀请;使用 `channels.matrix.autoJoin` 和 `channels.matrix.autoJoinAllowlist` 控制。 - 要**禁止所有房间**,设置 `channels.matrix.groupPolicy: "disabled"`(或保持空的允许列表)。 - 旧版键名:`channels.matrix.rooms`(与 `groups` 相同的结构)。 ## 话题 - 支持回复话题。 - `channels.matrix.threadReplies` 控制回复是否保持在话题中: - `off`、`inbound`(默认)、`always` - `channels.matrix.replyToMode` 控制不在话题中回复时的 reply-to 元数据: - `off`(默认)、`first`、`all` ## 功能 | 功能 | 状态 | | -------- | ------------------------------------------------------ | | 私信 | ✅ 支持 | | 房间 | ✅ 支持 | | 话题 | ✅ 支持 | | 媒体 | ✅ 支持 | | E2EE | ✅ 支持(需要加密模块) | | 表情回应 | ✅ 支持(通过工具发送/读取) | | 投票 | ✅ 支持发送;入站投票开始转换为文本(响应/结束被忽略) | | 位置 | ✅ 支持(geo URI;忽略海拔) | | 原生命令 | ✅ 支持 | ## 配置参考(Matrix) 完整配置:[配置](/gateway/configuration) 提供商选项: - `channels.matrix.enabled`:启用/禁用渠道启动。 - `channels.matrix.homeserver`:主服务器 URL。 - `channels.matrix.userId`:Matrix 用户 ID(使用访问令牌时可选)。 - `channels.matrix.accessToken`:访问令牌。 - `channels.matrix.password`:登录密码(令牌会被存储)。 - `channels.matrix.deviceName`:设备显示名称。 - `channels.matrix.encryption`:启用 E2EE(默认:false)。 - `channels.matrix.initialSyncLimit`:初始同步限制。 - `channels.matrix.threadReplies`:`off | inbound | always`(默认:inbound)。 - `channels.matrix.textChunkLimit`:出站文本分块大小(字符)。 - `channels.matrix.chunkMode`:`length`(默认)或 `newline` 在长度分块前按空行(段落边界)分割。 - `channels.matrix.dm.policy`:`pairing | allowlist | open | disabled`(默认:pairing)。 - `channels.matrix.dm.allowFrom`:私信允许列表(需完整 Matrix 用户 ID)。`open` 需要 `"*"`。向导在可能时将名称解析为 ID。 - `channels.matrix.groupPolicy`:`allowlist | open | disabled`(默认:allowlist)。 - `channels.matrix.groupAllowFrom`:群组消息的允许发送者列表(需完整 Matrix 用户 ID)。 - `channels.matrix.allowlistOnly`:强制私信 + 房间使用允许列表规则。 - `channels.matrix.groups`:群组允许列表 + 每个房间的设置映射。 - `channels.matrix.rooms`:旧版群组允许列表/配置。 - `channels.matrix.replyToMode`:话题/标签的 reply-to 模式。 - `channels.matrix.mediaMaxMb`:入站/出站媒体上限(MB)。 - `channels.matrix.autoJoin`:邀请处理(`always | allowlist | off`,默认:always)。 - `channels.matrix.autoJoinAllowlist`:自动加入的允许房间 ID/别名。 - `channels.matrix.actions`:每个操作的工具限制(reactions/messages/pins/memberInfo/channelInfo)。 ````
https://github.com/openclaw/openclaw/blob/main//docs/zh-CN/channels/matrix.md
main
opebclaw
[ -0.05458226799964905, 0.019312329590320587, -0.09524965286254883, -0.06125033646821976, -0.01667315512895584, -0.017886072397232056, 0.02278905175626278, -0.03728541359305382, 0.004783345386385918, 0.02048587240278721, 0.17480263113975525, -0.04189644753932953, 0.08894869685173035, -0.03626150265336037, 0.031105460599064827, 0.11410239338874817, -0.04747863486409187, 0.018312212079763412, -0.05855311453342438, 0.008319812826812267, -0.03147082403302193, -0.03217126429080963, 0.019190514460206032, -0.02627239003777504, -0.03487119823694229, 0.10092389583587646, 0.03280115872621536, 0.08618859946727753, -0.03487537056207657, -0.06077944487333298, 0.004944018088281155, 0.1066223680973053, 0.020574061200022697, -0.015663860365748405, 0.03815026581287384, 0.0691743716597557, 0.005695930682122707, -0.030324053019285202, -0.053994763642549515, 0.05428892374038696, 0.007323612924665213, 0.022457968443632126, -0.013825122267007828, -0.03991591930389404, 0.0861586406826973, -0.02143656276166439, -0.07666899263858795, -0.10445495694875717, -0.031679634004831314, -0.09775377064943314, -0.11744901537895203, -0.0006894001853652298, 0.012945841066539288, -0.018156813457608223, 0.01387152448296547, -0.13884706795215607, -0.005433736834675074, -0.030771441757678986, 0.04453381523489952, -0.08551067858934402, 0.025140469893813133, -0.013210237957537174, 0.003812540089711547, 0.008406413719058037, -0.024305840954184532, -0.05305112153291702, -0.0748823806643486, -0.04224983975291252, -0.05419696867465973, 0.03991131857037544, -0.11994443088769913, -0.03286002576351166, -0.019805660471320152, 0.004016460385173559, -0.0683949887752533, -0.0006650842260569334, 0.0493910014629364, -0.027658013626933098, -0.01111612282693386, -0.04955947399139404, -0.06702583283185959, 0.025438465178012848, -0.018737100064754486, 0.038117460906505585, -0.0723889172077179, 0.1486843228340149, -0.04316370561718941, -0.02585122361779213, 0.07959406822919846, -0.009766068309545517, 0.04264741390943527, -0.009387178346514702, 0.011067457497119904, 0.02198910340666771, 0.03172753378748894, -0.07276865094900131, 0.043908633291721344, 0.05813093110918999, -0.04094153642654419, 0.05704892426729202, 0.029920566827058792, -0.06726735085248947, -0.07118555158376694, 0.01736726053059101, -0.07713116705417633, -0.018407080322504044, -0.0072927619330585, 0.03924979269504547, 0.06991228461265564, -0.01782236620783806, -0.005107160657644272, -0.07625453919172287, -0.009044429287314415, -0.07686562091112137, -0.0345962829887867, 0.06093926355242729, 0.013753870502114296, -0.03587698936462402, 0.09485112875699997, 0.04038088023662567, 0.09697948396205902, 0.003339722752571106, -0.04978523403406143, 0.04659849405288696, -0.030299780890345573, -0.008411502465605736, -0.0055083781480789185, 1.6616277537865218e-33, -0.03801992908120155, -0.015068665146827698, 0.020289907231926918, -0.02316099777817726, 0.08173855394124985, -0.022308897227048874, -0.060820113867521286, -0.05013708770275116, -0.0269135944545269, -0.0012477420968934894, -0.032624054700136185, 0.0494803786277771, -0.10621041804552078, 0.08147478103637695, -0.029116977006196976, -0.07199274003505707, 0.01430237852036953, -0.0169542133808136, -0.0041665202006697655, -0.09694386273622513, 0.0680062547326088, 0.01687740348279476, 0.006234333850443363, 0.0033146252389997244, -0.05792120099067688, 0.008626100607216358, 0.10288730263710022, -0.08590598404407501, 0.02458256296813488, 0.02493230812251568, 0.04535331949591637, -0.0228800717741251, -0.0653652474284172, 0.021227985620498657, -0.11217386275529861, -0.04481253772974014, -0.009152325801551342, -0.0112304100766778, -0.001872211112640798, -0.06742332875728607, -0.053397323936223984, 0.014288059435784817, -0.004588854033499956, -0.008782611228525639, 0.035697177052497864, -0.015381239354610443, -0.06669455021619797, 0.023953862488269806, 0.046641577035188675, -0.06092081591486931, -0.03941700607538223, 0.040157392621040344, 0.04206399247050285, 0.05087257921695709, -0.020823976024985313, -0.01961570233106613, 0.02022366039454937, -0.01700138859450817, -0.01091277040541172, 0.02587032876908779, -0.029699767008423805, 0.047452542930841446, 0.04886355623602867, -0.050125040113925934, 0.06352131813764572, 0.0009929481893777847, -0.0017825148534029722, 0.002663845894858241, -0.001961634960025549, -0.0022501256316900253, -0.03899158909916878, -0.02311800792813301, 0.09958592057228088, 0.014333309605717659, -0.06134004518389702, -0.047236304730176926, -0.025672167539596558, -0.045572876930236816, 0.0038759412709623575, -0.07027658075094223, -0.04944837838411331, -0.014386868104338646, -0.07203014194965363, -0.07649441063404083, -0.05265960842370987, 0.021694978699088097, 0.019854100421071053, -0.054855816066265106, -0.020229121670126915, 0.03593350946903229, -0.09026321768760681, -0.009355250746011734, -0.01629755087196827, -0.03283369913697243, -0.04205048084259033, -6.048033780363844e-33, -0.03479239344596863, 0.013809639029204845, -0.03007090650498867, -0.0051698237657547, 0.038503848016262054, -0.11488452553749084, -0.0024441564455628395, -0.006805528420954943, 0.04286273941397667, 0.026702718809247017, -0.02110198698937893, 0.015337970107793808, -0.007163134403526783, 0.02630767412483692, 0.1073789969086647, 0.024970028549432755, -0.020489724352955818, 0.07466188073158264, -0.062009915709495544, -0.014967059716582298, -0.047319505363702774, 0.05813340097665787, -0.08753879368305206, 0.032058630138635635, -0.0320543572306633, 0.05119846388697624, 0.055337779223918915, 0.015099909156560898, 0.04949410632252693, 0.016589073464274406, -0.05953339487314224, -0.01349655631929636, -0.07991586625576019, 0.16000933945178986, -0.012224193662405014, -0.001860915799625218, -0.010477229952812195, -0.06075926870107651, -0.04127071425318718, -0.015459585934877396, -0.03276171535253525, -0.02624031901359558, -0.03260808810591698, -0.030960042029619217, -0.005107298027724028, 0.052816204726696014, -0.05548097565770149, -0.005930590443313122, -0.06419011950492859, -0.06628432124853134, 0.03684229031205177, 0.026083432137966156, -0.011325597763061523, 0.03295249864459038, -0.011361357755959034, 0.020272528752684593, -0.043138109147548676, -0.0733937919139862, -0.04095891863107681, -0.04560178145766258, 0.011775943450629711, 0.017193779349327087, 0.007655467372387648, -0.043639473617076874, 0.02609029784798622, -0.06280992925167084, -0.006934274919331074, 0.017169291153550148, 0.03145642578601837, -0.07382053881883621, 0.038963381201028824, 0.06912186741828918, 0.0122968265786767, -0.0675843358039856, 0.04743286594748497, 0.0268794484436512, -0.0806262418627739, 0.01142517477273941, -0.02451242506504059, 0.0277518592774868, -0.05891893804073334, -0.012401223182678223, 0.08524762094020844, 0.17661188542842865, -0.024270961061120033, 0.014779099263250828, 0.03416511416435242, 0.07327308505773544, 0.030192790552973747, -0.03179192915558815, 0.03689217194914818, 0.07772497087717056, 0.05108560249209404, 0.11735887080430984, 0.007544313557446003, -4.531805330998395e-8, -0.06890442222356796, -0.1315235048532486, -0.006521599367260933, -0.026036355644464493, 0.026306159794330597, -0.09025163948535919, -0.00039480344275943935, -0.019582517445087433, 0.010349977761507034, -0.032177865505218506, 0.017484329640865326, 0.009594200178980827, -0.07682161778211594, -0.011424497701227665, -0.07270192354917526, 0.03332247957587242, -0.04636888578534126, 0.03662172704935074, 0.049751296639442444, -0.12040174752473831, 0.003882625140249729, 0.06280148029327393, 0.027042748406529427, -0.0055426363833248615, -0.12699611485004425, -0.013706536032259464, -0.11120525002479553, 0.028537139296531677, 0.021579764783382416, 0.015618715435266495, 0.030962849035859108, -0.048650454729795456, 0.08122102916240692, 0.0011223058681935072, 0.03422471135854721, 0.025511829182505608, 0.06877775490283966, -0.0028001260943710804, -0.011019224300980568, 0.023129241541028023, 0.028247926384210587, -0.0693543553352356, -0.008415034040808678, 0.026281068101525307, 0.04930912330746651, 0.010751728899776936, -0.003148907795548439, -0.006677495781332254, 0.028362087905406952, -0.022432124242186546, 0.027468940243124962, 0.04182222858071327, -0.020300284028053284, -0.010416078381240368, 0.004894321318715811, -0.006129150278866291, -0.05429117754101753, -0.0027281895745545626, 0.08366655558347702, 0.07628372311592102, 0.016724828630685806, 0.07359044998884201, 0.010905963368713856, 0.024369269609451294 ]
0.103464
ID/别名。 - `channels.matrix.actions`:每个操作的工具限制(reactions/messages/pins/memberInfo/channelInfo)。 ````
https://github.com/openclaw/openclaw/blob/main//docs/zh-CN/channels/matrix.md
main
opebclaw
[ -0.037146829068660736, -0.046659812331199646, -0.050732582807540894, 0.008943809196352959, -0.015723995864391327, 0.013326491229236126, 0.14667461812496185, -0.018349850550293922, 0.06021115183830261, 0.009707369841635227, 0.1479489654302597, -0.03056453913450241, -0.013965309597551823, 0.03695995360612869, -0.03109646961092949, 0.023218048736453056, -0.037357039749622345, -0.03265935555100441, -0.06182272359728813, 0.011106221005320549, 0.00584232434630394, -0.020684873685240746, 0.041502006351947784, 0.019239572808146477, -0.00398823618888855, -0.036414362490177155, 0.06618209928274155, 0.044985316693782806, -0.017997248098254204, -0.05375942960381508, 0.028906289488077164, 0.11854750663042068, 0.03849589452147484, 0.032798055559396744, -0.006144176237285137, 0.11760874837636948, -0.02118464931845665, -0.14650236070156097, -0.01341483648866415, 0.022934434935450554, 0.03817014396190643, -0.032617196440696716, 0.008165496401488781, -0.0017152769723907113, 0.05564418062567711, -0.010179055854678154, 0.02192794904112816, -0.05872625485062599, -0.026109332218766212, 0.028622230514883995, -0.08271173387765884, -0.02149762585759163, 0.01031580287963152, 0.05166887119412422, 0.052955131977796555, -0.058174289762973785, -0.09254179894924164, -0.019603388383984566, 0.02879522368311882, -0.0511334091424942, 0.0424373559653759, 0.013917552307248116, 0.04283681884407997, 0.009487127885222435, -0.04406793415546417, -0.03388413414359093, 0.029585229232907295, -0.019683053717017174, 0.018943049013614655, -0.031387899070978165, -0.05768047273159027, -0.06714312732219696, 0.0005235678399913013, -0.01907835714519024, -0.0055150846019387245, -0.07243387401103973, 0.05009248107671738, -0.052829843014478683, -0.00564876664429903, 0.010265510529279709, -0.019350916147232056, -0.09361623972654343, -0.022337011992931366, 0.03795363008975983, -0.023841194808483124, 0.09365719556808472, -0.06078685447573662, 0.023779256269335747, 0.030311012640595436, 0.023844953626394272, -0.11154297739267349, -0.0010952558368444443, 0.04995135962963104, 0.03154193237423897, -0.045019056648015976, -0.02723321132361889, -0.046895626932382584, 0.0025568415876477957, -0.021786391735076904, 0.053186506032943726, 0.06100217252969742, 0.044835954904556274, -0.050371889024972916, 0.06814277172088623, -0.06881747394800186, -0.03794998303055763, -0.04325812682509422, 0.004953568801283836, -0.027021242305636406, -0.012649968266487122, -0.08789432793855667, -0.06545199453830719, -0.029013408347964287, -0.0451216883957386, 0.006562402471899986, 0.052814874798059464, 0.04511645808815956, 0.041397977620363235, -0.010662619955837727, -0.033462170511484146, 0.08860277384519577, -0.038354676216840744, -0.01723209023475647, 0.017094116657972336, -0.06098121404647827, -0.02126428857445717, -0.06425987184047699, -9.49279646556154e-34, 0.017466798424720764, 0.020317867398262024, 0.0012085037305951118, -0.028161726891994476, 0.02675553783774376, -0.03163795545697212, -0.034493375569581985, -0.06688404083251953, -0.033100470900535583, 0.01015436090528965, -0.06495745480060577, 0.024679124355316162, -0.03747392073273659, 0.031873367726802826, -0.06256746500730515, -0.022564757615327835, -0.031053487211465836, -0.048813458532094955, 0.009666343219578266, -0.0873381718993187, -0.030605053529143333, 0.07669691741466522, -0.0856756865978241, -0.012483962811529636, 0.03136952593922615, 0.00556589663028717, 0.04116310551762581, -0.04137292504310608, 0.00045018550008535385, 0.002707457635551691, 0.0360061451792717, -0.015850629657506943, -0.0040412587113678455, 0.05044383183121681, -0.008597700856626034, -0.015760527923703194, -0.028837595134973526, 0.003311548847705126, 0.008886110968887806, -0.06445116549730301, -0.0022522115614265203, 0.017210492864251137, -0.0773901641368866, -0.07314058393239975, -0.050402477383613586, 0.024166883900761604, -0.019384387880563736, -0.01615898124873638, 0.08586014062166214, -0.03884340822696686, 0.03080601990222931, -0.0393945686519146, 0.04126409441232681, 0.018397627398371696, 0.04774342477321625, -0.04737479239702225, -0.05136122554540634, 0.0638873353600502, -0.0059849112294614315, 0.03172561526298523, -0.017743701115250587, -0.07736639678478241, -0.006382557563483715, -0.016468588262796402, 0.008314378559589386, 0.06118602305650711, -0.04686252400279045, -0.062537282705307, 0.02211857959628105, -0.0195024237036705, -0.1027633547782898, 0.0025739341508597136, 0.03611866012215614, -0.03840842843055725, -0.09339885413646698, -0.0531819649040699, -0.05512722581624985, -0.016052240505814552, -0.028269486501812935, 0.06863932311534882, -0.0760425329208374, -0.05265698954463005, -0.04055633395910263, 0.08769088238477707, 0.02083490788936615, 0.08369655907154083, 0.007667082827538252, -0.08968409150838852, -0.04102713242173195, 0.05724627897143364, -0.047134291380643845, 0.0137626426294446, 0.04224099591374397, 0.03999069705605507, 0.009874125011265278, -3.3811552165067646e-33, -0.009325427003204823, 0.015092532150447369, -0.07968948781490326, -0.022367047145962715, -0.04408584535121918, -0.08173082023859024, 0.04643866792321205, 0.019284894689917564, 0.04053375497460365, 0.0016673780046403408, -0.019741546362638474, -0.0361994244158268, -0.07130810618400574, -0.007035686634480953, 0.04679125174880028, 0.005034522153437138, 0.004540492780506611, 0.015761442482471466, -0.035898253321647644, -0.03724009916186333, -0.067830391228199, 0.07499901205301285, -0.02589978091418743, 0.028681224212050438, -0.06936980783939362, -0.0004627911257557571, 0.19017590582370758, 0.020392723381519318, 0.01405285019427538, -0.013349995017051697, -0.03385180979967117, -0.06523104012012482, -0.08942823112010956, 0.09566319733858109, 0.03219098225235939, 0.05226458981633186, 0.0290814321488142, -0.0005042515695095062, -0.0456734299659729, -0.03986240178346634, 0.017569247633218765, 0.030800465494394302, -0.030898263677954674, 0.0807093009352684, -0.018629319965839386, 0.057719141244888306, -0.017219802364706993, -0.0008709949324838817, -0.0756235346198082, -0.024219917133450508, 0.03900308907032013, -0.013697654008865356, 0.03184277564287186, -0.05794287472963333, -0.0027748995926231146, 0.10589921474456787, 0.09681584686040878, 0.01032120082527399, 0.06948203593492508, -0.08096586167812347, 0.015097570605576038, -0.04365110769867897, -0.014095302671194077, -0.05089615285396576, 0.011117822490632534, 0.010340993292629719, -0.011797906830906868, 0.012516569346189499, 0.09056087583303452, -0.028291963040828705, 0.13462837040424347, 0.06526600569486618, -0.048815615475177765, 0.02907651476562023, 0.034055445343256, -0.02763926237821579, -0.1409234255552292, 0.007478244602680206, 0.014678288251161575, 0.054847169667482376, -0.012270677834749222, 0.06157407537102699, 0.03674554452300072, 0.07052387297153473, 0.01324175950139761, 0.004295795224606991, 0.0301510039716959, 0.12904588878154755, -0.022830966860055923, -0.07234227657318115, 0.10946955531835556, 0.07261892408132553, 0.015940850600600243, 0.07021208852529526, -0.05644978955388069, -3.06772847125103e-8, -0.08598370850086212, -0.07574158161878586, -0.015916936099529266, -0.10770334303379059, 0.008546961471438408, 0.035644982010126114, -0.0037665676791220903, 0.016435759142041206, 0.09755988419055939, -0.04497721046209335, 0.0616854690015316, 0.06480547040700912, 0.00926363654434681, -0.009787837974727154, -0.005080655682832003, -0.022583194077014923, -0.12833096086978912, 0.0648801252245903, -0.014057718217372894, -0.06669946014881134, 0.039635069668293, -0.014486879110336304, -0.02604280784726143, 0.013068871572613716, -0.0900246873497963, -0.0446149967610836, 0.011293533258140087, 0.10492449253797531, -0.08772431313991547, -0.05685441568493843, -0.010205540806055069, -0.00318767293356359, 0.03551279380917549, -0.002099913079291582, -0.017427191138267517, 0.0643574520945549, 0.06926701962947845, -0.050964660942554474, 0.021804112941026688, 0.04862512648105621, 0.03286239504814148, -0.10367247462272644, 0.07508526742458344, 0.028110284358263016, -0.0066296616569161415, 0.04828507825732231, 0.020727355033159256, -0.03977464884519577, 0.08216434717178345, -0.005918815266340971, 0.024826427921652794, 0.027015164494514465, -0.06727763265371323, 0.04583408311009407, -0.06023498997092247, 0.00578748295083642, -0.014536229893565178, 0.005855182185769081, 0.03161204606294632, -0.003947243094444275, 0.05329183116555214, 0.10974244028329849, -0.09901131689548492, -0.028998667374253273 ]
0.154961
# Nostr \*\*状态:\*\* 可选插件(默认禁用)。 Nostr 是一个去中心化的社交网络协议。此渠道使 OpenClaw 能够通过 NIP-04 接收和回复加密私信(DMs)。 ## 安装(按需) ### 新手引导(推荐) - 新手引导向导(`openclaw onboard`)和 `openclaw channels add` 会列出可选的渠道插件。 - 选择 Nostr 会提示你按需安装插件。 安装默认值: - \*\*Dev 渠道 + git checkout 可用:\*\* 使用本地插件路径。 - \*\*Stable/Beta:\*\* 从 npm 下载。 你可以随时在提示中覆盖选择。 ### 手动安装 ```bash openclaw plugins install @openclaw/nostr ``` 使用本地 checkout(开发工作流): ```bash openclaw plugins install --link /extensions/nostr ``` 安装或启用插件后重启 Gateway 网关。 ## 快速设置 1. 生成 Nostr 密钥对(如需要): ```bash # 使用 nak nak key generate ``` 2. 添加到配置: ```json { "channels": { "nostr": { "privateKey": "${NOSTR\_PRIVATE\_KEY}" } } } ``` 3. 导出密钥: ```bash export NOSTR\_PRIVATE\_KEY="nsec1..." ``` 4. 重启 Gateway 网关。 ## 配置参考 | 键 | 类型 | 默认值 | 描述 | | ------------ | -------- | ------------------------------------------- | --------------------------- | | `privateKey` | string | 必填 | `nsec` 或十六进制格式的私钥 | | `relays` | string[] | `['wss://relay.damus.io', 'wss://nos.lol']` | 中继 URL(WebSocket) | | `dmPolicy` | string | `pairing` | 私信访问策略 | | `allowFrom` | string[] | `[]` | 允许的发送者公钥 | | `enabled` | boolean | `true` | 启用/禁用渠道 | | `name` | string | - | 显示名称 | | `profile` | object | - | NIP-01 个人资料元数据 | ## 个人资料元数据 个人资料数据作为 NIP-01 `kind:0` 事件发布。你可以从控制界面(Channels -> Nostr -> Profile)管理它,或直接在配置中设置。 示例: ```json { "channels": { "nostr": { "privateKey": "${NOSTR\_PRIVATE\_KEY}", "profile": { "name": "openclaw", "displayName": "OpenClaw", "about": "Personal assistant DM bot", "picture": "https://example.com/avatar.png", "banner": "https://example.com/banner.png", "website": "https://example.com", "nip05": "openclaw@example.com", "lud16": "openclaw@example.com" } } } } ``` 注意事项: - 个人资料 URL 必须使用 `https://`。 - 从中继导入会合并字段并保留本地覆盖。 ## 访问控制 ### 私信策略 - \*\*pairing\*\*(默认):未知发送者会收到配对码。 - \*\*allowlist\*\*:只有 `allowFrom` 中的公钥可以发送私信。 - \*\*open\*\*:公开接收私信(需要 `allowFrom: ["\*"]`)。 - \*\*disabled\*\*:忽略接收的私信。 ### 允许列表示例 ```json { "channels": { "nostr": { "privateKey": "${NOSTR\_PRIVATE\_KEY}", "dmPolicy": "allowlist", "allowFrom": ["npub1abc...", "npub1xyz..."] } } } ``` ## 密钥格式 接受的格式: - \*\*私钥:\*\* `nsec...` 或 64 字符十六进制 - \*\*公钥(`allowFrom`):\*\* `npub...` 或十六进制 ## 中继 默认值:`relay.damus.io` 和 `nos.lol`。 ```json { "channels": { "nostr": { "privateKey": "${NOSTR\_PRIVATE\_KEY}", "relays": ["wss://relay.damus.io", "wss://relay.primal.net", "wss://nostr.wine"] } } } ``` 提示: - 使用 2-3 个中继以实现冗余。 - 避免使用过多中继(延迟、重复)。 - 付费中继可以提高可靠性。 - 本地中继适合测试(`ws://localhost:7777`)。 ## 协议支持 | NIP | 状态 | 描述 | | ------ | ------ | ----------------------------- | | NIP-01 | 已支持 | 基本事件格式 + 个人资料元数据 | | NIP-04 | 已支持 | 加密私信(`kind:4`) | | NIP-17 | 计划中 | 礼物包装私信 | | NIP-44 | 计划中 | 版本化加密 | ## 测试 ### 本地中继 ```bash # 启动 strfry docker run -p 7777:7777 ghcr.io/hoytech/strfry ``` ```json { "channels": { "nostr": { "privateKey": "${NOSTR\_PRIVATE\_KEY}", "relays": ["ws://localhost:7777"] } } } ``` ### 手动测试 1. 从日志中记下机器人公钥(npub)。 2. 打开 Nostr 客户端(Damus、Amethyst 等)。 3. 向机器人公钥发送私信。 4. 验证响应。 ## 故障排除 ### 未收到消息 - 验证私钥是否有效。 - 确保中继 URL 可访问并使用 `wss://`(本地使用 `ws://`)。 - 确认 `enabled` 不是 `false`。 - 检查 Gateway 网关日志中的中继连接错误。 ### 未发送响应 - 检查中继是否接受写入。 - 验证出站连接。 - 注意中继速率限制。 ### 重复响应 - 使用多个中继时属于正常现象。 - 消息按事件 ID 去重;只有首次投递会触发响应。 ## 安全 - 切勿提交私钥。 - 使用环境变量存储密钥。 - 生产环境机器人考虑使用 `allowlist`。 ## 限制(MVP) - 仅支持私信(不支持群聊)。 - 不支持媒体附件。 - 仅支持 NIP-04(计划支持 NIP-17 礼物包装)。
https://github.com/openclaw/openclaw/blob/main//docs/zh-CN/channels/nostr.md
main
opebclaw
[ 0.0008353333105333149, 0.047700054943561554, -0.043263595551252365, -0.04425404593348503, 0.018606863915920258, -0.09948352724313736, 0.026261424645781517, -0.021690167486667633, -0.008944560773670673, 0.010732287541031837, 0.10210135579109192, -0.029429400339722633, 0.021936699748039246, -0.008290623314678669, 0.052620552480220795, 0.0744761973619461, -0.02401861362159252, 0.009598629549145699, -0.004492106847465038, -0.02249469794332981, -0.035235147923231125, 0.02815997786819935, 0.035584308207035065, -0.02296740561723709, -0.0451839454472065, 0.01586006209254265, -0.08597254753112793, 0.056883055716753006, -0.03492096811532974, -0.05640169605612755, 0.0015536166029050946, 0.0795004814863205, 0.030868694186210632, -0.009440292604267597, 0.14641591906547546, 0.09244685620069504, 0.0022713460493832827, -0.07380310446023941, -0.09794070571660995, 0.010404613800346851, 0.006218319293111563, -0.008222633972764015, -0.004444153513759375, -0.0481828935444355, -0.03002326376736164, -0.01203708816319704, -0.044123727828264236, -0.076356440782547, -0.03638913482427597, -0.07147300243377686, -0.05178055539727211, -0.055617090314626694, -0.014429149217903614, -0.032377876341342926, 0.04397769272327423, -0.04099220037460327, -0.004911911673843861, -0.0124512342736125, 0.03546008840203285, -0.03972766920924187, 0.04094577208161354, 0.04826151579618454, -0.0867103636264801, 0.023027271032333374, -0.0874016135931015, 0.002578398212790489, -0.04810572415590286, -0.005593155510723591, -0.0644030049443245, -0.0256976205855608, -0.028108937665820122, -0.028214730322360992, 0.014830605126917362, -0.04022861644625664, -0.04652513191103935, -0.020088400691747665, 0.03512824326753616, 0.011657544411718845, -0.04823349788784981, -0.12783445417881012, -0.04687301814556122, -0.004823671188205481, 0.011040742509067059, -0.011203058063983917, -0.03617404028773308, 0.1770654320716858, -0.021500224247574806, 0.004628767725080252, 0.07729028910398483, -0.01246204599738121, -0.034739114344120026, 0.012965476140379906, 0.030496811494231224, 0.034442588686943054, 0.00881727784872055, -0.0967760756611824, 0.023544004186987877, 0.046960797160863876, -0.04853799566626549, 0.07709329575300217, 0.06430761516094208, -0.000917623343411833, -0.008327134884893894, -0.055525876581668854, -0.07348654419183731, 0.005361188668757677, -0.014978904277086258, 0.09499583393335342, 0.04602590203285217, 0.019205242395401, -0.013500131666660309, -0.09488626569509506, 0.059266701340675354, -0.11963333189487457, -0.08334702253341675, 0.06232856586575508, -0.034725937992334366, -0.04351985827088356, 0.009309130720794201, 0.008623620495200157, 0.08251751214265823, -0.022435015067458153, -0.061670467257499695, -0.039281684905290604, -0.031446512788534164, 0.05824819579720497, 0.1325971633195877, 3.121493657197906e-33, 0.014387947507202625, 0.0026832858566194773, -0.07813835889101028, -0.031154420226812363, 0.08798597753047943, -0.040217071771621704, -0.011200613342225552, -0.017723621800541878, -0.08181513845920563, 0.1045973151922226, 0.0073188175447285175, 0.012405996210873127, -0.12530569732189178, 0.0014717496233060956, 0.028922410681843758, -0.07994872331619263, -0.01774432696402073, -0.004281074274331331, 0.023659927770495415, -0.03236567974090576, 0.028030894696712494, -0.049002017825841904, -0.044139038771390915, -0.03238208591938019, 0.037062812596559525, 0.027020832523703575, 0.05387239530682564, -0.038512833416461945, 0.015315824188292027, 0.04596193507313728, 0.06404391676187515, -0.013277283869683743, -0.0139284897595644, 0.01169683039188385, -0.09155406802892685, -0.03889443352818489, -0.08138857781887054, -0.028451649472117424, -0.05310623347759247, -0.034518804401159286, -0.0071819550357759, -0.03266486898064613, -0.07384013384580612, 0.01768980175256729, 0.09663737565279007, -0.0017501853872090578, -0.04625584930181503, -0.020702136680483818, 0.11877480894327164, -0.04025832563638687, -0.015990139916539192, 0.044061437249183655, -0.03783554956316948, 0.023534197360277176, 0.0068962546065449715, -0.050617802888154984, -0.02463681250810623, -0.022420817986130714, -0.0007743455353192985, -0.026981215924024582, -0.04748653993010521, 0.05052056163549423, 0.022952962666749954, -0.04530846327543259, 0.07152862101793289, -0.018377024680376053, 0.05289198458194733, 0.05902024731040001, -0.011668610386550426, -0.05127325654029846, -0.09905926883220673, -0.04633837565779686, 0.07524674385786057, 0.04559747874736786, -0.09043868631124496, -0.022789210081100464, -0.030262421816587448, 0.0166059210896492, 0.0698334276676178, -0.05179145932197571, -0.01798388548195362, -0.05388632044196129, -0.040160972625017166, 0.006893121171742678, 0.035326018929481506, 0.049605052918195724, 0.0671667531132698, 0.002338460646569729, -0.042792417109012604, 0.0809677466750145, -0.1356639862060547, 0.023097703233361244, -0.06491518765687943, -0.02080632746219635, 0.004256999585777521, -6.420952751006491e-33, -0.025866802781820297, 0.011305847205221653, -0.03689384460449219, -0.027736997231841087, -0.009990221820771694, -0.0640045553445816, -0.03216804191470146, -0.03180653601884842, 0.0626431405544281, 0.04873807728290558, -0.06463789194822311, 0.02337687276303768, 0.04113473743200302, 0.012328519485890865, 0.01857394352555275, -0.010686632245779037, 0.005587928928434849, 0.048153165727853775, -0.05466210097074509, 0.08449245989322662, 0.0038020857609808445, 0.014725086279213428, -0.11253401637077332, 0.061548180878162384, -0.005231273360550404, 0.09256686270236969, 0.08871932327747345, -0.015976054593920708, 0.03540677949786186, 0.0033694137819111347, -0.03799779340624809, 0.0017191186780110002, -0.04449441283941269, 0.1291365623474121, -0.027838582172989845, -0.01193306129425764, 0.03786354139447212, 0.016254352405667305, -0.045720525085926056, -0.016133638098835945, 0.025233343243598938, 0.03228503838181496, -0.02990308590233326, -0.022428184747695923, -0.06564445048570633, 0.017354194074869156, -0.035828687250614166, -0.05504872649908066, -0.14015014469623566, -0.028164014220237732, 0.05199488252401352, 0.01879037730395794, -0.0015527395298704505, -0.025406252592802048, 0.021463235840201378, 0.05261215567588806, -0.005858210381120443, -0.08019684255123138, -0.06571368128061295, -0.12491883337497711, 0.0796758159995079, 0.007736296392977238, -0.01716742478311062, 0.03143768385052681, 0.01435891818255186, -0.013831188902258873, 0.020217368379235268, -0.015679484233260155, -0.026441015303134918, -0.05112364515662193, -0.0040253931656479836, 0.013966653496026993, 0.003768451977521181, -0.08514291793107986, 0.004073473159223795, 0.059344932436943054, -0.02110932394862175, 0.05555865913629532, -0.03886780887842178, 0.053215522319078445, -0.0003055631532333791, -0.006892669480293989, 0.04106985032558441, 0.06532151997089386, 0.006327198818325996, 0.0060745300725102425, -0.003883417695760727, 0.07469554990530014, 0.05754994601011276, 0.014920583926141262, -0.0498933307826519, 0.1230488270521164, 0.018870849162340164, 0.05980183556675911, 0.013479907996952534, -4.8428237420239384e-8, -0.035377487540245056, -0.10759856551885605, -0.0785536989569664, -0.019065724685788155, 0.007566982880234718, -0.083885058760643, 0.000956058909650892, -0.029449788853526115, -0.06090012192726135, -0.028943398967385292, 0.05904398486018181, 0.07088376581668854, -0.12753722071647644, 0.02928902581334114, -0.06076856702566147, 0.01266470830887556, -0.07506947964429855, 0.0455755814909935, 0.014690503478050232, -0.0645977035164833, -0.013514209538698196, 0.0658133402466774, 0.11188136786222458, -0.022207966074347496, -0.11951940506696701, -0.009401562623679638, -0.05394325777888298, -0.003819644683972001, -0.012050478719174862, 0.004197311121970415, 0.053974051028490067, -0.0077900090254843235, 0.004624530207365751, -0.04056372866034508, 0.023190584033727646, 0.04583224281668663, 0.05400625988841057, 0.019448980689048767, 0.016159920021891594, 0.004619708750396967, 0.035956304520368576, -0.06811648607254028, -0.012307499535381794, 0.03497261554002762, -0.030844207853078842, -0.030534664168953896, 0.03293953463435173, -0.0030950289219617844, 0.03406858444213867, -0.07060719281435013, -0.019136536866426468, -0.03701316937804222, -0.001132039469666779, -0.012509914115071297, 0.041835471987724304, 0.0818227007985115, 0.006461729761213064, 0.0078117079101502895, 0.0208901334553957, 0.10342170298099518, -0.03173059597611427, 0.009057994931936264, 0.04758729413151741, 0.006008149590343237 ]
0.114149
# iMessage (imsg) 状态:外部 CLI 集成。Gateway 网关生成 `imsg rpc`(基于 stdio 的 JSON-RPC)。 ## 快速设置(新手) 1. 确保在此 Mac 上已登录"信息"。 2. 安装 `imsg`: - `brew install steipete/tap/imsg` 3. 配置 OpenClaw 的 `channels.imessage.cliPath` 和 `channels.imessage.dbPath`。 4. 启动 Gateway 网关并批准所有 macOS 提示(自动化 + 完全磁盘访问权限)。 最小配置: ```json5 { channels: { imessage: { enabled: true, cliPath: "/usr/local/bin/imsg", dbPath: "/Users//Library/Messages/chat.db", }, }, } ``` ## 简介 - 基于 macOS 上 `imsg` 的 iMessage 渠道。 - 确定性路由:回复始终返回到 iMessage。 - 私信共享智能体的主会话;群组是隔离的(`agent::imessage:group:`)。 - 如果多参与者会话以 `is\_group=false` 到达,你仍可使用 `channels.imessage.groups` 按 `chat\_id` 隔离(参见下方"类群组会话")。 ## 配置写入 默认情况下,iMessage 允许写入由 `/config set|unset` 触发的配置更新(需要 `commands.config: true`)。 禁用方式: ```json5 { channels: { imessage: { configWrites: false } }, } ``` ## 要求 - 已登录"信息"的 macOS。 - OpenClaw + `imsg` 的完全磁盘访问权限(访问"信息"数据库)。 - 发送时需要自动化权限。 - `channels.imessage.cliPath` 可以指向任何代理 stdin/stdout 的命令(例如,通过 SSH 连接到另一台 Mac 并运行 `imsg rpc` 的包装脚本)。 ## 设置(快速路径) 1. 确保在此 Mac 上已登录"信息"。 2. 配置 iMessage 并启动 Gateway 网关。 ### 专用机器人 macOS 用户(用于隔离身份) 如果你希望机器人从\*\*独立的 iMessage 身份\*\*发送(并保持你的个人"信息"整洁),请使用专用 Apple ID + 专用 macOS 用户。 1. 创建专用 Apple ID(例如:`my-cool-bot@icloud.com`)。 - Apple 可能需要电话号码进行验证 / 2FA。 2. 创建 macOS 用户(例如:`openclawhome`)并登录。 3. 在该 macOS 用户中打开"信息"并使用机器人 Apple ID 登录 iMessage。 4. 启用远程登录(系统设置 → 通用 → 共享 → 远程登录)。 5. 安装 `imsg`: - `brew install steipete/tap/imsg` 6. 设置 SSH 使 `ssh @localhost true` 无需密码即可工作。 7. 将 `channels.imessage.accounts.bot.cliPath` 指向以机器人用户身份运行 `imsg` 的 SSH 包装脚本。 首次运行注意事项:发送/接收可能需要在\*机器人 macOS 用户\*中进行 GUI 批准(自动化 + 完全磁盘访问权限)。如果 `imsg rpc` 看起来卡住或退出,请登录该用户(屏幕共享很有帮助),运行一次 `imsg chats --limit 1` / `imsg send ...`,批准提示,然后重试。 示例包装脚本(`chmod +x`)。将 `` 替换为你的实际 macOS 用户名: ```bash #!/usr/bin/env bash set -euo pipefail # Run an interactive SSH once first to accept host keys: # ssh @localhost true exec /usr/bin/ssh -o BatchMode=yes -o ConnectTimeout=5 -T @localhost \ "/usr/local/bin/imsg" "$@" ``` 示例配置: ```json5 { channels: { imessage: { enabled: true, accounts: { bot: { name: "Bot", enabled: true, cliPath: "/path/to/imsg-bot", dbPath: "/Users//Library/Messages/chat.db", }, }, }, }, } ``` 对于单账户设置,使用扁平选项(`channels.imessage.cliPath`、`channels.imessage.dbPath`)而不是 `accounts` 映射。 ### 远程/SSH 变体(可选) 如果你想在另一台 Mac 上使用 iMessage,请将 `channels.imessage.cliPath` 设置为通过 SSH 在远程 macOS 主机上运行 `imsg` 的包装脚本。OpenClaw 只需要 stdio。 示例包装脚本: ```bash #!/usr/bin/env bash exec ssh -T gateway-host imsg "$@" ``` \*\*远程附件:\*\* 当 `cliPath` 通过 SSH 指向远程主机时,"信息"数据库中的附件路径引用的是远程机器上的文件。OpenClaw 可以通过设置 `channels.imessage.remoteHost` 自动通过 SCP 获取这些文件: ```json5 { channels: { imessage: { cliPath: "~/imsg-ssh", // SSH wrapper to remote Mac remoteHost: "user@gateway-host", // for SCP file transfer includeAttachments: true, }, }, } ``` 如果未设置 `remoteHost`,OpenClaw 会尝试通过解析包装脚本中的 SSH 命令自动检测。建议显式配置以提高可靠性。 #### 通过 Tailscale 连接远程 Mac(示例) 如果 Gateway 网关运行在 Linux 主机/虚拟机上但 iMessage 必须运行在 Mac 上,Tailscale 是最简单的桥接方式:Gateway 网关通过 tailnet 与 Mac 通信,通过 SSH 运行 `imsg`,并通过 SCP 获取附件。 架构: ``` ┌──────────────────────────────┐ SSH (imsg rpc) ┌──────────────────────────┐ │ Gateway host (Linux/VM) │──────────────────────────────────▶│ Mac with Messages + imsg │ │ - openclaw gateway │ SCP (attachments) │ - Messages signed in │ │ - channels.imessage.cliPath │◀──────────────────────────────────│ - Remote Login enabled │ └──────────────────────────────┘ └──────────────────────────┘ ▲ │ Tailscale tailnet (hostname or 100.x.y.z) ▼ user@gateway-host ``` 具体配置示例(Tailscale 主机名): ```json5 { channels: { imessage: { enabled: true, cliPath: "~/.openclaw/scripts/imsg-ssh", remoteHost: "bot@mac-mini.tailnet-1234.ts.net", includeAttachments: true, dbPath: "/Users/bot/Library/Messages/chat.db", }, }, } ``` 示例包装脚本(`~/.openclaw/scripts/imsg-ssh`): ```bash #!/usr/bin/env bash exec ssh -T bot@mac-mini.tailnet-1234.ts.net imsg "$@" ``` 注意事项: - 确保 Mac 已登录"信息",并已启用远程登录。 - 使用 SSH 密钥使 `ssh bot@mac-mini.tailnet-1234.ts.net` 无需提示即可工作。 - `remoteHost` 应与 SSH 目标匹配,以便 SCP 可以获取附件。 多账户支持:使用 `channels.imessage.accounts` 配置每个账户及可选的 `name`。参见 [`gateway/configuration`](/gateway/configuration#telegramaccounts--discordaccounts--slackaccounts--signalaccounts--imessageaccounts) 了解共享模式。不要提交 `~/.openclaw/openclaw.json`(它通常包含令牌)。 ## 访问控制(私信 + 群组) 私信: - 默认:`channels.imessage.dmPolicy = "pairing"`。 - 未知发送者会收到配对码;消息在批准前会被忽略(配对码在 1 小时后过期)。 - 批准方式: - `openclaw pairing list imessage` - `openclaw pairing approve imessage ```` ` - 配对是 iMessage 私信的默认令牌交换方式。详情:[配对](/start/pairing) 群组: - `channels.imessage.groupPolicy = open | allowlist | disabled`。 - 设置 `allowlist` 时,`channels.imessage.groupAllowFrom` 控制谁可以在群组中触发。 - 提及检测使用 `agents.list[].groupChat.mentionPatterns`(或 `messages.groupChat.mentionPatterns`),因为 iMessage 没有原生提及元数据。 - 多智能体覆盖:在 `agents.list[].groupChat.mentionPatterns` 上设置每个智能体的模式。 ## 工作原理(行为) - `imsg` 流式传输消息事件;Gateway 网关将它们规范化为共享渠道信封。 - 回复始终路由回相同的 chat id 或 handle。 ## 类群组会话(`is_group=false`) 某些 iMessage 会话可能有多个参与者,但根据"信息"存储聊天标识符的方式,仍以 `is_group=false` 到达。 如果你在 `channels.imessage.groups` 下显式配置了 `chat_id`,OpenClaw 会将该会话视为"群组"用于: - 会话隔离(独立的 `agent::imessage:group:` 会话键) - 群组允许列表 / 提及检测行为 示例: ```json5 { channels: { imessage: { groupPolicy: "allowlist", groupAllowFrom: ["+15555550123"], groups: { "42": { requireMention:
https://github.com/openclaw/openclaw/blob/main//docs/zh-CN/channels/imessage.md
main
opebclaw
[ -0.036521147936582565, -0.020900532603263855, 0.05748682841658592, -0.039009757339954376, 0.027534177526831627, -0.12009194493293762, 0.05326768010854721, 0.009257234632968903, 0.061701927334070206, -0.012826720252633095, 0.061148468405008316, -0.023008357733488083, -0.018737105652689934, 0.08758696913719177, 0.07123041898012161, 0.04027564451098442, -0.0355505533516407, -0.0561818890273571, -0.024920430034399033, -0.05100157856941223, -0.0031921216286718845, 0.04601582512259483, 0.09388010948896408, 0.026236284524202347, -0.014248986728489399, -0.06247778981924057, -0.031183477491140366, 0.06319309026002884, -0.02140587940812111, -0.014959764666855335, 0.025466641411185265, 0.039369821548461914, 0.04767809808254242, -0.007971605286002159, 0.030433988198637962, 0.14082519710063934, 0.09353140741586685, -0.06496457755565643, 0.04080666974186897, -0.008619612082839012, -0.05760607868432999, -0.03630024939775467, -0.02234252355992794, -0.01907607913017273, 0.04870591312646866, -0.018912144005298615, -0.053723372519016266, -0.014054019004106522, -0.02812410518527031, 0.016407184302806854, -0.029085597023367882, 0.036535024642944336, -0.011960236355662346, 0.07573656737804413, -0.006505279336124659, 0.04131198674440384, -0.14446239173412323, 0.08172741532325745, 0.05978279933333397, 0.06198280677199364, -0.021927254274487495, -0.0018256173934787512, 0.02810673788189888, -0.02221493236720562, -0.15757301449775696, -0.01267473865300417, -0.004110416397452354, 0.01677665114402771, 0.051938656717538834, -0.0038986988365650177, -0.023356743156909943, -0.012897435575723648, -0.09201595932245255, -0.00900979433208704, -0.0435493104159832, 0.033326197415590286, 0.09039149433374405, -0.0871148481965065, -0.11863815784454346, -0.011446183547377586, -0.08601422607898712, -0.07898341119289398, 0.043362975120544434, 0.01906365342438221, -0.02922566421329975, 0.02101292461156845, -0.06642671674489975, -0.05732748657464981, 0.026904860511422157, 0.016127251088619232, -0.015351938083767891, -0.016538534313440323, -0.027691837400197983, 0.10729261487722397, 0.04199037328362465, 0.019635198637843132, 0.002092539332807064, 0.044406987726688385, -0.0739406868815422, 0.09001170843839645, 0.038272254168987274, -0.0005258449236862361, 0.029122456908226013, -0.0022702075075358152, 0.06072445213794708, -0.05972437560558319, -0.01654069684445858, -0.03097686916589737, 0.040650807321071625, -0.031088829040527344, -0.027369270101189613, -0.04679100215435028, -0.007667620200663805, 0.019656822085380554, -0.020459597930312157, 0.0160110704600811, 0.014454391784965992, 0.0004988047294318676, -0.01585960015654564, -0.0012617077445611358, 0.05789915844798088, -0.0526488833129406, -0.1062375158071518, 0.009268391877412796, -0.04884720966219902, 0.06699444353580475, 0.1131686121225357, 4.046021433487574e-33, -0.019325392320752144, 0.039059724658727646, -0.00014874203770887107, 0.023031406104564667, -0.0307464562356472, -0.0654165968298912, 0.008136275224387646, 0.01105443574488163, -0.05251067504286766, -0.014300037175416946, -0.011484574526548386, -0.038718804717063904, -0.047699280083179474, -0.013897290453314781, 0.01054039690643549, -0.05853234976530075, -0.0237042848020792, 0.03028811514377594, 0.0988193079829216, 0.02520424872636795, -0.017610451206564903, 0.025325169786810875, -0.015578774735331535, 0.008525021374225616, 0.00872786995023489, 0.08508659154176712, 0.04150894284248352, -0.07521694153547287, 0.011101940646767616, 0.015511064790189266, 0.07260991632938385, -0.05135507509112358, -0.018177080899477005, 0.04463394731283188, -0.029044626280665398, -0.03163187950849533, 0.03668059781193733, 0.005628280807286501, -0.10205750912427902, -0.022981101647019386, -0.018409283831715584, -0.008912337012588978, -0.09445826709270477, -0.06759300827980042, -0.02200983092188835, -0.010015326552093029, -0.1496080756187439, -0.011129039339721203, 0.05640976130962372, -0.023037446662783623, -0.1048816591501236, -0.007850111462175846, 0.04008866846561432, 0.04616175964474678, 0.0656161680817604, -0.07120275497436523, -0.05363805964589119, -0.007998214103281498, -0.012106972746551037, -0.07293544709682465, -0.02955896221101284, -0.029131073504686356, -0.0008413210744038224, -0.01057037990540266, 0.11809131503105164, -0.02153966575860977, -0.06575679779052734, -0.006663529668003321, -0.012843058444559574, 0.01176417525857687, -0.08788134157657623, -0.010595005936920643, 0.02012070082128048, 0.03019591048359871, -0.041897621005773544, -0.04381692036986351, -0.0924672856926918, 0.10162235796451569, 0.019881704822182655, 0.08146476000547409, -0.017023997381329536, 0.010568663477897644, -0.054385941475629807, 0.026714174076914787, 0.01325139682739973, 0.09233865141868591, 0.07288214564323425, -0.021132247522473335, 0.012523640878498554, 0.1186128705739975, -0.10696595907211304, 0.07847588509321213, 0.029413118958473206, 0.0341070294380188, -0.10641470551490784, -6.884893187969185e-33, 0.03688934072852135, 0.0360952727496624, -0.09920136630535126, 0.026774825528264046, -0.02873215079307556, -0.02564748376607895, 0.10332918912172318, 0.010073518380522728, -0.011542280204594135, -0.03068671002984047, -0.010894380509853363, 0.002300118561834097, 0.05262477695941925, -0.036393895745277405, -0.046875130385160446, 0.07170519232749939, 0.021043946966528893, 0.0008920071995817125, -0.03748371824622154, 0.03942882642149925, -0.05455603078007698, 0.06431771069765091, -0.04868650436401367, 0.04770411550998688, -0.051293522119522095, 0.03107794001698494, 0.05919510871171951, -0.02689572237432003, -0.12203019857406616, -0.058944471180438995, -0.03723609820008278, 0.03691130504012108, -0.011166248470544815, 0.05821767449378967, 0.0351874865591526, -0.034700166434049606, 0.018240397796034813, 0.047254689037799835, -0.012516452930867672, -0.012700364924967289, 0.1085139662027359, 0.02529793232679367, -0.09510906785726547, -0.00761975534260273, -0.03074970655143261, 0.027494017034769058, -0.0158521868288517, 0.020999595522880554, -0.06085333973169327, -0.023763682693243027, 0.0556032769382, -0.04665443301200867, 0.025178616866469383, 0.0024780239909887314, -0.011767258867621422, 0.020563611760735512, 0.04646380618214607, -0.03894784301519394, -0.052317988127470016, -0.07476403564214706, -0.028849530965089798, -0.09335450828075409, 0.015364537015557289, -0.07672124356031418, 0.04207172989845276, -0.0537215992808342, -0.05248098075389862, 0.01975976675748825, 0.06883639097213745, -0.11706660687923431, -0.006970054004341364, -0.024315200746059418, 0.07131288945674896, -0.03727523609995842, 0.08335179090499878, 0.0018666698597371578, -0.08761396259069443, -0.04607760161161423, -0.018464161083102226, -0.006834485102444887, 0.01025779452174902, 0.06002644822001457, -0.018287764862179756, 0.04702029749751091, 0.007923219352960587, -0.017231294885277748, -0.009158603847026825, 0.06168491393327713, 0.024375291541218758, -0.04621049761772156, 0.011857262812554836, 0.06853081285953522, -0.02622533030807972, 0.04824904724955559, 0.03227914124727249, -5.235762756683471e-8, -0.031444571912288666, -0.12118309736251831, -0.04379943013191223, -0.0271459948271513, 0.018617095425724983, 0.0328468456864357, -0.015404142439365387, 0.004263457376509905, 0.042372431606054306, -0.007058007176965475, 0.006151971407234669, 0.06429225206375122, -0.04481183737516403, 0.018490822985768318, -0.06333101540803909, -0.07897081971168518, -0.1104101687669754, 0.0638071820139885, -0.0034055050928145647, -0.06469382345676422, 0.010103448294103146, -0.0054182936437428, -0.017454497516155243, 0.011691167950630188, 0.003076873952522874, 0.0030084061436355114, 0.01808990351855755, -0.05304105952382088, -0.06718838214874268, -0.09540490061044693, -0.02513114921748638, -0.014519722200930119, 0.008523998782038689, -0.018219521269202232, -0.003098859451711178, 0.06617588549852371, 0.007211792282760143, -0.03201572597026825, -0.05982562154531479, 0.01727393828332424, 0.041635170578956604, -0.08296862989664078, -0.041063085198402405, -0.02517959475517273, 0.03948557376861572, -0.04321819916367531, -0.008787509053945541, 0.04702587053179741, 0.04791189730167389, 0.03214734047651291, 0.01940438523888588, -0.04609023034572601, 0.08466051518917084, 0.007803336251527071, 0.03914699703454971, -0.0716899037361145, 0.06303197145462036, -0.0725942999124527, 0.009394638240337372, 0.016975177451968193, 0.08574633300304413, 0.06539648771286011, 0.03408471494913101, -0.05637035146355629 ]
0.099256
`agents.list[].groupChat.mentionPatterns` 上设置每个智能体的模式。 ## 工作原理(行为) - `imsg` 流式传输消息事件;Gateway 网关将它们规范化为共享渠道信封。 - 回复始终路由回相同的 chat id 或 handle。 ## 类群组会话(`is_group=false`) 某些 iMessage 会话可能有多个参与者,但根据"信息"存储聊天标识符的方式,仍以 `is_group=false` 到达。 如果你在 `channels.imessage.groups` 下显式配置了 `chat_id`,OpenClaw 会将该会话视为"群组"用于: - 会话隔离(独立的 `agent::imessage:group:` 会话键) - 群组允许列表 / 提及检测行为 示例: ```json5 { channels: { imessage: { groupPolicy: "allowlist", groupAllowFrom: ["+15555550123"], groups: { "42": { requireMention: false }, }, }, }, } ``` 当你想为特定会话使用隔离的个性/模型时这很有用(参见[多智能体路由](/concepts/multi-agent))。关于文件系统隔离,参见[沙箱隔离](/gateway/sandboxing)。 ## 媒体 + 限制 - 通过 `channels.imessage.includeAttachments` 可选附件摄取。 - 通过 `channels.imessage.mediaMaxMb` 设置媒体上限。 ## 限制 - 出站文本按 `channels.imessage.textChunkLimit` 分块(默认 4000)。 - 可选换行分块:设置 `channels.imessage.chunkMode="newline"` 在长度分块前按空行(段落边界)分割。 - 媒体上传受 `channels.imessage.mediaMaxMb` 限制(默认 16)。 ## 寻址 / 投递目标 优先使用 `chat_id` 进行稳定路由: - `chat_id:123`(推荐) - `chat_guid:...` - `chat_identifier:...` - 直接 handle:`imessage:+1555` / `sms:+1555` / `user@example.com` 列出聊天: ``` imsg chats --limit 20 ``` ## 配置参考(iMessage) 完整配置:[配置](/gateway/configuration) 提供商选项: - `channels.imessage.enabled`:启用/禁用渠道启动。 - `channels.imessage.cliPath`:`imsg` 路径。 - `channels.imessage.dbPath`:"信息"数据库路径。 - `channels.imessage.remoteHost`:当 `cliPath` 指向远程 Mac 时用于 SCP 附件传输的 SSH 主机(例如 `user@gateway-host`)。如未设置则从 SSH 包装脚本自动检测。 - `channels.imessage.service`:`imessage | sms | auto`。 - `channels.imessage.region`:短信区域。 - `channels.imessage.dmPolicy`:`pairing | allowlist | open | disabled`(默认:pairing)。 - `channels.imessage.allowFrom`:私信允许列表(handle、邮箱、E.164 号码或 `chat_id:*`)。`open` 需要 `"*"`。iMessage 没有用户名;使用 handle 或聊天目标。 - `channels.imessage.groupPolicy`:`open | allowlist | disabled`(默认:allowlist)。 - `channels.imessage.groupAllowFrom`:群组发送者允许列表。 - `channels.imessage.historyLimit` / `channels.imessage.accounts.*.historyLimit`:作为上下文包含的最大群组消息数(0 禁用)。 - `channels.imessage.dmHistoryLimit`:私信历史限制(用户轮次)。每用户覆盖:`channels.imessage.dms[""].historyLimit`。 - `channels.imessage.groups`:每群组默认值 + 允许列表(使用 `"*"` 作为全局默认值)。 - `channels.imessage.includeAttachments`:将附件摄取到上下文。 - `channels.imessage.mediaMaxMb`:入站/出站媒体上限(MB)。 - `channels.imessage.textChunkLimit`:出站分块大小(字符)。 - `channels.imessage.chunkMode`:`length`(默认)或 `newline` 在长度分块前按空行(段落边界)分割。 相关全局选项: - `agents.list[].groupChat.mentionPatterns`(或 `messages.groupChat.mentionPatterns`)。 - `messages.responsePrefix`。 ````
https://github.com/openclaw/openclaw/blob/main//docs/zh-CN/channels/imessage.md
main
opebclaw
[ -0.04324248433113098, 0.0355326384305954, -0.024278366938233376, 0.01786423847079277, -0.007707154843956232, -0.050270192325115204, 0.06572723388671875, -0.053411807864904404, 0.05225140601396561, -0.016269151121377945, 0.098880834877491, -0.04060370847582817, -0.00006314285565167665, 0.05928918719291687, 0.0785977691411972, -0.00046630247379653156, -0.056422069668769836, -0.036859240382909775, -0.0451657734811306, -0.0888657495379448, -0.0023393642622977495, 0.027567187324166298, 0.034188203513622284, -0.01236413512378931, -0.0594773069024086, -0.05167385935783386, -0.0651746317744255, -0.009712984785437584, -0.0003358975809533149, -0.028393017128109932, -0.006127939559519291, 0.08599508553743362, -0.034403808414936066, 0.024020254611968994, 0.06348658353090286, 0.08156570792198181, 0.0304980780929327, -0.03925596922636032, 0.07286181300878525, 0.03915746137499809, -0.016272516921162605, 0.005881955847144127, 0.007099847309291363, -0.004952982999384403, 0.03713531792163849, -0.005717092659324408, -0.01931837387382984, 0.021313544362783432, -0.046646106988191605, 0.016700027510523796, -0.031225744634866714, 0.036173515021800995, -0.010265418328344822, 0.08920297026634216, -0.02804630622267723, 0.01691354252398014, -0.15895012021064758, 0.061737723648548126, 0.05521285906434059, -0.021576495841145515, -0.03245580196380615, -0.042653441429138184, 0.030626555904746056, -0.013693369925022125, -0.1871209293603897, -0.01037784293293953, -0.04825149476528168, -0.015641245990991592, 0.010367022827267647, -0.017597319558262825, -0.00016860285541042686, -0.035519473254680634, -0.05345447361469269, -0.017932837828993797, -0.016136953607201576, 0.0409473292529583, 0.030161719769239426, -0.05222654342651367, -0.054815858602523804, -0.044871505349874496, -0.0227726511657238, -0.0848350077867508, 0.02745380811393261, -0.0013924119994044304, -0.03469022735953331, 0.02714863419532776, -0.07367955148220062, -0.02348729781806469, 0.0087660551071167, -0.04193611070513725, 0.003512090304866433, 0.015920791774988174, -0.00967790000140667, 0.05975737422704697, 0.08110332489013672, 0.036400988698005676, -0.02441379614174366, 0.015331798233091831, -0.0790344700217247, 0.08158496767282486, 0.033292897045612335, -0.03363335132598877, -0.044852785766124725, -0.00605927174910903, -0.006702063139528036, -0.05594366416335106, 0.08604174107313156, -0.024031220003962517, 0.019437361508607864, 0.012559844180941582, -0.09907691180706024, 0.005980061832815409, 0.013899758458137512, -0.03831970691680908, 0.020692946389317513, -0.01703769899904728, 0.09548857063055038, 0.06408824771642685, 0.03341338038444519, 0.007561058737337589, 0.1234762966632843, -0.0725359246134758, -0.03655361756682396, 0.029069628566503525, 0.0027927032206207514, 0.06939662247896194, 0.07320006191730499, 8.153813809413913e-34, -0.01193249598145485, 0.03125932812690735, -0.049292683601379395, 0.0017955232178792357, -0.03847493603825569, -0.0163116455078125, -0.032186657190322876, 0.03186468034982681, -0.06959802657365799, 0.00009194154699798673, -0.008314697071909904, -0.04454069957137108, -0.05704865604639053, -0.04408644512295723, -0.033194538205862045, -0.013156278058886528, -0.04628480225801468, 0.030889073386788368, 0.07557442784309387, -0.01768331229686737, -0.041778769344091415, 0.0356680192053318, 0.007833579555153847, 0.04991189390420914, -0.00408940901979804, 0.10215514153242111, -0.03283592686057091, -0.07541978359222412, 0.0249803364276886, 0.005055503454059362, 0.06631594151258469, 0.036284592002630234, -0.05711972340941429, 0.05642758682370186, -0.0012816388625651598, 0.047279052436351776, -0.01636122539639473, -0.010995360091328621, -0.060805585235357285, -0.05689029395580292, -0.051441919058561325, -0.019099801778793335, -0.03805610164999962, -0.057857975363731384, 0.028930788859725, -0.011964297853410244, -0.1468394249677658, -0.017343517392873764, 0.0562790185213089, -0.05620689317584038, -0.08022257685661316, 0.04172930493950844, -0.07459180802106857, 0.023836631327867508, 0.0751415565609932, -0.08642109483480453, -0.06729550659656525, 0.06666699051856995, 0.010454026982188225, -0.027901293709874153, 0.0033446839079260826, -0.030632156878709793, -0.04165489226579666, 0.02035442180931568, 0.07176356017589569, -0.010910208337008953, -0.0428050272166729, 0.06245534494519234, -0.004213621374219656, -0.04751625284552574, -0.009905832819640636, 0.03733816742897034, 0.03559116646647453, 0.08230426162481308, -0.09370606392621994, -0.061394013464450836, -0.012512192130088806, 0.10143286734819412, 0.029368281364440918, 0.01628483273088932, 0.004592571407556534, -0.058174923062324524, -0.0678759440779686, 0.001329637598246336, -0.08109986782073975, 0.06452695280313492, 0.03176227584481239, -0.041554901748895645, 0.005795661360025406, 0.07382666319608688, -0.10456225275993347, 0.055778712034225464, -0.0033110890071839094, 0.08601102977991104, -0.07123877853155136, -6.0449796991036135e-33, 0.02108212374150753, 0.04400893300771713, -0.053669944405555725, -0.05584889277815819, 0.01600155420601368, -0.08814651519060135, 0.13501867651939392, -0.023251164704561234, 0.043047044426202774, 0.02542814426124096, -0.019776243716478348, -0.031085645779967308, 0.008019676432013512, -0.003946369048207998, -0.01132967323064804, 0.0007836525328457355, 0.004812456201761961, -0.03333468735218048, 0.0021611638367176056, 0.02651115506887436, -0.02351239323616028, 0.06749819964170456, -0.08047984540462494, 0.11331663280725479, 0.02375323511660099, -0.012805977836251259, 0.024236125871539116, -0.008921441622078419, -0.033765386790037155, -0.07376683503389359, 0.008641153573989868, 0.011246240697801113, -0.04534958302974701, 0.05971866101026535, 0.027267364785075188, -0.025365522131323814, -0.0031058108434081078, 0.11266887187957764, -0.05414887145161629, -0.006149807944893837, 0.13786064088344574, -0.006381900515407324, -0.11276980489492416, -0.005148307885974646, -0.014785273000597954, 0.01618911698460579, 0.08331503719091415, -0.003716173116117716, -0.060708727687597275, 0.03633464127779007, 0.038139283657073975, -0.07416876405477524, 0.061805710196495056, -0.06323838233947754, 0.03022289276123047, 0.06683486700057983, 0.08668022602796555, -0.10302897542715073, -0.024423886090517044, -0.10978427529335022, 0.031651731580495834, -0.0797155350446701, 0.022530311718583107, -0.018484603613615036, 0.0626254454255104, -0.07363785058259964, -0.0842534676194191, 0.022034289315342903, 0.11127198487520218, -0.013708885759115219, -0.02215573377907276, -0.09214205294847488, 0.03502475842833519, -0.02239980921149254, 0.07154349237680435, 0.021708618849515915, -0.0500047542154789, -0.009566339664161205, -0.01755327358841896, 0.0024190531112253666, -0.019346294924616814, 0.012579553760588169, -0.004493419546633959, 0.07238899916410446, -0.014661705121397972, 0.018466930836439133, 0.021338364109396935, 0.12056829035282135, -0.03723197802901268, 0.020802367478609085, -0.004606820177286863, -0.03211961314082146, 0.0384858101606369, -0.007299175951629877, -0.05340956524014473, -4.6060453229301856e-8, -0.05414636433124542, -0.11297934502363205, -0.01833486184477806, -0.07380644977092743, 0.020550422370433807, -0.02273366041481495, -0.04587581753730774, -0.05673038586974144, 0.05701463297009468, -0.02034251019358635, -0.029059788212180138, 0.04800385236740112, -0.02370264008641243, -0.022365299984812737, -0.05549432337284088, -0.0484706275165081, -0.11194691807031631, -0.0113194165751338, 0.03175025060772896, -0.04965676739811897, -0.028425317257642746, -0.06216808408498764, -0.021327119320631027, -0.02297712117433548, -0.022037234157323837, -0.012303557246923447, -0.08272328227758408, -0.015681151300668716, -0.12235077470541, 0.0040304590947926044, -0.020320918411016464, -0.04609021171927452, 0.04668949171900749, -0.047938812524080276, -0.01688280515372753, 0.06059957295656204, 0.018041588366031647, -0.072187639772892, -0.015317069366574287, -0.04200475662946701, 0.06516491621732712, -0.0261131189763546, -0.0019385823979973793, -0.004334854427725077, 0.04258675128221512, -0.04851575940847397, 0.01887131854891777, -0.0330631323158741, 0.09475944936275482, -0.024702686816453934, -0.06031576916575432, -0.02565573900938034, 0.023252131417393684, 0.030073968693614006, 0.022169215604662895, -0.07465817779302597, 0.07781337946653366, 0.0024926785845309496, 0.04687900468707085, 0.005677429493516684, 0.023072049021720886, 0.06796646118164062, 0.010802039876580238, -0.0073834434151649475 ]
0.091916
# Zalo Personal(非官方) 状态:实验性。此集成通过 `zca-cli` 自动化\*\*个人 Zalo 账户\*\*。 > \*\*警告:\*\*这是一个非官方集成,可能导致账户被暂停/封禁。使用风险自负。 ## 需要插件 Zalo Personal 作为插件提供,不包含在核心安装中。 - 通过 CLI 安装:`openclaw plugins install @openclaw/zalouser` - 或从源码检出安装:`openclaw plugins install ./extensions/zalouser` - 详情:[插件](/plugin) ## 前置条件:zca-cli Gateway 网关机器必须在 `PATH` 中有可用的 `zca` 二进制文件。 - 验证:`zca --version` - 如果缺失,请安装 zca-cli(参见 `extensions/zalouser/README.md` 或上游 zca-cli 文档)。 ## 快速设置(新手) 1. 安装插件(见上文)。 2. 登录(QR,在 Gateway 网关机器上): - `openclaw channels login --channel zalouser` - 用 Zalo 手机应用扫描终端中的二维码。 3. 启用渠道: ```json5 { channels: { zalouser: { enabled: true, dmPolicy: "pairing", }, }, } ``` 4. 重启 Gateway 网关(或完成新手引导)。 5. 私信访问默认为配对模式;首次联系时批准配对码。 ## 这是什么 - 使用 `zca listen` 接收入站消息。 - 使用 `zca msg ...` 发送回复(文本/媒体/链接)。 - 专为"个人账户"使用场景设计,适用于 Zalo Bot API 不可用的情况。 ## 命名 渠道 ID 为 `zalouser`,以明确表示这是自动化\*\*个人 Zalo 用户账户\*\*(非官方)。我们保留 `zalo` 用于未来可能的官方 Zalo API 集成。 ## 查找 ID(目录) 使用目录 CLI 发现联系人/群组及其 ID: ```bash openclaw directory self --channel zalouser openclaw directory peers list --channel zalouser --query "name" openclaw directory groups list --channel zalouser --query "work" ``` ## 限制 - 出站文本分块为约 2000 字符(Zalo 客户端限制)。 - 默认阻止流式传输。 ## 访问控制(私信) `channels.zalouser.dmPolicy` 支持:`pairing | allowlist | open | disabled`(默认:`pairing`)。 `channels.zalouser.allowFrom` 接受用户 ID 或名称。向导会在可用时通过 `zca friend find` 将名称解析为 ID。 通过以下方式批准: - `openclaw pairing list zalouser` - `openclaw pairing approve zalouser ```` ` ## 群组访问(可选) - 默认:`channels.zalouser.groupPolicy = "open"`(允许群组)。使用 `channels.defaults.groupPolicy` 在未设置时覆盖默认值。 - 通过以下方式限制为允许列表: - `channels.zalouser.groupPolicy = "allowlist"` - `channels.zalouser.groups`(键为群组 ID 或名称) - 阻止所有群组:`channels.zalouser.groupPolicy = "disabled"`。 - 配置向导可以提示输入群组允许列表。 - 启动时,OpenClaw 将允许列表中的群组/用户名称解析为 ID 并记录映射;未解析的条目保持原样。 示例: ```json5 { channels: { zalouser: { groupPolicy: "allowlist", groups: { "123456789": { allow: true }, "Work Chat": { allow: true }, }, }, }, } ``` ## 多账户 账户映射到 zca 配置文件。示例: ```json5 { channels: { zalouser: { enabled: true, defaultAccount: "default", accounts: { work: { enabled: true, profile: "work" }, }, }, }, } ``` ## 故障排除 **找不到 `zca`:** - 安装 zca-cli 并确保它在 Gateway 网关进程的 `PATH` 中。 **登录不保持:** - `openclaw channels status --probe` - 重新登录:`openclaw channels logout --channel zalouser && openclaw channels login --channel zalouser` ````
https://github.com/openclaw/openclaw/blob/main//docs/zh-CN/channels/zalouser.md
main
opebclaw
[ -0.08899244666099548, 0.048198070377111435, -0.09478305280208588, -0.02434282749891281, -0.0020027717109769583, -0.08568819612264633, 0.044844139367341995, -0.005017584189772606, -0.005208945833146572, -0.013688287697732449, 0.09876495599746704, -0.022510956972837448, 0.09105231612920761, 0.021812880411744118, -0.00804976001381874, 0.07312288135290146, -0.0352267324924469, -0.02670215256512165, -0.036783721297979355, 0.06278086453676224, -0.03090681880712509, 0.027521178126335144, 0.03499326854944229, -0.011106044985353947, -0.08084950596094131, 0.015042782761156559, -0.04841821640729904, 0.06721774488687515, -0.02061537094414234, -0.01894405484199524, 0.0307795200496912, 0.09957626461982727, 0.02417733334004879, -0.041188836097717285, 0.11826799809932709, 0.009725527837872505, 0.02054026909172535, 0.0009385120938532054, -0.0717565044760704, 0.012974529527127743, 0.016667000949382782, 0.043766316026449203, -0.02600148133933544, -0.03686805069446564, -0.056519001722335815, -0.01818765699863434, 0.00150855362880975, -0.11614243686199188, -0.09112827479839325, -0.001386813586577773, -0.08552147448062897, -0.08542332053184509, -0.06620918214321136, 0.005476848687976599, 0.0658479779958725, -0.01657850667834282, -0.07034090161323547, -0.008066759444773197, 0.018497459590435028, 0.010610715486109257, 0.026235686615109444, 0.04374586418271065, -0.052063435316085815, 0.03534636273980141, -0.09611445665359497, 0.021945443004369736, 0.002736495342105627, -0.029348088428378105, -0.049281999468803406, -0.05254192277789116, -0.0344015397131443, -0.023277724161744118, -0.014856440015137196, 0.010961812920868397, -0.007721731439232826, -0.01798979751765728, 0.08975032716989517, -0.03273225948214531, -0.07531729340553284, -0.15140938758850098, -0.06411218643188477, -0.02319682575762272, 0.0836106464266777, 0.021344436332583427, 0.015047939494252205, 0.15853014588356018, -0.015899144113063812, -0.04069396108388901, 0.07482346147298813, 0.0166157279163599, 0.07038164138793945, -0.00774479890242219, 0.019315475597977638, 0.026076804846525192, -0.02061416767537594, -0.0351964607834816, 0.020512225106358528, 0.032499559223651886, -0.042468927800655365, 0.07974977046251297, 0.03996513411402702, -0.04805159568786621, 0.04614343121647835, -0.0361102856695652, -0.07686832547187805, 0.05834895372390747, -0.006493946071714163, 0.09411659836769104, -0.03536403179168701, 0.03445383906364441, -0.0020068632438778877, -0.05437452718615532, 0.015348377637565136, -0.1484771966934204, -0.07787024974822998, 0.042957305908203125, -0.042917199432849884, -0.02566302940249443, 0.0022676135413348675, 0.014733805321156979, 0.010189956985414028, -0.009423155337572098, -0.07485629618167877, -0.05395456403493881, -0.0235215462744236, 0.036485474556684494, 0.04531947150826454, 2.319373413737225e-33, -0.01608991250395775, 0.028514528647065163, -0.06736606359481812, -0.01615176908671856, 0.049598488956689835, -0.02714204043149948, 0.041780490428209305, 0.010686267167329788, -0.1232587918639183, 0.020703371614217758, 0.04425980523228645, -0.008122384548187256, -0.07548057287931442, 0.026228096336126328, -0.016682671383023262, -0.00861418154090643, 0.025209074839949608, -0.0464898943901062, -0.02165156789124012, -0.02106100507080555, 0.05383851006627083, 0.04870680347084999, -0.04161694645881653, -0.046419158577919006, 0.014311515726149082, 0.1019967719912529, 0.03703022375702858, -0.03551725670695305, -0.008975506760179996, 0.009588136337697506, 0.10173988342285156, -0.015393158420920372, -0.033904753625392914, 0.03474535420536995, -0.08469222486019135, 0.008820753544569016, -0.048746559768915176, -0.022540107369422913, -0.062195777893066406, -0.0750429779291153, 0.015145758166909218, 0.0036640919279307127, -0.07210366427898407, 0.02961188554763794, 0.02950335294008255, -0.019367557018995285, -0.05096603184938431, 0.008144037798047066, 0.04695640876889229, -0.0861583724617958, -0.08671089261770248, 0.027058439329266548, -0.06381015479564667, 0.11363431066274643, -0.08857777714729309, -0.0014531868509948254, -0.08048196136951447, -0.013232654891908169, 0.03485749661922455, -0.0482729971408844, 0.07886466383934021, 0.049687910825014114, 0.006867028772830963, 0.044191911816596985, 0.08394499123096466, -0.0403902493417263, 0.013888543471693993, 0.0034535182639956474, 0.001962202601134777, -0.012783527374267578, -0.09049873054027557, -0.06001099571585655, 0.09183098375797272, 0.05737330764532089, 0.003627647180110216, -0.08053452521562576, -0.056693654507398605, -0.02169092372059822, 0.08374570310115814, -0.024273347109556198, -0.08480539172887802, -0.04509294405579567, -0.02644851803779602, -0.0015889143105596304, -0.03409198671579361, 0.04790681228041649, 0.03741893544793129, 0.023192567750811577, -0.00994644220918417, 0.032982949167490005, -0.0466674380004406, -0.02754480205476284, -0.04578053951263428, -0.02145865000784397, -0.10038316249847412, -6.589301174459505e-33, -0.014962507411837578, -0.008870729245245457, -0.014554259367287159, -0.013750574551522732, 0.014752022922039032, -0.044308457523584366, -0.04351819306612015, -0.04410149157047272, -0.0077780140563845634, -0.013461331836879253, 0.018155384808778763, 0.12032699584960938, 0.048369862139225006, -0.05793077126145363, 0.05869818106293678, 0.014176052995026112, 0.003814487485215068, 0.006198669318109751, -0.04885782673954964, 0.013080056756734848, -0.00508070969954133, 0.029678164049983025, -0.1133212223649025, -0.005271222908049822, 0.010988041758537292, -0.010433197021484375, 0.10151270776987076, -0.005350268445909023, 0.09954587370157242, 0.049665313214063644, -0.03185146674513817, 0.023307621479034424, -0.0967179462313652, 0.03903708979487419, -0.03116648644208908, -0.033760763704776764, -0.04361525550484657, -0.0310441255569458, -0.027458783239126205, -0.012086058966815472, -0.010218842886388302, -0.0031983465887606144, -0.008630839176476002, 0.010748310014605522, -0.03405933082103729, 0.02745189145207405, -0.059878140687942505, -0.08562637865543365, -0.05856126546859741, -0.01935575343668461, 0.08239981532096863, -0.0007363728363998234, 0.005826218519359827, -0.01592233218252659, 0.05963888764381409, 0.06968650221824646, 0.0360550694167614, -0.0713440477848053, -0.05824552848935127, -0.12090863287448883, 0.046162474900484085, 0.04128515347838402, -0.04429362714290619, -0.012761387042701244, 0.030017603188753128, 0.023863883689045906, 0.011594611220061779, -0.017909131944179535, -0.011652735993266106, -0.10149943083524704, -0.027893273159861565, 0.02372373454272747, -0.018758129328489304, -0.10744082182645798, 0.004090934991836548, -0.004140806384384632, -0.034908223897218704, 0.026221919804811478, 0.011361832730472088, 0.020740989595651627, 0.05337357893586159, -0.05227723717689514, 0.08412214368581772, 0.07449600845575333, -0.026119569316506386, -0.07570970058441162, -0.02107183076441288, 0.10708873718976974, 0.05359164997935295, -0.029614796862006187, -0.012925711460411549, 0.030949965119361877, 0.053789619356393814, 0.06369592994451523, -0.031455639749765396, -4.802999953312792e-8, -0.08500150591135025, -0.11863699555397034, -0.07847750931978226, -0.0011350320419296622, -0.0003805271990131587, -0.051836539059877396, -0.005955299828201532, -0.0037245769053697586, -0.08127743005752563, 0.0057183559983968735, 0.07071639597415924, 0.01716757006943226, -0.07141178101301193, 0.03913044184446335, -0.07854509353637695, 0.0165647491812706, -0.026292217895388603, 0.07940391451120377, 0.019214747473597527, -0.0577642023563385, -0.061078622937202454, 0.05142945423722267, 0.04672996327280998, -0.03181546553969383, -0.036880165338516235, 0.04221431910991669, -0.0651487410068512, -0.015271248295903206, -0.027832049876451492, -0.0462285652756691, -0.0003825944440905005, 0.0026488180737942457, 0.12414649873971939, -0.03815663605928421, 0.03322124853730202, 0.04050455242395401, 0.01094602420926094, 0.0016111478907987475, -0.03081418201327324, 0.00009361744014313444, 0.10886775702238083, -0.06822285056114197, 0.008517256006598473, 0.03566719591617584, -0.008836312219500542, -0.04470397159457207, 0.03254769742488861, -0.030499644577503204, 0.03839123249053955, -0.017115717753767967, 0.0263356976211071, 0.016490543261170387, 0.014157704077661037, -0.0030097472481429577, 0.01518350187689066, 0.08083736151456833, -0.006310488563030958, -0.006983587983995676, 0.06104353815317154, 0.06551042199134827, 0.02733319252729416, 0.03306082263588905, 0.021278202533721924, 0.005182680673897266 ]
0.072979
# Telegram(Bot API) 状态:通过 grammY 支持机器人私信和群组,已可用于生产环境。默认使用长轮询;webhook 可选。 ## 快速设置(入门) 1. 通过 \*\*@BotFather\*\*([直达链接](https://t.me/BotFather))创建机器人。确认用户名确实是 `@BotFather`,然后复制 token。 2. 设置 token: - 环境变量:`TELEGRAM\_BOT\_TOKEN=...` - 或配置:`channels.telegram.botToken: "..."`。 - 如果两者都设置了,配置优先(环境变量回退仅适用于默认账户)。 3. 启动 Gateway 网关。 4. 私信访问默认使用配对模式;首次联系时需要批准配对码。 最小配置: ```json5 { channels: { telegram: { enabled: true, botToken: "123:abc", dmPolicy: "pairing", }, }, } ``` ## 这是什么 - 一个由 Gateway 网关拥有的 Telegram Bot API 渠道。 - 确定性路由:回复返回到 Telegram;模型不会选择渠道。 - 私信共享智能体的主会话;群组保持隔离(`agent::telegram:group:`)。 ## 设置(快速路径) ### 1)创建机器人 token(BotFather) 1. 打开 Telegram 并与 \*\*@BotFather\*\*([直达链接](https://t.me/BotFather))对话。确认用户名确实是 `@BotFather`。 2. 运行 `/newbot`,然后按照提示操作(名称 + 以 `bot` 结尾的用户名)。 3. 复制 token 并安全保存。 可选的 BotFather 设置: - `/setjoingroups` — 允许/拒绝将机器人添加到群组。 - `/setprivacy` — 控制机器人是否可以看到所有群组消息。 ### 2)配置 token(环境变量或配置文件) 示例: ```json5 { channels: { telegram: { enabled: true, botToken: "123:abc", dmPolicy: "pairing", groups: { "\*": { requireMention: true } }, }, }, } ``` 环境变量选项:`TELEGRAM\_BOT\_TOKEN=...`(适用于默认账户)。 如果环境变量和配置都设置了,配置优先。 多账户支持:使用 `channels.telegram.accounts`,每个账户有独立的 token 和可选的 `name`。参见 [`gateway/configuration`](/gateway/configuration#telegramaccounts--discordaccounts--slackaccounts--signalaccounts--imessageaccounts) 了解共享模式。 3. 启动 Gateway 网关。当 token 解析成功时 Telegram 启动(配置优先,环境变量回退)。 4. 私信访问默认为配对模式。机器人首次被联系时批准配对码。 5. 对于群组:添加机器人,决定隐私/管理员行为(见下文),然后设置 `channels.telegram.groups` 来控制提及门控和允许列表。 ## Token + 隐私 + 权限(Telegram 端) ### Token 创建(BotFather) - `/newbot` 创建机器人并返回 token(请保密)。 - 如果 token 泄露,通过 @BotFather 撤销/重新生成,并更新你的配置。 ### 群组消息可见性(隐私模式) Telegram 机器人默认启用\*\*隐私模式\*\*,这会限制它们接收哪些群组消息。 如果你的机器人必须看到\*所有\*群组消息,有两个选项: - 使用 `/setprivacy` 禁用隐私模式\*\*或\*\* - 将机器人添加为群组\*\*管理员\*\*(管理员机器人可以接收所有消息)。 \*\*注意:\*\* 当你切换隐私模式时,Telegram 要求将机器人从每个群组中移除并重新添加,更改才能生效。 ### 群组权限(管理员权限) 管理员状态在群组内设置(Telegram UI)。管理员机器人始终接收所有群组消息,因此如果需要完全可见性,请使用管理员身份。 ## 工作原理(行为) - 入站消息被规范化为共享渠道信封,包含回复上下文和媒体占位符。 - 群组回复默认需要提及(原生 @提及或 `agents.list[].groupChat.mentionPatterns` / `messages.groupChat.mentionPatterns`)。 - 多智能体覆盖:在 `agents.list[].groupChat.mentionPatterns` 上设置每个智能体的模式。 - 回复始终路由回同一个 Telegram 聊天。 - 长轮询使用 grammY runner,每个聊天按顺序处理;总体并发受 `agents.defaults.maxConcurrent` 限制。 - Telegram Bot API 不支持已读回执;没有 `sendReadReceipts` 选项。 ## 草稿流式传输 OpenClaw 可以在 Telegram 私信中使用 `sendMessageDraft` 流式传输部分回复。 要求: - 在 @BotFather 中为机器人启用线程模式(论坛话题模式)。 - 仅限私聊线程(Telegram 在入站消息中包含 `message\_thread\_id`)。 - `channels.telegram.streamMode` 未设置为 `"off"`(默认:`"partial"`,`"block"` 启用分块草稿更新)。 草稿流式传输仅限私信;Telegram 在群组或频道中不支持此功能。 ## 格式化(Telegram HTML) - 出站 Telegram 文本使用 `parse\_mode: "HTML"`(Telegram 支持的标签子集)。 - 类 Markdown 输入被渲染为 \*\*Telegram 安全 HTML\*\*(粗体/斜体/删除线/代码/链接);块级元素被扁平化为带换行/项目符号的文本。 - 来自模型的原始 HTML 会被转义,以避免 Telegram 解析错误。 - 如果 Telegram 拒绝 HTML 负载,OpenClaw 会以纯文本重试相同的消息。 ## 命令(原生 + 自定义) OpenClaw 在启动时向 Telegram 的机器人菜单注册原生命令(如 `/status`、`/reset`、`/model`)。 你可以通过配置向菜单添加自定义命令: ```json5 { channels: { telegram: { customCommands: [ { command: "backup", description: "Git 备份" }, { command: "generate", description: "创建图片" }, ], }, }, } ``` ## 故障排除 - 日志中出现 `setMyCommands failed` 通常意味着到 `api.telegram.org` 的出站 HTTPS/DNS 被阻止。 - 如果你看到 `sendMessage` 或 `sendChatAction` 失败,检查 IPv6 路由和 DNS。 更多帮助:[渠道故障排除](/channels/troubleshooting)。 注意: - 自定义命令\*\*仅是菜单条目\*\*;除非你在其他地方处理它们,否则 OpenClaw 不会实现它们。 - 命令名称会被规范化(去除前导 `/`,转为小写),必须匹配 `a-z`、`0-9`、`\_`(1-32 个字符)。 - 自定义命令\*\*不能覆盖原生命令\*\*。冲突会被忽略并记录日志。 - 如果禁用了 `commands.native`,则只注册自定义命令(如果没有则清空)。 ## 限制 - 出站文本按 `channels.telegram.textChunkLimit` 分块(默认 4000)。 - 可选的换行分块:设置 `channels.telegram.chunkMode="newline"` 在长度分块之前按空行(段落边界)分割。 - 媒体下载/上传受 `channels.telegram.mediaMaxMb` 限制(默认 5)。 - Telegram Bot API 请求在 `channels.telegram.timeoutSeconds` 后超时(通过 grammY 默认 500)。设置较低的值以避免长时间挂起。 - 群组历史上下文使用 `channels.telegram.historyLimit`(或 `channels.telegram.accounts.\*.historyLimit`),回退到 `messages.groupChat.historyLimit`。设置 `0` 禁用(默认 50)。 - 私信历史可以用 `channels.telegram.dmHistoryLimit`(用户轮次)限制。每用户覆盖:`channels.telegram.dms[""].historyLimit`。 ## 群组激活模式 默认情况下,机器人只响应群组中的提及(`@botname` 或 `agents.list[].groupChat.mentionPatterns` 中的模式)。要更改此行为: ### 通过配置(推荐) ```json5 { channels: { telegram: { groups: { "-1001234567890": { requireMention: false }, // 在此群组中始终响应 }, }, }, } ``` \*\*重要:\*\* 设置 `channels.telegram.groups` 会创建一个\*\*允许列表\*\* - 只有列出的群组(或 `"\*"`)会被接受。 论坛话题继承其父群组配置(allowFrom、requireMention、skills、prompts),除非你在 `channels.telegram.groups..topics.` 下添加每话题覆盖。 要允许所有群组并始终响应: ```json5 { channels: { telegram: { groups: { "\*": { requireMention: false }, // 所有群组,始终响应 }, }, }, } ``` 要保持所有群组仅提及响应(默认行为): ```json5 { channels: { telegram: { groups: { "\*": { requireMention: true }, // 或完全省略 groups }, }, }, } ``` ### 通过命令(会话级别) 在群组中发送: - `/activation always` - 响应所有消息 - `/activation mention` - 需要提及(默认) \*\*注意:\*\* 命令只更新会话状态。要在重启后保持持久行为,请使用配置。 ### 获取群组聊天 ID 将群组中的任何消息转发给 Telegram 上的 `@userinfobot` 或 `@getidsbot` 以查看聊天 ID(负数,如 `-1001234567890`)。 \*\*提示:\*\* 要获取你自己的用户 ID,私信机器人,它会回复你的用户 ID(配对消息),或者在命令启用后使用 `/whoami`。 \*\*隐私注意:\*\* `@userinfobot` 是第三方机器人。如果你更倾向于其他方式,将机器人添加到群组,发送一条消息,然后使用 `openclaw logs --follow` 读取 `chat.id`,或使用 Bot API `getUpdates`。 ## 配置写入 默认情况下,Telegram 允许写入由渠道事件或 `/config set|unset` 触发的配置更新。 这发生在以下情况: - 群组升级为超级群组,Telegram 发出 `migrate\_to\_chat\_id`(聊天 ID 更改)。OpenClaw 可以自动迁移 `channels.telegram.groups`。 - 你在 Telegram 聊天中运行 `/config set` 或 `/config unset`(需要 `commands.config: true`)。 禁用方式: ```json5 { channels: { telegram: { configWrites: false } }, } ``` ## 话题(论坛超级群组) Telegram 论坛话题在每条消息中包含 `message\_thread\_id`。OpenClaw: - 将 `:topic:` 附加到 Telegram 群组会话键,使每个话题隔离。 - 发送输入指示器和回复时带上 `message\_thread\_id`,使响应保持在话题内。 - 通用话题(线程 id `1`)是特殊的:消息发送省略 `message\_thread\_id`(Telegram 会拒绝),但输入指示器仍然包含它。 - 在模板上下文中暴露 `MessageThreadId` + `IsForum` 用于路由/模板。 - 话题特定配置可在 `channels.telegram.groups..topics.` 下设置(skills、允许列表、自动回复、系统提示、禁用)。 - 话题配置继承群组设置(requireMention、允许列表、skills、提示、enabled),除非每话题覆盖。 私聊在某些边缘情况下可能包含 `message\_thread\_id`。OpenClaw 保持私信会话键不变,但在存在线程 id 时仍将其用于回复/草稿流式传输。 ## 内联按钮 Telegram 支持带回调按钮的内联键盘。 ```json5 { channels: { telegram: { capabilities: { inlineButtons: "allowlist", }, }, }, } ``` 对于每账户配置: ```json5
https://github.com/openclaw/openclaw/blob/main//docs/zh-CN/channels/telegram.md
main
opebclaw
[ -0.06297705322504044, -0.00283131399191916, 0.04020120948553085, -0.046199023723602295, 0.02311158925294876, -0.07129303365945816, 0.012694315053522587, 0.0012494762195274234, 0.018730614334344864, 0.014559333212673664, 0.042847760021686554, -0.07337111979722977, 0.022033412009477615, 0.025592856109142303, 0.11603685468435287, 0.041680071502923965, -0.0795641839504242, -0.011442550458014011, -0.06993379443883896, -0.08048296719789505, 0.012490390799939632, -0.004470973741263151, -0.02429746277630329, 0.023786723613739014, 0.024302657693624496, -0.03269615396857262, -0.039915964007377625, 0.03222010284662247, -0.03451294079422951, 0.006201532203704119, 0.014158116653561592, 0.009880305267870426, -0.042987048625946045, 0.012875047512352467, 0.04375274479389191, 0.07921987026929855, 0.0005212631658650935, -0.021453699097037315, 0.08204230666160583, 0.029093341901898384, -0.028225036337971687, -0.0764414370059967, -0.04628165438771248, -0.052159469574689865, 0.059211574494838715, 0.03398105129599571, -0.02945738658308983, 0.022465037181973457, -0.06614126265048981, -0.0056688240729272366, -0.06472822278738022, -0.02669622376561165, -0.0144951231777668, 0.035486962646245956, -0.051350269466638565, -0.04253009334206581, -0.06764283031225204, 0.07540944963693619, 0.09521758556365967, -0.014859378337860107, -0.011916331015527248, -0.036370955407619476, 0.04243370518088341, -0.040783628821372986, -0.09705742448568344, -0.019977128133177757, -0.10968036949634552, 0.02131841704249382, 0.027018209919333458, 0.02980806492269039, 0.029429789632558823, 0.006249540485441685, -0.08093831688165665, -0.006439595483243465, -0.02131449058651924, -0.016455499455332756, 0.035780809819698334, 0.003353297710418701, -0.10739336907863617, -0.048455316573381424, -0.010543806478381157, -0.018647873774170876, 0.05154845863580704, 0.0433187410235405, -0.05360500514507294, 0.08588605374097824, -0.0524015910923481, -0.02308703400194645, -0.0041623665019869804, -0.0258465725928545, -0.0049082254990935326, 0.0024785208515822887, 0.02885705977678299, 0.03134698420763016, 0.03131525218486786, 0.012441023252904415, -0.017299747094511986, -0.0052142697386443615, -0.059653911739587784, 0.06504408270120621, 0.02254960872232914, -0.0471118725836277, -0.034246042370796204, 0.0010754663962870836, 0.06972908973693848, -0.0178433395922184, 0.010189658962190151, 0.015112406574189663, 0.12944968044757843, 0.04001361131668091, -0.037425946444272995, 0.01238873228430748, -0.033805545419454575, -0.0336497500538826, -0.04090658575296402, 0.07853265851736069, 0.012674330733716488, 0.03343440219759941, 0.03403234854340553, 0.035168491303920746, 0.10826054215431213, -0.09335766732692719, -0.05974686145782471, -0.019846854731440544, -0.07250722497701645, -0.03118859976530075, 0.13731592893600464, 4.269011242470623e-33, 0.007489657029509544, 0.030059920623898506, -0.03267659619450569, -0.02213570848107338, -0.01753471978008747, -0.019407853484153748, -0.005256523843854666, -0.02104358747601509, -0.057030003517866135, -0.05063318461179733, -0.055820997804403305, -0.0023173384834080935, -0.02781214751303196, 0.020684603601694107, -0.09886980056762695, -0.07288050651550293, -0.005328726023435593, 0.004390551708638668, 0.0787118449807167, 0.007096866145730019, 0.00479273684322834, 0.01345987617969513, 0.02114291675388813, 0.03131713718175888, 0.04264023154973984, 0.07899156212806702, 0.038278765976428986, -0.030725115910172462, -0.003974415827542543, 0.023367030546069145, 0.01598851941525936, -0.024910718202590942, -0.026112694293260574, 0.015557453036308289, 0.031866952776908875, -0.03651594743132591, -0.014141799882054329, -0.014933379366993904, -0.08669309318065643, -0.07407022267580032, -0.03703024610877037, -0.03157859295606613, -0.07732611149549484, -0.038808997720479965, -0.018182026222348213, 0.011230982840061188, -0.06848898530006409, -0.08656076341867447, 0.05815000832080841, -0.04639916121959686, -0.045502904802560806, 0.07594411075115204, -0.03795219212770462, -0.033103346824645996, 0.06988455355167389, -0.08967700600624084, -0.04246228188276291, -0.03300794959068298, -0.04785803705453873, -0.07633499056100845, 0.05075456574559212, -0.03519904613494873, 0.04577842727303505, -0.037143636494874954, 0.07273552566766739, 0.026365812867879868, 0.018267806619405746, 0.052685946226119995, 0.022588083520531654, -0.028892898932099342, -0.05477294325828552, 0.08366797864437103, 0.029103541746735573, 0.07022653520107269, -0.137102410197258, -0.040748145431280136, 0.02987123653292656, 0.06014326214790344, 0.001451643300242722, 0.011174323037266731, -0.03652658686041832, -0.0535966232419014, -0.026236718520522118, -0.007201263215392828, 0.002769047161564231, 0.08828826248645782, 0.02942618913948536, -0.08691217005252838, -0.020589208230376244, 0.057959578931331635, -0.10519465059041977, 0.08793957531452179, -0.031523022800683975, 0.00027287224656902254, -0.11690584570169449, -8.052539644631795e-33, -0.016492575407028198, 0.0251073706895113, -0.00314139062538743, -0.010015221312642097, -0.03469325602054596, -0.05952612683176994, 0.07555056363344193, 0.06136495620012283, 0.0403018482029438, 0.1293933093547821, -0.030720146372914314, -0.06918915361166, -0.01801278442144394, -0.029263732954859734, 0.024818917736411095, 0.04591605067253113, -0.01685967482626438, 0.013178177177906036, 0.02496729977428913, 0.028748750686645508, -0.04639304801821709, 0.030104026198387146, -0.13770416378974915, 0.06328414380550385, -0.0307694673538208, 0.024626147001981735, -0.004291127901524305, -0.01677107810974121, 0.0025802860036492348, -0.0826663225889206, 0.03440837934613228, 0.004547661170363426, -0.06969356536865234, 0.058769725263118744, 0.039452482014894485, -0.03818824514746666, -0.0040553598664700985, 0.13602879643440247, 0.011876873672008514, -0.02729850821197033, 0.09183940291404724, -0.004994301125407219, -0.08869119733572006, -0.0053057181648910046, -0.026751171797513962, -0.022914428263902664, -0.020171379670500755, 0.05748651921749115, -0.11839565634727478, -0.010612625628709793, 0.1290547400712967, -0.03881651535630226, -0.009865782223641872, -0.013013957068324089, -0.010319443419575691, 0.01931493729352951, 0.10420709103345871, -0.0305526964366436, -0.015497894026339054, -0.09220051765441895, 0.00758959399536252, -0.15254968404769897, 0.01695886440575123, 0.06676505506038666, 0.041690923273563385, 0.009656176902353764, 0.003993422724306583, 0.043046239763498306, -0.009433248080313206, -0.057760659605264664, 0.0579606331884861, -0.04058791324496269, 0.008375467732548714, -0.031084664165973663, 0.06182742863893509, 0.01952999457716942, -0.06496366858482361, 0.026029275730252266, -0.0025570420548319817, 0.02800244837999344, -0.058731403201818466, 0.05593768507242203, 0.006498484406620264, 0.07368332147598267, -0.003211959730833769, 0.02491244301199913, 0.03930491581559181, 0.09235116094350815, -0.03149063140153885, -0.0017090477049350739, 0.03393126651644707, 0.0553920678794384, 0.043610043823719025, 0.056760262697935104, 0.02282644808292389, -4.7276291326170394e-8, -0.027688493952155113, -0.09610556811094284, -0.06523145735263824, -0.02302996627986431, -0.05459478124976158, 0.04126664623618126, -0.030729390680789948, -0.08238298445940018, 0.03750535845756531, -0.049573082476854324, -0.033491361886262894, 0.035968489944934845, -0.0799054428935051, -0.008398187346756458, -0.06929772347211838, -0.035932522267103195, -0.13162842392921448, 0.028957657516002655, 0.05485761538147926, -0.03092428669333458, 0.0196621585637331, 0.016152499243617058, -0.0032811476849019527, -0.06118420138955116, 0.004567133262753487, -0.004765400197356939, -0.0111648328602314, 0.058135196566581726, -0.10441242903470993, -0.07354145497083664, -0.04189413785934448, -0.019115395843982697, 0.030801089480519295, -0.10694512724876404, 0.02689608372747898, 0.04946175217628479, -0.034723661839962006, -0.0853552520275116, -0.05800341069698334, 0.015394117683172226, 0.05870620906352997, -0.058219339698553085, -0.007046188227832317, -0.0019045176450163126, 0.06807796657085419, -0.029536673799157143, 0.06888436526060104, -0.009811848402023315, 0.09410328418016434, -0.058591656386852264, -0.034483734518289566, -0.035490646958351135, 0.0737035870552063, -0.02036464586853981, -0.0023681202437728643, -0.014374005608260632, -0.023136993870139122, -0.032607752829790115, 0.020197855308651924, 0.04395167529582977, 0.0733475610613823, 0.07598261535167694, 0.012412198819220066, -0.0032834988087415695 ]
0.123537
附加到 Telegram 群组会话键,使每个话题隔离。 - 发送输入指示器和回复时带上 `message\_thread\_id`,使响应保持在话题内。 - 通用话题(线程 id `1`)是特殊的:消息发送省略 `message\_thread\_id`(Telegram 会拒绝),但输入指示器仍然包含它。 - 在模板上下文中暴露 `MessageThreadId` + `IsForum` 用于路由/模板。 - 话题特定配置可在 `channels.telegram.groups..topics.` 下设置(skills、允许列表、自动回复、系统提示、禁用)。 - 话题配置继承群组设置(requireMention、允许列表、skills、提示、enabled),除非每话题覆盖。 私聊在某些边缘情况下可能包含 `message\_thread\_id`。OpenClaw 保持私信会话键不变,但在存在线程 id 时仍将其用于回复/草稿流式传输。 ## 内联按钮 Telegram 支持带回调按钮的内联键盘。 ```json5 { channels: { telegram: { capabilities: { inlineButtons: "allowlist", }, }, }, } ``` 对于每账户配置: ```json5 { channels: { telegram: { accounts: { main: { capabilities: { inlineButtons: "allowlist", }, }, }, }, }, } ``` 作用域: - `off` — 禁用内联按钮 - `dm` — 仅私信(群组目标被阻止) - `group` — 仅群组(私信目标被阻止) - `all` — 私信 + 群组 - `allowlist` — 私信 + 群组,但仅限 `allowFrom`/`groupAllowFrom` 允许的发送者(与控制命令规则相同) 默认:`allowlist`。 旧版:`capabilities: ["inlineButtons"]` = `inlineButtons: "all"`。 ### 发送按钮 使用带 `buttons` 参数的消息工具: ```json5 { action: "send", channel: "telegram", to: "123456789", message: "选择一个选项:", buttons: [ [ { text: "是", callback\_data: "yes" }, { text: "否", callback\_data: "no" }, ], [{ text: "取消", callback\_data: "cancel" }], ], } ``` 当用户点击按钮时,回调数据会以以下格式作为消息发送回智能体: `callback\_data: value` ### 配置选项 Telegram 功能可以在两个级别配置(上面显示的对象形式;旧版字符串数组仍然支持): - `channels.telegram.capabilities`:应用于所有 Telegram 账户的全局默认功能配置,除非被覆盖。 - `channels.telegram.accounts..capabilities`:每账户功能,覆盖该特定账户的全局默认值。 当所有 Telegram 机器人/账户应具有相同行为时使用全局设置。当不同机器人需要不同行为时使用每账户配置(例如,一个账户只处理私信,而另一个允许在群组中使用)。 ## 访问控制(私信 + 群组) ### 私信访问 - 默认:`channels.telegram.dmPolicy = "pairing"`。未知发送者收到配对码;在批准之前消息被忽略(配对码 1 小时后过期)。 - 批准方式: - `openclaw pairing list telegram` - `openclaw pairing approve telegram ```` ` - 配对是 Telegram 私信使用的默认 token 交换。详情:[配对](/start/pairing) - `channels.telegram.allowFrom` 接受数字用户 ID(推荐)或 `@username` 条目。这**不是**机器人用户名;使用人类发送者的 ID。向导接受 `@username` 并在可能时将其解析为数字 ID。 #### 查找你的 Telegram 用户 ID 更安全(无第三方机器人): 1. 启动 Gateway 网关并私信你的机器人。 2. 运行 `openclaw logs --follow` 并查找 `from.id`。 备选(官方 Bot API): 1. 私信你的机器人。 2. 使用你的机器人 token 获取更新并读取 `message.from.id`: ```bash curl "https://api.telegram.org/bot/getUpdates" ``` 第三方(隐私性较低): - 私信 `@userinfobot` 或 `@getidsbot` 并使用返回的用户 id。 ### 群组访问 两个独立的控制: **1. 允许哪些群组**(通过 `channels.telegram.groups` 的群组允许列表): - 无 `groups` 配置 = 允许所有群组 - 有 `groups` 配置 = 只允许列出的群组或 `"*"` - 示例:`"groups": { "-1001234567890": {}, "*": {} }` 允许所有群组 **2. 允许哪些发送者**(通过 `channels.telegram.groupPolicy` 的发送者过滤): - `"open"` = 允许群组中的所有发送者发消息 - `"allowlist"` = 只有 `channels.telegram.groupAllowFrom` 中的发送者可以发消息 - `"disabled"` = 不接受任何群组消息 默认是 `groupPolicy: "allowlist"`(除非添加 `groupAllowFrom` 否则被阻止)。 大多数用户需要:`groupPolicy: "allowlist"` + `groupAllowFrom` + 在 `channels.telegram.groups` 中列出特定群组 ## 长轮询 vs webhook - 默认:长轮询(不需要公共 URL)。 - Webhook 模式:设置 `channels.telegram.webhookUrl` 和 `channels.telegram.webhookSecret`(可选 `channels.telegram.webhookPath`)。 - 本地监听器绑定到 `0.0.0.0:8787`,默认服务于 `POST /telegram-webhook`。 - 如果你的公共 URL 不同,使用反向代理并将 `channels.telegram.webhookUrl` 指向公共端点。 ## 回复线程 Telegram 通过标签支持可选的线程回复: - `[[reply_to_current]]` -- 回复触发消息。 - `[[reply_to:]]` -- 回复特定消息 id。 通过 `channels.telegram.replyToMode` 控制: - `first`(默认)、`all`、`off`。 ## 音频消息(语音 vs 文件) Telegram 区分**语音备忘录**(圆形气泡)和**音频文件**(元数据卡片)。 OpenClaw 默认使用音频文件以保持向后兼容性。 要在智能体回复中强制使用语音备忘录气泡,在回复中的任何位置包含此标签: - `[[audio_as_voice]]` — 将音频作为语音备忘录而不是文件发送。 该标签会从发送的文本中去除。其他渠道会忽略此标签。 对于消息工具发送,设置 `asVoice: true` 并配合兼容语音的音频 `media` URL(当存在 media 时 `message` 是可选的): ```json5 { action: "send", channel: "telegram", to: "123456789", media: "https://example.com/voice.ogg", asVoice: true, } ``` ## 贴纸 OpenClaw 支持接收和发送 Telegram 贴纸,并具有智能缓存功能。 ### 接收贴纸 当用户发送贴纸时,OpenClaw 根据贴纸类型处理: - **静态贴纸(WEBP):** 下载并通过视觉处理。贴纸在消息内容中显示为 `` 占位符。 - **动画贴纸(TGS):** 跳过(Lottie 格式不支持处理)。 - **视频贴纸(WEBM):** 跳过(视频格式不支持处理)。 接收贴纸时可用的模板上下文字段: - `Sticker` — 包含以下属性的对象: - `emoji` — 与贴纸关联的表情符号 - `setName` — 贴纸集名称 - `fileId` — Telegram 文件 ID(用于发送相同贴纸) - `fileUniqueId` — 用于缓存查找的稳定 ID - `cachedDescription` — 可用时的缓存视觉描述 ### 贴纸缓存 贴纸通过 AI 的视觉功能处理以生成描述。由于相同的贴纸经常重复发送,OpenClaw 缓存这些描述以避免冗余的 API 调用。 **工作原理:** 1. **首次遇到:** 贴纸图像被发送给 AI 进行视觉分析。AI 生成描述(例如"一只卡通猫热情地挥手")。 2. **缓存存储:** 描述与贴纸的文件 ID、表情符号和集合名称一起保存。 3. **后续遇到:** 当再次看到相同贴纸时,直接使用缓存的描述。图像不会发送给 AI。 **缓存位置:** `~/.openclaw/telegram/sticker-cache.json` **缓存条目格式:** ```json { "fileId": "CAACAgIAAxkBAAI...", "fileUniqueId": "AgADBAADb6cxG2Y", "emoji": "👋", "setName": "CoolCats", "description": "一只卡通猫热情地挥手", "cachedAt": "2026-01-15T10:30:00.000Z" } ``` **优点:** - 通过避免对相同贴纸重复调用视觉 API 来降低 API 成本 - 缓存贴纸响应更快(无视觉处理延迟) - 基于缓存描述启用贴纸搜索功能 缓存在接收贴纸时自动填充。无需手动缓存管理。 ### 发送贴纸 智能体可以使用 `sticker` 和 `sticker-search` 动作发送和搜索贴纸。这些默认禁用,必须在配置中启用: ```json5 { channels: { telegram: { actions: { sticker: true, }, }, }, } ``` **发送贴纸:** ```json5 { action: "sticker", channel: "telegram", to: "123456789", fileId: "CAACAgIAAxkBAAI...", } ``` 参数: - `fileId`(必需)— 贴纸的 Telegram 文件 ID。从接收贴纸时的 `Sticker.fileId` 获取,或从 `sticker-search` 结果获取。 - `replyTo`(可选)— 要回复的消息 ID。 - `threadId`(可选)— 论坛话题的消息线程 ID。 **搜索贴纸:** 智能体可以按描述、表情符号或集合名称搜索缓存的贴纸: ```json5 { action: "sticker-search", channel: "telegram", query: "猫 挥手", limit: 5, } ``` 返回缓存中匹配的贴纸: ```json5 { ok: true, count: 2, stickers: [ { fileId: "CAACAgIAAxkBAAI...", emoji: "👋", description: "一只卡通猫热情地挥手", setName: "CoolCats", }, ], } ``` 搜索在描述文本、表情符号字符和集合名称之间使用模糊匹配。 **带线程的示例:** ```json5 { action: "sticker", channel: "telegram", to: "-1001234567890", fileId: "CAACAgIAAxkBAAI...", replyTo: 42, threadId: 123, } ``` ## 流式传输(草稿) Telegram 可以在智能体生成响应时流式传输**草稿气泡**。 OpenClaw 使用
https://github.com/openclaw/openclaw/blob/main//docs/zh-CN/channels/telegram.md
main
opebclaw
[ -0.012672760523855686, 0.026096707209944725, -0.019092263653874397, 0.0009311101748608053, 0.01352081447839737, -0.009728810749948025, 0.07077232748270035, -0.043714337050914764, 0.010964740999042988, 0.011842046864330769, 0.15444567799568176, -0.09924441576004028, 0.08771902322769165, -0.014520409516990185, 0.004078651312738657, 0.0313560925424099, -0.005937372334301472, -0.026582347229123116, -0.08003916591405869, -0.03508710861206055, -0.0013357398565858603, 0.06615433841943741, 0.027936507016420364, 0.01836179383099079, 0.02517719753086567, 0.00866719614714384, -0.06189543381333351, 0.006829208694398403, 0.04651607200503349, -0.014498413540422916, -0.004608312156051397, 0.06038779392838478, -0.003409616183489561, 0.03734240308403969, 0.105411097407341, 0.07651682943105698, 0.03943052515387535, -0.0409201979637146, 0.04045999050140381, 0.043259475380182266, -0.061173856258392334, -0.028676116839051247, -0.06269180029630661, -0.04529805853962898, -0.01352751161903143, 0.020842092111706734, -0.042064469307661057, 0.026431074365973473, -0.09366446733474731, -0.0407167412340641, -0.06935963779687881, -0.006888465024530888, -0.010192197747528553, 0.05931029096245766, 0.06651544570922852, 0.0011181418085470796, -0.08079390972852707, -0.007717187982052565, -0.012887373566627502, -0.045038025826215744, -0.0035834088921546936, 0.010237992741167545, -0.006255820859223604, -0.0020778030157089233, -0.09162100404500961, 0.03297625854611397, -0.051084838807582855, 0.06906791031360626, 0.02912898175418377, -0.028590640053153038, -0.045370250940322876, 0.032022397965192795, -0.058440279215574265, 0.07551855593919754, -0.033614631742239, 0.030856629833579063, 0.022420832887291908, 0.02678229659795761, -0.11540167033672333, -0.14683416485786438, -0.07579652965068817, -0.00342769268900156, 0.08714630454778671, -0.035716500133275986, -0.0009814162040129304, 0.021589208394289017, -0.04957260936498642, -0.0056280530989170074, 0.04668440669775009, 0.03847618028521538, 0.03171185776591301, 0.04323491454124451, 0.01565590500831604, 0.06135471165180206, 0.08528351038694382, -0.052789412438869476, 0.03544555604457855, 0.06412509083747864, -0.002968392800539732, 0.04184204339981079, 0.005855383817106485, -0.03791598603129387, -0.11502671986818314, -0.053386952728033066, -0.09006305783987045, -0.05971056967973709, -0.044657882302999496, -0.011516585014760494, 0.028978025540709496, -0.01885337010025978, -0.018423408269882202, -0.017343463376164436, 0.015785643830895424, -0.12359710037708282, -0.019675860181450844, 0.02412595972418785, 0.06158909574151039, 0.004126040264964104, 0.024500159546732903, 0.005187680944800377, 0.0763087049126625, -0.048884641379117966, -0.05987335368990898, -0.01919855922460556, -0.02689468115568161, 0.02465803548693657, 0.09013806283473969, -2.739594093385969e-33, 0.0392887182533741, 0.0239730067551136, -0.0822891891002655, 0.010262901894748211, 0.006194833666086197, 0.005822851322591305, -0.05383620038628578, 0.0008299925248138607, -0.027903486043214798, -0.04642842337489128, -0.0636105164885521, -0.013945243321359158, -0.05786596238613129, -0.02140902914106846, -0.012538384646177292, -0.05504881218075752, -0.022556455805897713, 0.02760433405637741, 0.05244666710495949, -0.04411153867840767, 0.0353865772485733, -0.024381808936595917, -0.034196969121694565, 0.03522207960486412, 0.05232616141438484, 0.06790551543235779, 0.048510223627090454, -0.08878187835216522, -0.0050662728026509285, 0.0382579006254673, 0.026257727295160294, -0.020847555249929428, -0.019116634503006935, 0.03538515046238899, -0.019869031384587288, 0.05188663676381111, 0.014406084083020687, -0.048512376844882965, -0.03080723062157631, -0.044175371527671814, -0.0630207508802414, -0.037289708852767944, 0.01683647185564041, -0.013153069652616978, 0.030859388411045074, -0.05415753647685051, -0.06818655878305435, -0.030546613037586212, 0.04492443799972534, -0.06276406347751617, 0.045037973672151566, 0.020857609808444977, 0.00835035927593708, -0.022038070484995842, 0.05191606655716896, -0.026941226795315742, -0.07005783170461655, 0.020667554810643196, -0.028829291462898254, 0.05615396797657013, 0.003970597870647907, 0.012859617359936237, -0.026205947622656822, 0.023907404392957687, 0.06118364259600639, 0.014027184806764126, -0.019077392295002937, -0.007659028749912977, 0.06933855265378952, -0.06457766890525818, -0.1186341643333435, 0.017782369628548622, -0.0046751839108765125, 0.060412365943193436, -0.07627468556165695, -0.06593815982341766, -0.04848187044262886, 0.048083774745464325, 0.04559018462896347, -0.02703399956226349, -0.0283549465239048, -0.04662839323282242, -0.03622368350625038, -0.015099400654435158, 0.00517174880951643, 0.02726927027106285, 0.0743178054690361, -0.034873053431510925, -0.03738079592585564, 0.02389167807996273, -0.07510826736688614, 0.041050899773836136, -0.0204304289072752, 0.0403381884098053, 0.011841635219752789, -2.724423053091661e-33, -0.021855076774954796, 0.02051752433180809, -0.06264006346464157, -0.02334589883685112, 0.04836616665124893, -0.0015994878485798836, 0.04290461540222168, -0.020661693066358566, -0.007761032786220312, 0.04664412513375282, -0.07716383039951324, -0.08393740653991699, -0.07246013730764389, 0.04442125931382179, -0.02693772129714489, -0.02135360613465309, 0.023126615211367607, 0.08025673776865005, -0.03496314957737923, 0.03279370069503784, 0.010829657316207886, 0.03514973446726799, -0.1372593194246292, 0.025401979684829712, 0.017496613785624504, 0.027512354776263237, 0.010249434038996696, -0.027818841859698296, 0.02999749965965748, -0.0022313683293759823, -0.0016270887572318316, -0.04449300095438957, -0.0927022248506546, 0.07884273678064346, -0.029301006346940994, -0.07056249678134918, 0.0379343256354332, -0.009705988690257072, -0.08573692291975021, 0.03653286024928093, 0.040438536554574966, 0.0396571047604084, -0.08416421711444855, -0.002278577769175172, -0.062442418187856674, 0.02644607238471508, 0.00224411953240633, -0.08103076368570328, -0.1128295361995697, 0.0026964962016791105, 0.07714103162288666, -0.04547521471977234, 0.049311984330415726, 0.016819413751363754, -0.0025645035784691572, 0.028164930641651154, 0.04273485392332077, -0.11182296276092529, -0.05673541873693466, -0.0892259031534195, 0.049013618379831314, 0.031666867434978485, -0.012434780597686768, 0.021686797961592674, 0.1113230362534523, -0.052582405507564545, 0.019873760640621185, -0.011762169189751148, -0.029755210503935814, -0.06210608407855034, 0.0680570974946022, -0.03645915165543556, -0.01601390354335308, -0.08792634308338165, 0.05117371305823326, 0.0596422404050827, -0.0345444455742836, 0.05486344173550606, -0.0779201090335846, 0.033248044550418854, -0.022668931633234024, -0.0025815945118665695, 0.04445856809616089, 0.12433644384145737, -0.0379825197160244, 0.019409054890275, 0.062457505613565445, 0.11290339380502701, -0.023783113807439804, -0.015355804935097694, -0.027986984699964523, 0.000983544159680605, 0.042923543602228165, 0.08648169040679932, 0.035707611590623856, -4.517507079526695e-8, -0.09036492556333542, -0.11942700296640396, -0.10530272871255875, -0.05825479328632355, 0.06174145266413689, 0.03222793713212013, -0.09395737200975418, -0.07176831364631653, -0.004451466724276543, -0.07071153819561005, 0.012664934620261192, -0.013033849187195301, -0.0832032635807991, -0.08438920974731445, -0.04559949040412903, -0.09036964923143387, -0.10890650749206543, -0.03729039803147316, 0.0025192578323185444, -0.08604680746793747, 0.04727897047996521, 0.05460744351148605, -0.046742651611566544, -0.017357245087623596, -0.026125354692339897, -0.016677724197506905, -0.02342483587563038, 0.06659318506717682, -0.04146977886557579, -0.02559850737452507, 0.0003105961950495839, -0.07212024182081223, 0.04211236163973808, -0.0404202975332737, -0.004834600258618593, 0.06232617050409317, 0.05828653648495674, -0.006687691900879145, -0.00017716195725370198, 0.03128518909215927, 0.07722480595111847, -0.08463446795940399, -0.0018854293739423156, 0.04297364503145218, 0.11061175912618637, -0.02833567000925541, -0.029338808730244637, -0.04487087205052376, 0.012513716705143452, -0.030609803274273872, -0.05405618995428085, -0.07740305364131927, 0.0597640685737133, -0.0008676506113260984, -0.033529434353113174, 0.037264104932546616, 0.05302383750677109, 0.022905703634023666, 0.0031840933952480555, 0.02127920836210251, 0.0874389186501503, 0.08815830945968628, 0.01958078145980835, 0.06844128668308258 ]
0.114047
limit: 5, } ``` 返回缓存中匹配的贴纸: ```json5 { ok: true, count: 2, stickers: [ { fileId: "CAACAgIAAxkBAAI...", emoji: "👋", description: "一只卡通猫热情地挥手", setName: "CoolCats", }, ], } ``` 搜索在描述文本、表情符号字符和集合名称之间使用模糊匹配。 **带线程的示例:** ```json5 { action: "sticker", channel: "telegram", to: "-1001234567890", fileId: "CAACAgIAAxkBAAI...", replyTo: 42, threadId: 123, } ``` ## 流式传输(草稿) Telegram 可以在智能体生成响应时流式传输**草稿气泡**。 OpenClaw 使用 Bot API `sendMessageDraft`(不是真实消息),然后将最终回复作为普通消息发送。 要求(Telegram Bot API 9.3+): - **启用话题的私聊**(机器人的论坛话题模式)。 - 入站消息必须包含 `message_thread_id`(私有话题线程)。 - 群组/超级群组/频道的流式传输被忽略。 配置: - `channels.telegram.streamMode: "off" | "partial" | "block"`(默认:`partial`) - `partial`:用最新的流式文本更新草稿气泡。 - `block`:以较大块(分块)更新草稿气泡。 - `off`:禁用草稿流式传输。 - 可选(仅用于 `streamMode: "block"`): - `channels.telegram.draftChunk: { minChars?, maxChars?, breakPreference? }` - 默认值:`minChars: 200`、`maxChars: 800`、`breakPreference: "paragraph"`(限制在 `channels.telegram.textChunkLimit` 内)。 注意:草稿流式传输与**分块流式传输**(渠道消息)不同。 分块流式传输默认关闭,如果你想要早期 Telegram 消息而不是草稿更新,需要 `channels.telegram.blockStreaming: true`。 推理流(仅限 Telegram): - `/reasoning stream` 在回复生成时将推理流式传输到草稿气泡中,然后发送不带推理的最终答案。 - 如果 `channels.telegram.streamMode` 为 `off`,推理流被禁用。 更多上下文:[流式传输 + 分块](/concepts/streaming)。 ## 重试策略 出站 Telegram API 调用在遇到临时网络/429 错误时会以指数退避和抖动进行重试。通过 `channels.telegram.retry` 配置。参见[重试策略](/concepts/retry)。 ## 智能体工具(消息 + 反应) - 工具:`telegram`,使用 `sendMessage` 动作(`to`、`content`,可选 `mediaUrl`、`replyToMessageId`、`messageThreadId`)。 - 工具:`telegram`,使用 `react` 动作(`chatId`、`messageId`、`emoji`)。 - 工具:`telegram`,使用 `deleteMessage` 动作(`chatId`、`messageId`)。 - 反应移除语义:参见 [/tools/reactions](/tools/reactions)。 - 工具门控:`channels.telegram.actions.reactions`、`channels.telegram.actions.sendMessage`、`channels.telegram.actions.deleteMessage`(默认:启用),以及 `channels.telegram.actions.sticker`(默认:禁用)。 ## 反应通知 **反应工作原理:** Telegram 反应作为**单独的 `message_reaction` 事件**到达,而不是消息负载中的属性。当用户添加反应时,OpenClaw: 1. 从 Telegram API 接收 `message_reaction` 更新 2. 将其转换为**系统事件**,格式为:`"Telegram reaction added: {emoji} by {user} on msg {id}"` 3. 使用与常规消息**相同的会话键**将系统事件加入队列 4. 当该对话中的下一条消息到达时,系统事件被排出并前置到智能体的上下文中 智能体将反应视为对话历史中的**系统通知**,而不是消息元数据。 **配置:** - `channels.telegram.reactionNotifications`:控制哪些反应触发通知 - `"off"` — 忽略所有反应 - `"own"` — 当用户对机器人消息做出反应时通知(尽力而为;内存中)(默认) - `"all"` — 通知所有反应 - `channels.telegram.reactionLevel`:控制智能体的反应能力 - `"off"` — 智能体不能对消息做出反应 - `"ack"` — 机器人发送确认反应(处理时显示 👀)(默认) - `"minimal"` — 智能体可以少量反应(指导:每 5-10 次交换 1 次) - `"extensive"` — 智能体可以在适当时自由反应 **论坛群组:** 论坛群组中的反应包含 `message_thread_id`,使用类似 `agent:main:telegram:group:{chatId}:topic:{threadId}` 的会话键。这确保同一话题中的反应和消息保持在一起。 **示例配置:** ```json5 { channels: { telegram: { reactionNotifications: "all", // 查看所有反应 reactionLevel: "minimal", // 智能体可以少量反应 }, }, } ``` **要求:** - Telegram 机器人必须在 `allowed_updates` 中明确请求 `message_reaction`(由 OpenClaw 自动配置) - 对于 webhook 模式,反应包含在 webhook `allowed_updates` 中 - 对于轮询模式,反应包含在 `getUpdates` `allowed_updates` 中 ## 投递目标(CLI/cron) - 使用聊天 id(`123456789`)或用户名(`@name`)作为目标。 - 示例:`openclaw message send --channel telegram --target 123456789 --message "hi"`。 ## 故障排除 **机器人不响应群组中的非提及消息:** - 如果你设置了 `channels.telegram.groups.*.requireMention=false`,Telegram 的 Bot API **隐私模式**必须禁用。 - BotFather:`/setprivacy` → **Disable**(然后从群组中移除并重新添加机器人) - `openclaw channels status` 在配置期望未提及群组消息时显示警告。 - `openclaw channels status --probe` 可以额外检查显式数字群组 ID 的成员资格(它无法审计通配符 `"*"` 规则)。 - 快速测试:`/activation always`(仅会话级别;使用配置以持久化) **机器人完全看不到群组消息:** - 如果设置了 `channels.telegram.groups`,群组必须被列出或使用 `"*"` - 在 @BotFather 中检查隐私设置 →"Group Privacy"应为 **OFF** - 验证机器人确实是成员(不仅仅是没有读取权限的管理员) - 检查 Gateway 网关日志:`openclaw logs --follow`(查找"skipping group message") **机器人响应提及但不响应 `/activation always`:** - `/activation` 命令更新会话状态但不持久化到配置 - 要持久化行为,将群组添加到 `channels.telegram.groups` 并设置 `requireMention: false` **像 `/status` 这样的命令不起作用:** - 确保你的 Telegram 用户 ID 已授权(通过配对或 `channels.telegram.allowFrom`) - 即使在 `groupPolicy: "open"` 的群组中,命令也需要授权 **长轮询在 Node 22+ 上立即中止(通常与代理/自定义 fetch 有关):** - Node 22+ 对 `AbortSignal` 实例更严格;外部信号可以立即中止 `fetch` 调用。 - 升级到规范化中止信号的 OpenClaw 构建版本,或在可以升级之前在 Node 20 上运行 Gateway 网关。 **机器人启动后静默停止响应(或日志显示 `HttpError: Network request ... failed`):** - 某些主机首先将 `api.telegram.org` 解析为 IPv6。如果你的服务器没有可用的 IPv6 出口,grammY 可能会卡在仅 IPv6 的请求上。 - 通过启用 IPv6 出口**或**强制 `api.telegram.org` 使用 IPv4 解析来修复(例如,使用 IPv4 A 记录添加 `/etc/hosts` 条目,或在你的 OS DNS 堆栈中优先使用 IPv4),然后重启 Gateway 网关。 - 快速检查:`dig +short api.telegram.org A` 和 `dig +short api.telegram.org AAAA` 确认 DNS 返回的内容。 ## 配置参考(Telegram) 完整配置:[配置](/gateway/configuration) 提供商选项: - `channels.telegram.enabled`:启用/禁用渠道启动。 - `channels.telegram.botToken`:机器人 token(BotFather)。 - `channels.telegram.tokenFile`:从文件路径读取 token。 - `channels.telegram.dmPolicy`:`pairing | allowlist | open | disabled`(默认:pairing)。 - `channels.telegram.allowFrom`:私信允许列表(id/用户名)。`open` 需要 `"*"`。 - `channels.telegram.groupPolicy`:`open | allowlist | disabled`(默认:allowlist)。 - `channels.telegram.groupAllowFrom`:群组发送者允许列表(id/用户名)。 - `channels.telegram.groups`:每群组默认值 + 允许列表(使用 `"*"` 作为全局默认值)。 - `channels.telegram.groups..requireMention`:提及门控默认值。 - `channels.telegram.groups..skills`:skill 过滤器(省略 = 所有 skills,空 = 无)。 - `channels.telegram.groups..allowFrom`:每群组发送者允许列表覆盖。 - `channels.telegram.groups..systemPrompt`:群组的额外系统提示。 - `channels.telegram.groups..enabled`:为 `false` 时禁用群组。 - `channels.telegram.groups..topics..*`:每话题覆盖(与群组相同的字段)。 - `channels.telegram.groups..topics..requireMention`:每话题提及门控覆盖。 - `channels.telegram.capabilities.inlineButtons`:`off | dm | group | all | allowlist`(默认:allowlist)。 - `channels.telegram.accounts..capabilities.inlineButtons`:每账户覆盖。 - `channels.telegram.replyToMode`:`off | first | all`(默认:`first`)。 - `channels.telegram.textChunkLimit`:出站分块大小(字符)。 - `channels.telegram.chunkMode`:`length`(默认)或 `newline` 在长度分块之前按空行(段落边界)分割。 - `channels.telegram.linkPreview`:切换出站消息的链接预览(默认:true)。 - `channels.telegram.streamMode`:`off | partial | block`(草稿流式传输)。 - `channels.telegram.mediaMaxMb`:入站/出站媒体上限(MB)。 - `channels.telegram.retry`:出站 Telegram API 调用的重试策略(attempts、minDelayMs、maxDelayMs、jitter)。 - `channels.telegram.network.autoSelectFamily`:覆盖 Node autoSelectFamily(true=启用,false=禁用)。在 Node 22 上默认禁用以避免 Happy Eyeballs 超时。 - `channels.telegram.proxy`:Bot API 调用的代理 URL(SOCKS/HTTP)。 - `channels.telegram.webhookUrl`:启用 webhook 模式(需要 `channels.telegram.webhookSecret`)。 - `channels.telegram.webhookSecret`:webhook 密钥(设置 webhookUrl 时必需)。 - `channels.telegram.webhookPath`:本地 webhook 路径(默认 `/telegram-webhook`)。 - `channels.telegram.actions.reactions`:门控 Telegram 工具反应。 - `channels.telegram.actions.sendMessage`:门控 Telegram 工具消息发送。 - `channels.telegram.actions.deleteMessage`:门控 Telegram 工具消息删除。 - `channels.telegram.actions.sticker`:门控 Telegram 贴纸动作 — 发送和搜索(默认:false)。 - `channels.telegram.reactionNotifications`:`off | own | all` — 控制哪些反应触发系统事件(未设置时默认:`own`)。 - `channels.telegram.reactionLevel`:`off | ack | minimal | extensive` — 控制智能体的反应能力(未设置时默认:`minimal`)。 相关全局选项: - `agents.list[].groupChat.mentionPatterns`(提及门控模式)。 - `messages.groupChat.mentionPatterns`(全局回退)。 - `commands.native`(默认为 `"auto"`
https://github.com/openclaw/openclaw/blob/main//docs/zh-CN/channels/telegram.md
main
opebclaw
[ -0.10607681423425674, 0.04737183079123497, 0.022514261305332184, -0.008795814588665962, 0.04287314787507057, -0.08365683257579803, 0.06020142883062363, -0.010737680830061436, 0.06083422154188156, 0.00033648806856945157, 0.0876639261841774, -0.06728342175483704, 0.09103655815124512, 0.03753677010536194, 0.07602602243423462, 0.06529448181390762, -0.06072882190346718, -0.02505962923169136, -0.09527752548456192, -0.09101884067058563, 0.012709096074104309, 0.030560065060853958, 0.032929468899965286, 0.006481548305600882, -0.041088756173849106, -0.002592980396002531, -0.08805334568023682, 0.004417588468641043, -0.041971564292907715, -0.0071765040047466755, 0.0006705456762574613, -0.002027255017310381, -0.043851036578416824, 0.05232231691479683, 0.07077523320913315, 0.06734780967235565, -0.017570337280631065, -0.07085902243852615, 0.049739714711904526, 0.04505891352891922, -0.0036986435297876596, -0.014835283160209656, -0.06108500063419342, -0.035925041884183884, 0.02504512295126915, 0.021657103672623634, -0.034356988966464996, 0.03460072726011276, -0.03156872093677521, 0.02278432995080948, -0.10534559935331345, 0.01032737735658884, -0.05010998621582985, -0.027866486459970474, 0.010451138019561768, -0.07264187932014465, -0.10449337959289551, -0.0018220975762233138, 0.04703601449728012, -0.003608548082411289, 0.03374428302049637, -0.023143216967582703, -0.009568337351083755, -0.006318403407931328, -0.07469885796308517, -0.031076189130544662, -0.075189970433712, 0.05128584802150726, 0.020081965252757072, 0.03234459087252617, 0.03303806856274605, 0.010021581314504147, -0.03367353230714798, 0.08552613854408264, -0.05231047049164772, -0.0012945373309776187, 0.04431936889886856, -0.027715137228369713, -0.12541116774082184, -0.08057107776403427, -0.08110455423593521, -0.06901578605175018, 0.06815794855356216, 0.029963739216327667, -0.026901116594672203, 0.08296304196119308, -0.0433586910367012, 0.023561354726552963, -0.0018631524872034788, 0.05149099975824356, 0.0014460277743637562, -0.010254353284835815, 0.0882299542427063, 0.022716185078024864, 0.035513315349817276, 0.008729307912290096, 0.005301265977323055, 0.013274011202156544, -0.08607348054647446, 0.09249289333820343, 0.02538442052900791, -0.017230786383152008, -0.002092198934406042, -0.0341547392308712, 0.042033854871988297, -0.06330471485853195, -0.037607721984386444, 0.012607217766344547, 0.0013454953441396356, 0.016344206407666206, -0.029587771743535995, 0.012669948861002922, -0.020718591287732124, -0.10239099711179733, -0.05411400645971298, 0.054704468697309494, -0.02563275396823883, 0.012393283657729626, 0.03730461746454239, -0.020913466811180115, 0.13395828008651733, -0.03073306940495968, -0.08095646649599075, -0.037988558411598206, -0.01387255173176527, -0.014852290041744709, 0.07523317635059357, 4.827869542184355e-33, 0.017402060329914093, 0.03572719544172287, 0.00560457818210125, -0.0350203663110733, 0.0034054568968713284, -0.05616985261440277, -0.002854639198631048, 0.03664754703640938, -0.08063317835330963, -0.006387374363839626, -0.03321002796292305, 0.049886565655469894, -0.029725125059485435, 0.060269925743341446, -0.04140105098485947, -0.05447017401456833, -0.006579551845788956, 0.009372844360768795, 0.06078412011265755, 0.0029395977035164833, 0.02628323994576931, -0.05341121554374695, -0.009224291890859604, 0.034104831516742706, -0.04137423634529114, 0.0817306861281395, 0.039097871631383896, -0.0302765890955925, -0.02582108974456787, 0.03894352540373802, -0.021426502615213394, 0.004640989005565643, 0.00553965475410223, -0.01857186295092106, 0.026337292045354843, -0.02496684156358242, -0.056864336133003235, -0.048503510653972626, -0.07479322701692581, -0.042052146047353745, 0.033584076911211014, -0.008470241911709309, -0.13770782947540283, 0.036999356001615524, 0.00260377349331975, 0.04689774662256241, -0.07027454674243927, -0.0655382052063942, -0.0014483848353847861, -0.07169011235237122, 0.013751446269452572, 0.04600832238793373, -0.00794930662959814, 0.0042067039757966995, 0.045111093670129776, -0.08300580829381943, -0.010282030329108238, -0.048094235360622406, -0.04928584024310112, -0.03642088174819946, 0.04702888801693916, -0.019566679373383522, 0.07641082257032394, 0.0070816450752317905, 0.08151280134916306, 0.021123358979821205, 0.02572457864880562, 0.02919679507613182, -0.0017807038966566324, -0.024278556928038597, 0.03923548012971878, 0.0917026624083519, 0.05183838680386543, 0.0257639829069376, -0.07926985621452332, -0.06756211817264557, -0.00562714459374547, 0.03161003440618515, -0.012781319208443165, -0.0272960402071476, -0.01922028698027134, -0.09294533729553223, 0.0004386510408949107, 0.008360030129551888, 0.01283283717930317, 0.074479840695858, 0.0555790439248085, -0.03301313892006874, -0.03855539485812187, 0.031751569360494614, -0.1351391077041626, -0.015061164274811745, -0.031567495316267014, -0.05649268999695778, -0.09524989873170853, -6.563291157895654e-33, -0.03102368488907814, -0.004537053871899843, -0.02907896786928177, 0.02962394244968891, -0.014801147393882275, -0.06513072550296783, 0.03871207684278488, 0.1332107037305832, 0.05211612209677696, 0.0834888219833374, -0.07983292639255524, -0.02364526502788067, 0.01337710116058588, -0.02036982960999012, 0.01942521147429943, 0.03774796053767204, 0.024396222084760666, 0.05028165131807327, -0.0460658073425293, -0.012071565724909306, -0.04779020696878433, 0.027897855266928673, -0.07346910238265991, 0.10832031816244125, 0.04667941853404045, 0.03407873958349228, 0.04498067498207092, -0.051358625292778015, -0.02081790193915367, -0.08634119480848312, -0.01257207989692688, 0.010829887352883816, -0.039727259427309036, 0.08358786255121231, 0.01018329244107008, -0.09606287628412247, 0.04233226925134659, 0.09785731136798859, 0.011385033838450909, 0.042851705104112625, 0.05851159989833832, 0.01675482466816902, -0.0674920603632927, 0.05639634653925896, -0.03500696271657944, -0.03678310289978981, -0.05815225839614868, 0.016249626874923706, -0.06988095492124557, -0.013664559461176395, 0.08704689890146255, -0.0552399680018425, 0.016404295340180397, -0.044802092015743256, -0.011520793661475182, 0.02899988181889057, 0.026115013286471367, -0.07066123187541962, -0.003259809222072363, -0.06899987161159515, 0.008575108833611012, -0.08192919939756393, -0.006650010123848915, 0.06617999076843262, 0.08933739364147186, -0.03637740761041641, -0.005279562436044216, -0.003247044747695327, -0.052216142416000366, -0.07841701060533524, 0.07162763178348541, -0.013529432937502861, -0.02462884411215782, -0.04864222928881645, 0.04030851647257805, 0.02001476287841797, -0.008539827540516853, 0.044008057564496994, -0.013742578215897083, 0.05676441639661789, -0.05225735902786255, 0.034335907548666, 0.032795391976833344, 0.1056031808257103, 0.04686271399259567, -0.010744715109467506, 0.013680839911103249, 0.0934068113565445, -0.021761152893304825, 0.017499785870313644, -0.009803474880754948, 0.035693615674972534, 0.07639172673225403, 0.06283187121152878, 0.01898965612053871, -5.286966953121919e-8, -0.09079737216234207, -0.06662425398826599, -0.10430418699979782, 0.0452849343419075, -0.005697168409824371, 0.08529175817966461, -0.05239725112915039, -0.024168698117136955, 0.04874999448657036, -0.08304691314697266, 0.05310332775115967, 0.009353304281830788, -0.10637339949607849, 0.021987827494740486, -0.07163187116384506, -0.0520905964076519, -0.06942490488290787, 0.012479138560593128, 0.009197124280035496, -0.02493712678551674, 0.027699830010533333, 0.06271519511938095, 0.030728070065379143, -0.09858579933643341, -0.03565247729420662, -0.022031666710972786, -0.02466241829097271, 0.05483154579997063, -0.045354560017585754, -0.08558797836303711, -0.05832337960600853, -0.06601069122552872, 0.03521372377872467, -0.05386922508478165, -0.010808022692799568, 0.04544771835207939, 0.038194313645362854, -0.07382866740226746, -0.03118377923965454, 0.01792238838970661, 0.07827731966972351, -0.07148436456918716, -0.042132310569286346, 0.01818251423537731, 0.05384525656700134, -0.040776580572128296, 0.021514425054192543, -0.038309235125780106, 0.05509469285607338, -0.02089228853583336, -0.017886556684970856, -0.0524861104786396, 0.06437237560749054, 0.013759412802755833, -0.028350334614515305, 0.0010869570542126894, 0.05253781005740166, -0.011224842630326748, 0.06366252154111862, 0.1175549328327179, 0.10330090671777725, 0.0366024374961853, 0.00467319693416357, 0.0655631273984909 ]
0.109377
时必需)。 - `channels.telegram.webhookPath`:本地 webhook 路径(默认 `/telegram-webhook`)。 - `channels.telegram.actions.reactions`:门控 Telegram 工具反应。 - `channels.telegram.actions.sendMessage`:门控 Telegram 工具消息发送。 - `channels.telegram.actions.deleteMessage`:门控 Telegram 工具消息删除。 - `channels.telegram.actions.sticker`:门控 Telegram 贴纸动作 — 发送和搜索(默认:false)。 - `channels.telegram.reactionNotifications`:`off | own | all` — 控制哪些反应触发系统事件(未设置时默认:`own`)。 - `channels.telegram.reactionLevel`:`off | ack | minimal | extensive` — 控制智能体的反应能力(未设置时默认:`minimal`)。 相关全局选项: - `agents.list[].groupChat.mentionPatterns`(提及门控模式)。 - `messages.groupChat.mentionPatterns`(全局回退)。 - `commands.native`(默认为 `"auto"` → Telegram/Discord 开启,Slack 关闭)、`commands.text`、`commands.useAccessGroups`(命令行为)。使用 `channels.telegram.commands.native` 覆盖。 - `messages.responsePrefix`、`messages.ackReaction`、`messages.ackReactionScope`、`messages.removeAckAfterReply`。 ````
https://github.com/openclaw/openclaw/blob/main//docs/zh-CN/channels/telegram.md
main
opebclaw
[ -0.02428712137043476, -0.0050885374657809734, -0.009539550170302391, -0.014187319204211235, 0.05350427329540253, -0.06171328201889992, 0.10204111039638519, 0.023254750296473503, 0.04744406044483185, 0.04315568134188652, 0.1082790195941925, -0.06506633013486862, 0.04865983873605728, 0.01081090234220028, 0.08865739405155182, 0.021128693595528603, 0.010974793694913387, -0.061025671660900116, -0.06873131543397903, -0.021569591015577316, 0.008996638469398022, 0.02420124039053917, 0.043633997440338135, 0.024654744192957878, 0.022738125175237656, -0.024141594767570496, -0.07774414867162704, 0.023027626797556877, -0.0163770392537117, -0.03759770467877388, -0.003830966306850314, 0.06672478467226028, -0.009907228872179985, 0.030662797391414642, 0.06860961019992828, 0.13363781571388245, -0.06698144972324371, -0.03566962480545044, 0.03190800920128822, 0.0667412206530571, -0.04189060255885124, -0.046352826058864594, -0.04085828736424446, -0.05423549935221672, 0.017629683017730713, 0.022803686559200287, -0.02909327857196331, -0.01768210344016552, -0.09271398186683655, -0.005141356494277716, -0.0601956807076931, -0.03251484036445618, -0.0640387013554573, 0.071851946413517, 0.06732416152954102, -0.007141190581023693, -0.0965895801782608, 0.031577736139297485, 0.014556393958628178, -0.02987636812031269, 0.001427929732017219, 0.0027610103134065866, -0.00840006023645401, -0.0011511185439303517, -0.09598926454782486, 0.02952512912452221, 0.012820291332900524, 0.04939257353544235, 0.04141118377447128, -0.01859547197818756, -0.03054746240377426, -0.014033381827175617, 0.006648124661296606, 0.00000817549334897194, -0.029864272102713585, -0.03326842933893204, 0.047459185123443604, 0.0439247265458107, -0.0925896018743515, -0.11475128680467606, -0.08023778349161148, -0.048193372786045074, 0.04956749081611633, -0.016338663175702095, -0.07341741025447845, 0.08871861547231674, -0.040531057864427567, -0.015259074978530407, 0.08619030565023422, 0.005752303637564182, -0.028307782486081123, -0.03847000002861023, 0.08527103066444397, 0.05299488827586174, 0.005735278129577637, -0.002436842070892453, -0.031370893120765686, 0.06165255978703499, -0.0614229179918766, 0.06127246469259262, 0.054132360965013504, -0.03766400367021561, -0.033441685140132904, -0.010009769350290298, -0.026087496429681778, -0.038306619971990585, -0.06245173513889313, -0.0015346279833465815, 0.04987502843141556, -0.0036840541288256645, -0.12268861383199692, -0.022960852831602097, -0.05295369774103165, -0.0883966013789177, 0.023158857598900795, 0.03463103622198105, 0.04057689756155014, -0.001069289050064981, 0.047849275171756744, -0.018921323120594025, 0.14080239832401276, -0.031385812908411026, -0.025867493823170662, -0.021939942613244057, -0.03517398610711098, 0.03916626423597336, 0.03939013183116913, 2.293511619664173e-33, 0.07694071531295776, 0.06701615452766418, -0.06448406726121902, -0.04549071937799454, 0.008437230251729488, -0.009770589880645275, -0.04994090273976326, -0.014418411999940872, -0.05051468312740326, -0.001707701594568789, 0.01402564998716116, 0.03975743055343628, -0.07054200023412704, 0.06283418834209442, -0.03233078122138977, -0.023811781778931618, -0.016364887356758118, -0.0012409695191308856, 0.015339002013206482, -0.05334522947669029, -0.023955393582582474, 0.05950452387332916, -0.04610303044319153, 0.05246620252728462, -0.01395446341484785, 0.05861007049679756, 0.027881041169166565, -0.01863502711057663, -0.10167308151721954, 0.018513785675168037, 0.017996905371546745, -0.05422702431678772, -0.004705688450485468, 0.022174417972564697, -0.010799992829561234, -0.004572619684040546, -0.10801812261343002, -0.040408335626125336, -0.015718210488557816, -0.08122539520263672, -0.0742030143737793, -0.004948635119944811, -0.06396457552909851, -0.012468256056308746, 0.05942985787987709, -0.018921876326203346, -0.08683287352323532, -0.03750871866941452, 0.0773896723985672, -0.04728097468614578, 0.009755033068358898, 0.009107518009841442, 0.07378954440355301, 0.018480481579899788, -0.0011592271039262414, -0.011427395977079868, -0.030438203364610672, -0.0036990446969866753, 0.02250564843416214, -0.006498299073427916, -0.002890182426199317, -0.03838720545172691, 0.02858109585940838, -0.043685924261808395, 0.05882977694272995, 0.08337771892547607, -0.020488673821091652, 0.037120506167411804, 0.023288365453481674, -0.0512206107378006, -0.06632951647043228, 0.0684506818652153, -0.003397539025172591, 0.04226899519562721, -0.05555575713515282, -0.08428316563367844, -0.026202136650681496, -0.027331359684467316, -0.01389769185334444, 0.0062005966901779175, -0.06304972618818283, -0.06914569437503815, -0.04962291195988655, 0.03771280124783516, -0.004720924887806177, 0.028712231665849686, 0.05826463922858238, -0.08612926304340363, -0.02910260111093521, 0.10500399023294449, -0.1269703060388565, 0.08337709307670593, -0.05740831419825554, 0.0009199422784149647, -0.05597466602921486, -6.480423214266498e-33, -0.023469476029276848, 0.01348568219691515, -0.08848319947719574, 0.03781741484999657, -0.04971686750650406, -0.033831145614385605, 0.05387444794178009, 0.00929082278162241, 0.08443639427423477, 0.05431502312421799, -0.05421168729662895, -0.03858392313122749, -0.049871403723955154, -0.023609528318047523, -0.032356832176446915, 0.02436862140893936, -0.014422126114368439, -0.020143210887908936, 0.003986347932368517, -0.0012069997610524297, -0.03190414234995842, 0.041220083832740784, -0.13984759151935577, 0.0869641974568367, 0.0008649525116197765, -0.019501131027936935, 0.05790821090340614, -0.021569358184933662, 0.059811271727085114, -0.045288946479558945, 0.07178451120853424, -0.038300737738609314, -0.06183810904622078, 0.07530725747346878, 0.015452501364052296, -0.03895385563373566, 0.019233902916312218, 0.06329284608364105, -0.05506518483161926, -0.017510540783405304, 0.09985439479351044, -0.05057293549180031, -0.040788035839796066, 0.01312380749732256, -0.07993151992559433, 0.010609236545860767, -0.06837093830108643, -0.031439971178770065, -0.12149866670370102, 0.0018493056995794177, 0.10020320117473602, -0.038856036961078644, 0.012402093969285488, -0.03200475499033928, -0.015486171469092369, 0.06457091867923737, 0.05194436386227608, -0.042165014892816544, -0.03715735301375389, -0.12197504192590714, 0.09090329706668854, -0.02058788575232029, -0.00881655141711235, 0.026095489040017128, 0.03758469223976135, -0.004533134866505861, -0.04377895966172218, 0.04197116568684578, 0.01949302852153778, -0.045412827283144, 0.08928325772285461, -0.011129744350910187, -0.03770717978477478, -0.08688212931156158, 0.06022213026881218, 0.008439972065389156, -0.06719435751438141, 0.02505514770746231, -0.040948543697595596, 0.009562590159475803, -0.03577650338411331, 0.05379288271069527, 0.040416814386844635, 0.012403096072375774, -0.04103896766901016, -0.006887542083859444, 0.011642306111752987, 0.15391023457050323, -0.0481773279607296, -0.05367129668593407, 0.04357050731778145, 0.04906285181641579, 0.04421366751194, 0.09543342888355255, -0.03620154783129692, -4.7202039610283464e-8, -0.06294120103120804, -0.06731179356575012, 0.00035102179390378296, -0.043639108538627625, 0.005453493446111679, -0.01073733065277338, 0.06357856839895248, 0.007854592986404896, -0.013292047195136547, -0.051455628126859665, 0.00028505022055469453, 0.024595819413661957, -0.08063730597496033, -0.017929771915078163, 0.006053302902728319, -0.07072971016168594, -0.09618698805570602, 0.039296772330999374, -0.01614980585873127, -0.04377445951104164, 0.02979452721774578, 0.010740880854427814, -0.039338286966085434, -0.04134098067879677, -0.014193771407008171, 0.007735645864158869, 0.015910986810922623, 0.08692652732133865, -0.058451440185308456, -0.022621208801865578, 0.033547140657901764, -0.04794066771864891, 0.0177745558321476, -0.08632541447877884, 0.03430621698498726, 0.10176859050989151, 0.0004813599225599319, -0.07462913542985916, -0.004054266028106213, 0.030005190521478653, -0.007071714848279953, -0.10536900907754898, 0.01998639851808548, 0.048252809792757034, 0.06855303794145584, -0.03840106353163719, 0.0036173551343381405, -0.05921965464949608, 0.10527084022760391, -0.07258543372154236, -0.0017486481228843331, -0.023367006331682205, -0.004661858547478914, 0.023867810145020485, -0.009421413764357567, 0.03491969034075737, 0.06182795763015747, -0.023931115865707397, 0.06155295670032501, 0.006777894217520952, 0.08569923788309097, 0.06471902132034302, -0.0250305887311697, 0.05099710822105408 ]
0.175665
# Nextcloud Talk(插件) 状态:通过插件支持(webhook 机器人)。支持私信、房间、表情回应和 Markdown 消息。 ## 需要插件 Nextcloud Talk 以插件形式提供,不包含在核心安装包中。 通过 CLI 安装(npm 仓库): ```bash openclaw plugins install @openclaw/nextcloud-talk ``` 本地检出安装(从 git 仓库运行时): ```bash openclaw plugins install ./extensions/nextcloud-talk ``` 如果你在配置/新手引导过程中选择了 Nextcloud Talk,并且检测到 git 检出, OpenClaw 将自动提供本地安装路径。 详情:[插件](/plugin) ## 快速设置(新手) 1. 安装 Nextcloud Talk 插件。 2. 在你的 Nextcloud 服务器上创建机器人: ```bash ./occ talk:bot:install "OpenClaw" "" "" --feature reaction ``` 3. 在目标房间设置中启用机器人。 4. 配置 OpenClaw: - 配置项:`channels.nextcloud-talk.baseUrl` + `channels.nextcloud-talk.botSecret` - 或环境变量:`NEXTCLOUD\_TALK\_BOT\_SECRET`(仅默认账户) 5. 重启 Gateway 网关(或完成新手引导)。 最小配置: ```json5 { channels: { "nextcloud-talk": { enabled: true, baseUrl: "https://cloud.example.com", botSecret: "shared-secret", dmPolicy: "pairing", }, }, } ``` ## 注意事项 - 机器人无法主动发起私信。用户必须先向机器人发送消息。 - Webhook URL 必须可被 Gateway 网关访问;如果在代理后面,请设置 `webhookPublicUrl`。 - 机器人 API 不支持媒体上传;媒体以 URL 形式发送。 - Webhook 载荷无法区分私信和房间;设置 `apiUser` + `apiPassword` 以启用房间类型查询(否则私信将被视为房间)。 ## 访问控制(私信) - 默认:`channels.nextcloud-talk.dmPolicy = "pairing"`。未知发送者将收到配对码。 - 批准方式: - `openclaw pairing list nextcloud-talk` - `openclaw pairing approve nextcloud-talk ```` ` - 公开私信:`channels.nextcloud-talk.dmPolicy="open"` 加上 `channels.nextcloud-talk.allowFrom=["*"]`。 ## 房间(群组) - 默认:`channels.nextcloud-talk.groupPolicy = "allowlist"`(需要提及触发)。 - 使用 `channels.nextcloud-talk.rooms` 设置房间白名单: ```json5 { channels: { "nextcloud-talk": { rooms: { "room-token": { requireMention: true }, }, }, }, } ``` - 如需禁止所有房间,保持白名单为空或设置 `channels.nextcloud-talk.groupPolicy="disabled"`。 ## 功能支持 | 功能 | 状态 | | -------- | ------ | | 私信 | 支持 | | 房间 | 支持 | | 话题 | 不支持 | | 媒体 | 仅 URL | | 表情回应 | 支持 | | 原生命令 | 不支持 | ## 配置参考(Nextcloud Talk) 完整配置:[配置](/gateway/configuration) 提供商选项: - `channels.nextcloud-talk.enabled`:启用/禁用渠道启动。 - `channels.nextcloud-talk.baseUrl`:Nextcloud 实例 URL。 - `channels.nextcloud-talk.botSecret`:机器人共享密钥。 - `channels.nextcloud-talk.botSecretFile`:密钥文件路径。 - `channels.nextcloud-talk.apiUser`:用于房间查询的 API 用户(私信检测)。 - `channels.nextcloud-talk.apiPassword`:用于房间查询的 API/应用密码。 - `channels.nextcloud-talk.apiPasswordFile`:API 密码文件路径。 - `channels.nextcloud-talk.webhookPort`:webhook 监听端口(默认:8788)。 - `channels.nextcloud-talk.webhookHost`:webhook 主机(默认:0.0.0.0)。 - `channels.nextcloud-talk.webhookPath`:webhook 路径(默认:/nextcloud-talk-webhook)。 - `channels.nextcloud-talk.webhookPublicUrl`:外部可达的 webhook URL。 - `channels.nextcloud-talk.dmPolicy`:`pairing | allowlist | open | disabled`。 - `channels.nextcloud-talk.allowFrom`:私信白名单(用户 ID)。`open` 需要 `"*"`。 - `channels.nextcloud-talk.groupPolicy`:`allowlist | open | disabled`。 - `channels.nextcloud-talk.groupAllowFrom`:群组白名单(用户 ID)。 - `channels.nextcloud-talk.rooms`:每个房间的设置和白名单。 - `channels.nextcloud-talk.historyLimit`:群组历史记录限制(0 表示禁用)。 - `channels.nextcloud-talk.dmHistoryLimit`:私信历史记录限制(0 表示禁用)。 - `channels.nextcloud-talk.dms`:每个私信的覆盖设置(historyLimit)。 - `channels.nextcloud-talk.textChunkLimit`:出站文本分块大小(字符数)。 - `channels.nextcloud-talk.chunkMode`:`length`(默认)或 `newline`,在长度分块前按空行(段落边界)分割。 - `channels.nextcloud-talk.blockStreaming`:禁用此渠道的分块流式传输。 - `channels.nextcloud-talk.blockStreamingCoalesce`:分块流式传输合并调优。 - `channels.nextcloud-talk.mediaMaxMb`:入站媒体大小上限(MB)。 ````
https://github.com/openclaw/openclaw/blob/main//docs/zh-CN/channels/nextcloud-talk.md
main
opebclaw
[ -0.033414117991924286, -0.0018592507112771273, -0.008411460556089878, -0.10335829854011536, 0.022295668721199036, -0.04549219831824303, 0.019550731405615807, -0.047138359397649765, 0.10090719163417816, -0.005177399143576622, 0.07564398646354675, -0.030681071802973747, 0.05065104365348816, -0.04257100448012352, 0.06519995629787445, 0.08234909921884537, -0.04355139285326004, 0.03078252077102661, -0.036711785942316055, -0.03834550455212593, -0.057951848953962326, 0.09375093877315521, 0.02790044993162155, -0.0017986821476370096, -0.03430849686264992, 0.029190337285399437, -0.11320313811302185, 0.05626640468835831, -0.017854230478405952, 0.014989436604082584, 0.08208824694156647, 0.0706310048699379, -0.021165097132325172, 0.0000420474425482098, 0.062164291739463806, 0.09946444630622864, 0.003400784684345126, -0.04972072318196297, -0.06936993449926376, 0.013537411577999592, 0.01864430122077465, -0.0003636304463725537, -0.0338049940764904, -0.09576480090618134, -0.044352855533361435, -0.034241825342178345, -0.12753832340240479, -0.1296233832836151, -0.05644010379910469, -0.004616998601704836, -0.08573822677135468, -0.14242374897003174, -0.06125413998961449, 0.045805349946022034, 0.0059885550290346146, 0.010065351612865925, -0.06512000411748886, 0.050710320472717285, 0.0243205726146698, 0.034505750983953476, 0.022148339077830315, -0.0022394221741706133, -0.014926270581781864, -0.002926815301179886, -0.06802073866128922, 0.017049333080649376, -0.04821497201919556, 0.018710525706410408, 0.00415704445913434, 0.023053519427776337, 0.006951629184186459, 0.04673651233315468, -0.03083987720310688, -0.04950253292918205, -0.04602279141545296, -0.04129377752542496, -0.0027733510360121727, 0.024252640083432198, -0.12695299088954926, -0.1516600102186203, -0.008841324597597122, -0.019740669056773186, 0.0674068033695221, -0.0061101773753762245, -0.034607768058776855, 0.10699398815631866, -0.035403136163949966, -0.03630608692765236, 0.006499837152659893, -0.034651707857847214, -0.01346078421920538, -0.031803786754608154, -0.016596538946032524, 0.030618807300925255, 0.03537806496024132, -0.012122114188969135, -0.016100486740469933, 0.02898455783724785, -0.015171819366514683, 0.03444739803671837, 0.0282975472509861, -0.0030346468556672335, -0.0030356983188539743, -0.08691832423210144, -0.008283478207886219, -0.011653734371066093, -0.03366032615303993, 0.08147946745157242, 0.055403996258974075, 0.012418032623827457, -0.03012506477534771, -0.10877811908721924, -0.01195654459297657, -0.12341558188199997, -0.06933480501174927, 0.062030669301748276, 0.011063537560403347, -0.049207575619220734, 0.033174216747283936, 0.059791043400764465, 0.08335848897695541, -0.01902942545711994, -0.058707624673843384, -0.05403520539402962, -0.05149306356906891, 0.0008128627669066191, 0.038167234510183334, 4.481157116067337e-33, 0.08912186324596405, -0.04231883957982063, -0.0061166719533503056, -0.004790940321981907, 0.11503510922193527, -0.04783589765429497, -0.0384015217423439, -0.01943817548453808, -0.11456787586212158, 0.05695256590843201, 0.045522257685661316, 0.011465124785900116, -0.07477068156003952, 0.04485434293746948, 0.01042743306607008, -0.13090719282627106, 0.023686084896326065, -0.030546337366104126, 0.042468469589948654, -0.07171891629695892, -0.03550969809293747, 0.07741552591323853, -0.02271733619272709, -0.001060500624589622, 0.017617082223296165, 0.03599972277879715, 0.051031436771154404, -0.04213743284344673, 0.003513237927109003, 0.010755264200270176, 0.06648814678192139, -0.06632459163665771, -0.011448198929429054, 0.02028437703847885, -0.04450305923819542, 0.01634797267615795, -0.06602903455495834, 0.005137625150382519, -0.0583588182926178, -0.0637238621711731, 0.08112676441669464, -0.04851725697517395, -0.07921938598155975, -0.01567983441054821, 0.06020969897508621, -0.014843199402093887, -0.06693734973669052, -0.02483154647052288, 0.052490755915641785, -0.047109536826610565, -0.013393452391028404, 0.020412322133779526, -0.04834744706749916, 0.07645175606012344, -0.017751431092619896, -0.05665906146168709, -0.08392243087291718, -0.022356070578098297, -0.02000252902507782, -0.035792190581560135, -0.03199281916022301, -0.008375942707061768, 0.022279327735304832, -0.029708510264754295, 0.03980369120836258, -0.009728258475661278, 0.0055428375490009785, 0.06122404336929321, 0.0227209385484457, 0.02196676656603813, -0.05717834457755089, -0.009894021786749363, 0.05669466406106949, 0.05167211964726448, -0.024403903633356094, -0.025025879964232445, -0.08133269101381302, -0.01937391422688961, 0.08200426399707794, 0.005260637030005455, -0.05148816481232643, -0.07111071795225143, -0.08232074230909348, 0.023692194372415543, -0.0027952492237091064, 0.06827832013368607, 0.0975361093878746, -0.01956017129123211, -0.013858265243470669, 0.04782392457127571, -0.09035608917474747, 0.08439549058675766, -0.02367001585662365, -0.042481180280447006, -0.08820854127407074, -8.320147545752212e-33, 0.026144588366150856, 0.0637999027967453, -0.04953479766845703, 0.029088830575346947, 0.0598260834813118, -0.030717434361577034, 0.03896158188581467, -0.020098373293876648, 0.06422469019889832, 0.06571364402770996, -0.017319045960903168, 0.030041204765439034, 0.004143342841416597, -0.03061828948557377, 0.0440218560397625, 0.017914243042469025, -0.00935307890176773, -0.028010563924908638, 0.02275780588388443, 0.02625296078622341, -0.03999161720275879, 0.019045855849981308, -0.06500348448753357, 0.09317606687545776, 0.006244672928005457, 0.009477658197283745, 0.06803101301193237, 0.0008147801272571087, 0.05495321378111839, 0.0027648122049868107, 0.017422031611204147, -0.006611260585486889, -0.0872567817568779, 0.0951799675822258, 0.00747255003079772, 0.026040928438305855, 0.002218111651018262, 0.025940846651792526, -0.013790007680654526, -0.005148589611053467, 0.0065128393471241, -0.04912054166197777, -0.02202177420258522, -0.024615012109279633, -0.04148998111486435, -0.01971358060836792, -0.02413361705839634, 0.0020445308182388544, -0.13905172049999237, -0.027394475415349007, 0.08411882817745209, -0.02828250639140606, -0.00038442161167040467, -0.020314175635576248, 0.057038526982069016, 0.04603222385048866, 0.00038892036536708474, -0.05760545656085014, -0.14365912973880768, -0.0996919721364975, 0.08234027773141861, -0.04623333364725113, 0.005052597727626562, -0.008774246089160442, -0.03125763311982155, -0.0014227036153897643, -0.03279358148574829, -0.04360838979482651, -0.029350491240620613, -0.05438292771577835, -0.0608762726187706, 0.04557792842388153, -0.018311742693185806, -0.08415902405977249, 0.025982597842812538, -0.029466157779097557, 0.016043860465288162, -0.0037239198572933674, 0.05181312561035156, 0.004601018503308296, -0.029538964852690697, 0.03850511834025383, 0.005319585092365742, -0.0011360370554029942, 0.0006018957355991006, -0.012420427054166794, -0.018776515498757362, 0.09243243932723999, -0.015781523659825325, -0.042579084634780884, 0.0027772104367613792, 0.10502956062555313, 0.01033200416713953, 0.05836188420653343, 0.004268828779459, -4.70074006386767e-8, -0.05477968603372574, -0.0848265290260315, -0.022031957283616066, -0.009141880087554455, 0.04855955392122269, -0.03716808930039406, 0.05587509647011757, 0.050705332309007645, -0.02461335062980652, -0.014801988378167152, 0.04021916911005974, 0.011070950888097286, -0.06424311548471451, 0.007620878983289003, -0.10315673798322678, -0.008850128389894962, -0.014513642527163029, 0.021363133564591408, 0.03209371492266655, -0.10736457258462906, -0.03846549242734909, 0.0717904344201088, 0.030451402068138123, -0.05259732902050018, -0.09019394218921661, 0.02915879338979721, -0.018216121941804886, -0.00012097785656806082, -0.09687037765979767, 0.0007278115954250097, 0.038286659866571426, -0.04439409822225571, -0.024942191317677498, -0.07405044138431549, 0.05860571935772896, -0.019333595409989357, -0.014003029093146324, -0.014059160836040974, -0.029170943424105644, 0.04374019429087639, 0.06985414028167725, -0.0418357215821743, 0.028661038726568222, 0.01615128107368946, -0.015887582674622536, -0.05929235368967056, 0.07437685132026672, 0.008216901682317257, 0.0001367025397485122, -0.02388397417962551, -0.0004482436052057892, -0.016269002109766006, 0.06502224504947662, 0.005482291337102652, 0.047098297625780106, 0.07919582724571228, 0.024873897433280945, 0.051213521510362625, 0.01186591386795044, 0.1014641597867012, -0.031595658510923386, 0.09101992100477219, 0.05788654461503029, 0.045201778411865234 ]
0.050641
# Google Chat(Chat API) 状态:已支持通过 Google Chat API webhooks(仅 HTTP)使用私信和空间。 ## 快速设置(新手) 1. 创建一个 Google Cloud 项目并启用 \*\*Google Chat API\*\*。 - 前往:[Google Chat API Credentials](https://console.cloud.google.com/apis/api/chat.googleapis.com/credentials) - 如果 API 尚未启用,请启用它。 2. 创建一个\*\*服务账号\*\*: - 点击 \*\*Create Credentials\*\* > \*\*Service Account\*\*。 - 随意命名(例如 `openclaw-chat`)。 - 权限留空(点击 \*\*Continue\*\*)。 - 有访问权限的主账号留空(点击 \*\*Done\*\*)。 3. 创建并下载 \*\*JSON 密钥\*\*: - 在服务账号列表中,点击刚刚创建的账号。 - 前往 \*\*Keys\*\* 标签页。 - 点击 \*\*Add Key\*\* > \*\*Create new key\*\*。 - 选择 \*\*JSON\*\* 并点击 \*\*Create\*\*。 4. 将下载的 JSON 文件存储在 Gateway 网关主机上(例如 `~/.openclaw/googlechat-service-account.json`)。 5. 在 [Google Cloud Console Chat Configuration](https://console.cloud.google.com/apis/api/chat.googleapis.com/hangouts-chat) 中创建一个 Google Chat 应用: - 填写 \*\*Application info\*\*: - \*\*App name\*\*:(例如 `OpenClaw`) - \*\*Avatar URL\*\*:(例如 `https://openclaw.ai/logo.png`) - \*\*Description\*\*:(例如 `Personal AI Assistant`) - 启用 \*\*Interactive features\*\*。 - 在 \*\*Functionality\*\* 下,勾选 \*\*Join spaces and group conversations\*\*。 - 在 \*\*Connection settings\*\* 下,选择 \*\*HTTP endpoint URL\*\*。 - 在 \*\*Triggers\*\* 下,选择 \*\*Use a common HTTP endpoint URL for all triggers\*\* 并将其设置为你的 Gateway 网关公网 URL 后加 `/googlechat`。 - \_提示:运行 `openclaw status` 查看你的 Gateway 网关公网 URL。\_ - 在 \*\*Visibility\*\* 下,勾选 \*\*Make this Chat app available to specific people and groups in <Your Domain>\*\*。 - 在文本框中输入你的邮箱地址(例如 `user@example.com`)。 - 点击底部的 \*\*Save\*\*。 6. \*\*启用应用状态\*\*: - 保存后,\*\*刷新页面\*\*。 - 找到 \*\*App status\*\* 部分(通常在保存后位于顶部或底部附近)。 - 将状态更改为 \*\*Live - available to users\*\*。 - 再次点击 \*\*Save\*\*。 7. 使用服务账号路径和 webhook audience 配置 OpenClaw: - 环境变量:`GOOGLE\_CHAT\_SERVICE\_ACCOUNT\_FILE=/path/to/service-account.json` - 或配置:`channels.googlechat.serviceAccountFile: "/path/to/service-account.json"`。 8. 设置 webhook audience 类型和值(与你的 Chat 应用配置匹配)。 9. 启动 Gateway 网关。Google Chat 将向你的 webhook 路径发送 POST 请求。 ## 添加到 Google Chat Gateway 网关运行后,且你的邮箱已添加到可见性列表中: 1. 前往 [Google Chat](https://chat.google.com/)。 2. 点击 \*\*Direct Messages\*\* 旁边的 \*\*+\*\*(加号)图标。 3. 在搜索栏(通常用于添加联系人的位置)中,输入你在 Google Cloud Console 中配置的 \*\*App name\*\*。 - \*\*注意\*\*:该机器人\*不会\*出现在"Marketplace"浏览列表中,因为它是私有应用。你必须按名称搜索。 4. 从结果中选择你的机器人。 5. 点击 \*\*Add\*\* 或 \*\*Chat\*\* 开始一对一对话。 6. 发送"Hello"来触发助手! ## 公网 URL(仅 Webhook) Google Chat webhooks 需要一个公网 HTTPS 端点。为了安全起见,\*\*只将 `/googlechat` 路径暴露到互联网\*\*。将 OpenClaw 仪表板和其他敏感端点保留在你的私有网络上。 ### 方案 A:Tailscale Funnel(推荐) 使用 Tailscale Serve 提供私有仪表板,使用 Funnel 提供公网 webhook 路径。这样可以保持 `/` 私有,同时只暴露 `/googlechat`。 1. \*\*检查你的 Gateway 网关绑定的地址:\*\* ```bash ss -tlnp | grep 18789 ``` 记下 IP 地址(例如 `127.0.0.1`、`0.0.0.0` 或你的 Tailscale IP 如 `100.x.x.x`)。 2. \*\*仅将仪表板暴露给 tailnet(端口 8443):\*\* ```bash # 如果绑定到 localhost(127.0.0.1 或 0.0.0.0): tailscale serve --bg --https 8443 http://127.0.0.1:18789 # 如果仅绑定到 Tailscale IP(例如 100.106.161.80): tailscale serve --bg --https 8443 http://100.106.161.80:18789 ``` 3. \*\*仅公开暴露 webhook 路径:\*\* ```bash # 如果绑定到 localhost(127.0.0.1 或 0.0.0.0): tailscale funnel --bg --set-path /googlechat http://127.0.0.1:18789/googlechat # 如果仅绑定到 Tailscale IP(例如 100.106.161.80): tailscale funnel --bg --set-path /googlechat http://100.106.161.80:18789/googlechat ``` 4. \*\*授权节点访问 Funnel:\*\* 如果出现提示,请访问输出中显示的授权 URL,以在你的 tailnet 策略中为此节点启用 Funnel。 5. \*\*验证配置:\*\* ```bash tailscale serve status tailscale funnel status ``` 你的公网 webhook URL 将是: `https://..ts.net/googlechat` 你的私有仪表板仅限 tailnet 访问: `https://..ts.net:8443/` 在 Google Chat 应用配置中使用公网 URL(不带 `:8443`)。 > 注意:此配置在重启后会保留。如需稍后移除,请运行 `tailscale funnel reset` 和 `tailscale serve reset`。 ### 方案 B:反向代理(Caddy) 如果你使用像 Caddy 这样的反向代理,只代理特定路径: ```caddy your-domain.com { reverse\_proxy /googlechat\* localhost:18789 } ``` 使用此配置,任何发往 `your-domain.com/` 的请求将被忽略或返回 404,而 `your-domain.com/googlechat` 会安全地路由到 OpenClaw。 ### 方案 C:Cloudflare Tunnel 配置你的隧道入口规则,只路由 webhook 路径: - \*\*路径\*\*:`/googlechat` -> `http://localhost:18789/googlechat` - \*\*默认规则\*\*:HTTP 404(未找到) ## 工作原理 1. Google Chat 向 Gateway 网关发送 webhook POST 请求。每个请求都包含一个 `Authorization: Bearer ` 头。 2. OpenClaw 根据配置的 `audienceType` + `audience` 验证令牌: - `audienceType: "app-url"` → audience 是你的 HTTPS webhook URL。 - `audienceType: "project-number"` → audience 是 Cloud 项目编号。 3. 消息按空间路由: - 私信使用会话键 `agent::googlechat:dm:`。 - 空间使用会话键 `agent::googlechat:group:`。 4. 私信访问默认为配对模式。未知发送者会收到配对码;使用以下命令批准: - `openclaw pairing approve googlechat ```` ` 5. 群组空间默认需要 @提及。如果提及检测需要应用的用户名,请使用 `botUser`。 ## 目标标识符 使用这些标识符进行消息投递和允许列表: - 私信:`users/` 或 `users/`(接受邮箱地址)。 - 空间:`spaces/`。 ## 配置要点 ```json5 { channels: { googlechat: { enabled: true, serviceAccountFile: "/path/to/service-account.json", audienceType: "app-url", audience: "https://gateway.example.com/googlechat", webhookPath: "/googlechat", botUser: "users/1234567890", // 可选;帮助提及检测 dm: { policy: "pairing", allowFrom: ["users/1234567890", "name@example.com"], }, groupPolicy: "allowlist", groups: { "spaces/AAAA": { allow: true, requireMention: true, users: ["users/1234567890"], systemPrompt: "Short answers only.", }, }, actions: { reactions: true }, typingIndicator: "message", mediaMaxMb: 20, }, }, } ``` 注意事项: - 服务账号凭证也可以通过 `serviceAccount`(JSON 字符串)内联传递。 - 如果未设置 `webhookPath`,默认 webhook 路径为 `/googlechat`。 - 当 `actions.reactions` 启用时,可通过 `reactions` 工具和 `channels action` 使用表情回应。 - `typingIndicator` 支持 `none`、`message`(默认)和 `reaction`(reaction 需要用户 OAuth)。 - 附件通过
https://github.com/openclaw/openclaw/blob/main//docs/zh-CN/channels/googlechat.md
main
opebclaw
[ -0.11667519062757492, 0.019671576097607613, 0.046050067991018295, -0.09941955655813217, -0.0206744521856308, -0.07741441577672958, 0.04215605929493904, -0.06111569702625275, 0.03555687144398689, 0.01844933070242405, 0.10654504597187042, -0.08586160838603973, 0.023502664640545845, -0.01090504601597786, 0.11315657198429108, 0.044914890080690384, -0.03692246973514557, -0.023759374395012856, -0.10934758931398392, -0.05648335441946983, 0.010622857138514519, 0.02713010087609291, 0.03207996487617493, 0.01833726279437542, -0.013928800821304321, -0.035004712641239166, -0.0021652847062796354, -0.03425838053226471, -0.01822860725224018, 0.004452998749911785, -0.035871099680662155, 0.008319059386849403, 0.006961282808333635, 0.06926163285970688, 0.058932334184646606, 0.06487935036420822, 0.002487238496541977, 0.0052706403657794, -0.011567794717848301, 0.0540492907166481, -0.05774303153157234, -0.07798280566930771, -0.043031927198171616, -0.10362417250871658, 0.029170555993914604, 0.02118537202477455, -0.06995195150375366, -0.025841575115919113, -0.05521296709775925, 0.0003612089203670621, -0.08803479373455048, 0.0015175644075497985, -0.02796936221420765, 0.02376704104244709, -0.03308531269431114, -0.004835732281208038, -0.08519311249256134, 0.09711397439241409, 0.049890611320734024, 0.0021029191557317972, -0.00864909216761589, -0.009625090286135674, -0.009852822870016098, -0.03143946826457977, -0.03358376771211624, 0.00554754538461566, -0.00625970121473074, -0.04868770018219948, 0.003368135541677475, 0.02366909198462963, -0.011010730639100075, 0.04019177705049515, -0.08117429912090302, -0.035412468016147614, -0.03697307035326958, 0.004298276733607054, -0.025686368346214294, 0.030989661812782288, -0.05178212374448776, -0.06581838428974152, 0.022431256249547005, -0.0032834340818226337, 0.08225391805171967, 0.08454973995685577, -0.11521713435649872, 0.028994422405958176, -0.07115194201469421, -0.049158304929733276, 0.06550238281488419, -0.022479036822915077, 0.04196222499012947, -0.0478954091668129, 0.04545639082789421, 0.05510350316762924, 0.08663718402385712, -0.009977299720048904, 0.002391301328316331, 0.041061315685510635, -0.015494061633944511, 0.01932636834681034, 0.03049471229314804, -0.010761717334389687, -0.05363226309418678, -0.03614470735192299, 0.03477558493614197, 0.009495312348008156, -0.05553331971168518, 0.003661062801256776, 0.08982568979263306, 0.03944116085767746, -0.05129678174853325, -0.04653385281562805, 0.01537860557436943, -0.062258023768663406, -0.006820456124842167, 0.08157337456941605, -0.02810654416680336, -0.08909904956817627, 0.02304946258664131, 0.04832509532570839, 0.10735601931810379, -0.052179206162691116, -0.039496131241321564, -0.0413273349404335, -0.08816389739513397, -0.020791614428162575, 0.10932962596416473, 2.5669916660799245e-33, 0.04692113399505615, 0.014316034503281116, 0.0030371234752237797, -0.0081983283162117, 0.024124642834067345, -0.0363185815513134, -0.02425733581185341, -0.017916418612003326, -0.09394250810146332, -0.031697701662778854, -0.04016479477286339, -0.02128259651362896, -0.06806349754333496, -0.004307164810597897, 0.027420315891504288, 0.015466651879251003, 0.031208813190460205, 0.008544459007680416, 0.09934641420841217, 0.02578376606106758, -0.0035534813068807125, 0.03687853366136551, 0.03897002711892128, -0.018333328887820244, -0.0011209204094484448, 0.0799853652715683, 0.04440672695636749, -0.07330911606550217, -0.024154197424650192, 0.02810198813676834, 0.05925978347659111, -0.08009325712919235, -0.040349118411540985, 0.06469493359327316, -0.022658899426460266, -0.014984102919697762, -0.06524980813264847, -0.014927880838513374, -0.0617806613445282, -0.0030463365837931633, -0.0681549534201622, -0.023643890395760536, -0.08078086376190186, -0.020819783210754395, 0.007354218512773514, -0.02104956842958927, -0.060278426855802536, -0.0817883312702179, 0.06851854175329208, 0.035085830837488174, -0.09534376114606857, 0.053135067224502563, -0.05984041839838028, 0.011543262749910355, 0.03675144165754318, -0.07546699047088623, -0.019189774990081787, -0.036097414791584015, -0.057582613080739975, -0.060388945043087006, 0.03363663703203201, -0.010570475831627846, -0.0292526762932539, 0.002615876728668809, 0.06345348805189133, -0.050612788647413254, -0.04664097726345062, 0.04394170641899109, -0.014285053126513958, -0.05087193474173546, -0.022330669686198235, 0.009864305146038532, 0.060539186000823975, 0.05612041428685188, -0.11337431520223618, -0.03941280022263527, 0.02715275064110756, 0.0919966846704483, 0.025629939511418343, -0.013377418741583824, 0.026385124772787094, -0.004053289536386728, -0.04792560636997223, 0.002791523700580001, -0.10694330185651779, 0.0273259449750185, 0.08552674204111099, -0.028240615501999855, -0.02495863102376461, 0.07725352048873901, -0.11904437839984894, 0.022703252732753754, 0.018413953483104706, -0.002408216707408428, -0.06079878658056259, -6.222759995354038e-33, 0.006558514665812254, 0.0552605465054512, -0.06709913909435272, 0.026506656780838966, 0.03698369860649109, -0.01011737436056137, 0.11726029217243195, 0.024718372151255608, 0.02391267940402031, 0.09975043684244156, -0.0333285816013813, 0.0016346744960173965, 0.035185493528842926, 0.017690734937787056, 0.07317262887954712, 0.026170160621404648, -0.009474921971559525, -0.024811390787363052, -0.09256084263324738, 0.029689937829971313, 0.02951589971780777, 0.02305350825190544, -0.10012467950582504, -0.0017293376149609685, 0.019134588539600372, 0.0019163773395121098, 0.021364690735936165, 0.017919857054948807, -0.028350409120321274, -0.014869453385472298, 0.024194035679101944, 0.04509453848004341, -0.09744224697351456, 0.13809067010879517, 0.015870148316025734, -0.10685252398252487, 0.056185998022556305, 0.04606807976961136, -0.026559140533208847, -0.09954744577407837, 0.0756053775548935, -0.06955640017986298, -0.021213894709944725, -0.07941612601280212, 0.04029195383191109, 0.03688563406467438, -0.06729428470134735, -0.012332314625382423, -0.10927294194698334, -0.05334038659930229, 0.08103982359170914, -0.03331630304455757, 0.008547890931367874, -0.02886766567826271, 0.00865485705435276, 0.05013483390212059, 0.05429700389504433, -0.0369662307202816, 0.0006035336409695446, -0.11301212012767792, -0.007483119610697031, -0.041348040103912354, 0.025928625836968422, 0.0750688835978508, 0.013836170546710491, -0.011816194280982018, 0.02557118609547615, 0.049215152859687805, 0.015885934233665466, -0.06601817160844803, 0.006299539003521204, -0.04203347861766815, 0.030211342498660088, -0.031579919159412384, 0.03191313147544861, 0.011408789083361626, -0.014103718101978302, 0.01554320938885212, 0.004616410471498966, 0.03708788752555847, 0.00950033962726593, 0.03687380626797676, 0.04772568121552467, 0.08312392234802246, 0.04816675931215286, -0.03001704253256321, 0.030129890888929367, 0.10309872031211853, -0.007003673352301121, -0.012120363302528858, -0.026121016591787338, 0.03158783167600632, -0.02862456813454628, 0.06633662432432175, 0.028736434876918793, -4.753883331432007e-8, -0.028573984280228615, -0.10516922175884247, -0.048315610736608505, 0.020834384486079216, 0.006212322972714901, -0.04604380205273628, -0.0029647222254425287, 0.015150848776102066, 0.016260847449302673, 0.008671674877405167, -0.005733556114137173, 0.042248327285051346, -0.06557142734527588, 0.003850576002150774, -0.09176092594861984, -0.053384993225336075, -0.10388434678316116, -0.0033990463707596064, 0.043299600481987, -0.09360210597515106, 0.01528891921043396, 0.031787626445293427, 0.008909391239285469, -0.02637072466313839, -0.04266500473022461, 0.023190515115857124, -0.0018487826455384493, 0.036565277725458145, -0.11165699362754822, -0.034955158829689026, -0.041721608489751816, -0.032899171113967896, 0.003132106503471732, -0.052620455622673035, 0.04105076193809509, -0.035135418176651, -0.004580815322697163, -0.05720716714859009, -0.04453810304403305, 0.0264855045825243, 0.07502876222133636, -0.005990831181406975, 0.04075222834944725, -0.005810942500829697, 0.16143232583999634, -0.014466667547821999, 0.03477161005139351, -0.02041671611368656, 0.06536564230918884, 0.057616282254457474, -0.06958591192960739, -0.0067780883982777596, 0.06653764843940735, 0.019456032663583755, 0.01733887568116188, -0.02737143263220787, -0.0005185084301047027, -0.05464016646146774, 0.01002495177090168, 0.07057864964008331, 0.06982603669166565, 0.12704432010650635, 0.006323072127997875, 0.0052323429845273495 ]
0.050902
users: ["users/1234567890"], systemPrompt: "Short answers only.", }, }, actions: { reactions: true }, typingIndicator: "message", mediaMaxMb: 20, }, }, } ``` 注意事项: - 服务账号凭证也可以通过 `serviceAccount`(JSON 字符串)内联传递。 - 如果未设置 `webhookPath`,默认 webhook 路径为 `/googlechat`。 - 当 `actions.reactions` 启用时,可通过 `reactions` 工具和 `channels action` 使用表情回应。 - `typingIndicator` 支持 `none`、`message`(默认)和 `reaction`(reaction 需要用户 OAuth)。 - 附件通过 Chat API 下载并存储在媒体管道中(大小受 `mediaMaxMb` 限制)。 ## 故障排除 ### 405 Method Not Allowed 如果 Google Cloud Logs Explorer 显示如下错误: ``` status code: 405, reason phrase: HTTP error response: HTTP/1.1 405 Method Not Allowed ``` 这意味着 webhook 处理程序未注册。常见原因: 1. **渠道未配置**:配置中缺少 `channels.googlechat` 部分。使用以下命令验证: ```bash openclaw config get channels.googlechat ``` 如果返回"Config path not found",请添加配置(参见[配置要点](#配置要点))。 2. **插件未启用**:检查插件状态: ```bash openclaw plugins list | grep googlechat ``` 如果显示"disabled",请在配置中添加 `plugins.entries.googlechat.enabled: true`。 3. **Gateway 网关未重启**:添加配置后,重启 Gateway 网关: ```bash openclaw gateway restart ``` 验证渠道是否正在运行: ```bash openclaw channels status # 应显示:Google Chat default: enabled, configured, ... ``` ### 其他问题 - 检查 `openclaw channels status --probe` 以查看认证错误或缺少 audience 配置。 - 如果没有收到消息,请确认 Chat 应用的 webhook URL 和事件订阅。 - 如果提及门控阻止了回复,请将 `botUser` 设置为应用的用户资源名称并验证 `requireMention`。 - 在发送测试消息时使用 `openclaw logs --follow` 查看请求是否到达 Gateway 网关。 相关文档: - [Gateway 网关配置](/gateway/configuration) - [安全](/gateway/security) - [表情回应](/tools/reactions) ````
https://github.com/openclaw/openclaw/blob/main//docs/zh-CN/channels/googlechat.md
main
opebclaw
[ -0.04949353262782097, -0.00032742362236604095, -0.000060460937675088644, -0.03526972234249115, 0.020048286765813828, -0.08212147653102875, 0.04047231748700142, -0.018765084445476532, 0.03609609976410866, 0.029921486973762512, 0.11753055453300476, -0.06340359896421432, 0.10398083180189133, 0.007846660912036896, 0.07106082141399384, 0.009848075918853283, -0.02508612908422947, -0.07576216757297516, -0.08602503687143326, -0.029801389202475548, -0.053564660251140594, 0.043454695492982864, -0.020036399364471436, 0.03715062141418457, -0.03016817755997181, -0.023056330159306526, -0.060292866080999374, -0.058126356452703476, -0.05161375179886818, 0.0006229273858480155, -0.01608952321112156, -0.017903050407767296, -0.037925221025943756, 0.08567105233669281, 0.06118573620915413, 0.052406273782253265, 0.028268318623304367, -0.09011215716600418, 0.0005252808914519846, 0.053203970193862915, -0.03761366754770279, -0.07481279224157333, -0.05120215564966202, -0.04688951373100281, 0.017298465594649315, -0.003432659665122628, -0.04993265122175217, -0.10006346553564072, -0.10124783217906952, 0.01735471747815609, -0.06378863751888275, 0.06189212575554848, -0.0473967082798481, 0.07004721462726593, 0.0325278677046299, -0.07794587314128876, -0.1523388922214508, 0.08369023352861404, 0.0473216287791729, 0.027678733691573143, -0.035197217017412186, -0.05616134777665138, -0.007071114610880613, -0.04113456979393959, -0.041225019842386246, 0.02541426569223404, -0.03061833791434765, -0.06618496030569077, 0.020530415698885918, 0.05898535996675491, -0.0381009578704834, 0.0366215817630291, -0.08989845961332321, 0.020527713000774384, -0.02964382991194725, 0.001161548076197505, 0.004429087974131107, -0.004651451949030161, -0.03410930186510086, -0.050858814269304276, -0.02581760846078396, -0.09249787032604218, 0.04862552136182785, 0.12385711818933487, -0.06219683960080147, 0.04403338581323624, -0.07600992172956467, -0.018967226147651672, 0.04606214165687561, 0.002134597860276699, 0.039048176258802414, -0.02031796984374523, 0.05769410356879234, 0.022589532658457756, 0.026282303035259247, -0.03770582750439644, -0.023110173642635345, 0.04621145501732826, -0.05148947611451149, 0.04707498848438263, 0.015680840238928795, -0.0007554733892902732, -0.001509523717686534, -0.033135998994112015, 0.01744600012898445, -0.040094781666994095, -0.0040564886294305325, 0.027090134099125862, 0.03818591311573982, 0.0018604506039991975, -0.03746318817138672, -0.02842998132109642, -0.02375572733581066, -0.06574242562055588, 0.006714736111462116, 0.08392995595932007, -0.013649459928274155, -0.06361637264490128, -0.05430905520915985, 0.04990442097187042, 0.10916614532470703, -0.017560085281729698, -0.03900284692645073, -0.004550477955490351, -0.005739338230341673, 0.05177377536892891, 0.07082562893629074, 3.235278204279642e-33, 0.024042489007115364, 0.03590865433216095, 0.05288207530975342, -0.0677853375673294, 0.03499818220734596, -0.006032312288880348, -0.017883911728858948, -0.0039382935501635075, -0.006294789724051952, -0.056748587638139725, 0.00566983362659812, 0.04679245874285698, -0.04425649344921112, -0.010042453184723854, -0.024018771946430206, 0.03352859243750572, 0.01351750548928976, 0.05599519982933998, 0.00801277905702591, 0.0168775524944067, 0.03596733510494232, -0.04879196733236313, 0.032836854457855225, 0.045668989419937134, -0.0035939805675297976, 0.0571812242269516, 0.01674775220453739, -0.026768309995532036, -0.01823289878666401, 0.005515883211046457, 0.027599291875958443, -0.05315275117754936, -0.009248939342796803, 0.04928380623459816, -0.0027631360571831465, -0.044485729187726974, -0.058020368218421936, 0.016112063080072403, -0.061322636902332306, -0.0548599474132061, -0.07071557641029358, 0.028592200949788094, -0.11323104053735733, -0.021327685564756393, -0.0012503942707553506, 0.010464285500347614, -0.05217224359512329, -0.0732983723282814, 0.02913644164800644, 0.017660629004240036, -0.05504677817225456, 0.03416150435805321, -0.011175007559359074, 0.024097656831145287, 0.007738648448139429, -0.016238383948802948, 0.03188536688685417, -0.07671921700239182, -0.026018472388386726, -0.018354274332523346, 0.06391029059886932, -0.021584946662187576, 0.07449749112129211, -0.05711939558386803, 0.07769235223531723, -0.04492339491844177, -0.029587766155600548, 0.07471807301044464, -0.04925509914755821, -0.00034845771733671427, 0.0052812956273555756, 0.0039477963000535965, 0.08010789752006531, 0.07277489453554153, -0.05852971225976944, -0.10736040771007538, -0.003615747671574354, 0.04082498326897621, -0.038469135761260986, -0.02941218949854374, 0.035841941833496094, -0.09222962707281113, -0.01541350781917572, -0.01758991740643978, -0.07075250893831253, 0.058247264474630356, 0.008259926922619343, 0.025165816769003868, -0.1355738639831543, 0.09367746859788895, -0.086037777364254, 0.0325661227107048, 0.0032475159969180822, -0.011736608110368252, -0.0801086500287056, -8.020409710603976e-33, -0.04548852518200874, 0.006906322203576565, -0.05188824236392975, -0.04756086692214012, 0.027299948036670685, 0.004189684055745602, 0.10517802834510803, 0.056588441133499146, 0.06975236535072327, 0.09858901053667068, 0.01721278205513954, -0.012660791166126728, -0.016964025795459747, 0.009020364843308926, -0.00847445148974657, 0.04703027009963989, -0.02608150616288185, -0.025011666119098663, -0.030310947448015213, 0.02503945305943489, -0.06053275987505913, 0.11314202845096588, -0.09267012029886246, 0.07661574333906174, -0.0054252357222139835, 0.010852082632482052, 0.056230317801237106, -0.015631461516022682, -0.01590987667441368, -0.06364236027002335, 0.05932863429188728, -0.0023472565226256847, -0.08966707438230515, 0.05598447471857071, 0.046341996639966965, -0.1064419224858284, 0.019175153225660324, 0.054982930421829224, -0.03030555509030819, -0.028699824586510658, 0.0902130976319313, -0.07556430995464325, -0.009666945785284042, 0.020304422825574875, 0.012522502802312374, 0.033952392637729645, -0.04622217267751694, -0.07290013134479523, -0.07111209630966187, 0.0034903923515230417, 0.07980574667453766, -0.04975895956158638, 0.0632634162902832, -0.005219643469899893, -0.023991208523511887, 0.050665732473134995, 0.015845583751797676, -0.04783264547586441, -0.047854892909526825, -0.12801127135753632, 0.025387443602085114, -0.08889429271221161, -0.028430040925741196, 0.06252633780241013, 0.026450084522366524, -0.03210737556219101, -0.0041539487428963184, 0.048610202968120575, 0.03851089999079704, -0.06379635632038116, 0.02008594572544098, -0.022175533697009087, 0.004902162589132786, -0.041319623589515686, 0.04320641979575157, -0.0007504082168452442, -0.08565588295459747, -0.041944123804569244, -0.028238428756594658, 0.029723914340138435, -0.06428931653499603, 0.05043943226337433, 0.01577942818403244, 0.04157138615846634, 0.00048025869182311, -0.048318684101104736, -0.0005790339200757444, 0.13168132305145264, -0.05106812343001366, 0.017618359997868538, -0.029554972425103188, 0.010318531654775143, -0.03537138178944588, 0.06083717569708824, -0.03835420310497284, -5.816055903551387e-8, -0.024136364459991455, -0.09089811146259308, -0.017119664698839188, 0.048998795449733734, 0.04751277714967728, 0.006016643717885017, -0.026820912957191467, 0.03314504399895668, -0.015763336792588234, -0.013376353308558464, -0.010337301529943943, 0.03998399153351784, -0.034945134073495865, -0.046349503099918365, -0.017162932083010674, -0.11922663450241089, -0.09170360863208771, 0.010103141888976097, 0.014595462940633297, -0.09689793735742569, -0.019112778827548027, 0.00006190991553012282, -0.0175970159471035, -0.03293371945619583, 0.0012395632220432162, 0.02748144045472145, 0.058343324810266495, 0.08169015496969223, -0.10808248817920685, -0.04547524079680443, -0.01999213546514511, -0.0771358385682106, -0.046739596873521805, -0.09840647876262665, -0.0032285775523632765, 0.011471941135823727, 0.022039800882339478, -0.08396871387958527, -0.023953748866915703, -0.03517397493124008, 0.03009830415248871, -0.008665641769766808, 0.01114527229219675, 0.043297797441482544, 0.07963386923074722, 0.004447012208402157, 0.04398075491189957, -0.001333634601905942, 0.1210402399301529, 0.03273850679397583, -0.03825351223349571, -0.06394682824611664, 0.0378582663834095, 0.07035146653652191, 0.011236704885959625, -0.0360027477145195, 0.061295896768569946, -0.055086519569158554, 0.0309518501162529, 0.057777468115091324, 0.13118542730808258, 0.06452273577451706, 0.0018126992508769035, 0.0635465681552887 ]
0.06244
# Mattermost(插件) 状态:通过插件支持(bot token + WebSocket 事件)。支持频道、群组和私信。 Mattermost 是一个可自托管的团队消息平台;有关产品详情和下载,请访问官方网站 [mattermost.com](https://mattermost.com)。 ## 需要插件 Mattermost 以插件形式提供,不包含在核心安装中。 通过 CLI 安装(npm 注册表): ```bash openclaw plugins install @openclaw/mattermost ``` 本地检出(从 git 仓库运行时): ```bash openclaw plugins install ./extensions/mattermost ``` 如果你在配置/新手引导期间选择 Mattermost 并检测到 git 检出,OpenClaw 会自动提供本地安装路径。 详情:[插件](/plugin) ## 快速设置 1. 安装 Mattermost 插件。 2. 创建 Mattermost bot 账户并复制 \*\*bot token\*\*。 3. 复制 Mattermost \*\*基础 URL\*\*(例如 `https://chat.example.com`)。 4. 配置 OpenClaw 并启动 Gateway 网关。 最小配置: ```json5 { channels: { mattermost: { enabled: true, botToken: "mm-token", baseUrl: "https://chat.example.com", dmPolicy: "pairing", }, }, } ``` ## 环境变量(默认账户) 如果你偏好使用环境变量,请在 Gateway 网关主机上设置: - `MATTERMOST\_BOT\_TOKEN=...` - `MATTERMOST\_URL=https://chat.example.com` 环境变量仅适用于\*\*默认\*\*账户(`default`)。其他账户必须使用配置值。 ## 聊天模式 Mattermost 自动响应私信。频道行为由 `chatmode` 控制: - `oncall`(默认):仅在频道中被 @提及时响应。 - `onmessage`:响应每条频道消息。 - `onchar`:当消息以触发前缀开头时响应。 配置示例: ```json5 { channels: { mattermost: { chatmode: "onchar", oncharPrefixes: [">", "!"], }, }, } ``` 注意事项: - `onchar` 仍会响应显式 @提及。 - `channels.mattermost.requireMention` 对旧配置仍然有效,但推荐使用 `chatmode`。 ## 访问控制(私信) - 默认:`channels.mattermost.dmPolicy = "pairing"`(未知发送者会收到配对码)。 - 通过以下方式批准: - `openclaw pairing list mattermost` - `openclaw pairing approve mattermost ```` ` - 公开私信:`channels.mattermost.dmPolicy="open"` 加上 `channels.mattermost.allowFrom=["*"]`。 ## 频道(群组) - 默认:`channels.mattermost.groupPolicy = "allowlist"`(提及限制)。 - 使用 `channels.mattermost.groupAllowFrom` 将发送者加入允许列表(用户 ID 或 `@username`)。 - 开放频道:`channels.mattermost.groupPolicy="open"`(提及限制)。 ## 出站投递目标 在 `openclaw message send` 或 cron/webhooks 中使用这些目标格式: - `channel:` 用于频道 - `user:` 用于私信 - `@username` 用于私信(通过 Mattermost API 解析) 裸 ID 被视为频道。 ## 多账户 Mattermost 支持在 `channels.mattermost.accounts` 下配置多个账户: ```json5 { channels: { mattermost: { accounts: { default: { name: "Primary", botToken: "mm-token", baseUrl: "https://chat.example.com" }, alerts: { name: "Alerts", botToken: "mm-token-2", baseUrl: "https://alerts.example.com" }, }, }, }, } ``` ## 故障排除 - 频道中无回复:确保 bot 在频道中并提及它(oncall),使用触发前缀(onchar),或设置 `chatmode: "onmessage"`。 - 认证错误:检查 bot token、基础 URL 以及账户是否已启用。 - 多账户问题:环境变量仅适用于 `default` 账户。 ````
https://github.com/openclaw/openclaw/blob/main//docs/zh-CN/channels/mattermost.md
main
opebclaw
[ -0.06064406782388687, -0.040541872382164, -0.06044917553663254, 0.013413215056061745, 0.03485840931534767, -0.10893848538398743, 0.02114906720817089, 0.015306664630770683, 0.032730165868997574, -0.005234722979366779, 0.0765136256814003, -0.07546836882829666, -0.007875557988882065, -0.0010707585606724024, 0.11959218233823776, 0.07335305958986282, -0.019493861123919487, -0.033357132226228714, -0.007940850220620632, -0.047921258956193924, -0.00029678005375899374, 0.01686284691095352, 0.03438551723957062, -0.03780283033847809, -0.08031029999256134, -0.001339867478236556, -0.07965296506881714, 0.03844822198152542, 0.030789176002144814, -0.03525920212268829, 0.04614380747079849, 0.08979057520627975, -0.006037644576281309, 0.010752376168966293, 0.09712676703929901, 0.0909438505768776, 0.014606311917304993, -0.07191258668899536, -0.04336868226528168, 0.0075364792719483376, 0.0464307926595211, 0.005143503192812204, 0.025392182171344757, -0.04933750256896019, -0.011427600868046284, 0.009022935293614864, -0.027736512944102287, -0.06308130919933319, -0.0783969908952713, -0.06690598279237747, -0.05620798096060753, -0.10866596549749374, -0.04745689034461975, 0.06687669456005096, 0.01723240688443184, -0.028033802285790443, -0.035988759249448776, -0.03423639386892319, 0.04665533825755119, -0.02713213860988617, 0.04355520009994507, 0.04757305234670639, -0.01621450111269951, -0.02917969971895218, -0.04070739820599556, 0.0024965505581349134, -0.03539155423641205, 0.013567134737968445, -0.04398896172642708, 0.052806779742240906, -0.0006280784728005528, 0.03834376484155655, -0.07960226386785507, -0.002972537185996771, -0.006879877299070358, -0.003886730410158634, -0.005480163265019655, -0.001174328150227666, -0.07187600433826447, -0.08001406490802765, -0.09206691384315491, -0.00624892208725214, 0.03398754447698593, 0.008252560161054134, -0.05096813663840294, 0.10790745168924332, -0.05204775184392929, 0.010523834265768528, 0.0024761026725172997, 0.020644724369049072, -0.017544519156217575, -0.019695483148097992, 0.0065652187913656235, 0.04228014871478081, 0.03314535319805145, 0.012215829454362392, -0.022415366023778915, 0.07687214761972427, -0.07111329585313797, 0.04343023523688316, 0.044034283608198166, 0.009308496490120888, -0.04072798788547516, 0.032483700662851334, -0.0007308043423108757, 0.027343615889549255, -0.058089543133974075, 0.06735654175281525, 0.0654744803905487, 0.025206392630934715, -0.029767272993922234, -0.038192328065633774, 0.03820415958762169, -0.1409795582294464, -0.09264303743839264, 0.020360596477985382, 0.010628300718963146, 0.0021151863038539886, 0.06324520707130432, 0.07677815854549408, 0.10131176561117172, 0.025793323293328285, -0.10124019533395767, -0.0034399947617202997, 0.021875502541661263, 0.01598723977804184, 0.07719167321920395, 2.676558943507093e-33, 0.06495699286460876, -0.027087654918432236, -0.030410094186663628, -0.02430688589811325, 0.009021887555718422, 0.009199446067214012, 0.023082904517650604, -0.0018593152053654194, -0.08686114102602005, 0.07575545459985733, -0.004945083521306515, 0.03854313865303993, -0.07512370496988297, -0.03361198678612709, -0.017078299075365067, -0.09797914326190948, 0.014176624827086926, 0.003388244193047285, 0.027185561135411263, -0.06972245126962662, -0.009748190641403198, 0.02818170376121998, -0.06790164113044739, -0.01991771161556244, 0.03460294380784035, 0.09449784457683563, 0.02105359546840191, 0.0011991211213171482, -0.024420082569122314, 0.02139192260801792, 0.08370298892259598, -0.017852691933512688, -0.05651092529296875, 0.07846849411725998, -0.011269848793745041, -0.017415599897503853, -0.0754752904176712, -0.015558499842882156, -0.07476549595594406, -0.13109435141086578, 0.013951164670288563, 0.01427780743688345, -0.08979520946741104, -0.015198634937405586, 0.014543663710355759, -0.010616355575621128, -0.09822601824998856, -0.016765838488936424, 0.11400047689676285, -0.06355255097150803, -0.02138095162808895, 0.019273648038506508, 0.02134389989078045, 0.057831987738609314, -0.005188253242522478, -0.06532919406890869, -0.039666298776865005, 0.003589530475437641, -0.04454265534877777, -0.024348029866814613, -0.05573558062314987, -0.002649173606187105, 0.052195701748132706, -0.0025663201231509447, 0.05503183603286743, -0.02781728282570839, 0.04092181473970413, 0.01895095221698284, -0.021256446838378906, 0.015872249379754066, -0.04802986606955528, 0.018930746242403984, 0.06331659853458405, 0.06905629485845566, -0.023331308737397194, 0.015965480357408524, -0.001189122791402042, -0.06708616763353348, 0.02176450751721859, -0.07284212112426758, -0.01805892027914524, -0.03907669708132744, -0.005866160616278648, -0.06731797754764557, -0.033936791121959686, 0.016451526433229446, 0.021662503480911255, -0.012842711992561817, -0.007642650976777077, -0.013106848113238811, -0.10581235587596893, -0.013307113200426102, 0.01751416176557541, -0.01479693315923214, -0.12920600175857544, -5.5915074066769765e-33, -0.08637988567352295, 0.03402376547455788, -0.025254681706428528, 0.06620857119560242, -0.026455633342266083, -0.041968293488025665, -0.010286802425980568, -0.06780639290809631, 0.059236302971839905, 0.0746862068772316, -0.03287820890545845, 0.029367631301283836, -0.0012157964520156384, -0.050505831837654114, 0.11274614930152893, 0.06824339181184769, -0.041628897190093994, -0.06402778625488281, -0.014249454252421856, 0.03249102458357811, -0.07211705297231674, 0.028946787118911743, -0.13088425993919373, 0.037004657089710236, 0.03652091696858406, 0.06459887325763702, 0.09307076036930084, -0.06017221882939339, 0.04880320280790329, -0.033427461981773376, -0.005976047832518816, 0.02618650160729885, -0.03937263414263725, 0.10115130245685577, -0.017049947753548622, -0.05980763956904411, 0.0556139200925827, 0.06037573143839836, 0.04708969220519066, -0.014147092588245869, 0.028214553371071815, -0.01189504750072956, -0.002636835677549243, 0.03637395426630974, -0.045164596289396286, 0.03217845410108566, -0.040611159056425095, 0.04642532020807266, -0.06725409626960754, -0.02103159762918949, 0.002792882267385721, -0.006124395877122879, -0.0033005878794938326, -0.07241298258304596, 0.007647793740034103, 0.06525618582963943, -0.00045037228846922517, -0.0059792837128043175, -0.11459790170192719, -0.13788191974163055, 0.08648058027029037, -0.10345429182052612, 0.025952773168683052, 0.010608159936964512, -0.004491550847887993, -0.01512987818568945, -0.07930589467287064, -0.016427762806415558, -0.058001384139060974, -0.0992317795753479, -0.0015793205238878727, 0.06372375786304474, -0.01926521025598049, -0.12142474204301834, -0.015786664560437202, 0.00022262590937316418, 0.1116354763507843, -0.006959923077374697, 0.03791822865605354, 0.08104097098112106, -0.01605878956615925, 0.06637611240148544, 0.0392533540725708, -0.01995229162275791, 0.02069610171020031, -0.06512001901865005, 0.008535769768059254, 0.13361069560050964, -0.007237004116177559, -0.017125755548477173, -0.09913583099842072, 0.045178044587373734, 0.05949553847312927, 0.018704816699028015, -0.02778121829032898, -5.552326243218886e-8, -0.03970269113779068, -0.14056161046028137, -0.10251998156309128, 0.018676061183214188, -0.016377277672290802, -0.008220678195357323, -0.022253427654504776, 0.033338434994220734, -0.03636730834841728, 0.031148137524724007, 0.05290728807449341, 0.009027021005749702, -0.09900934249162674, -0.0006085801287554204, -0.02114391140639782, -0.044224705547094345, -0.04341179132461548, -0.02066810242831707, -0.00820979941636324, -0.08830145001411438, -0.029843920841813087, 0.09873533993959427, 0.02081196941435337, -0.04200281575322151, -0.050958044826984406, -0.0261087529361248, -0.036069247871637344, 0.016263149678707123, -0.04898772016167641, 0.011770515702664852, 0.006912536919116974, -0.018969764932990074, 0.03830956295132637, -0.039173346012830734, 0.026762064546346664, 0.04173273965716362, 0.0007561893435195088, 0.003084917552769184, 0.024355310946702957, -0.008164546452462673, 0.06031298264861107, -0.05347215756773949, -0.0006701647071167827, 0.0468713715672493, -0.017535964027047157, 0.023510923609137535, 0.011939460411667824, 0.04251528158783913, 0.042233966290950775, -0.008371150121092796, -0.026977356523275375, -0.01426390465348959, -0.0008504852885380387, -0.0008434981573373079, -0.021194884553551674, 0.11714980006217957, 0.016450420022010803, -0.003595831338316202, 0.03240196406841278, 0.06593459099531174, -0.009480886161327362, 0.02994902804493904, 0.05571074038743973, 0.06641071289777756 ]
0.134364
# Discord(Bot API) 状态:已支持通过官方 Discord 机器人网关进行私信和服务器文字频道通信。 ## 快速设置(新手) 1. 创建 Discord 机器人并复制机器人令牌。 2. 在 Discord 应用设置中启用 \*\*Message Content Intent\*\*(如果你计划使用允许列表或名称查找,还需启用 \*\*Server Members Intent\*\*)。 3. 为 OpenClaw 设置令牌: - 环境变量:`DISCORD\_BOT\_TOKEN=...` - 或配置:`channels.discord.token: "..."`。 - 如果两者都设置,配置优先(环境变量回退仅适用于默认账户)。 4. 使用消息权限邀请机器人到你的服务器(如果你只想使用私信,可以创建一个私人服务器)。 5. 启动 Gateway 网关。 6. 私信访问默认采用配对模式;首次联系时需批准配对码。 最小配置: ```json5 { channels: { discord: { enabled: true, token: "YOUR\_BOT\_TOKEN", }, }, } ``` ## 目标 - 通过 Discord 私信或服务器频道与 OpenClaw 对话。 - 直接聊天会合并到智能体的主会话(默认 `agent:main:main`);服务器频道保持隔离为 `agent::discord:channel:`(显示名称使用 `discord:#`)。 - 群组私信默认被忽略;通过 `channels.discord.dm.groupEnabled` 启用,并可选择通过 `channels.discord.dm.groupChannels` 进行限制。 - 保持路由确定性:回复始终返回到消息来源的渠道。 ## 工作原理 1. 创建 Discord 应用程序 → Bot,启用你需要的意图(私信 + 服务器消息 + 消息内容),并获取机器人令牌。 2. 使用所需权限邀请机器人到你的服务器,以便在你想使用的地方读取/发送消息。 3. 使用 `channels.discord.token` 配置 OpenClaw(或使用 `DISCORD\_BOT\_TOKEN` 作为回退)。 4. 运行 Gateway 网关;当令牌可用(配置优先,环境变量回退)且 `channels.discord.enabled` 不为 `false` 时,它会自动启动 Discord 渠道。 - 如果你更喜欢使用环境变量,设置 `DISCORD\_BOT\_TOKEN`(配置块是可选的)。 5. 直接聊天:发送时使用 `user:`(或 `<@id>` 提及);所有对话都进入共享的 `main` 会话。纯数字 ID 是模糊的,会被拒绝。 6. 服务器频道:发送时使用 `channel:`。默认需要提及,可以按服务器或按频道设置。 7. 直接聊天:默认通过 `channels.discord.dm.policy` 进行安全保护(默认:`"pairing"`)。未知发送者会收到配对码(1 小时后过期);通过 `openclaw pairing approve discord ```` ` 批准。 - 要保持旧的"对任何人开放"行为:设置 `channels.discord.dm.policy="open"` 和 `channels.discord.dm.allowFrom=["*"]`。 - 要使用硬编码允许列表:设置 `channels.discord.dm.policy="allowlist"` 并在 `channels.discord.dm.allowFrom` 中列出发送者。 - 要忽略所有私信:设置 `channels.discord.dm.enabled=false` 或 `channels.discord.dm.policy="disabled"`。 8. 群组私信默认被忽略;通过 `channels.discord.dm.groupEnabled` 启用,并可选择通过 `channels.discord.dm.groupChannels` 进行限制。 9. 可选服务器规则:设置 `channels.discord.guilds`,以服务器 ID(首选)或 slug 为键,并包含每个频道的规则。 10. 可选原生命令:`commands.native` 默认为 `"auto"`(Discord/Telegram 开启,Slack 关闭)。使用 `channels.discord.commands.native: true|false|"auto"` 覆盖;`false` 会清除之前注册的命令。文本命令由 `commands.text` 控制,必须作为独立的 `/...` 消息发送。使用 `commands.useAccessGroups: false` 可跳过命令的访问组检查。 - 完整命令列表 + 配置:[斜杠命令](/tools/slash-commands) 11. 可选服务器上下文历史:设置 `channels.discord.historyLimit`(默认 20,回退到 `messages.groupChat.historyLimit`)以在回复提及时包含最近 N 条服务器消息作为上下文。设置 `0` 禁用。 12. 表情反应:智能体可以通过 `discord` 工具触发表情反应(受 `channels.discord.actions.*` 控制)。 - 表情反应移除语义:参见 [/tools/reactions](/tools/reactions)。 - `discord` 工具仅在当前渠道是 Discord 时暴露。 13. 原生命令使用隔离的会话键(`agent::discord:slash:`)而不是共享的 `main` 会话。 注意:名称 → ID 解析使用服务器成员搜索,需要 Server Members Intent;如果机器人无法搜索成员,请使用 ID 或 `<@id>` 提及。 注意:Slug 为小写,空格替换为 `-`。频道名称的 slug 不包含前导 `#`。 注意:服务器上下文 `[from:]` 行包含 `author.tag` + `id`,便于进行可提及的回复。 ## 配置写入 默认情况下,允许 Discord 写入由 `/config set|unset` 触发的配置更新(需要 `commands.config: true`)。 禁用方式: ```json5 { channels: { discord: { configWrites: false } }, } ``` ## 如何创建自己的机器人 这是在服务器(guild)频道(如 `#help`)中运行 OpenClaw 的"Discord 开发者门户"设置。 ### 1)创建 Discord 应用 + 机器人用户 1. Discord 开发者门户 → **Applications** → **New Application** 2. 在你的应用中: - **Bot** → **Add Bot** - 复制 **Bot Token**(这是你放入 `DISCORD_BOT_TOKEN` 的内容) ### 2)启用 OpenClaw 需要的网关意图 Discord 会阻止"特权意图",除非你明确启用它们。 在 **Bot** → **Privileged Gateway Intents** 中启用: - **Message Content Intent**(在大多数服务器中读取消息文本所必需;没有它你会看到"Used disallowed intents"或机器人会连接但不响应消息) - **Server Members Intent**(推荐;服务器中的某些成员/用户查找和允许列表匹配需要) 你通常**不需要** **Presence Intent**。 ### 3)生成邀请 URL(OAuth2 URL Generator) 在你的应用中:**OAuth2** → **URL Generator** **Scopes** - ✅ `bot` - ✅ `applications.commands`(原生命令所需) **Bot Permissions**(最小基线) - ✅ View Channels - ✅ Send Messages - ✅ Read Message History - ✅ Embed Links - ✅ Attach Files - ✅ Add Reactions(可选但推荐) - ✅ Use External Emojis / Stickers(可选;仅当你需要时) 除非你在调试并完全信任机器人,否则避免使用 **Administrator**。 复制生成的 URL,打开它,选择你的服务器,然后安装机器人。 ### 4)获取 ID(服务器/用户/频道) Discord 到处使用数字 ID;OpenClaw 配置优先使用 ID。 1. Discord(桌面/网页)→ **用户设置** → **高级** → 启用 **开发者模式** 2. 右键点击: - 服务器名称 → **复制服务器 ID**(服务器 ID) - 频道(例如 `#help`)→ **复制频道 ID** - 你的用户 → **复制用户 ID** ### 5)配置 OpenClaw #### 令牌 通过环境变量设置机器人令牌(服务器上推荐): - `DISCORD_BOT_TOKEN=...` 或通过配置: ```json5 { channels: { discord: { enabled: true, token: "YOUR_BOT_TOKEN", }, }, } ``` 多账户支持:使用 `channels.discord.accounts`,每个账户有自己的令牌和可选的 `name`。参见 [`gateway/configuration`](/gateway/configuration#telegramaccounts--discordaccounts--slackaccounts--signalaccounts--imessageaccounts) 了解通用模式。 #### 允许列表 + 频道路由 示例"单服务器,只允许我,只允许 #help": ```json5 { channels: { discord: { enabled: true, dm: { enabled: false }, guilds: { YOUR_GUILD_ID: { users: ["YOUR_USER_ID"], requireMention: true, channels: { help: { allow: true, requireMention: true }, }, }, }, retry: { attempts: 3, minDelayMs: 500, maxDelayMs: 30000, jitter: 0.1, }, }, }, } ``` 注意: - `requireMention: true` 意味着机器人只在被提及时回复(推荐用于共享频道)。 - `agents.list[].groupChat.mentionPatterns`(或 `messages.groupChat.mentionPatterns`)对于服务器消息也算作提及。 - 多智能体覆盖:在 `agents.list[].groupChat.mentionPatterns` 上设置每个智能体的模式。 - 如果存在 `channels`,任何未列出的频道默认被拒绝。 - 使用 `"*"` 频道条目在所有频道应用默认值;显式频道条目覆盖通配符。 - 话题继承父频道配置(允许列表、`requireMention`、Skills、提示词等),除非你显式添加话题频道 ID。 - 机器人发送的消息默认被忽略;设置 `channels.discord.allowBots=true` 允许它们(自己的消息仍被过滤)。 - 警告:如果你允许回复其他机器人(`channels.discord.allowBots=true`),请使用 `requireMention`、`channels.discord.guilds.*.channels..users` 允许列表和/或在 `AGENTS.md` 和 `SOUL.md` 中设置明确的防护措施来防止机器人之间的回复循环。 ### 6)验证是否工作 1. 启动 Gateway 网关。 2. 在你的服务器频道中发送:`@Krill hello`(或你的机器人名称)。 3. 如果没有反应:查看下面的**故障排除**。 ### 故障排除 - 首先:运行 `openclaw doctor` 和 `openclaw channels status --probe`(可操作的警告 + 快速审计)。 - **"Used disallowed intents"**:在开发者门户中启用 **Message Content Intent**(可能还需要 **Server Members Intent**),然后重启 Gateway 网关。 - **机器人连接但从不在服务器频道回复**: - 缺少 **Message Content Intent**,或 - 机器人缺少频道权限(View/Send/Read History),或 - 你的配置需要提及但你没有提及它,或 - 你的服务器/频道允许列表拒绝了该频道/用户。 - **`requireMention: false` 但仍然没有回复**: - `channels.discord.groupPolicy` 默认为 **allowlist**;将其设置为 `"open"` 或在 `channels.discord.guilds` 下添加服务器条目(可选择在 `channels.discord.guilds..channels` 下列出频道以进行限制)。 - 如果你只设置了 `DISCORD_BOT_TOKEN` 而从未创建 `channels.discord` 部分,运行时会将 `groupPolicy` 默认为 `open`。添加 `channels.discord.groupPolicy`、`channels.defaults.groupPolicy` 或服务器/频道允许列表来锁定它。 - `requireMention` 必须位于 `channels.discord.guilds`(或特定频道)下。顶层的
https://github.com/openclaw/openclaw/blob/main//docs/zh-CN/channels/discord.md
main
opebclaw
[ -0.031225189566612244, -0.05515759065747261, -0.03598807752132416, -0.020241007208824158, -0.017210667952895164, -0.08348271250724792, 0.023841384798288345, 0.014953352510929108, 0.054967958480119705, -0.01917663961648941, 0.04505909979343414, -0.06795721501111984, 0.07410050928592682, -0.008980069309473038, 0.08651294559240341, 0.044494450092315674, -0.02414160966873169, -0.0084170987829566, -0.020614899694919586, -0.06247654929757118, -0.033567775040864944, 0.029695771634578705, -0.03813951835036278, 0.01849757321178913, 0.012547038495540619, -0.08751644939184189, -0.016040446236729622, 0.015010452829301357, -0.03615212067961693, 0.0022557827178388834, 0.05232691019773483, 0.0195445753633976, -0.057279072701931, 0.07075836509466171, 0.06956549733877182, 0.04986337572336197, -0.01408902183175087, -0.037058908492326736, 0.023562196642160416, 0.05014234781265259, -0.010829474776983261, -0.05058471858501434, -0.025492751970887184, 0.000526072399225086, 0.023864610120654106, 0.002070285612717271, -0.045532889664173126, -0.023567048832774162, -0.06393560022115707, 0.009599577635526657, -0.0607600137591362, -0.03576971963047981, -0.023362712934613228, 0.05496446043252945, -0.03395242989063263, -0.04755908623337746, -0.08793909847736359, 0.053816057741642, 0.0556459054350853, -0.060627423226833344, -0.0026859482750296593, -0.031687404960393906, 0.057100627571344376, -0.04357573017477989, -0.08279615640640259, -0.0048356628976762295, -0.09091568738222122, -0.011360679753124714, 0.022663023322820663, -0.006955521646887064, -0.045050591230392456, 0.05086110159754753, -0.12685365974903107, -0.03277019411325455, -0.06616643816232681, -0.026986852288246155, -0.028638888150453568, 0.05237823352217674, -0.10331711918115616, -0.11219003051519394, 0.04930025339126587, 0.0037789177149534225, 0.05628540739417076, 0.047519732266664505, -0.029505448415875435, 0.09404350817203522, -0.043188899755477905, -0.008570406585931778, -0.021353894844651222, -0.007586852181702852, 0.013050442561507225, 0.025156771764159203, 0.030628036707639694, 0.03159094229340553, 0.009671131148934364, 0.030658669769763947, -0.05373265966773033, -0.0028748272452503443, -0.037307482212781906, 0.026052622124552727, 0.021779295057058334, 0.017375467345118523, -0.06737950444221497, -0.017573513090610504, 0.014189555309712887, -0.01689060591161251, 0.03580300137400627, 0.05336751043796539, 0.10693822801113129, 0.05863962695002556, -0.0812251940369606, -0.029790181666612625, -0.016390474513173103, -0.05682403966784477, -0.0054739657789468765, 0.07152032107114792, 0.01205398514866829, 0.04449884593486786, 0.05531997233629227, 0.03174402192234993, 0.06070604920387268, -0.07715478539466858, -0.05480442941188812, -0.04332906752824783, -0.05629977956414223, -0.030500365421175957, 0.1256805956363678, 1.0017859486360124e-33, -0.0518534816801548, 0.013141016475856304, -0.0606696754693985, 0.026215465739369392, 0.02941765822470188, 0.011553371325135231, 0.027334248647093773, -0.021283388137817383, -0.06054592877626419, -0.06320475041866302, -0.0790104866027832, 0.010744535364210606, 0.0027807678561657667, -0.02275381051003933, -0.040877439081668854, -0.03191151097416878, 0.003809866961091757, 0.05125783756375313, 0.08400697261095047, -0.04376070201396942, -0.022785520181059837, 0.022302456200122833, 0.027900749817490578, 0.07577680051326752, 0.04992090165615082, 0.04340687766671181, -0.001509198104031384, -0.029913373291492462, -0.009807289578020573, -0.01660384237766266, 0.025208430364727974, -0.015855571255087852, -0.0706709772348404, 0.09029971063137054, 0.01720568723976612, -0.05326681584119797, -0.033905863761901855, -0.0035963442642241716, -0.09937853366136551, -0.04479832947254181, -0.07074581831693649, -0.05583519861102104, -0.04153558239340782, -0.07024878263473511, -0.046593450009822845, -0.02616783045232296, -0.13585880398750305, -0.05168568715453148, 0.055142056196928024, -0.05188262090086937, -0.035026051104068756, 0.046845439821481705, 0.00019143708050251007, -0.006606880109757185, 0.07379966974258423, -0.08405084908008575, -0.09975291788578033, 0.006729808636009693, -0.051469914615154266, -0.07546591013669968, 0.043730974197387695, -0.023174254223704338, -0.012892036698758602, -0.024523166939616203, 0.08116193860769272, 0.021686652675271034, -0.0374823734164238, 0.01851164549589157, 0.022613395005464554, -0.05657821521162987, -0.06082949414849281, 0.02776840701699257, 0.047955870628356934, 0.03970462456345558, -0.11767274886369705, -0.06125443056225777, -0.02044553868472576, 0.013822592794895172, 0.03332167863845825, -0.0016517462208867073, -0.03949393704533577, -0.08774527907371521, -0.07501216232776642, -0.0781356692314148, -0.03292122110724449, 0.0556415319442749, 0.01769668236374855, -0.036853790283203125, 0.01868203468620777, 0.08581671118736267, -0.09441323578357697, 0.018825743347406387, -0.020773299038410187, 0.09172516316175461, -0.011187453754246235, -6.508723975446514e-33, -0.03799769654870033, 0.07615732401609421, -0.011063437908887863, -0.05501897633075714, -0.006393439136445522, -0.014446096494793892, 0.06861545890569687, -0.004067129455506802, 0.0038253224920481443, 0.11284966766834259, -0.030953101813793182, -0.0013018824392929673, -0.00896899588406086, -0.039805132895708084, 0.010534991510212421, 0.03996729478240013, 0.004508815240114927, -0.01829615980386734, -0.04608634114265442, 0.006829375401139259, -0.06835932284593582, 0.05393111705780029, -0.1407512128353119, 0.006454699207097292, -0.005897030234336853, 0.03647060692310333, 0.05329982563853264, -0.004120608791708946, -0.021307485178112984, -0.056393351405858994, 0.04981200397014618, 0.049701202660799026, -0.04567080736160278, 0.06782843172550201, 0.019251616671681404, -0.0551946721971035, 0.00039742354420013726, 0.09716112911701202, -0.0179304089397192, -0.06445205211639404, 0.10555168241262436, -0.01136792078614235, -0.07829910516738892, -0.030420387163758278, 0.02316872403025627, 0.04190642014145851, -0.022167909890413284, 0.04377388209104538, -0.10020681470632553, -0.0006641484797000885, 0.10497163236141205, -0.05256420373916626, 0.044157739728689194, -0.02001594938337803, 0.026027221232652664, 0.093848817050457, 0.09862625598907471, -0.014523687772452831, 0.005989019758999348, -0.14992903172969818, -0.01445454265922308, -0.11520042270421982, 0.007632499095052481, 0.09800077229738235, 0.03955283761024475, 0.0027769622392952442, -0.014606868848204613, 0.08282820880413055, 0.00723716476932168, -0.08221901953220367, 0.006775807123631239, -0.011781652458012104, 0.01571722701191902, -0.01217127125710249, 0.04282953962683678, -0.017689118161797523, -0.02559557370841503, -0.013342647813260555, -0.0239547211676836, 0.03690452501177788, -0.010734728537499905, 0.05346018075942993, 0.0109381303191185, 0.07981263846158981, -0.02605396695435047, -0.030338115990161896, 0.02262282185256481, 0.15580932796001434, 0.012656236998736858, 0.0016881728079169989, 0.03506160527467728, 0.02309434302151203, 0.057972684502601624, 0.048708464950323105, 0.00030238518957048655, -4.9187232065150965e-8, -0.07457152009010315, -0.09936702251434326, -0.05641443654894829, -0.007386505603790283, -0.005498960614204407, 0.034517280757427216, -0.035379353910684586, -0.02685580588877201, 0.03354001045227051, 0.004167445469647646, -0.05437332019209862, 0.011189521290361881, -0.04704933613538742, 0.027411649003624916, -0.0594165064394474, -0.012915542349219322, -0.046190835535526276, 0.00383597519248724, 0.09367166459560394, -0.06424921005964279, 0.03764299303293228, -0.030175115913152695, 0.04007117450237274, 0.030510537326335907, -0.03967694565653801, 0.013154092244803905, -0.014933939091861248, 0.025074394419789314, -0.1379028707742691, -0.06647347658872604, -0.029696427285671234, -0.030191732570528984, 0.06793756037950516, -0.07286279648542404, -0.016062909737229347, 0.08399220556020737, -0.012247021310031414, -0.06396526843309402, -0.039883676916360855, 0.005668796133249998, 0.09090788662433624, -0.01937357895076275, 0.01346564944833517, -0.02925187535583973, 0.046882957220077515, -0.009397472254931927, 0.024548623710870743, -0.00924462080001831, 0.0757981687784195, -0.03256304934620857, -0.05557025596499443, -0.018408577889204025, 0.05058804526925087, 0.02682800590991974, -0.02767571061849594, -0.027581987902522087, -0.04292122274637222, -0.04138938710093498, 0.005413965322077274, 0.03538055345416069, 0.05418940261006355, 0.13522149622440338, 0.019069205969572067, -0.02418479323387146 ]
0.138504
Content Intent**(可能还需要 **Server Members Intent**),然后重启 Gateway 网关。 - **机器人连接但从不在服务器频道回复**: - 缺少 **Message Content Intent**,或 - 机器人缺少频道权限(View/Send/Read History),或 - 你的配置需要提及但你没有提及它,或 - 你的服务器/频道允许列表拒绝了该频道/用户。 - **`requireMention: false` 但仍然没有回复**: - `channels.discord.groupPolicy` 默认为 **allowlist**;将其设置为 `"open"` 或在 `channels.discord.guilds` 下添加服务器条目(可选择在 `channels.discord.guilds..channels` 下列出频道以进行限制)。 - 如果你只设置了 `DISCORD_BOT_TOKEN` 而从未创建 `channels.discord` 部分,运行时会将 `groupPolicy` 默认为 `open`。添加 `channels.discord.groupPolicy`、`channels.defaults.groupPolicy` 或服务器/频道允许列表来锁定它。 - `requireMention` 必须位于 `channels.discord.guilds`(或特定频道)下。顶层的 `channels.discord.requireMention` 会被忽略。 - **权限审计**(`channels status --probe`)只检查数字频道 ID。如果你使用 slug/名称作为 `channels.discord.guilds.*.channels` 键,审计无法验证权限。 - **私信不工作**:`channels.discord.dm.enabled=false`、`channels.discord.dm.policy="disabled"`,或者你尚未被批准(`channels.discord.dm.policy="pairing"`)。 - **Discord 中的执行审批**:Discord 支持私信中执行审批的**按钮 UI**(允许一次 / 始终允许 / 拒绝)。`/approve ...` 仅用于转发的审批,不会解析 Discord 的按钮提示。如果你看到 `❌ Failed to submit approval: Error: unknown approval id` 或 UI 从未出现,请检查: - 你的配置中有 `channels.discord.execApprovals.enabled: true`。 - 你的 Discord 用户 ID 在 `channels.discord.execApprovals.approvers` 中列出(UI 仅发送给审批者)。 - 使用私信提示中的按钮(**Allow once**、**Always allow**、**Deny**)。 - 参见[执行审批](/tools/exec-approvals)和[斜杠命令](/tools/slash-commands)了解更广泛的审批和命令流程。 ## 功能和限制 - 支持私信和服务器文字频道(话题被视为独立频道;不支持语音)。 - 打字指示器尽力发送;消息分块使用 `channels.discord.textChunkLimit`(默认 2000),并按行数分割长回复(`channels.discord.maxLinesPerMessage`,默认 17)。 - 可选换行分块:设置 `channels.discord.chunkMode="newline"` 以在空行(段落边界)处分割,然后再进行长度分块。 - 支持文件上传,最大 `channels.discord.mediaMaxMb`(默认 8 MB)。 - 默认服务器回复需要提及,以避免嘈杂的机器人。 - 当消息引用另一条消息时,会注入回复上下文(引用内容 + ID)。 - 原生回复线程**默认关闭**;使用 `channels.discord.replyToMode` 和回复标签启用。 ## 重试策略 出站 Discord API 调用在速率限制(429)时使用 Discord `retry_after`(如果可用)进行重试,采用指数退避和抖动。通过 `channels.discord.retry` 配置。参见[重试策略](/concepts/retry)。 ## 配置 ```json5 { channels: { discord: { enabled: true, token: "abc.123", groupPolicy: "allowlist", guilds: { "*": { channels: { general: { allow: true }, }, }, }, mediaMaxMb: 8, actions: { reactions: true, stickers: true, emojiUploads: true, stickerUploads: true, polls: true, permissions: true, messages: true, threads: true, pins: true, search: true, memberInfo: true, roleInfo: true, roles: false, channelInfo: true, channels: true, voiceStatus: true, events: true, moderation: false, }, replyToMode: "off", dm: { enabled: true, policy: "pairing", // pairing | allowlist | open | disabled allowFrom: ["123456789012345678", "steipete"], groupEnabled: false, groupChannels: ["openclaw-dm"], }, guilds: { "*": { requireMention: true }, "123456789012345678": { slug: "friends-of-openclaw", requireMention: false, reactionNotifications: "own", users: ["987654321098765432", "steipete"], channels: { general: { allow: true }, help: { allow: true, requireMention: true, users: ["987654321098765432"], skills: ["search", "docs"], systemPrompt: "Keep answers short.", }, }, }, }, }, }, } ``` 确认表情反应通过 `messages.ackReaction` + `messages.ackReactionScope` 全局控制。使用 `messages.removeAckAfterReply` 在机器人回复后清除确认表情反应。 - `dm.enabled`:设置 `false` 忽略所有私信(默认 `true`)。 - `dm.policy`:私信访问控制(推荐 `pairing`)。`"open"` 需要 `dm.allowFrom=["*"]`。 - `dm.allowFrom`:私信允许列表(用户 ID 或名称)。用于 `dm.policy="allowlist"` 和 `dm.policy="open"` 验证。向导接受用户名,并在机器人可以搜索成员时将其解析为 ID。 - `dm.groupEnabled`:启用群组私信(默认 `false`)。 - `dm.groupChannels`:群组私信频道 ID 或 slug 的可选允许列表。 - `groupPolicy`:控制服务器频道处理(`open|disabled|allowlist`);`allowlist` 需要频道允许列表。 - `guilds`:按服务器规则,以服务器 ID(首选)或 slug 为键。 - `guilds."*"`:当没有显式条目时应用的默认每服务器设置。 - `guilds..slug`:用于显示名称的可选友好 slug。 - `guilds..users`:可选的每服务器用户允许列表(ID 或名称)。 - `guilds..tools`:可选的每服务器工具策略覆盖(`allow`/`deny`/`alsoAllow`),在频道覆盖缺失时使用。 - `guilds..toolsBySender`:服务器级别的可选每发送者工具策略覆盖(在频道覆盖缺失时应用;支持 `"*"` 通配符)。 - `guilds..channels..allow`:当 `groupPolicy="allowlist"` 时允许/拒绝频道。 - `guilds..channels..requireMention`:频道的提及限制。 - `guilds..channels..tools`:可选的每频道工具策略覆盖(`allow`/`deny`/`alsoAllow`)。 - `guilds..channels..toolsBySender`:频道内的可选每发送者工具策略覆盖(支持 `"*"` 通配符)。 - `guilds..channels..users`:可选的每频道用户允许列表。 - `guilds..channels..skills`:Skills 过滤器(省略 = 所有 Skills,空 = 无)。 - `guilds..channels..systemPrompt`:频道的额外系统提示词(与频道主题组合)。 - `guilds..channels..enabled`:设置 `false` 禁用频道。 - `guilds..channels`:频道规则(键为频道 slug 或 ID)。 - `guilds..requireMention`:每服务器提及要求(可按频道覆盖)。 - `guilds..reactionNotifications`:表情反应系统事件模式(`off`、`own`、`all`、`allowlist`)。 - `textChunkLimit`:出站文本块大小(字符)。默认:2000。 - `chunkMode`:`length`(默认)仅在超过 `textChunkLimit` 时分割;`newline` 在空行(段落边界)处分割,然后再进行长度分块。 - `maxLinesPerMessage`:每条消息的软最大行数。默认:17。 - `mediaMaxMb`:限制保存到磁盘的入站媒体大小。 - `historyLimit`:回复提及时作为上下文包含的最近服务器消息数量(默认 20;回退到 `messages.groupChat.historyLimit`;`0` 禁用)。 - `dmHistoryLimit`:私信历史限制(用户轮次)。每用户覆盖:`dms[""].historyLimit`。 - `retry`:出站 Discord API 调用的重试策略(attempts、minDelayMs、maxDelayMs、jitter)。 - `pluralkit`:解析 PluralKit 代理消息,使系统成员显示为不同的发送者。 - `actions`:每操作工具门控;省略允许所有(设置 `false` 禁用)。 - `reactions`(涵盖表情反应 + 读取表情反应) - `stickers`、`emojiUploads`、`stickerUploads`、`polls`、`permissions`、`messages`、`threads`、`pins`、`search` - `memberInfo`、`roleInfo`、`channelInfo`、`voiceStatus`、`events` - `channels`(创建/编辑/删除频道 + 类别 + 权限) - `roles`(角色添加/移除,默认 `false`) - `moderation`(超时/踢出/封禁,默认 `false`) - `execApprovals`:Discord 专用执行审批私信(按钮 UI)。支持 `enabled`、`approvers`、`agentFilter`、`sessionFilter`。 表情反应通知使用 `guilds..reactionNotifications`: - `off`:无表情反应事件。 - `own`:机器人自己消息上的表情反应(默认)。 - `all`:所有消息上的所有表情反应。 - `allowlist`:来自 `guilds..users` 的用户在所有消息上的表情反应(空列表禁用)。 ### PluralKit(PK)支持 启用 PK 查找,以便代理消息解析到底层系统 + 成员。启用后,OpenClaw 使用成员身份进行允许列表匹配,并将发送者标记为 `Member (PK:System)` 以避免意外的 Discord 提及。 ```json5 { channels: { discord: { pluralkit: { enabled: true, token: "pk_live_...", // 可选;私有系统需要 }, }, }, } ``` 允许列表注意事项(启用 PK 时): - 在 `dm.allowFrom`、`guilds..users` 或每频道 `users` 中使用 `pk:`。 - 成员显示名称也按名称/slug 匹配。 - 查找使用**原始** Discord 消息 ID(代理前的消息),因此 PK API 只在其 30 分钟窗口内解析它。 - 如果 PK 查找失败(例如,没有令牌的私有系统),代理消息会被视为机器人消息并被丢弃,除非 `channels.discord.allowBots=true`。 ### 工具操作默认值 | 操作组 | 默认 | 说明 | | -------------- | ---- | ----------------------------------- | | reactions | 启用 | 表情反应 + 列出表情反应 + emojiList | | stickers | 启用 | 发送贴纸 | | emojiUploads | 启用 | 上传表情 | | stickerUploads | 启用 | 上传贴纸 | | polls | 启用 | 创建投票 | | permissions | 启用 | 频道权限快照 | | messages | 启用 | 读取/发送/编辑/删除 | | threads | 启用 | 创建/列出/回复 | | pins | 启用 | 置顶/取消置顶/列出 | | search | 启用 | 消息搜索(预览功能) | | memberInfo |
https://github.com/openclaw/openclaw/blob/main//docs/zh-CN/channels/discord.md
main
opebclaw
[ 0.0295094083994627, -0.058017946779727936, -0.03260280564427376, -0.05959387868642807, 0.01920192502439022, -0.03749509155750275, 0.02759101614356041, -0.029741378501057625, 0.04805217683315277, -0.0017860917141661048, 0.06755702197551727, -0.04405442625284195, 0.03486764430999756, 0.012581792660057545, 0.048980459570884705, -0.004338512197136879, -0.030610525980591774, -0.07366832345724106, -0.022679220885038376, -0.06832544505596161, -0.03325412794947624, 0.02768324501812458, -0.029674820601940155, 0.011982264928519726, 0.008792166598141193, -0.12864577770233154, -0.08472313731908798, 0.0303904227912426, -0.014777345582842827, -0.040010277181863785, 0.015313863754272461, 0.048065781593322754, -0.05749768391251564, 0.038564011454582214, 0.05673332139849663, 0.05404166504740715, -0.0249651949852705, -0.03522249683737755, 0.02227061800658703, 0.06731805205345154, 0.021035460755228996, -0.07043440639972687, -0.004256643354892731, -0.007837177254259586, -0.01757732406258583, 0.006315206177532673, -0.03210845962166786, -0.06506409496068954, -0.045431192964315414, 0.04310856759548187, -0.041012242436409, 0.025716710835695267, -0.029659118503332138, 0.07914796471595764, -0.037424780428409576, -0.0037638952489942312, -0.102981798350811, 0.08846916258335114, 0.0469050370156765, -0.0691562369465828, -0.021478313952684402, -0.04463714361190796, 0.03627094253897667, -0.024890340864658356, -0.12307514250278473, -0.013943749479949474, -0.06417002528905869, 0.005360870622098446, 0.0006920843152329326, 0.016484975814819336, -0.01605578511953354, 0.021299559623003006, -0.1429939568042755, -0.0014902062248438597, 0.01575935073196888, 0.022748861461877823, -0.024672141298651695, 0.03627169877290726, -0.08841051161289215, -0.11563297361135483, 0.00974359456449747, -0.024251000955700874, 0.02593321166932583, 0.027600623667240143, -0.04847932234406471, 0.06802896410226822, -0.07047642767429352, -0.026648754253983498, -0.02692384272813797, -0.03655897080898285, 0.045055586844682693, 0.028455965220928192, 0.030071144923567772, 0.072987399995327, 0.003450344316661358, 0.022336672991514206, -0.06706717610359192, 0.02168208360671997, -0.05155019462108612, 0.03760189563035965, 0.004154926631599665, 0.0012011498911306262, -0.06684750318527222, 0.012395945377647877, -0.011114848777651787, -0.06097136810421944, 0.048029351979494095, 0.06049007177352905, 0.06674648076295853, 0.02826319821178913, -0.09450335055589676, 0.006849100347608328, -0.0084944237023592, -0.04392779618501663, -0.007126441225409508, 0.053202878683805466, 0.022116919979453087, 0.042034074664115906, 0.010524807497859001, 0.027510162442922592, 0.08911269903182983, -0.06041231378912926, -0.06781882792711258, 0.001559038064442575, -0.05073951929807663, -0.04336079955101013, 0.12671129405498505, 4.192092953295559e-34, -0.04329122602939606, 0.01149505004286766, -0.07156364619731903, -0.005795305594801903, 0.035251352936029434, -0.019981812685728073, -0.035016175359487534, -0.01461807545274496, -0.07319331169128418, -0.003023593220859766, -0.04167523607611656, -0.006316227838397026, -0.03887631744146347, -0.029354959726333618, -0.050491321831941605, -0.0085417740046978, 0.04464174807071686, 0.03723016381263733, 0.055126458406448364, -0.05255648121237755, 0.000685033155605197, 0.019269300624728203, 0.016370443627238274, 0.03117811493575573, -0.005898499395698309, 0.038057345896959305, -0.03116024285554886, -0.021136600524187088, 0.010854831896722317, -0.005322211887687445, 0.004002539906650782, -0.04533451423048973, -0.0031906149815768003, 0.05721383914351463, 0.02370825596153736, 0.02016271837055683, -0.01013714075088501, -0.022606706246733665, -0.07087977230548859, -0.07026597112417221, -0.05859029293060303, -0.0509200282394886, -0.058150772005319595, -0.04335225746035576, -0.018700821325182915, 0.001676664687693119, -0.10713329166173935, -0.06467526406049728, 0.0293362308293581, -0.012370727024972439, -0.029430046677589417, 0.04755363240838051, -0.006766538601368666, -0.009493153542280197, 0.07020216435194016, -0.07730492204427719, -0.11369655281305313, 0.05578667297959328, 0.007095933426171541, -0.05971069633960724, 0.07317294180393219, -0.0034766506869345903, -0.0011559503618627787, -0.00008588563650846481, 0.07465469837188721, 0.020033668726682663, -0.03673809766769409, 0.016858277842402458, 0.021364647895097733, -0.11356732994318008, -0.07828222215175629, 0.029823876917362213, 0.05003027617931366, 0.038192734122276306, -0.07538178563117981, -0.11062755435705185, -0.038931332528591156, 0.018198702484369278, 0.09113786369562149, 0.012060307897627354, -0.03160202130675316, -0.09464404731988907, -0.10860203951597214, -0.048798173666000366, -0.010421577841043472, 0.040765922516584396, 0.04893455654382706, 0.017555927857756615, -0.02414204366505146, 0.062489043921232224, -0.09454698860645294, 0.05601976439356804, -0.00601151492446661, 0.09009641408920288, 0.0041276514530181885, -6.319943256124301e-33, -0.031479861587285995, 0.06623094528913498, -0.007632140535861254, -0.05908823385834694, 0.018059661611914635, 0.006791390012949705, 0.07262255251407623, -0.002680094912648201, 0.04293294623494148, 0.10614154487848282, 0.004115832503885031, -0.02363092079758644, -0.05086881294846535, -0.055559705942869186, -0.04707462340593338, 0.0031924687791615725, 0.008609719574451447, 0.013263902626931667, -0.06980914622545242, 0.011979256756603718, -0.08128266036510468, 0.0794302225112915, -0.13327328860759735, 0.08961207419633865, -0.020021483302116394, 0.034161847084760666, 0.06118404120206833, 0.013924834318459034, -0.05650525912642479, -0.04805475473403931, 0.08198201656341553, 0.01457204855978489, -0.0984446108341217, 0.05604567378759384, 0.011416728608310223, -0.0817713662981987, 0.01935368776321411, 0.12069833278656006, -0.055557772517204285, -0.05236154794692993, 0.1448187381029129, -0.01248671393841505, -0.07810527086257935, -0.021296346560120583, -0.021356919780373573, 0.021150652319192886, 0.06357325613498688, -0.020794088020920753, -0.06788713485002518, 0.0437137745320797, 0.06771889328956604, -0.06679962575435638, 0.1346811056137085, -0.040322788059711456, 0.045839980244636536, 0.11539964377880096, 0.059622105211019516, -0.021613098680973053, 0.02497422695159912, -0.14662563800811768, 0.03413793072104454, -0.05377376452088356, -0.04382386803627014, 0.04778990522027016, 0.08500266820192337, -0.020802902057766914, -0.03525717183947563, 0.10486984997987747, 0.06543582677841187, -0.04817872494459152, 0.009614026173949242, 0.015807876363396645, 0.004446542356163263, -0.029796743765473366, 0.058402951806783676, 0.011454160325229168, -0.03476256877183914, -0.022666430100798607, -0.05934261903166771, 0.04448743909597397, -0.0227463711053133, 0.02787066623568535, -0.012939317151904106, 0.06703467667102814, -0.004502006806433201, -0.0018940690206363797, 0.014864934608340263, 0.14053313434123993, -0.031129619106650352, -0.044489674270153046, 0.046898942440748215, -0.05230586975812912, 0.03896750137209892, 0.04731711745262146, -0.01968987099826336, -4.6748635185167586e-8, -0.04874343052506447, -0.07402946054935455, -0.050797101110219955, -0.02159200608730316, 0.04608023911714554, -0.02046358212828636, -0.0024750051088631153, -0.06723199784755707, -0.005860792938619852, -0.006639163475483656, -0.052547138184309006, 0.007371691986918449, -0.06267619878053665, -0.018361568450927734, -0.029645107686519623, -0.09355635195970535, -0.049657996743917465, 0.03279520571231842, 0.054343510419130325, -0.046493638306856155, -0.0017666650237515569, -0.046375572681427, 0.021551690995693207, -0.0021074831020087004, -0.03981287404894829, 0.01215018704533577, -0.012950610369443893, 0.016268065199255943, -0.08403501659631729, -0.007750280201435089, -0.0052363513968884945, -0.030751701444387436, 0.034590814262628555, -0.0673777163028717, -0.08502206951379776, 0.062404513359069824, 0.028362490236759186, -0.0396849699318409, -0.015023578889667988, -0.02793678268790245, 0.06166798993945122, -0.022703051567077637, 0.03885013237595558, -0.005680988077074289, 0.0008124926825985312, -0.004596482962369919, 0.03813723847270012, 0.01467119064182043, 0.09939096868038177, -0.028999924659729004, -0.03668016567826271, -0.022648850455880165, 0.05646027997136116, 0.01054275594651699, -0.0012070171069353819, -0.0440497100353241, 0.022516226395964622, 0.026231149211525917, -0.031122412532567978, -0.012949091382324696, 0.07735814899206161, 0.07933914661407471, 0.0023941155523061752, -0.022808104753494263 ]
0.067165
| 启用 | 上传贴纸 | | polls | 启用 | 创建投票 | | permissions | 启用 | 频道权限快照 | | messages | 启用 | 读取/发送/编辑/删除 | | threads | 启用 | 创建/列出/回复 | | pins | 启用 | 置顶/取消置顶/列出 | | search | 启用 | 消息搜索(预览功能) | | memberInfo | 启用 | 成员信息 | | roleInfo | 启用 | 角色列表 | | channelInfo | 启用 | 频道信息 + 列表 | | channels | 启用 | 频道/类别管理 | | voiceStatus | 启用 | 语音状态查询 | | events | 启用 | 列出/创建预定事件 | | roles | 禁用 | 角色添加/移除 | | moderation | 禁用 | 超时/踢出/封禁 | - `replyToMode`:`off`(默认)、`first` 或 `all`。仅在模型包含回复标签时适用。 ## 回复标签 要请求线程回复,模型可以在其输出中包含一个标签: - `[[reply_to_current]]` — 回复触发的 Discord 消息。 - `[[reply_to:]]` — 回复上下文/历史中的特定消息 ID。当前消息 ID 作为 `[message_id: …]` 附加到提示词;历史条目已包含 ID。 行为由 `channels.discord.replyToMode` 控制: - `off`:忽略标签。 - `first`:只有第一个出站块/附件是回复。 - `all`:每个出站块/附件都是回复。 允许列表匹配注意事项: - `allowFrom`/`users`/`groupChannels` 接受 ID、名称、标签或像 `<@id>` 这样的提及。 - 支持 `discord:`/`user:`(用户)和 `channel:`(群组私信)等前缀。 - 使用 `*` 允许任何发送者/频道。 - 当存在 `guilds..channels` 时,未列出的频道默认被拒绝。 - 当省略 `guilds..channels` 时,允许列表中服务器的所有频道都被允许。 - 要**不允许任何频道**,设置 `channels.discord.groupPolicy: "disabled"`(或保持空允许列表)。 - 配置向导接受 `Guild/Channel` 名称(公开 + 私有)并在可能时将其解析为 ID。 - 启动时,OpenClaw 将允许列表中的频道/用户名称解析为 ID(当机器人可以搜索成员时)并记录映射;未解析的条目保持原样。 原生命令注意事项: - 注册的命令镜像 OpenClaw 的聊天命令。 - 原生命令遵循与私信/服务器消息相同的允许列表(`channels.discord.dm.allowFrom`、`channels.discord.guilds`、每频道规则)。 - 斜杠命令可能在 Discord UI 中对未在允许列表中的用户仍然可见;OpenClaw 在执行时强制执行允许列表并回复"未授权"。 ## 工具操作 智能体可以使用以下操作调用 `discord`: - `react` / `reactions`(添加或列出表情反应) - `sticker`、`poll`、`permissions` - `readMessages`、`sendMessage`、`editMessage`、`deleteMessage` - 读取/搜索/置顶工具负载包含规范化的 `timestampMs`(UTC 纪元毫秒)和 `timestampUtc` 以及原始 Discord `timestamp`。 - `threadCreate`、`threadList`、`threadReply` - `pinMessage`、`unpinMessage`、`listPins` - `searchMessages`、`memberInfo`、`roleInfo`、`roleAdd`、`roleRemove`、`emojiList` - `channelInfo`、`channelList`、`voiceStatus`、`eventList`、`eventCreate` - `timeout`、`kick`、`ban` Discord 消息 ID 在注入的上下文中显示(`[discord message id: …]` 和历史行),以便智能体可以定位它们。 表情可以是 unicode(例如 `✅`)或自定义表情语法如 `<:party_blob:1234567890>`。 ## 安全与运维 - 像对待密码一样对待机器人令牌;在受监督的主机上优先使用 `DISCORD_BOT_TOKEN` 环境变量,或锁定配置文件权限。 - 只授予机器人所需的权限(通常是读取/发送消息)。 - 如果机器人卡住或受到速率限制,在确认没有其他进程拥有 Discord 会话后重启 Gateway 网关(`openclaw gateway --force`)。 ````
https://github.com/openclaw/openclaw/blob/main//docs/zh-CN/channels/discord.md
main
opebclaw
[ -0.01571943797171116, -0.08739003539085388, -0.0436166450381279, -0.05705593526363373, 0.013894332572817802, 0.01554531417787075, 0.040900953114032745, -0.048219215124845505, 0.02857705019414425, -0.003271033288910985, 0.08948291838169098, -0.02191472239792347, 0.06601777672767639, -0.04840046912431717, 0.026988066732883453, -0.009001613594591618, -0.001580529846251011, 0.010187149979174137, -0.012987902387976646, -0.11525285989046097, -0.02549067698419094, -0.0005257034208625555, 0.0323929525911808, 0.009760107845067978, 0.046140629798173904, -0.03657441958785057, -0.08511588722467422, 0.04160323739051819, -0.01123879011720419, -0.055872298777103424, -0.03838790953159332, 0.10038614273071289, 0.027347784489393234, 0.048136889934539795, -0.0014414285542443395, 0.07520655542612076, 0.061397671699523926, -0.02677796222269535, -0.01642693765461445, -0.022222431376576424, -0.05735619738698006, -0.03338712826371193, -0.07971276342868805, -0.01798693649470806, 0.00472157122567296, -0.01357236411422491, -0.09037696570158005, -0.01898258551955223, -0.09041514247655869, 0.02333393134176731, -0.04046108201146126, 0.010286656208336353, 0.04769432917237282, 0.10277840495109558, 0.08001024276018143, 0.039456188678741455, -0.023728258907794952, 0.006285645999014378, -0.011401518248021603, -0.020563598722219467, -0.01057451032102108, 0.01107114553451538, -0.06272458285093307, 0.010510566644370556, -0.10843148082494736, 0.057467732578516006, -0.07812032848596573, 0.031908340752124786, -0.007200461812317371, -0.02026215009391308, -0.11354954540729523, -0.03411853685975075, -0.03734422102570534, 0.02792569249868393, -0.013781269080936909, -0.029441602528095245, 0.004583773203194141, -0.0037503386847674847, -0.1034800112247467, -0.1167512983083725, -0.022244498133659363, 0.02052578516304493, 0.03360328823328018, 0.036885831505060196, -0.07214746624231339, 0.06792724877595901, -0.06148570775985718, -0.024560779333114624, 0.06056094169616699, 0.014492211863398552, -0.04340586066246033, 0.021563734859228134, 0.0768468901515007, 0.025184018537402153, 0.01949690282344818, -0.02585795894265175, 0.006420143414288759, 0.03445493429899216, 0.0016343939350917935, 0.049236446619033813, 0.00008140556019498035, -0.008732598274946213, -0.05324697121977806, -0.08714786916971207, -0.0723591074347496, -0.03295212984085083, -0.03691139817237854, 0.030098656192421913, -0.0333806648850441, 0.01933521218597889, -0.06029387190937996, -0.0043000709265470505, -0.043667372316122055, -0.1104583889245987, 0.00339216529391706, -0.007572294678539038, -0.028388096019625664, 0.043023910373449326, 0.022571049630641937, 0.05294080823659897, 0.08428186178207397, 0.006447285879403353, -0.08243575692176819, -0.016587205231189728, -0.036672770977020264, 0.006077254191040993, 0.06447449326515198, -3.2068062617347875e-33, 0.0647016167640686, 0.043027363717556, -0.0827084630727768, 0.011948882602155209, 0.06718581914901733, 0.01555971521884203, -0.020352138206362724, 0.0034538162872195244, -0.002552035031840205, 0.0022854169365018606, 0.021139904856681824, 0.04871182516217232, -0.07885536551475525, -0.025836430490016937, 0.020881744101643562, -0.02683994360268116, -0.00410839356482029, 0.03599575534462929, 0.0356813482940197, -0.014000152237713337, 0.010191698558628559, 0.05990022048354149, -0.005369221791625023, 0.048577941954135895, 0.11956004798412323, 0.035980187356472015, -0.0047528850845992565, -0.046481430530548096, 0.00471665570512414, 0.0400274358689785, 0.03824695944786072, -0.04532574117183685, -0.017098981887102127, -0.028547191992402077, -0.060871392488479614, 0.002306555863469839, -0.06151067093014717, -0.03580084070563316, -0.05131494998931885, -0.051512863487005234, -0.07770943641662598, -0.05453807860612869, -0.09287291765213013, 0.009969043545424938, -0.04400822892785072, -0.033216413110494614, -0.08651046454906464, -0.0851413905620575, 0.13355085253715515, -0.0401676781475544, 0.012206454761326313, 0.009817837737500668, -0.007626386824995279, -0.003729354590177536, 0.032358113676309586, -0.0844888910651207, -0.06554574519395828, 0.04193539172410965, 0.004613528959453106, -0.03549784794449806, 0.03111899085342884, 0.03329022601246834, 0.034511253237724304, 0.037731803953647614, 0.03593548387289047, -0.02556086890399456, -0.01611633598804474, -0.03132094815373421, 0.03318299725651741, -0.06791691482067108, -0.11789734661579132, 0.022564994171261787, 0.04446912929415703, 0.07812371850013733, -0.110409677028656, -0.08171630650758743, -0.10076036304235458, -0.004460390657186508, 0.05893085151910782, 0.0346791036427021, -0.060348380357027054, -0.05702066794037819, -0.07256067544221878, -0.011673915199935436, 0.05988755449652672, 0.022589650005102158, 0.06545228511095047, -0.04667884483933449, -0.06328720599412918, 0.048903897404670715, -0.13942429423332214, 0.04020901396870613, 0.002723223064094782, -0.015468972735106945, -0.04567790403962135, -3.177009316651366e-33, 0.0012647954281419516, -0.011724697425961494, -0.005622032098472118, -0.012271705083549023, -0.04302902892231941, -0.04389326274394989, 0.02127142995595932, 0.05914011970162392, 0.03451446071267128, 0.074870765209198, -0.08932055532932281, -0.007462587207555771, -0.005558251868933439, -0.026269109919667244, -0.0038209343329072, 0.02274707704782486, -0.03151024132966995, 0.002221538918092847, -0.02813626639544964, 0.07919580489397049, -0.02710449881851673, -0.001493335934355855, -0.11164659261703491, 0.09956718981266022, -0.027187509462237358, -0.005513276904821396, 0.05518392100930214, -0.0003559296892490238, -0.0063046845607459545, -0.02245287038385868, 0.0396871492266655, -0.04582648724317551, -0.08762737363576889, 0.07196878641843796, -0.033542733639478683, -0.03931763395667076, -0.021982867270708084, 0.0717487633228302, -0.06179855018854141, 0.009297509677708149, 0.09683813154697418, -0.0019234284991398454, -0.04990212246775627, -0.031579576432704926, -0.11642691493034363, -0.018177062273025513, 0.022144047543406487, -0.09812423586845398, -0.11534859240055084, -0.034856490790843964, 0.07533884048461914, -0.028853876516222954, 0.055146366357803345, -0.029594216495752335, 0.0323970727622509, 0.06812327355146408, 0.047090571373701096, -0.1230669915676117, -0.007650020532310009, -0.08688327670097351, 0.050195418298244476, -0.03912344202399254, 0.01774141751229763, 0.05962665379047394, 0.06297847628593445, -0.044165510684251785, -0.0025961589999496937, 0.056025125086307526, 0.015381588600575924, -0.010468311607837677, 0.06281810253858566, -0.011506610549986362, -0.002838314976543188, 0.01565784215927124, 0.021416056901216507, 0.01565973274409771, -0.05707070231437683, 0.012740198522806168, -0.07385896891355515, 0.037564583122730255, -0.04976167902350426, 0.021899957209825516, -0.02149822749197483, 0.10242827236652374, -0.016343165189027786, -0.008344567380845547, 0.020434796810150146, 0.09592533111572266, 0.026742998510599136, -0.04716069623827934, 0.04674322530627251, 0.008897766470909119, -0.00867551565170288, 0.049767397344112396, 0.02230222336947918, -4.227175409710071e-8, -0.09378597140312195, -0.1142803207039833, -0.015060986392199993, 0.006570102646946907, 0.08404773473739624, 0.007751295808702707, -0.020434316247701645, -0.0468527153134346, -0.0006204394740052521, -0.02786681428551674, -0.03080352582037449, -0.017582504078745842, -0.09519509971141815, -0.06667758524417877, 0.052747879177331924, -0.06740312278270721, -0.02569051831960678, 0.08398852497339249, 0.016253331676125526, -0.025667335838079453, -0.000424267869675532, 0.07251125574111938, 0.042964447289705276, -0.05945436283946037, -0.030630843713879585, 0.03388701006770134, -0.07870563864707947, 0.019986940547823906, -0.028103085234761238, -0.03577816113829613, 0.04750946909189224, -0.041749779134988785, 0.026928501203656197, -0.09736166894435883, -0.014249241910874844, 0.07494144141674042, -0.033918607980012894, -0.07006826251745224, -0.017264684662222862, 0.010508849285542965, 0.06466467678546906, -0.02473568730056286, 0.009847749955952168, 0.08965115249156952, 0.03565072640776634, -0.0356237031519413, -0.019195763394236565, 0.010733191855251789, 0.08875411748886108, -0.12130317836999893, -0.036272987723350525, -0.036984145641326904, 0.041220713406801224, 0.0101441890001297, 0.002240314381197095, 0.03618426248431206, 0.05281443893909454, 0.01723373495042324, 0.051608845591545105, 0.013675259426236153, 0.025743165984749794, 0.10253030061721802, -0.01847819611430168, 0.03368726372718811 ]
0.116118
# LINE(插件) LINE 通过 LINE Messaging API 连接到 OpenClaw。该插件作为 webhook 接收器在 Gateway 网关上运行,使用你的 channel access token + channel secret 进行身份验证。 状态:通过插件支持。支持私信、群聊、媒体、位置、Flex 消息、模板消息和快捷回复。不支持表情回应和话题回复。 ## 需要安装插件 安装 LINE 插件: ```bash openclaw plugins install @openclaw/line ``` 本地检出(从 git 仓库运行时): ```bash openclaw plugins install ./extensions/line ``` ## 配置步骤 1. 创建 LINE Developers 账户并打开控制台: https://developers.line.biz/console/ 2. 创建(或选择)一个 Provider 并添加 \*\*Messaging API\*\* 渠道。 3. 从渠道设置中复制 \*\*Channel access token\*\* 和 \*\*Channel secret\*\*。 4. 在 Messaging API 设置中启用 \*\*Use webhook\*\*。 5. 将 webhook URL 设置为你的 Gateway 网关端点(必须使用 HTTPS): ``` https://gateway-host/line/webhook ``` Gateway 网关会响应 LINE 的 webhook 验证(GET)和入站事件(POST)。如果你需要自定义路径,请设置 `channels.line.webhookPath` 或 `channels.line.accounts..webhookPath` 并相应更新 URL。 ## 配置 最小配置: ```json5 { channels: { line: { enabled: true, channelAccessToken: "LINE\_CHANNEL\_ACCESS\_TOKEN", channelSecret: "LINE\_CHANNEL\_SECRET", dmPolicy: "pairing", }, }, } ``` 环境变量(仅限默认账户): - `LINE\_CHANNEL\_ACCESS\_TOKEN` - `LINE\_CHANNEL\_SECRET` Token/secret 文件: ```json5 { channels: { line: { tokenFile: "/path/to/line-token.txt", secretFile: "/path/to/line-secret.txt", }, }, } ``` 多账户配置: ```json5 { channels: { line: { accounts: { marketing: { channelAccessToken: "...", channelSecret: "...", webhookPath: "/line/marketing", }, }, }, }, } ``` ## 访问控制 私信默认使用配对模式。未知发送者会收到配对码,其消息在获得批准前会被忽略。 ```bash openclaw pairing list line openclaw pairing approve line ```` ``` 允许列表和策略: - `channels.line.dmPolicy`:`pairing | allowlist | open | disabled` - `channels.line.allowFrom`:私信的允许列表 LINE 用户 ID - `channels.line.groupPolicy`:`allowlist | open | disabled` - `channels.line.groupAllowFrom`:群组的允许列表 LINE 用户 ID - 单群组覆盖:`channels.line.groups..allowFrom` LINE ID 区分大小写。有效 ID 格式如下: - 用户:`U` + 32 位十六进制字符 - 群组:`C` + 32 位十六进制字符 - 房间:`R` + 32 位十六进制字符 ## 消息行为 - 文本按 5000 字符分块。 - Markdown 格式会被移除;代码块和表格会尽可能转换为 Flex 卡片。 - 流式响应会被缓冲;智能体处理时,LINE 会收到完整分块并显示加载动画。 - 媒体下载受 `channels.line.mediaMaxMb` 限制(默认 10)。 ## 渠道数据(富消息) 使用 `channelData.line` 发送快捷回复、位置、Flex 卡片或模板消息。 ```json5 { text: "Here you go", channelData: { line: { quickReplies: ["Status", "Help"], location: { title: "Office", address: "123 Main St", latitude: 35.681236, longitude: 139.767125, }, flexMessage: { altText: "Status card", contents: { /* Flex payload */ }, }, templateMessage: { type: "confirm", text: "Proceed?", confirmLabel: "Yes", confirmData: "yes", cancelLabel: "No", cancelData: "no", }, }, }, } ``` LINE 插件还提供 `/card` 命令用于 Flex 消息预设: ``` /card info "Welcome" "Thanks for joining!" ``` ## 故障排除 - **Webhook 验证失败:** 确保 webhook URL 使用 HTTPS 且 `channelSecret` 与 LINE 控制台中的一致。 - **没有入站事件:** 确认 webhook 路径与 `channels.line.webhookPath` 匹配,且 Gateway 网关可从 LINE 访问。 - **媒体下载错误:** 如果媒体超过默认限制,请提高 `channels.line.mediaMaxMb`。 ````
https://github.com/openclaw/openclaw/blob/main//docs/zh-CN/channels/line.md
main
opebclaw
[ -0.03162166103720665, 0.027690889313817024, -0.09844566136598587, -0.02765166573226452, 0.008778013288974762, -0.10713256150484085, 0.016487272456288338, 0.03976190835237503, 0.03937740996479988, -0.025078264996409416, 0.07160620391368866, -0.07920105755329132, 0.03795301541686058, -0.0402749739587307, 0.12384253740310669, 0.12027810513973236, -0.04927936941385269, -0.006290763150900602, -0.02442663349211216, -0.043884363025426865, -0.005802907980978489, 0.0639118030667305, -0.001721157575957477, -0.01361501682549715, -0.021073538810014725, -0.045300740748643875, -0.04205889254808426, 0.02621183544397354, -0.04209905490279198, -0.014452486298978329, 0.0056501454673707485, 0.060355160385370255, -0.03273545205593109, 0.017380952835083008, 0.0957016572356224, 0.12068849802017212, 0.06934280693531036, -0.048187922686338425, -0.061192676424980164, 0.013840987347066402, 0.02643059752881527, -0.02101656049489975, -0.040017202496528625, -0.10261039435863495, -0.03612488880753517, -0.07066021114587784, -0.031982697546482086, -0.08739808946847916, -0.051943425089120865, -0.015566137619316578, -0.07888520509004593, -0.06499265134334564, -0.012539699673652649, -0.014553114771842957, -0.00003856370676658116, -0.045109931379556656, -0.08441964536905289, 0.035626526921987534, 0.06955919414758682, -0.010482018813490868, 0.028173161670565605, 0.018983269110322, -0.003733207704499364, 0.014933292753994465, -0.14199742674827576, -0.020808201283216476, -0.0733860433101654, -0.003705774201080203, 0.007466190028935671, -0.03741789609193802, -0.06640084832906723, -0.0005962637951597571, -0.09049410372972488, -0.04132634401321411, -0.0210168045014143, 0.004590681288391352, 0.037921302020549774, 0.04853183776140213, -0.05585873872041702, -0.11677166819572449, -0.03185151889920235, -0.0013272601645439863, -0.004188613034784794, 0.07393892854452133, -0.04568927735090256, 0.1766452044248581, -0.057106975466012955, 0.00922869797796011, 0.05752084404230118, 0.020065225660800934, -0.0028072225395590067, -0.061304591596126556, 0.010190540924668312, 0.019265562295913696, 0.02002163603901863, -0.04558330401778221, -0.011831630952656269, -0.008031967096030712, -0.10634442418813705, 0.08872900158166885, -0.016418633982539177, -0.012420598417520523, 0.014456753619015217, 0.04848781228065491, -0.03482864797115326, 0.013128743506968021, 0.018053390085697174, 0.08025337755680084, 0.05836818739771843, 0.016118286177515984, -0.0029163232538849115, -0.06021466851234436, 0.014689316973090172, -0.09895258396863937, -0.051520317792892456, 0.09340140968561172, -0.049776140600442886, -0.04166918247938156, 0.03379986807703972, 0.08160025626420975, 0.08465959876775742, -0.004935293458402157, -0.08242931216955185, -0.0032685657497495413, -0.00221310555934906, 0.0284062959253788, 0.17838017642498016, 4.9398261955505624e-33, -0.002787677338346839, -0.013092685490846634, -0.015493685379624367, -0.001051220460794866, 0.1179642528295517, -0.014901855029165745, 0.02898642234504223, -0.009448891505599022, -0.07826942205429077, 0.030343394726514816, 0.001607000594958663, -0.013936548493802547, -0.0711689367890358, 0.029508860781788826, 0.0014975491212680936, -0.07126086205244064, -0.01657485030591488, -0.024458471685647964, 0.06277014315128326, -0.034380052238702774, -0.031528323888778687, -0.02083318494260311, -0.01275179348886013, -0.004426280967891216, 0.0010176085634157062, 0.019729478284716606, 0.006295118015259504, -0.014601077884435654, 0.01493342500180006, 0.04578518122434616, 0.07776372879743576, -0.0544043593108654, -0.019630644470453262, 0.0492057241499424, -0.07216872274875641, -0.014251970686018467, -0.07025066018104553, -0.03562600538134575, -0.058516375720500946, -0.018899140879511833, -0.007869526743888855, -0.04459880664944649, -0.08281128108501434, -0.016470201313495636, 0.05374778434634209, -0.0325666107237339, -0.12267068773508072, -0.005267576314508915, 0.0648941770195961, -0.020244186744093895, -0.05785748362541199, 0.06595273315906525, -0.0008699297904968262, 0.009388845413923264, 0.05089178681373596, -0.06978694349527359, -0.10535316914319992, -0.026788443326950073, -0.06401649117469788, -0.03582565113902092, -0.032993316650390625, 0.021657083183526993, 0.018546205013990402, 0.0034087547101080418, 0.06541074812412262, -0.006515930872410536, 0.01793612353503704, 0.03260522335767746, -0.014867096208035946, -0.050760556012392044, -0.08147623389959335, -0.009253937751054764, 0.059713296592235565, 0.06493772566318512, -0.09861066192388535, -0.04071900248527527, -0.004000316374003887, 0.027017373591661453, 0.10681217908859253, -0.012036362662911415, 0.026306629180908203, -0.06062185764312744, -0.03639274090528488, 0.010347374714910984, 0.015364802442491055, 0.049784913659095764, 0.059778645634651184, -0.01875465363264084, -0.01928044855594635, 0.0794990137219429, -0.08448296040296555, 0.026649510487914085, -0.039274707436561584, -0.002632302697747946, -0.02425631508231163, -9.758291415586355e-33, -0.020691828802227974, 0.05470315366983414, -0.0447223000228405, -0.04419755935668945, -0.01110251247882843, -0.03801483288407326, 0.012629142962396145, -0.05766857787966728, 0.03658817708492279, 0.05568769946694374, -0.043940864503383636, 0.07721159607172012, 0.005630214232951403, -0.018125614151358604, 0.06531377881765366, 0.00540445139631629, -0.039854053407907486, -0.05077502503991127, -0.010735335759818554, 0.041556522250175476, -0.04890460893511772, 0.03465944528579712, -0.07043679058551788, 0.024440784007310867, -0.0006956002325750887, 0.0004501782823354006, 0.07244732230901718, 0.036710191518068314, -0.01929696835577488, -0.035865552723407745, 0.02161371521651745, 0.056671105325222015, -0.04100053757429123, 0.09425949305295944, 0.014749301597476006, -0.04866576939821243, 0.030677376314997673, 0.07222989201545715, -0.0029987897723913193, -0.06871841847896576, 0.06779826432466507, -0.049560703337192535, -0.0692293718457222, -0.06981131434440613, -0.0470769964158535, 0.045601729303598404, 0.00860670767724514, -0.056395597755908966, -0.11991625279188156, -0.03047308512032032, 0.022742396220564842, 0.013694670051336288, 0.02782132290303707, -0.00003103712515439838, 0.0032507977448403835, 0.0611533597111702, 0.0607932023704052, -0.019665997475385666, -0.05732526630163193, -0.14747266471385956, 0.024366118013858795, -0.04266275465488434, -0.009937062859535217, 0.06790880858898163, 0.014231790788471699, -0.04333886504173279, -0.02288076840341091, 0.027240600436925888, -0.04875294491648674, -0.09672358632087708, -0.014365981332957745, -0.0037617699708789587, 0.004459164571017027, -0.0624140202999115, 0.004083347041159868, 0.02991831675171852, -0.007442464120686054, -0.006056568119674921, -0.04892111197113991, 0.07053422927856445, 0.004681379068642855, 0.0020876696798950434, 0.05109997093677521, 0.03168981894850731, -0.02862202748656273, -0.04979697987437248, -0.003392075886949897, 0.11555159837007523, 0.02792568877339363, 0.013620056211948395, -0.02911350131034851, 0.07569417357444763, -0.03855140507221222, 0.06278780102729797, 0.014853790402412415, -5.7558853683303823e-8, -0.05658175051212311, -0.13852371275424957, -0.09809211641550064, -0.010309289209544659, 0.026454374194145203, -0.026090804487466812, -0.01326050329953432, -0.019982030615210533, -0.06356092542409897, -0.021488865837454796, 0.03871497884392738, 0.06324321031570435, -0.06691984832286835, 0.012691589072346687, -0.0718298926949501, 0.0009200035710819066, -0.060202259570360184, -0.003622894873842597, 0.04550269618630409, -0.0790894478559494, -0.004824172239750624, 0.033203091472387314, 0.08473392575979233, -0.03449808433651924, -0.07182351499795914, -0.018342921510338783, -0.05801507830619812, 0.014845899306237698, -0.07256773114204407, -0.028819561004638672, 0.04829300940036774, -0.02741333469748497, 0.04596629738807678, -0.05468866229057312, 0.012758228927850723, 0.007728405762463808, 0.028238320723176003, -0.04671914875507355, -0.0169232115149498, 0.002292273100465536, 0.06110731512308121, -0.022644562646746635, 0.04062267020344734, -0.027241667732596397, -0.00937566626816988, -0.0011651369277387857, 0.036641284823417664, 0.01083492860198021, 0.09174513071775436, -0.03666665405035019, -0.05137917771935463, 0.00918881967663765, 0.018595438450574875, 0.003326504258438945, -0.015497421845793724, 0.05801355093717575, -0.01911788247525692, -0.027554413303732872, -0.03236131742596626, 0.05678850784897804, -0.024907728657126427, 0.054578568786382675, 0.07600777596235275, 0.010180272161960602 ]
0.080262
# SOUL Evil Hook The SOUL Evil hook swaps the \*\*injected\*\* `SOUL.md` content with `SOUL\_EVIL.md` during a purge window or by random chance. It does \*\*not\*\* modify files on disk. ## How It Works When `agent:bootstrap` runs, the hook can replace the `SOUL.md` content in memory before the system prompt is assembled. If `SOUL\_EVIL.md` is missing or empty, OpenClaw logs a warning and keeps the normal `SOUL.md`. Sub-agent runs do \*\*not\*\* include `SOUL.md` in their bootstrap files, so this hook has no effect on sub-agents. ## Enable ```bash openclaw hooks enable soul-evil ``` Then set the config: ```json { "hooks": { "internal": { "enabled": true, "entries": { "soul-evil": { "enabled": true, "file": "SOUL\_EVIL.md", "chance": 0.1, "purge": { "at": "21:00", "duration": "15m" } } } } } } ``` Create `SOUL\_EVIL.md` in the agent workspace root (next to `SOUL.md`). ## Options - `file` (string): alternate SOUL filename (default: `SOUL\_EVIL.md`) - `chance` (number 0–1): random chance per run to use `SOUL\_EVIL.md` - `purge.at` (HH:mm): daily purge start (24-hour clock) - `purge.duration` (duration): window length (e.g. `30s`, `10m`, `1h`) \*\*Precedence:\*\* purge window wins over chance. \*\*Timezone:\*\* uses `agents.defaults.userTimezone` when set; otherwise host timezone. ## Notes - No files are written or modified on disk. - If `SOUL.md` is not in the bootstrap list, the hook does nothing. ## See Also - [Hooks](/hooks)
https://github.com/openclaw/openclaw/blob/main//docs/hooks/soul-evil.md
main
opebclaw
[ -0.008070236071944237, 0.05934062972664833, -0.029176494106650352, 0.009857303462922573, 0.03763270750641823, -0.06521410495042801, -0.028088903054594994, -0.05518777668476105, 0.05023223161697388, -0.0369686521589756, 0.011601785197854042, 0.0619814395904541, 0.02361576445400715, -0.008091386407613754, 0.03712662309408188, 0.09181937575340271, -0.011985468678176403, 0.020348576828837395, -0.03350600600242615, 0.06286358088254929, -0.04057522118091583, 0.060305360704660416, 0.01969359628856182, -0.02191893383860588, -0.08355391770601273, 0.004854929633438587, -0.04308561608195305, 0.022198230028152466, -0.000828434422146529, -0.05268239974975586, 0.030898289754986763, 0.06816545873880386, -0.03225495666265488, -0.05256209895014763, 0.06442296504974365, 0.10285471379756927, -0.06258238106966019, -0.011179792694747448, -0.05980583280324936, 0.02664921060204506, 0.0551944263279438, 0.0370468907058239, -0.10293091088533401, -0.009974408894777298, -0.1066434383392334, -0.10507619380950928, -0.04703902453184128, -0.10526949912309647, -0.032733358442783356, -0.004807819612324238, -0.022984782233834267, -0.023596836254000664, 0.008393587544560432, 0.05671904981136322, -0.09219557791948318, -0.027738934382796288, -0.021412348374724388, 0.03590031713247299, -0.019450906664133072, -0.042860254645347595, 0.05498592182993889, 0.05677010118961334, -0.036578454077243805, 0.023165348917245865, -0.0006843765149824321, 0.0002443581761326641, -0.006823510862886906, -0.09136953204870224, -0.049759551882743835, -0.011400867253541946, -0.034580402076244354, -0.05113501846790314, 0.010339629836380482, -0.026346255093812943, -0.008810684084892273, 0.034111734479665756, 0.05016087368130684, 0.0014438142534345388, 0.01845330186188221, -0.05930866673588753, -0.033527277410030365, -0.017540358006954193, 0.010477319359779358, -0.012219046242535114, -0.0032368956599384546, 0.13904821872711182, -0.019936062395572662, -0.01694626361131668, 0.0022018682211637497, 0.010192968882620335, -0.013501995243132114, -0.09285566210746765, 0.062322016805410385, 0.015462173148989677, -0.010784653015434742, 0.029346846044063568, -0.017370076850056648, 0.06125350296497345, -0.022271020337939262, 0.1259814202785492, -0.06947525590658188, 0.025452716276049614, 0.009137933142483234, 0.03774838522076607, 0.027302581816911697, -0.0007666973979212344, 0.05715154856443405, 0.03165047988295555, -0.06767672300338745, -0.04998306930065155, 0.04829675331711769, -0.008379453793168068, 0.12422963976860046, -0.03336842358112335, 0.03911485895514488, 0.08505713939666748, 0.007507041096687317, 0.04331887140870094, -0.06656524538993835, 0.033371590077877045, 0.14887601137161255, -0.05920064449310303, 0.0927116647362709, 0.059589434415102005, 0.07822904735803604, 0.04544111341238022, -0.049397606402635574, 2.2781060315126777e-33, 0.047411926090717316, -0.040109775960445404, 0.06614314019680023, 0.026701103895902634, 0.04025619849562645, -0.04587727412581444, -0.021959908306598663, 0.007088754326105118, -0.033160775899887085, 0.14258871972560883, 0.012497428804636002, 0.02549014240503311, 0.0007468256517313421, -0.002720552496612072, -0.04397173225879669, -0.020939810201525688, -0.02477896399796009, -0.003920583054423332, 0.05974828824400902, -0.03883542865514755, -0.015543295070528984, 0.03635958209633827, -0.028692010790109634, -0.003149899188429117, -0.052440281957387924, 0.10159056633710861, -0.060232628136873245, -0.008303144946694374, 0.054671335965394974, 0.0021149294916540384, 0.04297950118780136, 0.049947649240493774, 0.03402867168188095, 0.03978952392935753, -0.06306201219558716, -0.014443260617554188, -0.04771054536104202, -0.03784817457199097, -0.04714023694396019, -0.05067006126046181, 0.08696284145116806, 0.06311608850955963, 0.02380085550248623, -0.07392854243516922, 0.015482188202440739, -0.11974773555994034, -0.04087957739830017, 0.01396049465984106, 0.023743394762277603, 0.030698714777827263, 0.041071996092796326, 0.07070551067590714, 0.11172635853290558, 0.08680345118045807, -0.017292270436882973, -0.002376762917265296, -0.01820690743625164, -0.03787830099463463, 0.051491864025592804, 0.051079608500003815, -0.021825017407536507, -0.019779164344072342, 0.04692791402339935, -0.008572770282626152, 0.022076871246099472, -0.018900927156209946, 0.048576802015304565, 0.05271541327238083, -0.021960988640785217, 0.02359253540635109, -0.05045748129487038, 0.011648674495518208, -0.04853595793247223, 0.041503697633743286, -0.07265686988830566, -0.07829733937978745, 0.023564020171761513, -0.03322756662964821, 0.03223215788602829, -0.03815213218331337, 0.025944851338863373, -0.05752769112586975, -0.03734395280480385, 0.0368642695248127, -0.0022917226888239384, -0.02359885722398758, 0.0006348044844344258, -0.16305358707904816, 0.03058564104139805, 0.06286243349313736, -0.03406619280576706, 0.0043474952690303326, -0.05366808921098709, -0.025015264749526978, -0.0143805630505085, -3.6454724681288486e-33, 0.10827169567346573, -0.0428437739610672, -0.06516660004854202, 0.020287683233618736, -0.023697881028056145, -0.05247040092945099, 0.015305849723517895, -0.041909463703632355, 0.01716110296547413, -0.0002277848107041791, 0.013105294667184353, 0.0895872488617897, 0.02334069088101387, 0.0029443008825182915, 0.025787224993109703, 0.0007514292956329882, -0.010770647786557674, -0.08164515346288681, -0.02505071647465229, 0.011058290489017963, 0.021921291947364807, 0.08820591866970062, 0.0181768536567688, 0.003557139076292515, 0.02028517611324787, -0.006787215359508991, 0.0444876030087471, 0.08157429099082947, -0.03805636987090111, -0.03675190731883049, 0.0398438423871994, 0.0902884379029274, -0.09037600457668304, -0.00460038473829627, -0.0025535039603710175, -0.004077782854437828, -0.05036809667944908, 0.06720293313264847, -0.008918753825128078, -0.03648550808429718, 0.06205699220299721, 0.014458348974585533, -0.05059710890054703, -0.014213725924491882, -0.02513362281024456, -0.0002890242321882397, -0.008264884352684021, -0.0013041970087215304, 0.029549697414040565, -0.010029398836195469, -0.029421361163258553, -0.037760596722364426, 0.03663830831646919, 0.022580591961741447, -0.0030870619229972363, 0.019494710490107536, -0.0037824681494385004, -0.06981214135885239, 0.009565921500325203, 0.015742110088467598, 0.031873878091573715, 0.013264460489153862, -0.08208463340997696, -0.035086654126644135, -0.02744399942457676, -0.019054889678955078, -0.0140764145180583, 0.012387006543576717, 0.02793525904417038, -0.048128195106983185, -0.008354523219168186, -0.0557633675634861, -0.012593617662787437, -0.022513465955853462, 0.019111186265945435, 0.018107620999217033, 0.038010336458683014, -0.1356133371591568, 0.04456966742873192, -0.03634451702237129, -0.07143044471740723, -0.03780313581228256, -0.03969797119498253, 0.0069907610304653645, -0.056644096970558167, 0.03712432458996773, -0.08704005181789398, 0.11740072071552277, 0.003922820556908846, 0.018841072916984558, -0.07093372941017151, 0.02236824855208397, 0.04516036435961723, -0.058677226305007935, -0.056162457913160324, -4.793999508478919e-8, -0.04580657556653023, -0.005368930287659168, 0.030643144622445107, 0.05290374532341957, 0.017837723717093468, -0.04649601876735687, 0.011993951164186, 0.01740664802491665, -0.07641419023275375, 0.02280815690755844, 0.12707851827144623, 0.08034178614616394, -0.0009510139352642, -0.01796473190188408, -0.047824177891016006, 0.058163367211818695, -0.05518823117017746, 0.06777950376272202, -0.06500347703695297, -0.1423439234495163, -0.07420889288187027, 0.06566677987575531, 0.09132400155067444, 0.02025613561272621, -0.01059071533381939, -0.04596899822354317, -0.03096003271639347, -0.02699776366353035, -0.039817601442337036, 0.08436611294746399, 0.03590916097164154, 0.03274979069828987, 0.0696224793791771, 0.011343609541654587, -0.07028345763683319, 0.04198281839489937, 0.013951550237834454, 0.010332631878554821, 0.01912207342684269, -0.0661085695028305, 0.03624425455927849, 0.04262586310505867, -0.07846111804246902, -0.07049545645713806, -0.11250894516706467, -0.057976819574832916, -0.0007651824853383005, 0.07650313526391983, 0.03204524144530296, -0.042676977813243866, -0.014902940019965172, 0.059040796011686325, -0.05218753218650818, 0.02903059870004654, 0.07736460864543915, -0.054807815700769424, 0.08973074704408646, 0.04738603159785271, 0.045141614973545074, 0.020740346983075142, -0.003314705565571785, -0.1012609601020813, 0.04082585498690605, -0.13537608087062836 ]
0.077553
# Agent Runtime 🤖 OpenClaw runs a single embedded agent runtime derived from \*\*pi-mono\*\*. ## Workspace (required) OpenClaw uses a single agent workspace directory (`agents.defaults.workspace`) as the agent’s \*\*only\*\* working directory (`cwd`) for tools and context. Recommended: use `openclaw setup` to create `~/.openclaw/openclaw.json` if missing and initialize the workspace files. Full workspace layout + backup guide: [Agent workspace](/concepts/agent-workspace) If `agents.defaults.sandbox` is enabled, non-main sessions can override this with per-session workspaces under `agents.defaults.sandbox.workspaceRoot` (see [Gateway configuration](/gateway/configuration)). ## Bootstrap files (injected) Inside `agents.defaults.workspace`, OpenClaw expects these user-editable files: - `AGENTS.md` — operating instructions + “memory” - `SOUL.md` — persona, boundaries, tone - `TOOLS.md` — user-maintained tool notes (e.g. `imsg`, `sag`, conventions) - `BOOTSTRAP.md` — one-time first-run ritual (deleted after completion) - `IDENTITY.md` — agent name/vibe/emoji - `USER.md` — user profile + preferred address On the first turn of a new session, OpenClaw injects the contents of these files directly into the agent context. Blank files are skipped. Large files are trimmed and truncated with a marker so prompts stay lean (read the file for full content). If a file is missing, OpenClaw injects a single “missing file” marker line (and `openclaw setup` will create a safe default template). `BOOTSTRAP.md` is only created for a \*\*brand new workspace\*\* (no other bootstrap files present). If you delete it after completing the ritual, it should not be recreated on later restarts. To disable bootstrap file creation entirely (for pre-seeded workspaces), set: ```json5 { agent: { skipBootstrap: true } } ``` ## Built-in tools Core tools (read/exec/edit/write and related system tools) are always available, subject to tool policy. `apply\_patch` is optional and gated by `tools.exec.applyPatch`. `TOOLS.md` does \*\*not\*\* control which tools exist; it’s guidance for how \_you\_ want them used. ## Skills OpenClaw loads skills from three locations (workspace wins on name conflict): - Bundled (shipped with the install) - Managed/local: `~/.openclaw/skills` - Workspace: `/skills` Skills can be gated by config/env (see `skills` in [Gateway configuration](/gateway/configuration)). ## pi-mono integration OpenClaw reuses pieces of the pi-mono codebase (models/tools), but \*\*session management, discovery, and tool wiring are OpenClaw-owned\*\*. - No pi-coding agent runtime. - No `~/.pi/agent` or `/.pi` settings are consulted. ## Sessions Session transcripts are stored as JSONL at: - `~/.openclaw/agents//sessions/.jsonl` The session ID is stable and chosen by OpenClaw. Legacy Pi/Tau session folders are \*\*not\*\* read. ## Steering while streaming When queue mode is `steer`, inbound messages are injected into the current run. The queue is checked \*\*after each tool call\*\*; if a queued message is present, remaining tool calls from the current assistant message are skipped (error tool results with "Skipped due to queued user message."), then the queued user message is injected before the next assistant response. When queue mode is `followup` or `collect`, inbound messages are held until the current turn ends, then a new agent turn starts with the queued payloads. See [Queue](/concepts/queue) for mode + debounce/cap behavior. Block streaming sends completed assistant blocks as soon as they finish; it is \*\*off by default\*\* (`agents.defaults.blockStreamingDefault: "off"`). Tune the boundary via `agents.defaults.blockStreamingBreak` (`text\_end` vs `message\_end`; defaults to text\_end). Control soft block chunking with `agents.defaults.blockStreamingChunk` (defaults to 800–1200 chars; prefers paragraph breaks, then newlines; sentences last). Coalesce streamed chunks with `agents.defaults.blockStreamingCoalesce` to reduce single-line spam (idle-based merging before send). Non-Telegram channels require explicit `\*.blockStreaming: true` to enable block replies. Verbose tool summaries are emitted at tool start (no debounce); Control UI streams tool output via agent events when available. More details: [Streaming + chunking](/concepts/streaming). ## Model refs Model refs in config (for example `agents.defaults.model` and `agents.defaults.models`) are parsed by splitting on the \*\*first\*\* `/`. - Use `provider/model` when configuring models. - If the model
https://github.com/openclaw/openclaw/blob/main//docs/concepts/agent.md
main
opebclaw
[ -0.03695116564631462, -0.02919822745025158, -0.06946897506713867, 0.02629656158387661, -0.005989986006170511, -0.058345891535282135, -0.04874041676521301, -0.012831129133701324, 0.00904090330004692, -0.019127914682030678, 0.015913959592580795, -0.0024495895486325026, 0.03333589434623718, 0.006402596365660429, 0.10939714312553406, 0.07119651883840561, 0.06443130224943161, 0.003121535060927272, 0.023708313703536987, 0.04160690680146217, 0.034998681396245956, 0.017754297703504562, 0.015824168920516968, -0.08369351923465729, -0.10117899626493454, 0.003346269018948078, -0.06341582536697388, -0.038807958364486694, -0.026377443224191666, -0.00048442123807035387, 0.08464615046977997, 0.06346329301595688, -0.0436590239405632, -0.01433670986443758, 0.11036708950996399, 0.11247311532497406, -0.017569411545991898, 0.013958759605884552, -0.02837183326482773, 0.023643793538212776, 0.058893218636512756, 0.0640617087483406, 0.01463616918772459, -0.02862238511443138, -0.1129532903432846, -0.07440977543592453, 0.014158700592815876, -0.13424232602119446, 0.03892476111650467, 0.006553474813699722, -0.043543748557567596, -0.04812416061758995, 0.051618561148643494, -0.04530758410692215, 0.021699698641896248, 0.015701385214924812, 0.03211474046111107, 0.009725193493068218, 0.01599680632352829, -0.06127959117293358, 0.04371173679828644, 0.0028420095331966877, -0.032452985644340515, 0.02260165475308895, -0.0770874172449112, 0.021399039775133133, -0.08119502663612366, -0.08368721604347229, -0.05353325977921486, -0.06951851397752762, -0.06960555166006088, 0.005193864461034536, -0.03420570492744446, -0.034529075026512146, -0.023249277845025063, -0.04520400986075401, 0.05734740570187569, 0.033807992935180664, 0.023681722581386566, -0.07744472473859787, -0.02450055070221424, 0.00794184859842062, -0.022195393219590187, 0.015285403467714787, -0.017197467386722565, 0.14190560579299927, 0.019526321440935135, 0.0798969641327858, 0.015756387263536453, 0.002650306560099125, 0.010782195255160332, -0.06592296063899994, 0.03604714944958687, 0.000036855999496765435, 0.04062981158494949, -0.014544814825057983, -0.018990058451890945, 0.0752239003777504, -0.048998959362506866, 0.09872765839099884, -0.032193440943956375, -0.022962218150496483, 0.05917146056890488, 0.05872797220945358, -0.03449609503149986, 0.038189247250556946, 0.03400610014796257, 0.07491062581539154, -0.02969691902399063, -0.030237646773457527, -0.007199681363999844, -0.04391917213797569, 0.07456593215465546, 0.026503201574087143, 0.041309259831905365, 0.024731021374464035, -0.013190160505473614, 0.004185948986560106, 0.02012544870376587, 0.10414741188287735, 0.11646098643541336, -0.03375444561243057, 0.04742743447422981, 0.02205904945731163, 0.10657963901758194, 0.04959162697196007, 0.06331919133663177, 4.7630336818968135e-33, 0.08018270134925842, -0.06807172298431396, -0.009437233209609985, 0.04178612306714058, 0.16566890478134155, 0.01299796812236309, 0.03404976800084114, 0.025753488764166832, -0.06776636093854904, 0.08100797235965729, 0.02941901423037052, 0.12199532240629196, -0.07394508272409439, 0.023214463144540787, -0.01964045688509941, 0.03479050099849701, -0.04541735351085663, 0.047654420137405396, 0.026213090866804123, -0.05057739093899727, -0.009506250731647015, -0.041896991431713104, -0.07185812294483185, 0.030354395508766174, -0.057624511420726776, 0.030451463535428047, -0.05071398243308067, -0.03220227360725403, 0.08460121601819992, 0.030237190425395966, -0.01099108811467886, 0.05383425951004028, -0.060629721730947495, 0.07073570787906647, -0.08800363540649414, 0.02362869121134281, -0.12287122011184692, 0.0005101856077089906, -0.06507464498281479, -0.049511492252349854, 0.018706519156694412, 0.013103795237839222, 0.03742500767111778, -0.06798597425222397, -0.014378289692103863, -0.14937466382980347, -0.04136618971824646, 0.07795145362615585, 0.07318346947431564, 0.041505809873342514, 0.02363523468375206, 0.024963079020380974, 0.05232058838009834, 0.03499668836593628, -0.031177807599306107, -0.02257491648197174, -0.04984235018491745, 0.008532451465725899, 0.026818161830306053, 0.023429857566952705, -0.032246559858322144, 0.03232516348361969, -0.04372677579522133, 0.07540595531463623, -0.009455890394747257, -0.014838592149317265, 0.03752613440155983, 0.051299773156642914, -0.010426600463688374, -0.010738042183220387, -0.016047248616814613, -0.01692778430879116, -0.013865665532648563, 0.0442405603826046, -0.06037207320332527, -0.06881505995988846, 0.04747798666357994, -0.015751603990793228, -0.024922171607613564, 0.0034780260175466537, 0.001054222579114139, 0.02937234938144684, -0.020627085119485855, -0.01418526191264391, -0.0034844991751015186, 0.038468606770038605, 0.011328964494168758, -0.07323002070188522, 0.05622085928916931, 0.07610397785902023, -0.04091629013419151, -0.0691666454076767, -0.08361825346946716, 0.05435396358370781, -0.031626373529434204, -6.0303532433015226e-33, -0.02992696315050125, -0.06790556013584137, -0.07935597002506256, -0.049096185714006424, -0.028413351625204086, 0.0370643325150013, 0.0023897355422377586, -0.0718444436788559, -0.04680025205016136, -0.036588992923498154, -0.017486458644270897, 0.07714027911424637, 0.05764508247375488, -0.018523333594202995, 0.022747373208403587, -0.05829908698797226, 0.02169337123632431, -0.0690394788980484, -0.015778683125972748, -0.011387910693883896, 0.021498046815395355, 0.0411808006465435, -0.016402767971158028, -0.002732132561504841, 0.12025135010480881, 0.008150368928909302, -0.0028421757742762566, 0.06060156598687172, 0.0015261323424056172, -0.016925539821386337, -0.005117555148899555, 0.04130657762289047, -0.06411091983318329, -0.000369490880984813, 0.004268958233296871, 0.028988750651478767, -0.10635919123888016, 0.048630036413669586, -0.00569171505048871, 0.01207263395190239, 0.048682209104299545, -0.08916402608156204, -0.08002309501171112, -0.009896420873701572, 0.02353804185986519, 0.04793085157871246, -0.05036003887653351, -0.04498991742730141, -0.04783175513148308, -0.003771540941670537, -0.04833585396409035, 0.00693439831957221, 0.03856572508811951, -0.020558511838316917, 0.0023449899163097143, 0.06927776336669922, 0.08515244722366333, -0.04848610237240791, 0.02645530365407467, -0.07310172915458679, 0.02728830836713314, -0.027496472001075745, -0.06994959712028503, 0.10783780366182327, -0.0733935683965683, -0.06535682082176208, -0.05894583463668823, 0.03620632365345955, -0.0430331826210022, -0.04134885594248772, -0.07469663769006729, -0.0357658788561821, -0.011181559413671494, -0.04158438742160797, 0.031973037868738174, 0.017000386491417885, 0.0316413938999176, -0.10432209074497223, -0.02699444629251957, 0.007239020429551601, -0.0393059141933918, 0.02129729650914669, 0.014462383463978767, -0.044345609843730927, -0.06455492973327637, -0.015689538791775703, -0.024733474478125572, 0.09888388216495514, 0.02767806313931942, 0.037809934467077255, -0.05536346137523651, 0.034849055111408234, -0.021217411383986473, 0.017704229801893234, -0.0040449537336826324, -5.473162190128278e-8, -0.05116990953683853, 0.03192608430981636, -0.013861356303095818, 0.0034363199956715107, -0.0485929399728775, -0.05718928202986717, 0.04020381718873978, 0.03578456863760948, -0.026597602292895317, 0.035223621875047684, 0.09301932901144028, -0.006536772940307856, -0.0056479377672076225, 0.032557498663663864, -0.06755167990922928, 0.08255508542060852, 0.02309679426252842, -0.016950929537415504, 0.0004828653472941369, -0.08911475539207458, -0.0020125352311879396, -0.05129942670464516, 0.10276764631271362, 0.030066873878240585, -0.1077067032456398, -0.02598429284989834, -0.016754383221268654, -0.01135982945561409, -0.04420856758952141, 0.06976113468408585, -0.0525929294526577, 0.02928435243666172, 0.02406441606581211, -0.012738434597849846, -0.0869329497218132, 0.03637775778770447, -0.009492636658251286, 0.03682427108287811, 0.013076185248792171, -0.025851983577013016, 0.022179963067173958, 0.028934022411704063, -0.03981085866689682, -0.08690474182367325, -0.024209126830101013, 0.024768013507127762, -0.054868243634700775, 0.030494600534439087, 0.05614478513598442, -0.0462244488298893, -0.08471359312534332, 0.07287988811731339, -0.024356631562113762, 0.0690070390701294, 0.04047900438308716, 0.07060351967811584, 0.07173439115285873, -0.062492694705724716, 0.009785346686840057, 0.03968297317624092, -0.08050231635570526, 0.0013681408017873764, 0.04294457286596298, -0.052722930908203125 ]
0.079619
at tool start (no debounce); Control UI streams tool output via agent events when available. More details: [Streaming + chunking](/concepts/streaming). ## Model refs Model refs in config (for example `agents.defaults.model` and `agents.defaults.models`) are parsed by splitting on the \*\*first\*\* `/`. - Use `provider/model` when configuring models. - If the model ID itself contains `/` (OpenRouter-style), include the provider prefix (example: `openrouter/moonshotai/kimi-k2`). - If you omit the provider, OpenClaw treats the input as an alias or a model for the \*\*default provider\*\* (only works when there is no `/` in the model ID). ## Configuration (minimal) At minimum, set: - `agents.defaults.workspace` - `channels.whatsapp.allowFrom` (strongly recommended) --- \_Next: [Group Chats](/concepts/group-messages)\_ 🦞
https://github.com/openclaw/openclaw/blob/main//docs/concepts/agent.md
main
opebclaw
[ -0.028276905417442322, -0.058235540986061096, -0.0571497306227684, 0.06176113337278366, 0.04183671995997429, -0.048986468464136124, 0.004124063532799482, -0.01564992405474186, 0.04864862933754921, -0.06270891427993774, 0.02523808740079403, -0.08408153802156448, -0.01995624043047428, 0.020327899605035782, 0.06798127293586731, 0.03227592632174492, 0.0640379786491394, -0.09840860962867737, -0.04535648226737976, -0.06974802911281586, 0.0647701770067215, 0.02294061705470085, -0.016549862921237946, 0.009460375644266605, -0.027325047180056572, -0.010289931669831276, -0.020445799455046654, -0.01922636851668358, 0.04794693738222122, -0.003879107069224119, 0.08539088070392609, 0.03907322511076927, -0.07157385349273682, -0.003770285751670599, 0.04175085574388504, 0.03557664155960083, 0.023315448313951492, -0.002343558706343174, -0.06284883618354797, 0.028745152056217194, 0.10848984122276306, 0.013531995005905628, -0.04838079959154129, -0.04094173386693001, 0.0006239610956981778, -0.08750767260789871, -0.05518713220953941, -0.032848186790943146, -0.04085977375507355, 0.0246448777616024, -0.11131852120161057, -0.05727086216211319, -0.01254310179501772, 0.09887659549713135, 0.07337670028209686, 0.011988396756350994, -0.08078630268573761, 0.006956633646041155, 0.05044175311923027, -0.0670955628156662, -0.041638270020484924, -0.06633304804563522, -0.04157426580786705, -0.007832977920770645, -0.08048882335424423, 0.044339586049318314, -0.08116904646158218, 0.026604626327753067, 0.01103195734322071, -0.016106728464365005, -0.035671163350343704, 0.049136776477098465, 0.03419403359293938, -0.017292475327849388, -0.015643084421753883, -0.048413943499326706, 0.024191269651055336, 0.07978004217147827, -0.05961962789297104, -0.06735499203205109, 0.029940133914351463, -0.09385867416858673, -0.006819381378591061, 0.0002063128922600299, 0.019362613558769226, 0.10461075603961945, -0.005335938651114702, -0.04832087829709053, 0.05747760459780693, 0.024633437395095825, -0.09752462059259415, -0.0646970272064209, -0.016142254695296288, 0.037707310169935226, 0.03098021261394024, 0.040680110454559326, -0.030469493940472603, -0.000842289999127388, -0.01960180513560772, 0.07658177614212036, -0.0013376132119446993, 0.011795621365308762, 0.028732966631650925, 0.04114260897040367, -0.01238627452403307, -0.03775038570165634, 0.008258082903921604, 0.12213234603404999, 0.009702392853796482, 0.010476997122168541, -0.019647954031825066, -0.011892125941812992, 0.12103819847106934, -0.033863894641399384, 0.023836366832256317, 0.035435277968645096, -0.037930600345134735, -0.0417623370885849, 0.014403225854039192, 0.002783996518701315, 0.08175034075975418, 0.011303069069981575, -0.0248413123190403, 0.05288497358560562, 0.08971337229013443, 0.13231734931468964, 0.02865109220147133, 4.386539739059728e-33, 0.05932793766260147, -0.017172018066048622, -0.04725436866283417, 0.033806730061769485, 0.07701491564512253, 0.056013889610767365, -0.018072526901960373, 0.05685431882739067, -0.03012377768754959, 0.015932632610201836, -0.06965875625610352, 0.008081839419901371, -0.10558833181858063, -0.04197809845209122, 0.01988697238266468, 0.009930585511028767, -0.05571157485246658, 0.044368233531713486, 0.020089898258447647, 0.01734144054353237, -0.009134742431342602, 0.05718434602022171, -0.11053252220153809, -0.02579246647655964, -0.05417940765619278, 0.07917986065149307, -0.02145548351109028, -0.08827608078718185, -0.0012725245906040072, 0.021441731601953506, 0.02547094039618969, 0.021082065999507904, 0.028890127316117287, -0.00028628279687836766, -0.011348855681717396, -0.0005628871149383485, -0.08896540850400925, -0.03082909621298313, -0.05505290627479553, -0.08251391351222992, -0.02691582776606083, -0.00010202421981375664, -0.10462520271539688, -0.036696773022413254, -0.0662069097161293, -0.11043376475572586, -0.07091805338859558, 0.050422925502061844, -0.004908061120659113, -0.03160308673977852, 0.016404418274760246, 0.040280118584632874, 0.05291900038719177, 0.057994287461042404, 0.00603075185790658, -0.02544473670423031, -0.0013770685764029622, -0.0030986282508820295, 0.05449613183736801, 0.025827255100011826, -0.0716128796339035, 0.0007028126274235547, -0.02670932747423649, 0.053618982434272766, 0.04329610988497734, 0.044363632798194885, -0.02365228161215782, 0.02888120524585247, 0.017457855865359306, -0.03042633831501007, -0.07719479501247406, 0.0361601896584034, -0.030194168910384178, 0.06450701504945755, -0.010967659763991833, -0.07059286534786224, -0.041637592017650604, -0.009822526015341282, 0.008951791562139988, 0.00324255065061152, 0.03995063900947571, 0.016761695966124535, 0.006413958501070738, 0.08058574795722961, 0.018299706280231476, -0.0009300318197347224, 0.013801909983158112, -0.10385522991418839, -0.013551227748394012, 0.07481757551431656, -0.0824764147400856, 0.033902935683727264, -0.005000262055546045, 0.03181464597582817, 0.020508913323283195, -4.900771130428461e-33, 0.06729276478290558, 0.01973116584122181, -0.04058722034096718, -0.01942790485918522, 0.03944246470928192, -0.05093701183795929, 0.02266412042081356, 0.00950715783983469, 0.11148648709058762, -0.06800547242164612, -0.0027830423787236214, -0.029101161286234856, 0.03663012385368347, -0.05258924886584282, 0.035850536078214645, -0.09788694977760315, -0.013544746674597263, -0.10396711528301239, 0.031476717442274094, -0.0029540378600358963, -0.015220356173813343, -0.05393122881650925, -0.030301591381430626, 0.01978551782667637, 0.06833508610725403, 0.025982003659009933, 0.09857497364282608, 0.06718120723962784, -0.006996229290962219, -0.037754107266664505, 0.026495132595300674, 0.012447450309991837, -0.0642118975520134, -0.037843815982341766, -0.017806654796004295, 0.08599568903446198, -0.04435902088880539, 0.12398926913738251, 0.02070537954568863, 0.013275881297886372, 0.11024986952543259, -0.02986465021967888, -0.13584372401237488, 0.0054772282019257545, 0.008946165442466736, 0.07262095808982849, 0.009572699666023254, -0.0018505632178857923, -0.09276113659143448, -0.012438242323696613, 0.06059907749295235, -0.05126679316163063, -0.005340036004781723, 0.02625117264688015, 0.021712522953748703, 0.01871509850025177, 0.13660025596618652, -0.08091560751199722, -0.012032737024128437, -0.08994674682617188, 0.04900776967406273, -0.03503818437457085, -0.02546565793454647, -0.0010750144720077515, -0.011318306438624859, -0.054174888879060745, 0.046342428773641586, 0.06342568248510361, 0.07497008889913559, -0.08161485195159912, -0.0571507066488266, -0.0970960333943367, -0.015524848364293575, 0.017275119200348854, 0.06501148641109467, 0.027820611372590065, -0.0957629606127739, -0.05112330615520477, 0.026556294411420822, 0.0515374056994915, -0.061806291341781616, 0.008238238282501698, 0.10236453264951706, -0.031759291887283325, 0.031915225088596344, 0.06610419601202011, 0.06137046217918396, 0.05811870098114014, 0.02319609746336937, 0.05870046466588974, -0.0619736984372139, 0.04301833733916283, -0.0038884696550667286, 0.057688191533088684, -0.06765519082546234, -5.6942489834455046e-8, -0.1361190378665924, -0.05163899436593056, -0.057926829904317856, 0.02350994385778904, -0.06604370474815369, -0.06216290593147278, 0.015398545190691948, 0.013352397829294205, -0.002888425486162305, -0.024583203718066216, 0.034986454993486404, 0.0254653487354517, -0.02635478973388672, 0.001101114903576672, -0.00047710337094031274, 0.012048857286572456, 0.01552934292703867, -0.04059145599603653, -0.03278033435344696, -0.04989832267165184, 0.0007358057773672044, -0.03088538721203804, 0.03111921064555645, 0.036648593842983246, -0.03907133266329765, -0.07607333362102509, 0.010472910478711128, 0.048508305102586746, 0.02820673957467079, 0.01198792364448309, -0.020563533529639244, -0.015439021401107311, 0.005399140063673258, 0.026620876044034958, -0.05605880543589592, 0.03138688951730728, -0.03923890367150307, -0.018573097884655, 0.057400334626436234, 0.06495434790849686, 0.08642484247684479, 0.02863888628780842, -0.0287153460085392, -0.06397640705108643, -0.02585148625075817, 0.049733150750398636, 0.04033385589718819, -0.06109926849603653, 0.08497267216444016, 0.037009116262197495, -0.05802366882562637, 0.028009342029690742, -0.002183716744184494, 0.027695056051015854, 0.009974067099392414, -0.031566180288791656, 0.08898578584194183, -0.09511617571115494, -0.02160004712641239, 0.001963981194421649, -0.028392983600497246, 0.04868699982762337, 0.05063353478908539, 0.05738203600049019 ]
0.033043
# Usage tracking ## What it is - Pulls provider usage/quota directly from their usage endpoints. - No estimated costs; only the provider-reported windows. ## Where it shows up - `/status` in chats: emoji‑rich status card with session tokens + estimated cost (API key only). Provider usage shows for the \*\*current model provider\*\* when available. - `/usage off|tokens|full` in chats: per-response usage footer (OAuth shows tokens only). - `/usage cost` in chats: local cost summary aggregated from OpenClaw session logs. - CLI: `openclaw status --usage` prints a full per-provider breakdown. - CLI: `openclaw channels list` prints the same usage snapshot alongside provider config (use `--no-usage` to skip). - macOS menu bar: “Usage” section under Context (only if available). ## Providers + credentials - \*\*Anthropic (Claude)\*\*: OAuth tokens in auth profiles. - \*\*GitHub Copilot\*\*: OAuth tokens in auth profiles. - \*\*Gemini CLI\*\*: OAuth tokens in auth profiles. - \*\*Antigravity\*\*: OAuth tokens in auth profiles. - \*\*OpenAI Codex\*\*: OAuth tokens in auth profiles (accountId used when present). - \*\*MiniMax\*\*: API key (coding plan key; `MINIMAX\_CODE\_PLAN\_KEY` or `MINIMAX\_API\_KEY`); uses the 5‑hour coding plan window. - \*\*z.ai\*\*: API key via env/config/auth store. Usage is hidden if no matching OAuth/API credentials exist.
https://github.com/openclaw/openclaw/blob/main//docs/concepts/usage-tracking.md
main
opebclaw
[ -0.030199773609638214, 0.015738101676106453, -0.04635290801525116, 0.06425713002681732, 0.0789717361330986, -0.11807750910520554, 0.0823528841137886, -0.015086797997355461, 0.09231316298246384, 0.001256767543964088, 0.010230573825538158, -0.05766257643699646, -0.02962331846356392, 0.0052248514257371426, 0.03720606863498688, 0.06266598403453827, 0.0859215259552002, -0.08408897370100021, -0.058135636150836945, -0.006268024910241365, 0.04178055003285408, -0.013940678909420967, 0.0031280016992241144, 0.001708142226561904, 0.003068012883886695, -0.03749562054872513, -0.070589080452919, -0.0060165454633533955, 0.005318794399499893, 0.0405455157160759, 0.01729392632842064, 0.0602688230574131, 0.04277762770652771, -0.022175773978233337, 0.08048529177904129, -0.023909015581011772, 0.03949888423085213, -0.015338091179728508, -0.07933129370212555, 0.005501265171915293, 0.027013372629880905, 0.00856966432183981, -0.04619566723704338, 0.047210343182086945, -0.00833059474825859, -0.06062015891075134, -0.03982967510819435, -0.005427706521004438, -0.02838393859565258, 0.041049882769584656, -0.00325220194645226, -0.036751002073287964, 0.030419889837503433, -0.033455315977334976, 0.006638578604906797, 0.0003631205181591213, -0.04330975189805031, -0.04860900714993477, 0.07740340381860733, 0.021155552938580513, -0.029645096510648727, -0.033026233315467834, -0.0414743609726429, 0.03373623639345169, -0.05644306540489197, 0.04017738625407219, -0.010593914426863194, -0.04488087818026543, -0.06947862356901169, -0.04840436950325966, -0.0004976338241249323, 0.040782224386930466, -0.00786644034087658, -0.06733399629592896, 0.023836199194192886, 0.0010706220054998994, 0.10033749043941498, 0.06385492533445358, 0.014866555109620094, -0.10535922646522522, -0.01292800810188055, -0.022756917402148247, 0.006747502833604813, 0.06464580446481705, 0.038690514862537384, 0.06890702247619629, -0.010645812377333641, -0.018623847514390945, 0.008658939972519875, 0.06510470807552338, -0.016391102224588394, -0.06380613893270493, -0.032223910093307495, -0.011854399926960468, 0.031021207571029663, -0.020165273919701576, -0.05885332450270653, 0.045294150710105896, -0.034293677657842636, 0.08153551816940308, -0.026949461549520493, 0.03914575278759003, 0.08224652707576752, -0.04071709141135216, -0.048280488699674606, 0.010690789669752121, 0.018232321366667747, 0.1069612205028534, 0.056708451360464096, 0.09178341180086136, 0.008673625998198986, -0.06374769657850266, 0.02092856355011463, -0.004152486100792885, 0.03412328660488129, 0.0502680167555809, -0.055494748055934906, -0.002968002576380968, 0.09446556121110916, 0.07733970880508423, 0.062345460057258606, 0.005332207307219505, -0.012344202026724815, -0.044551730155944824, -0.03421627730131149, 0.0991721823811531, 0.03999852389097214, 6.1056183098747505e-33, 0.040395841002464294, -0.017778342589735985, -0.027213159948587418, -0.01718181185424328, 0.035071857273578644, 0.04587704688310623, -0.010030364617705345, 0.02305424213409424, -0.025447381660342216, -0.011408334597945213, -0.036870673298835754, 0.10705044865608215, -0.08182420581579208, 0.008126302622258663, 0.07664137333631516, -0.03799161687493324, 0.0070445723831653595, 0.04767335578799248, 0.09478120505809784, 0.02261394076049328, 0.020094985142350197, 0.015671534463763237, -0.01165860053151846, 0.006867455784231424, 0.05406054109334946, 0.04561387747526169, 0.032777342945337296, -0.059292808175086975, -0.011070072650909424, 0.030908480286598206, 0.07326619327068329, 0.005095259752124548, -0.019506482407450676, -0.023196322843432426, 0.041527993977069855, 0.029021231457591057, -0.03006957285106182, -0.020233407616615295, -0.03229449316859245, -0.057268284261226654, -0.04869666323065758, -0.00491029117256403, -0.0898084044456482, -0.07766783982515335, -0.09242255985736847, -0.14399568736553192, -0.05838409438729286, -0.0579511821269989, 0.029817204922437668, 0.08909736573696136, -0.06300103664398193, 0.011985976248979568, -0.0367923341691494, 0.027147045359015465, -0.029088590294122696, -0.11253127455711365, 0.009725588373839855, -0.027199825271964073, 0.03941535949707031, -0.006132704671472311, -0.0705396756529808, -0.04423660784959793, -0.005764363799244165, -0.0326998308300972, -0.02905023656785488, 0.053977131843566895, -0.001908041420392692, 0.0010862400522455573, -0.050945017486810684, 0.045949116349220276, -0.020598281174898148, 0.05857103317975998, 0.025021247565746307, 0.03594295307993889, -0.07931558787822723, -0.010050945915281773, -0.01693912409245968, 0.03085365518927574, -0.030206779018044472, 0.09074900299310684, 0.002176490146666765, -0.032345496118068695, 0.02072344906628132, 0.028601689264178276, -0.007295255083590746, 0.018820511177182198, 0.05942567065358162, -0.01798580400645733, -0.04783919081091881, 0.09869789332151413, -0.002670885296538472, 0.004835029598325491, -0.09103735536336899, 0.0049934289418160915, -0.04343545809388161, -6.459345865872285e-33, -0.044268783181905746, 0.07118775695562363, 0.05836963281035423, -0.042382773011922836, -0.032318368554115295, 0.0008663568878546357, -0.012049436569213867, 0.020476307719945908, 0.026660239323973656, -0.03345484286546707, -0.05256479233503342, 0.021062934771180153, 0.00037788072950206697, -0.010463372804224491, 0.030231190845370293, -0.011414855718612671, -0.06732203811407089, -0.06939812004566193, 0.01339280977845192, 0.006822106894105673, -0.09738607704639435, -0.0014943613205105066, 0.02029365673661232, -0.02733641117811203, 0.03724366053938866, 0.009693583473563194, -0.004915173165500164, -0.007823916152119637, 0.013265974819660187, -0.07771178334951401, 0.04204782843589783, -0.040581345558166504, -0.10262420028448105, -0.014024205505847931, -0.013044031336903572, 0.01184065081179142, -0.041392408311367035, 0.13803961873054504, 0.0018211547285318375, -0.007932889275252819, 0.06752652674913406, -0.044712964445352554, -0.07049022614955902, 0.011354961432516575, -0.019945848733186722, 0.08429833501577377, -0.0658879354596138, -0.07231926172971725, -0.0919928327202797, -0.0639692023396492, 0.07094033807516098, -0.022492481395602226, 0.007374252192676067, 0.05994636192917824, -0.042268116027116776, 0.013278848491609097, 0.07413486391305923, 0.0027547518257051706, -0.04235285520553589, -0.1520330160856247, 0.044722821563482285, -0.004466636572033167, -0.054947853088378906, 0.04253459349274635, -0.008621755056083202, -0.021385613828897476, 0.04657827317714691, -0.010010567493736744, -0.028120409697294235, -0.04162964969873428, -0.031193064525723457, -0.05319538339972496, -0.04619841277599335, -0.01419451180845499, -0.039977822452783585, 0.04464036226272583, 0.005229220259934664, -0.09433803707361221, 0.02272110804915428, 0.07544323056936264, -0.035992905497550964, 0.013011711649596691, 0.0638580471277237, -0.04149879515171051, -0.020137697458267212, -0.01045097503811121, 0.025613142177462578, 0.08929525315761566, 0.033890463411808014, 0.13575930893421173, -0.11285969614982605, 0.038192618638277054, -0.1282278597354889, 0.024000681936740875, -0.01163539756089449, -4.906016215500131e-8, -0.09760326892137527, -0.07694283127784729, -0.035907622426748276, 0.03829850256443024, 0.01780848018825054, -0.03873321786522865, 0.07801183313131332, 0.1037994772195816, -0.06371200829744339, 0.06544388830661774, 0.08543004095554352, 0.02210395783185959, -0.09278082847595215, -0.07381470501422882, -0.014486296102404594, 0.07550150901079178, 0.00997973419725895, 0.0012442265870049596, 0.028074026107788086, -0.045220550149679184, -0.018291449174284935, 0.039638716727495193, 0.022658539935946465, 0.052519723773002625, -0.08877839148044586, -0.05445300042629242, 0.010316438972949982, 0.11539594829082489, -0.03855856508016586, -0.024442903697490692, 0.006740362849086523, -0.0020316762384027243, 0.034808430820703506, -0.10160473734140396, -0.02248905785381794, 0.012030691839754581, -0.13313838839530945, -0.020769525319337845, 0.04030996933579445, 0.064908966422081, 0.016975676640868187, 0.014248814433813095, 0.027064917609095573, -0.005021830089390278, 0.016445377841591835, 0.04177849739789963, -0.09171183407306671, 0.008995371870696545, 0.011209789663553238, -0.10304214060306549, 0.02802440896630287, -0.03259926661849022, 0.022213229909539223, 0.12002010643482208, -0.07475778460502625, 0.006452055647969246, 0.09090910851955414, -0.07449482381343842, 0.03178120031952858, 0.02695712260901928, 0.000646785949356854, -0.01501117181032896, 0.04376304894685745, 0.03504868969321251 ]
0.137645
# Group messages (WhatsApp web channel) Goal: let Clawd sit in WhatsApp groups, wake up only when pinged, and keep that thread separate from the personal DM session. Note: `agents.list[].groupChat.mentionPatterns` is now used by Telegram/Discord/Slack/iMessage as well; this doc focuses on WhatsApp-specific behavior. For multi-agent setups, set `agents.list[].groupChat.mentionPatterns` per agent (or use `messages.groupChat.mentionPatterns` as a global fallback). ## What’s implemented (2025-12-03) - Activation modes: `mention` (default) or `always`. `mention` requires a ping (real WhatsApp @-mentions via `mentionedJids`, regex patterns, or the bot’s E.164 anywhere in the text). `always` wakes the agent on every message but it should reply only when it can add meaningful value; otherwise it returns the silent token `NO\_REPLY`. Defaults can be set in config (`channels.whatsapp.groups`) and overridden per group via `/activation`. When `channels.whatsapp.groups` is set, it also acts as a group allowlist (include `"\*"` to allow all). - Group policy: `channels.whatsapp.groupPolicy` controls whether group messages are accepted (`open|disabled|allowlist`). `allowlist` uses `channels.whatsapp.groupAllowFrom` (fallback: explicit `channels.whatsapp.allowFrom`). Default is `allowlist` (blocked until you add senders). - Per-group sessions: session keys look like `agent::whatsapp:group:` so commands such as `/verbose on` or `/think high` (sent as standalone messages) are scoped to that group; personal DM state is untouched. Heartbeats are skipped for group threads. - Context injection: \*\*pending-only\*\* group messages (default 50) that \_did not\_ trigger a run are prefixed under `[Chat messages since your last reply - for context]`, with the triggering line under `[Current message - respond to this]`. Messages already in the session are not re-injected. - Sender surfacing: every group batch now ends with `[from: Sender Name (+E164)]` so Pi knows who is speaking. - Ephemeral/view-once: we unwrap those before extracting text/mentions, so pings inside them still trigger. - Group system prompt: on the first turn of a group session (and whenever `/activation` changes the mode) we inject a short blurb into the system prompt like `You are replying inside the WhatsApp group "". Group members: Alice (+44...), Bob (+43...), … Activation: trigger-only … Address the specific sender noted in the message context.` If metadata isn’t available we still tell the agent it’s a group chat. ## Config example (WhatsApp) Add a `groupChat` block to `~/.openclaw/openclaw.json` so display-name pings work even when WhatsApp strips the visual `@` in the text body: ```json5 { channels: { whatsapp: { groups: { "\*": { requireMention: true }, }, }, }, agents: { list: [ { id: "main", groupChat: { historyLimit: 50, mentionPatterns: ["@?openclaw", "\\+?15555550123"], }, }, ], }, } ``` Notes: - The regexes are case-insensitive; they cover a display-name ping like `@openclaw` and the raw number with or without `+`/spaces. - WhatsApp still sends canonical mentions via `mentionedJids` when someone taps the contact, so the number fallback is rarely needed but is a useful safety net. ### Activation command (owner-only) Use the group chat command: - `/activation mention` - `/activation always` Only the owner number (from `channels.whatsapp.allowFrom`, or the bot’s own E.164 when unset) can change this. Send `/status` as a standalone message in the group to see the current activation mode. ## How to use 1. Add your WhatsApp account (the one running OpenClaw) to the group. 2. Say `@openclaw …` (or include the number). Only allowlisted senders can trigger it unless you set `groupPolicy: "open"`. 3. The agent prompt will include recent group context plus the trailing `[from: …]` marker so it can address the right person. 4. Session-level directives (`/verbose on`, `/think high`, `/new` or `/reset`, `/compact`) apply only to that group’s session; send them as standalone messages so they register. Your personal DM session remains independent. ## Testing / verification - Manual smoke: - Send
https://github.com/openclaw/openclaw/blob/main//docs/concepts/group-messages.md
main
opebclaw
[ -0.054161831736564636, -0.05878942459821701, 0.03945557028055191, 0.028530582785606384, -0.010527689941227436, -0.040072519332170486, 0.10388901829719543, -0.020494243130087852, 0.0534992478787899, 0.0284743532538414, 0.0406990572810173, -0.036484211683273315, 0.022546550258994102, 0.0823759064078331, 0.08828721940517426, -0.0004133748007006943, 0.06277092546224594, -0.16573384404182434, -0.05024002864956856, -0.03581555187702179, 0.09718930721282959, 0.006304115988314152, 0.057079702615737915, 0.015559384599328041, -0.002870498225092888, -0.051042988896369934, -0.05254131183028221, 0.00240565137937665, 0.03217557445168495, 0.021984906867146492, -0.030941087752580643, 0.08436545729637146, -0.01824990101158619, 0.056877464056015015, -0.05064234882593155, 0.0856437087059021, 0.033337466418743134, 0.04155910760164261, 0.02289864420890808, 0.07994034141302109, -0.03860689699649811, -0.01775350049138069, -0.07688664644956589, -0.012584547512233257, 0.02122953161597252, 0.006112648174166679, -0.017598304897546768, 0.034444693475961685, -0.07952166348695755, 0.03004523739218712, 0.03373173996806145, 0.039171457290649414, 0.035920172929763794, 0.11256607621908188, 0.024670347571372986, 0.03274043649435043, -0.05800653249025345, 0.11250943690538406, 0.048606909811496735, -0.07557348161935806, -0.030655143782496452, -0.07564660906791687, 0.02909919247031212, -0.016082720831036568, -0.026534758508205414, 0.03675561770796776, -0.0350203812122345, 0.013073374517261982, 0.003100639907643199, -0.013945641927421093, 0.012528887018561363, -0.013559838756918907, 0.04996310546994209, 0.006191832944750786, 0.029737742617726326, 0.005328767001628876, 0.008726757951080799, 0.0421401746571064, -0.04105887562036514, -0.044989217072725296, -0.021373853087425232, -0.011078445240855217, -0.009158884175121784, -0.003131054574623704, -0.00444813584908843, 0.012457236647605896, 0.016122594475746155, 0.016921423375606537, -0.0028504549991339445, -0.0014661959139630198, -0.002751118503510952, -0.004586151335388422, 0.006986232940107584, 0.08112996071577072, 0.04335862398147583, 0.05257030203938484, -0.025508075952529907, 0.003240492194890976, -0.07363320887088776, 0.02927171066403389, 0.04543381556868553, -0.04889645054936409, -0.03048190288245678, 0.004082783125340939, 0.023412451148033142, -0.015091447159647942, -0.01488170213997364, -0.014452053233981133, 0.0641423761844635, -0.035217300057411194, -0.06679104268550873, 0.03369642794132233, 0.08384142816066742, 0.011001728475093842, -0.02989552728831768, -0.02588488534092903, 0.06656757742166519, 0.0030697486363351345, 0.051845744252204895, -0.028310049325227737, 0.1481557935476303, -0.0922190323472023, 0.06282727420330048, 0.034522607922554016, 0.021428057923913002, 0.10410915315151215, -0.006187335588037968, 3.921458337892767e-33, 0.06315197795629501, 0.03861278295516968, -0.0699804425239563, 0.006881131790578365, -0.043641604483127594, 0.011989099904894829, -0.03784668445587158, 0.05106028541922569, -0.06138262152671814, -0.09337260574102402, -0.05947817116975784, -0.006181921809911728, 0.03791172429919243, 0.021630270406603813, -0.04892478883266449, 0.010634001344442368, 0.008458946831524372, -0.011198095045983791, 0.09415870159864426, -0.030619917437434196, 0.005699906498193741, 0.05237359181046486, -0.009766257368028164, 0.018458062782883644, 0.017682403326034546, 0.08724720031023026, 0.006455766502767801, -0.09047646820545197, 0.0050373137928545475, 0.01831888034939766, 0.014493418857455254, 0.013126631267368793, 0.011028418317437172, 0.03401491791009903, 0.0008262538467533886, 0.018151724711060524, -0.03057478368282318, -0.005871403496712446, -0.03788427263498306, -0.04345432296395302, 0.026931578293442726, 0.01035309862345457, -0.03830723837018013, -0.1010938286781311, 0.03432013466954231, -0.08307754993438721, -0.05410502105951309, -0.007529003079980612, -0.05471019819378853, 0.016178548336029053, 0.011094207875430584, 0.031611401587724686, -0.027264580130577087, -0.005131934769451618, 0.00249158195219934, -0.04925543814897537, -0.024124614894390106, -0.0299319326877594, -0.03957388550043106, 0.030679777264595032, -0.014857515692710876, -0.07126257568597794, 0.01524917408823967, -0.0050321416929364204, 0.026419367641210556, 0.010074286721646786, -0.031454261392354965, 0.0597417987883091, -0.0407877117395401, 0.013333783484995365, -0.005820779129862785, 0.05552353337407112, -0.030555108562111855, 0.04518257454037666, -0.14035628736019135, -0.04124278575181961, 0.0000558622159587685, 0.0511925183236599, -0.014562728814780712, -0.00853391457349062, 0.05299650505185127, 0.017119860276579857, -0.039172086864709854, -0.018798504024744034, -0.009026332758367062, 0.011058530770242214, 0.04260452836751938, -0.1361892968416214, -0.0931105688214302, 0.10188738256692886, -0.11511773616075516, 0.02801896445453167, 0.03424625098705292, 0.11192747205495834, -0.03735114634037018, -4.750008837147718e-33, 0.01176411285996437, 0.05737467482686043, -0.09466114640235901, 0.02876061014831066, 0.0380675345659256, -0.04302690178155899, 0.04485282674431801, 0.02349017933011055, 0.02038644254207611, -0.03439159318804741, -0.007341933902353048, -0.054383326321840286, -0.030779622495174408, 0.035138197243213654, 0.021845262497663498, -0.0035694390535354614, 0.005457972176373005, -0.017659848555922508, 0.001246697036549449, -0.007180346176028252, 0.047579120844602585, -0.05390177294611931, -0.04677364230155945, 0.07678215950727463, 0.05880212038755417, -0.027765318751335144, 0.037946708500385284, 0.034017156809568405, 0.055609628558158875, -0.07473690062761307, 0.06022092327475548, 0.008930960670113564, -0.0570015013217926, 0.003951254300773144, 0.03073209337890148, 0.03634980320930481, -0.02651882916688919, 0.11388769000768661, -0.036436744034290314, -0.02616974525153637, 0.13970860838890076, -0.011052684858441353, -0.1117643266916275, -0.040657591074705124, -0.06414768844842911, 0.042997971177101135, 0.010580207221210003, -0.021084245294332504, -0.13345091044902802, 0.0754849910736084, 0.07657624781131744, -0.11278364062309265, 0.08999145776033401, 0.013497293926775455, -0.05652064085006714, 0.0018946185009554029, 0.06331316381692886, 0.003771241055801511, -0.052052322775125504, -0.07431762665510178, 0.04285528138279915, -0.05985590070486069, 0.027739468961954117, 0.0025778922718018293, 0.05345459654927254, -0.0551542192697525, -0.002460016403347254, 0.00533643551170826, 0.06465072184801102, -0.030035845935344696, 0.08589650690555573, -0.12894777953624725, -0.06780695915222168, -0.03253193199634552, 0.039532992988824844, 0.04633738100528717, -0.09360440075397491, -0.14194710552692413, -0.03185904771089554, 0.026708826422691345, -0.08453726023435593, 0.020913781598210335, 0.02116241492331028, 0.05154856666922569, -0.03444662690162659, 0.057094331830739975, 0.046878065913915634, 0.1629684716463089, -0.018147271126508713, 0.05433674156665802, 0.010345403105020523, -0.029983991757035255, -0.00988738052546978, -0.0021814212668687105, -0.025115856900811195, -5.2556934804215416e-8, -0.05087998881936073, -0.05634310841560364, -0.06205431744456291, 0.00043739716056734324, -0.002516433596611023, -0.04973655939102173, 0.03161826357245445, -0.074918732047081, 0.03729782998561859, -0.04475780203938484, 0.010542294010519981, -0.04474610090255737, -0.030886832624673843, -0.011952470988035202, 0.06508645415306091, -0.0215348731726408, -0.08151945471763611, -0.07798302918672562, -0.03387545049190521, -0.07659558951854706, -0.026722431182861328, -0.06727000325918198, -0.048928577452898026, 0.03920347988605499, -0.032035619020462036, -0.04035179316997528, 0.02611997351050377, 0.06172703579068184, -0.0840488076210022, 0.022383954375982285, -0.05767880380153656, -0.04158587381243706, 0.011688340455293655, -0.008325583301484585, -0.05258578807115555, 0.083594411611557, -0.03174065798521042, -0.04309934005141258, 0.06440439075231552, -0.0057637374848127365, 0.05817786976695061, -0.03485165163874626, -0.019592851400375366, -0.01918579638004303, -0.0011788555420935154, -0.013866844587028027, -0.014301302842795849, -0.058401916176080704, 0.05447682738304138, -0.024539925158023834, -0.03926103934645653, -0.005902222357690334, 0.008536892011761665, 0.049687571823596954, 0.02896467037498951, 0.0009349294705316424, 0.08948726952075958, -0.00976292323321104, 0.1294729858636856, -0.02786746807396412, 0.022136837244033813, 0.016714971512556076, -0.07988972961902618, -0.03455200046300888 ]
0.058074
`[from: …]` marker so it can address the right person. 4. Session-level directives (`/verbose on`, `/think high`, `/new` or `/reset`, `/compact`) apply only to that group’s session; send them as standalone messages so they register. Your personal DM session remains independent. ## Testing / verification - Manual smoke: - Send an `@openclaw` ping in the group and confirm a reply that references the sender name. - Send a second ping and verify the history block is included then cleared on the next turn. - Check gateway logs (run with `--verbose`) to see `inbound web message` entries showing `from: ` and the `[from: …]` suffix. ## Known considerations - Heartbeats are intentionally skipped for groups to avoid noisy broadcasts. - Echo suppression uses the combined batch string; if you send identical text twice without mentions, only the first will get a response. - Session store entries will appear as `agent::whatsapp:group:` in the session store (`~/.openclaw/agents//sessions/sessions.json` by default); a missing entry just means the group hasn’t triggered a run yet. - Typing indicators in groups follow `agents.defaults.typingMode` (default: `message` when unmentioned).
https://github.com/openclaw/openclaw/blob/main//docs/concepts/group-messages.md
main
opebclaw
[ -0.02547997049987316, 0.03421736881136894, -0.02708774246275425, 0.010625542141497135, 0.031987112015485764, -0.10576415061950684, 0.07937516272068024, -0.07626792788505554, 0.0311275664716959, 0.01590595580637455, 0.05171152949333191, -0.045549098402261734, 0.0004590791359078139, -0.0023181044962257147, 0.10014509409666061, 0.02641516923904419, 0.039104580879211426, -0.08572111278772354, -0.043217163532972336, -0.0583084374666214, -0.011795571073889732, 0.04878148436546326, 0.006787638645619154, 0.04968823492527008, -0.10271662473678589, -0.023947246372699738, -0.04469171166419983, 0.01884591020643711, 0.0001504117826698348, 0.001735661644488573, 0.060178086161613464, 0.04836586117744446, -0.061912063509225845, 0.07061159610748291, 0.024249646812677383, 0.0025970616843551397, 0.10535327345132828, 0.040888454765081406, 0.03389699012041092, -0.041367094963788986, 0.03223251551389694, 0.00029769682441838086, -0.04553965479135513, -0.014771250076591969, 0.017956729978322983, 0.00023245569900609553, -0.04719432070851326, 0.01281079649925232, -0.09732603281736374, 0.04931529611349106, 0.019131995737552643, 0.03771195188164711, 0.005315533839166164, 0.11080125719308853, -0.021974723786115646, 0.06607425212860107, -0.04187130182981491, 0.04137888178229332, -0.004424575250595808, -0.050498880445957184, -0.054477348923683167, -0.06224818900227547, -0.020404744893312454, 0.009657285176217556, -0.06693221628665924, 0.01728244125843048, 0.015433354303240776, -0.01671687327325344, 0.07559587806463242, 0.0007677184185013175, 0.0026775903534144163, -0.02518945373594761, -0.048585258424282074, -0.004175888374447823, -0.007067330181598663, 0.007455510552972555, -0.028446774929761887, -0.013560776598751545, -0.07782437652349472, -0.06283825635910034, 0.00826781615614891, -0.01717517524957657, -0.038673192262649536, 0.048735201358795166, -0.020700452849268913, 0.06170731782913208, -0.01609661802649498, 0.018613126128911972, -0.011119650676846504, -0.007568811997771263, -0.003247321816161275, -0.052848704159259796, 0.01938994601368904, 0.06279820203781128, -0.027665449306368828, 0.026983480900526047, 0.03781591355800629, 0.0883256196975708, 0.01530599407851696, 0.08477498590946198, 0.035651929676532745, 0.029242925345897675, -0.029934486374258995, -0.020694054663181305, -0.04137787967920303, 0.04080131649971008, -0.04124433174729347, 0.00958044920116663, 0.05819157883524895, 0.01167430728673935, -0.027805985882878304, 0.005731647368520498, 0.09432777017354965, 0.04397839680314064, 0.03286302834749222, -0.010087409988045692, 0.016910409554839134, 0.025548411533236504, 0.011656844057142735, 0.03119700215756893, 0.05849801003932953, -0.07833144068717957, 0.0670270025730133, 0.035868920385837555, 0.04399530589580536, 0.04636591300368309, 0.0830778107047081, 8.4074845719664e-34, 0.04706384241580963, 0.0722222551703453, -0.010177649557590485, 0.0940820500254631, 0.09565471112728119, 0.048397887498140335, -0.00295543042011559, 0.03829909861087799, -0.05211299657821655, 0.042761318385601044, -0.07035858184099197, 0.08321836590766907, 0.02841685153543949, -0.008580569177865982, -0.05702465772628784, 0.04382126033306122, -0.046389978379011154, -0.004689816385507584, 0.06888365000486374, -0.006541219539940357, -0.02114221826195717, -0.05627172067761421, -0.04377022758126259, 0.030396688729524612, 0.03811213746666908, 0.0653190165758133, 0.008886076509952545, 0.009127043187618256, 0.026885289698839188, 0.011706601828336716, -0.004819143563508987, 0.03460563346743584, -0.0018412622157484293, -0.009636929258704185, 0.031162666156888008, 0.028858311474323273, -0.04646369814872742, 0.015489093959331512, -0.0857623964548111, -0.04057009890675545, -0.01103516947478056, -0.024385469034314156, -0.06835640221834183, -0.03715796396136284, -0.06243071332573891, -0.08485092967748642, -0.08393747359514236, 0.0003040136944036931, 0.05459195747971535, 0.012962632812559605, -0.09212920069694519, -0.004410694353282452, 0.011783556081354618, 0.021444814279675484, -0.03007436916232109, -0.0009532656986266375, 0.012348389253020287, -0.01856628991663456, -0.022717420011758804, 0.03027312643826008, 0.014124131761491299, -0.013567432761192322, -0.08700767904520035, 0.008922037668526173, 0.02094549685716629, -0.01962403766810894, -0.09831403195858002, -0.02276953123509884, 0.031103430315852165, 0.00036687220563180745, -0.02590867504477501, 0.044690415263175964, 0.04484033212065697, 0.08189094066619873, -0.021761681884527206, -0.0732593759894371, -0.04476197808980942, 0.14460612833499908, -0.06662862747907639, 0.028167912736535072, 0.07379917055368423, 0.008055695332586765, -0.08472763746976852, 0.02202121540904045, -0.04684982821345329, -0.06685350835323334, 0.024659430608153343, -0.09818536788225174, -0.12582547962665558, 0.11255937814712524, -0.11869621276855469, 0.012614697217941284, 0.10547914355993271, 0.1090184897184372, -0.05006469786167145, -3.22149626770022e-33, -0.05363919958472252, 0.08658463507890701, -0.062269993126392365, 0.0033735292963683605, -0.0017964920261874795, -0.0292357224971056, 0.06893026828765869, 0.04326684772968292, -0.02546735480427742, -0.033472929149866104, -0.014158865436911583, 0.038698822259902954, 0.06209925562143326, 0.051819272339344025, -0.03196580708026886, 0.03037451021373272, 0.03923259302973747, -0.07007533311843872, -0.040222566574811935, -0.04163459315896034, 0.0008964231819845736, 0.016569828614592552, -0.0666331946849823, 0.039206381887197495, 0.002248970093205571, -0.006978088989853859, 0.09240325540304184, -0.010363482870161533, -0.027844317257404327, -0.0595296174287796, 0.07889412343502045, 0.05787402018904686, -0.03210148215293884, 0.02146672084927559, -0.007658373098820448, -0.067513108253479, 0.011556245386600494, 0.13267455995082855, 0.004292692989110947, -0.010593671351671219, 0.11413370817899704, 0.07452283799648285, -0.09979048371315002, -0.02224024385213852, -0.02638436295092106, 0.10565274208784103, -0.020594926550984383, -0.02734513022005558, -0.13434898853302002, 0.12256237864494324, 0.002142322016879916, -0.05566489323973656, 0.013211138546466827, 0.02766035869717598, 0.026213182136416435, 0.008861458860337734, 0.037446245551109314, -0.043832771480083466, -0.007743362337350845, -0.10337900370359421, 0.0024208177346736193, -0.044729527086019516, -0.02481371909379959, 0.0537961944937706, 0.019718702882528305, -0.10927053540945053, -0.007274311501532793, 0.03031943365931511, 0.09320499002933502, -0.0034265690483152866, -0.043373484164476395, -0.11079490929841995, -0.05083513259887695, 0.0004441019846126437, 0.07121989130973816, -0.04976115748286247, -0.06550997495651245, -0.16219809651374817, -0.061802130192518234, 0.02120388299226761, -0.043134905397892, -0.016693755984306335, 0.003538422519341111, 0.030002396553754807, 0.003534685354679823, 0.04914587363600731, -0.001218038727529347, 0.0983918085694313, -0.008659928105771542, 0.024056117981672287, -0.03335185348987579, 0.03825156390666962, -0.08881615847349167, -0.072298564016819, -0.03671615198254585, -6.074665748201369e-8, -0.04652939736843109, -0.1172572672367096, -0.01719134859740734, 0.10502583533525467, -0.012972097843885422, -0.04214678704738617, 0.039202675223350525, -0.021739313378930092, -0.03125356510281563, -0.04462019354104996, 0.012740535661578178, -0.022426288574934006, -0.08045206218957901, -0.030955299735069275, 0.025796208530664444, -0.004476009868085384, -0.05098456144332886, -0.056914594024419785, -0.023579394444823265, -0.0961351990699768, -0.02344176359474659, 0.008235756307840347, 0.04637470841407776, 0.07074753940105438, -0.032424792647361755, -0.011745556257665157, 0.017846012488007545, 0.03826245665550232, -0.07266759872436523, 0.025731196627020836, -0.0696108415722847, -0.03242364525794983, 0.0037929844111204147, -0.01650950312614441, -0.05761544406414032, 0.00482955714687705, -0.06467221677303314, -0.029494760558009148, 0.044748879969120026, -0.012740038335323334, 0.04964582622051239, 0.002321487758308649, -0.013642348349094391, -0.0028695689979940653, 0.01074274443089962, -0.03206565976142883, -0.0337272509932518, -0.04493162781000137, 0.02363559976220131, -0.008497982285916805, 0.0042626033537089825, 0.005322353448718786, 0.036549899727106094, 0.0829646959900856, -0.026421131566166878, -0.019719887524843216, 0.03423627093434334, -0.015171020291745663, 0.056728895753622055, -0.03807831183075905, 0.05199859291315079, 0.057644907385110855, -0.06735917180776596, -0.06055087223649025 ]
0.040875
# Context Window & Compaction Every model has a \*\*context window\*\* (max tokens it can see). Long-running chats accumulate messages and tool results; once the window is tight, OpenClaw \*\*compacts\*\* older history to stay within limits. ## What compaction is Compaction \*\*summarizes older conversation\*\* into a compact summary entry and keeps recent messages intact. The summary is stored in the session history, so future requests use: - The compaction summary - Recent messages after the compaction point Compaction \*\*persists\*\* in the session’s JSONL history. ## Configuration See [Compaction config & modes](/concepts/compaction) for the `agents.defaults.compaction` settings. ## Auto-compaction (default on) When a session nears or exceeds the model’s context window, OpenClaw triggers auto-compaction and may retry the original request using the compacted context. You’ll see: - `🧹 Auto-compaction complete` in verbose mode - `/status` showing `🧹 Compactions: ` Before compaction, OpenClaw can run a \*\*silent memory flush\*\* turn to store durable notes to disk. See [Memory](/concepts/memory) for details and config. ## Manual compaction Use `/compact` (optionally with instructions) to force a compaction pass: ``` /compact Focus on decisions and open questions ``` ## Context window source Context window is model-specific. OpenClaw uses the model definition from the configured provider catalog to determine limits. ## Compaction vs pruning - \*\*Compaction\*\*: summarises and \*\*persists\*\* in JSONL. - \*\*Session pruning\*\*: trims old \*\*tool results\*\* only, \*\*in-memory\*\*, per request. See [/concepts/session-pruning](/concepts/session-pruning) for pruning details. ## Tips - Use `/compact` when sessions feel stale or context is bloated. - Large tool outputs are already truncated; pruning can further reduce tool-result buildup. - If you need a fresh slate, `/new` or `/reset` starts a new session id.
https://github.com/openclaw/openclaw/blob/main//docs/concepts/compaction.md
main
opebclaw
[ -0.07794710248708725, 0.025814114138484, -0.059190306812524796, 0.050622694194316864, 0.019845062866806984, -0.05677647516131401, -0.021039601415395737, -0.045685701072216034, 0.04774797335267067, -0.03466728329658508, -0.0035433403681963682, 0.03405625745654106, -0.006243275478482246, 0.013191434554755688, 0.06202833354473114, 0.04353460669517517, 0.011167350225150585, -0.046031683683395386, -0.08234970271587372, 0.0026664272882044315, 0.06985234469175339, 0.1019163504242897, 0.009240713901817799, -0.017201915383338928, -0.08621832728385925, -0.021149305626749992, -0.039177678525447845, -0.026616133749485016, 0.01955896057188511, 0.013738865964114666, 0.009067696519196033, 0.011551402509212494, 0.017447413876652718, 0.02297830395400524, 0.06851758062839508, 0.015396414324641228, -0.03859815374016762, -0.007925467565655708, 0.003378515597432852, -0.044001735746860504, -0.015302132815122604, 0.04764377325773239, -0.07655231654644012, -0.003470395924523473, -0.09957835078239441, -0.04923572391271591, -0.08261431753635406, -0.06501787155866623, -0.023092154413461685, 0.02536413073539734, -0.0821542739868164, -0.014805328100919724, 0.006277923937886953, -0.00755352433770895, 0.02896891161799431, 0.03914722427725792, -0.04948817938566208, 0.005549036432057619, -0.028125375509262085, -0.016876880079507828, 0.04523998871445656, -0.06795674562454224, -0.0883457213640213, 0.02643192559480667, -0.07485849410295486, 0.028871972113847733, 0.001810773159377277, -0.046713024377822876, 0.018407337367534637, -0.023199260234832764, 0.00016858545131981373, 0.004134275950491428, -0.08497828990221024, -0.02357812412083149, 0.04533401131629944, 0.015917647629976273, 0.02037300541996956, -0.029098661616444588, -0.07908610254526138, -0.05557579547166824, -0.06094082444906235, -0.0512816458940506, -0.01602860726416111, 0.02122325822710991, -0.03061872348189354, 0.08918236941099167, 0.0018254867754876614, 0.007287321612238884, 0.013053239323198795, 0.03995412960648537, -0.004598382860422134, -0.13005739450454712, -0.07129989564418793, 0.06901725381612778, -0.05327966809272766, -0.024659430608153343, -0.0012764489511027932, 0.07226650416851044, -0.04671701043844223, 0.09274647384881973, 0.0637095645070076, 0.03443657234311104, 0.05719248205423355, -0.010999823920428753, -0.037034787237644196, 0.0011665747733786702, -0.022339440882205963, 0.07381005585193634, -0.008362063206732273, 0.035451363772153854, -0.000006820946055086097, 0.02433355525135994, 0.06136520951986313, 0.004650313872843981, 0.0010524567915126681, 0.0059205954894423485, -0.006471406668424606, 0.03951271250844002, 0.017813794314861298, 0.1152990311384201, 0.1255210041999817, -0.022411489859223366, -0.002783606993034482, 0.008383292704820633, 0.04586418718099594, 0.06466782093048096, 0.10405975580215454, 4.463264990021868e-33, 0.05226528272032738, -0.07240109890699387, -0.03224435821175575, 0.0748201236128807, 0.08261293917894363, 0.040697596967220306, 0.004018809646368027, 0.08035216480493546, -0.03448458015918732, 0.00875183381140232, 0.04286173731088638, 0.11886539310216904, -0.023721057921648026, -0.05712106451392174, -0.012548853643238544, 0.0010636019287630916, -0.03219537064433098, 0.10074474662542343, 0.030407985672354698, 0.014753333292901516, 0.030790576711297035, 0.002340402454137802, 0.0025342602748423815, 0.02537568286061287, 0.039789192378520966, 0.01509954035282135, 0.01862148381769657, 0.023285886272788048, -0.1135057657957077, 0.04634418711066246, -0.033225126564502716, 0.06701929122209549, -0.037495214492082596, 0.07294417172670364, 0.016288865357637405, 0.07926033437252045, -0.031132932752370834, -0.0583573542535305, -0.029677506536245346, -0.10289415717124939, -0.00240734382532537, 0.019505847245454788, -0.10348965227603912, -0.021023180335760117, -0.0771193727850914, -0.20979365706443787, 0.008123555220663548, 0.04493506997823715, -0.020262300968170166, 0.028550181537866592, 0.058412861078977585, 0.034878890961408615, -0.005064202938228846, 0.00483804102987051, -0.06319121271371841, -0.05087631195783615, 0.018579140305519104, -0.0383775532245636, 0.027278751134872437, 0.06139736622571945, 0.05265031009912491, -0.02781105972826481, 0.018537940457463264, 0.05810501053929329, 0.10020877420902252, 0.04001370072364807, -0.04800925403833389, 0.03317529708147049, -0.06913480162620544, -0.030448298901319504, 0.020052149891853333, 0.02506553754210472, 0.025420978665351868, 0.030140897259116173, -0.0456770621240139, -0.09320782870054245, 0.07274855673313141, 0.034900471568107605, 0.01869075372815132, -0.010397909209132195, 0.09954290837049484, -0.05137331411242485, -0.026720385998487473, 0.02508876472711563, -0.048122797161340714, 0.012196815572679043, 0.02526972070336342, -0.05419125035405159, 0.02275952510535717, 0.028346126899123192, -0.0780959203839302, -0.013674138113856316, -0.04313739761710167, 0.00852599460631609, -0.016035178676247597, -5.933870136353968e-33, 0.08351187407970428, -0.06384707242250443, -0.044966135174036026, -0.019637472927570343, 0.01400741096585989, -0.026718011125922203, -0.03223605826497078, 0.046494174748659134, -0.06852367520332336, -0.09100844711065292, 0.009965245611965656, 0.005208589602261782, 0.0806557759642601, -0.014662767760455608, -0.0007553912000730634, 0.004990201443433762, 0.0646359995007515, -0.14109395444393158, -0.03528602048754692, 0.02456299029290676, 0.07327615469694138, -0.06744091957807541, -0.05697471648454666, -0.026999885216355324, 0.05341768637299538, -0.08322740346193314, -0.030275342985987663, -0.006938681937754154, 0.013137943111360073, -0.04800413176417351, 0.046191394329071045, -0.03380890190601349, -0.0410686694085598, -0.02654087543487549, -0.010010340251028538, -0.02988530322909355, 0.005463454872369766, 0.0357983224093914, 0.012399498373270035, 0.059676092118024826, 0.09093622118234634, -0.010775800794363022, -0.05506144091486931, 0.00026309475651942194, 0.05604731664061546, 0.010904909111559391, -0.0722278580069542, -0.05125431716442108, -0.05096347630023956, 0.012165459804236889, 0.03976358473300934, 0.022175364196300507, 0.014127569273114204, -0.006959803402423859, -0.04261847212910652, 0.06108854338526726, 0.028188560158014297, -0.0688050389289856, -0.04536927491426468, -0.10149483382701874, 0.007921269163489342, -0.01427101157605648, -0.04176097363233566, 0.00922857690602541, 0.03715360537171364, -0.029398959130048752, -0.004824828822165728, 0.021145757287740707, -0.028152888640761375, -0.049741439521312714, 0.00045804670662619174, -0.05415322259068489, -0.04888932406902313, 0.013298610225319862, 0.07668983936309814, -0.015008550137281418, 0.006776854861527681, -0.15251761674880981, 0.010891714133322239, 0.006552265491336584, -0.03308875113725662, 0.03352637216448784, 0.03636259213089943, 0.0566382072865963, 0.03108423762023449, 0.057365335524082184, -0.03763865306973457, 0.13783250749111176, -0.01773093454539776, 0.0684444010257721, -0.032577965408563614, -0.011376599781215191, -0.02352430298924446, 0.000804441049695015, -0.017741743475198746, -5.1040121462619936e-8, -0.14822953939437866, 0.01319405622780323, -0.026839109137654305, 0.0866779014468193, 0.07763982564210892, 0.016147682443261147, 0.04177756607532501, 0.08274304121732712, -0.0025448035448789597, 0.00300211482681334, 0.06895235180854797, 0.0753912627696991, -0.031178319826722145, -0.021673785522580147, -0.03752392902970314, 0.03907419368624687, 0.0044113639742136, -0.11402657628059387, -0.0007439663750119507, -0.03793950006365776, -0.004551593214273453, 0.005676981061697006, 0.05655094236135483, 0.045666396617889404, -0.054383207112550735, -0.008119317702949047, -0.02482197806239128, 0.15137337148189545, -0.08335511386394501, -0.03551291674375534, -0.08094921708106995, 0.02317512221634388, -0.008132961578667164, -0.04871213436126709, -0.0513797327876091, 0.04818491265177727, -0.013840761967003345, -0.006323180627077818, 0.0329185426235199, -0.035004690289497375, 0.054094187915325165, 0.03038572333753109, -0.06470170617103577, 0.03780350089073181, 0.0185172650963068, 0.06321040540933609, -0.010424639098346233, 0.014125287532806396, -0.014959923923015594, -0.05657285451889038, -0.024835679680109024, 0.01054027583450079, -0.006049735471606255, 0.1072913333773613, -0.028125347569584846, 0.06066754832863808, 0.08314745128154755, -0.07664810866117477, 0.021865740418434143, 0.013135056011378765, 0.033368658274412155, 0.028117191046476364, -0.07765749841928482, 0.010621747933328152 ]
0.123434
# Gateway architecture Last updated: 2026-01-22 ## Overview - A single long‑lived \*\*Gateway\*\* owns all messaging surfaces (WhatsApp via Baileys, Telegram via grammY, Slack, Discord, Signal, iMessage, WebChat). - Control-plane clients (macOS app, CLI, web UI, automations) connect to the Gateway over \*\*WebSocket\*\* on the configured bind host (default `127.0.0.1:18789`). - \*\*Nodes\*\* (macOS/iOS/Android/headless) also connect over \*\*WebSocket\*\*, but declare `role: node` with explicit caps/commands. - One Gateway per host; it is the only place that opens a WhatsApp session. - A \*\*canvas host\*\* (default `18793`) serves agent‑editable HTML and A2UI. ## Components and flows ### Gateway (daemon) - Maintains provider connections. - Exposes a typed WS API (requests, responses, server‑push events). - Validates inbound frames against JSON Schema. - Emits events like `agent`, `chat`, `presence`, `health`, `heartbeat`, `cron`. ### Clients (mac app / CLI / web admin) - One WS connection per client. - Send requests (`health`, `status`, `send`, `agent`, `system-presence`). - Subscribe to events (`tick`, `agent`, `presence`, `shutdown`). ### Nodes (macOS / iOS / Android / headless) - Connect to the \*\*same WS server\*\* with `role: node`. - Provide a device identity in `connect`; pairing is \*\*device‑based\*\* (role `node`) and approval lives in the device pairing store. - Expose commands like `canvas.\*`, `camera.\*`, `screen.record`, `location.get`. Protocol details: - [Gateway protocol](/gateway/protocol) ### WebChat - Static UI that uses the Gateway WS API for chat history and sends. - In remote setups, connects through the same SSH/Tailscale tunnel as other clients. ## Connection lifecycle (single client) ``` Client Gateway | | |---- req:connect -------->| |<------ res (ok) ---------| (or res error + close) | (payload=hello-ok carries snapshot: presence + health) | | |<------ event:presence ---| |<------ event:tick -------| | | |------- req:agent ------->| |<------ res:agent --------| (ack: {runId,status:"accepted"}) |<------ event:agent ------| (streaming) |<------ res:agent --------| (final: {runId,status,summary}) | | ``` ## Wire protocol (summary) - Transport: WebSocket, text frames with JSON payloads. - First frame \*\*must\*\* be `connect`. - After handshake: - Requests: `{type:"req", id, method, params}` → `{type:"res", id, ok, payload|error}` - Events: `{type:"event", event, payload, seq?, stateVersion?}` - If `OPENCLAW\_GATEWAY\_TOKEN` (or `--token`) is set, `connect.params.auth.token` must match or the socket closes. - Idempotency keys are required for side‑effecting methods (`send`, `agent`) to safely retry; the server keeps a short‑lived dedupe cache. - Nodes must include `role: "node"` plus caps/commands/permissions in `connect`. ## Pairing + local trust - All WS clients (operators + nodes) include a \*\*device identity\*\* on `connect`. - New device IDs require pairing approval; the Gateway issues a \*\*device token\*\* for subsequent connects. - \*\*Local\*\* connects (loopback or the gateway host’s own tailnet address) can be auto‑approved to keep same‑host UX smooth. - \*\*Non‑local\*\* connects must sign the `connect.challenge` nonce and require explicit approval. - Gateway auth (`gateway.auth.\*`) still applies to \*\*all\*\* connections, local or remote. Details: [Gateway protocol](/gateway/protocol), [Pairing](/start/pairing), [Security](/gateway/security). ## Protocol typing and codegen - TypeBox schemas define the protocol. - JSON Schema is generated from those schemas. - Swift models are generated from the JSON Schema. ## Remote access - Preferred: Tailscale or VPN. - Alternative: SSH tunnel ```bash ssh -N -L 18789:127.0.0.1:18789 user@host ``` - The same handshake + auth token apply over the tunnel. - TLS + optional pinning can be enabled for WS in remote setups. ## Operations snapshot - Start: `openclaw gateway` (foreground, logs to stdout). - Health: `health` over WS (also included in `hello-ok`). - Supervision: launchd/systemd for auto‑restart. ## Invariants - Exactly one Gateway controls a single Baileys session per host. - Handshake is mandatory; any non‑JSON or non‑connect first frame is a hard close. - Events are not replayed; clients must refresh on gaps.
https://github.com/openclaw/openclaw/blob/main//docs/concepts/architecture.md
main
opebclaw
[ -0.04252318665385246, -0.023001383990049362, 0.016303332522511482, -0.03404809907078743, -0.07065044343471527, -0.046928588300943375, 0.01892044208943844, 0.006502826232463121, 0.037236593663692474, 0.0834139734506607, 0.013718225061893463, -0.04003920406103134, 0.040144894272089005, 0.047578807920217514, 0.10350337624549866, 0.03200382739305496, 0.039859384298324585, -0.17808660864830017, 0.01564270257949829, 0.020444560796022415, -0.007738671265542507, -0.014554532244801521, 0.017932143062353134, 0.010462465696036816, -0.029649414122104645, 0.005582601763308048, -0.01832151599228382, -0.03274930268526077, 0.037903062999248505, 0.057091712951660156, 0.00504492549225688, -0.01985742524266243, -0.064092718064785, 0.08397874981164932, -0.06208868697285652, 0.004579123109579086, 0.10795964300632477, 0.044301070272922516, -0.030462486669421196, 0.044688209891319275, 0.029656490311026573, -0.002055126242339611, -0.050763458013534546, -0.016612334176898003, 0.06601645797491074, -0.04853757470846176, -0.07160824537277222, -0.015406643971800804, -0.04632677510380745, 0.0044812471605837345, 0.02734730951488018, -0.02132043056190014, 0.02344912476837635, 0.12395569682121277, 0.00214844080619514, 0.08391629904508591, -0.050110891461372375, 0.08725026994943619, 0.03221709281206131, -0.015810996294021606, -0.06404177844524384, -0.03607914596796036, 0.047824274748563766, 0.040216196328401566, -0.06722944229841232, 0.007207641843706369, -0.04647749289870262, -0.027349820360541344, -0.02283889800310135, -0.012144118547439575, -0.024084554985165596, -0.017577597871422768, 0.020684421062469482, -0.013480267487466335, 0.0041819666512310505, 0.001859919517301023, 0.032321471720933914, 0.040578171610832214, -0.14446039497852325, -0.0841156393289566, 0.09730212390422821, 0.06375742703676224, -0.10798957198858261, 0.1129455715417862, -0.06363054364919662, 0.015703817829489708, -0.052813295274972916, -0.006615648046135902, -0.003817933611571789, 0.005607821512967348, -0.020476551726460457, -0.10033439099788666, -0.04686642438173294, 0.045256633311510086, 0.041959650814533234, 0.052068695425987244, 0.011376295238733292, -0.020898938179016113, -0.06443329900503159, -0.013373487628996372, -0.043493371456861496, -0.034991178661584854, 0.004835071507841349, -0.014223809354007244, 0.016023000702261925, 0.045804329216480255, -0.021136216819286346, -0.003950022626668215, 0.1032746210694313, 0.010620652697980404, -0.07882477343082428, -0.03473569080233574, 0.0032233132515102625, 0.045494355261325836, 0.004860712680965662, 0.00806636642664671, -0.0047970418818295, -0.021730346605181694, 0.01165492832660675, 0.04344206675887108, 0.0889921486377716, -0.03566448763012886, -0.023688344284892082, 0.06315089017152786, -0.019796129316091537, 0.0067727272398769855, 0.032949697226285934, 3.782878574190358e-33, 0.010611472651362419, -0.013523035682737827, -0.058953531086444855, 0.07973713427782059, 0.07695283740758896, 0.018250824883580208, 0.03662791848182678, -0.02286178432404995, -0.040864065289497375, -0.011334987357258797, -0.0810447484254837, 0.0044454485177993774, -0.030942298471927643, 0.014800036326050758, -0.023364834487438202, 0.0008665332570672035, 0.030241752043366432, -0.009075718000531197, 0.14703747630119324, -0.009825974702835083, -0.035433102399110794, -0.05403097718954086, -0.06730981916189194, -0.03330539911985397, 0.045094724744558334, 0.07433084398508072, 0.0003300491953268647, -0.030478816479444504, 0.01542162150144577, 0.00024455925449728966, 0.004962537437677383, -0.016976412385702133, -0.030001284554600716, 0.007426968775689602, -0.062400903552770615, -0.05714857950806618, -0.076459139585495, -0.02733047865331173, -0.05592647194862366, 0.0007692110957577825, -0.11075494438409805, -0.03587286174297333, -0.10525315999984741, -0.01846352405846119, 0.011206298135221004, -0.0998004600405693, -0.06462480127811432, 0.0682666003704071, -0.002486846409738064, 0.04606718197464943, -0.10851269215345383, 0.0009995572036132216, -0.005979829467833042, 0.0028209625743329525, 0.011033345945179462, -0.04337209090590477, -0.04950949549674988, -0.0019210465252399445, -0.019042668864130974, -0.016770947724580765, 0.0024752297904342413, 0.023839222267270088, -0.09354940801858902, -0.000536095816642046, 0.07801727205514908, 0.06991743296384811, -0.0734792947769165, 0.0047562927938997746, -0.0503765307366848, -0.0011766806710511446, -0.06677145510911942, 0.08351947367191315, -0.022514088079333305, 0.09235992282629013, -0.07194991409778595, 0.005222098436206579, -0.031957268714904785, 0.04886103421449661, 0.03221966326236725, -0.0077990018762648106, 0.007492427714169025, 0.028009291738271713, 0.00851807463914156, 0.056899651885032654, 0.027361709624528885, 0.015258953906595707, 0.07637488842010498, -0.11882546544075012, -0.06600648164749146, 0.09042695164680481, -0.06369801610708237, 0.06007958948612213, 0.10979818552732468, 0.018934443593025208, -0.08167640119791031, -6.270490208785207e-33, 0.002998091047629714, 0.023298026993870735, -0.09499532729387283, -0.003392750397324562, 0.01775055006146431, -0.03129816800355911, 0.04841143265366554, -0.04261714965105057, -0.019532786682248116, -0.0023041795939207077, 0.0031133771408349276, 0.035832442343235016, 0.05079447850584984, -0.10060364007949829, 0.051600273698568344, 0.053704921156167984, -0.005651348270475864, -0.06457650661468506, -0.03301192447543144, -0.040546923875808716, -0.004532342776656151, 0.05112951621413231, -0.03448774665594101, -0.02995985746383667, -0.022048985585570335, -0.01298396848142147, 0.042049091309309006, 0.06111311540007591, -0.06724658608436584, -0.0030595494899898767, -0.00528477318584919, -0.019385196268558502, 0.000005335032255970873, -0.01712695136666298, 0.030347436666488647, 0.023469820618629456, 0.003913130611181259, 0.0740107074379921, 0.019933752715587616, -0.08036547899246216, 0.11676520854234695, -0.08816983550786972, -0.018861232325434685, -0.008113930001854897, 0.0311066173017025, 0.09779966622591019, -0.13048961758613586, 0.03136148676276207, -0.0809599831700325, 0.005028672982007265, 0.007248390465974808, -0.04126271605491638, -0.0023044722620397806, 0.04960189014673233, 0.03619842603802681, 0.07569369673728943, 0.07913265377283096, -0.011698535643517971, 0.027834922075271606, -0.14330583810806274, 0.08222781121730804, -0.09200647473335266, -0.0019208966987207532, 0.0916164368391037, 0.019695501774549484, -0.060283564031124115, -0.03367214277386665, -0.014961895532906055, -0.0030647707171738148, 0.026477687060832977, 0.01578281633555889, -0.09562193602323532, -0.005385676398873329, -0.002587964991107583, 0.07263853400945663, 0.046658165752887726, -0.00492494972422719, -0.1377776563167572, 0.013071051798760891, 0.02187153697013855, -0.039010174572467804, 0.10700488090515137, 0.04893793538212776, -0.04077942296862602, 0.03646675497293472, 0.03994864970445633, 0.002625763649120927, 0.06022736802697182, -0.004824353847652674, 0.03038841113448143, -0.03151378035545349, 0.030693449079990387, 0.004029131960123777, -0.040401361882686615, 0.05801806598901749, -5.7341686954259785e-8, -0.031686246395111084, -0.05332423374056816, -0.0860414057970047, -0.023872651159763336, -0.05783703178167343, -0.013440301641821861, 0.01672663912177086, -0.06102222576737404, 0.0928775742650032, 0.029531270265579224, -0.016364160925149918, -0.024738803505897522, -0.03384508937597275, 0.039113402366638184, -0.001813730807043612, 0.0016827622894197702, -0.024781016632914543, -0.043690942227840424, -0.010802321135997772, -0.10283011943101883, -0.011096587404608727, -0.05906560644507408, -0.030374018475413322, 0.03716425225138664, 0.0131160793825984, -0.04179893061518669, 0.024931464344263077, 0.01966530829668045, -0.09173212200403214, 0.03862588852643967, -0.1031508669257164, -0.03905736654996872, -0.021039286628365517, 0.03666199743747711, -0.001544673927128315, 0.032891277223825455, -0.03610316663980484, -0.024520382285118103, -0.013343987986445427, 0.05514363944530487, 0.019846785813570023, -0.01824374869465828, -0.011207692325115204, -0.02988342009484768, 0.0651186853647232, 0.023662200197577477, -0.007308508735150099, 0.06871360540390015, 0.03726377338171005, 0.10306312888860703, -0.004561624024063349, -0.03333864361047745, 0.05802297964692116, -0.03672105818986893, 0.014969436451792717, -0.014672309160232544, 0.07069391757249832, -0.045687559992074966, -0.01425005029886961, -0.00039260429912246764, -0.0006606438546441495, 0.09814269840717316, 0.03295188024640083, -0.036526549607515335 ]
0.068932
WS (also included in `hello-ok`). - Supervision: launchd/systemd for auto‑restart. ## Invariants - Exactly one Gateway controls a single Baileys session per host. - Handshake is mandatory; any non‑JSON or non‑connect first frame is a hard close. - Events are not replayed; clients must refresh on gaps.
https://github.com/openclaw/openclaw/blob/main//docs/concepts/architecture.md
main
opebclaw
[ -0.038590461015701294, -0.03228231146931648, -0.0787915363907814, -0.013182583265006542, -0.0528821237385273, 0.009316153824329376, 0.03728245943784714, -0.01360520999878645, 0.005709492601454258, 0.0379367470741272, -0.035426393151283264, 0.0845162644982338, 0.0018728234572336078, 0.0386955551803112, -0.0139796556904912, 0.020037613809108734, 0.06810930371284485, -0.06442377716302872, 0.01564195565879345, -0.08773797750473022, -0.025951769202947617, 0.033835966140031815, 0.014019569382071495, -0.009731958620250225, -0.10775762051343918, -0.006477174814790487, 0.004622414708137512, -0.048018764704465866, 0.03740822896361351, -0.01951925829052925, 0.020587598904967308, -0.03307519480586052, -0.046643033623695374, -0.04732576385140419, 0.021056942641735077, 0.06965962797403336, 0.12773573398590088, 0.006032335106283426, -0.04413948953151703, 0.03365416079759598, 0.04989877715706825, -0.042024604976177216, -0.041035640984773636, 0.07360079139471054, -0.07601987570524216, 0.003279072931036353, -0.1398015171289444, 0.008177460171282291, -0.027041524648666382, -0.015375682152807713, 0.051318492740392685, -0.048918407410383224, 0.07080953568220139, 0.06829728931188583, 0.10894866287708282, 0.036406874656677246, 0.007677872199565172, 0.014821376651525497, 0.016574067994952202, -0.013577641919255257, -0.07939228415489197, 0.004987894091755152, -0.040042340755462646, 0.06310377269983292, 0.06736154854297638, 0.05186716094613075, -0.050595708191394806, -0.008776221424341202, 0.011602691374719143, -0.05534028634428978, -0.0557953342795372, -0.04906085133552551, -0.02040953002870083, -0.030384598299860954, -0.10249127447605133, -0.029081901535391808, 0.025117455050349236, -0.06877917051315308, -0.03947873413562775, -0.025110188871622086, -0.010245205834507942, 0.01622130535542965, -0.054189324378967285, 0.05411779135465622, -0.0032099236268550158, 0.02776358090341091, -0.039275337010622025, -0.021702006459236145, 0.09578011929988861, 0.09083987027406693, -0.06645715981721878, -0.032828107476234436, 0.007023918908089399, 0.014385071583092213, -0.052766282111406326, 0.05448078736662865, 0.046390365809202194, -0.026788219809532166, -0.009242110885679722, 0.0459444634616375, -0.015124727971851826, 0.03557109460234642, 0.06435821950435638, 0.06824877113103867, -0.04734140634536743, -0.07203295826911926, -0.08231552690267563, 0.07834139466285706, -0.018891582265496254, -0.06564075499773026, 0.011391381733119488, -0.011808591894805431, 0.060333553701639175, -0.004533860366791487, 0.029608115553855896, -0.00201902212575078, 0.020974095910787582, 0.0020379172638058662, -0.02700384519994259, -0.010835133492946625, 0.06010031700134277, -0.00876536499708891, 0.08411766588687897, -0.021263474598526955, 0.006214969791471958, 0.03654303029179573, 0.10849681496620178, 1.5454957077519955e-33, 0.018186932429671288, -0.08291548490524292, -0.09658464044332504, 0.06913109123706818, 0.06494326889514923, -0.003367906203493476, -0.03516962006688118, -0.023253200575709343, -0.032875362783670425, 0.0012811709893867373, -0.002966910367831588, 0.022683152928948402, 0.0028416861314326525, -0.05106377229094505, 0.06529629975557327, -0.04676467552781105, -0.016225332394242287, 0.045089829713106155, 0.05634566769003868, 0.023047640919685364, 0.06632720679044724, 0.001875992980785668, -0.0051864259876310825, 0.01987638510763645, 0.08639715611934662, -0.011653381399810314, 0.007840856909751892, 0.058527253568172455, 0.0742802768945694, 0.014805056154727936, 0.0778023898601532, 0.006070032250136137, -0.08633435517549515, 0.0025896900333464146, -0.09092938899993896, 0.04953783005475998, -0.04489077627658844, -0.0587550550699234, -0.02240351215004921, -0.11768651753664017, -0.041014257818460464, 0.006983791012316942, -0.03510779142379761, -0.01800348237156868, 0.011619589291512966, -0.1301390677690506, -0.1143832579255104, 0.025913340970873833, -0.014853430911898613, 0.014221476390957832, 0.01978684403002262, 0.07054765522480011, 0.02951621264219284, -0.013673389330506325, -0.005118764936923981, -0.02290136180818081, -0.01630920171737671, 0.010624272748827934, -0.013513322919607162, 0.0842633917927742, 0.008834227919578552, -0.009737268090248108, -0.06615941971540451, 0.02625150978565216, 0.1021895557641983, 0.0025830247905105352, 0.0023507848381996155, -0.055186063051223755, -0.01947772316634655, 0.04666289687156677, -0.0793038085103035, 0.0030572363175451756, 0.0340704582631588, 0.01223533134907484, 0.03149820864200592, -0.024710163474082947, 0.05110164359211922, 0.013544952496886253, 0.010692210868000984, 0.009842741303145885, -0.0071207997389137745, -0.017340898513793945, -0.06937158852815628, 0.07546189427375793, 0.057495735585689545, -0.007560952100902796, -0.056086957454681396, -0.03766891732811928, -0.1327732801437378, -0.004914994817227125, -0.041584622114896774, 0.04756900295615196, 0.0709124356508255, 0.10560546070337296, -0.0016124268295243382, -2.929379309365158e-33, 0.04290314391255379, -0.031400445848703384, -0.028487863019108772, 0.04070286452770233, -0.015110996551811695, -0.015101522207260132, -0.002820718102157116, 0.0244110357016325, -0.04640207812190056, -0.03286046162247658, 0.05424663424491882, -0.011924880556762218, -0.010508757084608078, 0.020887888967990875, -0.006479008123278618, -0.07009093463420868, 0.010708163492381573, -0.07533406466245651, 0.043482571840286255, 0.06089764088392258, 0.017832709476351738, 0.04525628313422203, -0.025799810886383057, -0.052871719002723694, 0.044099319726228714, 0.04274364560842514, -0.053144074976444244, -0.011681255884468555, -0.10051656514406204, 0.011814543046057224, 0.0712062194943428, -0.0266294926404953, 0.03056647814810276, 0.03731406480073929, -0.047356683760881424, 0.03164776787161827, 0.027435507625341415, 0.05303889885544777, -0.03507290408015251, 0.045320093631744385, 0.16019588708877563, 0.012178177945315838, -0.044768720865249634, 0.05924898386001587, -0.0005526197492145002, 0.08780487626791, -0.13857632875442505, 0.031425535678863525, -0.09727662801742554, -0.010452276095747948, -0.06995469331741333, -0.0005508186877705157, -0.017291374504566193, 0.021946988999843597, 0.018858352676033974, -0.0019735603127628565, 0.005600768141448498, 0.015112304128706455, -0.001968318596482277, -0.07804758846759796, 0.09232660382986069, -0.08976060897111893, -0.004122558515518904, 0.09481918066740036, -0.02087520994246006, -0.08557935804128647, -0.0750066265463829, 0.013959317468106747, 0.030462950468063354, -0.044813740998506546, 0.0023891751188784838, 0.005538743920624256, -0.004993407055735588, -0.01954498328268528, 0.05704450234770775, -0.09261512756347656, -0.03178545832633972, -0.15499387681484222, 0.011242169886827469, 0.008926045149564743, -0.09664393961429596, 0.08184851706027985, -0.030074991285800934, 0.019329294562339783, 0.0123970378190279, -0.020876744762063026, 0.0102689228951931, 0.06724134832620621, 0.07004798948764801, 0.04240292310714722, -0.03112196736037731, 0.061739977449178696, 0.026164444163441658, 0.025078060105443, -0.014699204824864864, -4.608128634231434e-8, -0.0677107572555542, 0.006889288779348135, 0.005478248931467533, 0.003207404864951968, -0.0021753248292952776, -0.0014153285883367062, -0.01677783578634262, -0.015511959791183472, -0.028676869347691536, -0.017390333116054535, 0.04329763352870941, 0.10643444210290909, -0.05861453711986542, -0.01653609424829483, -0.0014123503351584077, 0.06547725945711136, -0.027843885123729706, -0.0017114738002419472, -0.04715191200375557, -0.0017991292988881469, -0.011081084609031677, 0.013626473024487495, 0.03344624862074852, 0.04633135348558426, -0.06765469908714294, 0.04114598408341408, 0.11849264800548553, -0.0043518985621631145, -0.041067834943532944, 0.0017380593344569206, -0.028081590309739113, 0.00472358800470829, 0.017082199454307556, 0.04264841973781586, -0.03749267756938934, 0.09729322046041489, -0.1230325847864151, -0.0335240513086319, 0.06512387096881866, -0.034750569611787796, -0.045447953045368195, -0.02305467240512371, -0.027478769421577454, 0.03993752598762512, 0.0032154822256416082, 0.03458728268742561, -0.13447892665863037, 0.06670589745044708, -0.030791567638516426, -0.017239360138773918, -0.05773921310901642, -0.028064820915460587, 0.07345495373010635, -0.014069780707359314, 0.05552050098776817, 0.06321652978658676, 0.0839490070939064, -0.11471522599458694, 0.021319426596164703, 0.026226287707686424, 0.021121840924024582, 0.07255356758832932, 0.000014193507013260387, -0.046146292239427567 ]
0.14617
# Messages This page ties together how OpenClaw handles inbound messages, sessions, queueing, streaming, and reasoning visibility. ## Message flow (high level) ``` Inbound message -> routing/bindings -> session key -> queue (if a run is active) -> agent run (streaming + tools) -> outbound replies (channel limits + chunking) ``` Key knobs live in configuration: - `messages.\*` for prefixes, queueing, and group behavior. - `agents.defaults.\*` for block streaming and chunking defaults. - Channel overrides (`channels.whatsapp.\*`, `channels.telegram.\*`, etc.) for caps and streaming toggles. See [Configuration](/gateway/configuration) for full schema. ## Inbound dedupe Channels can redeliver the same message after reconnects. OpenClaw keeps a short-lived cache keyed by channel/account/peer/session/message id so duplicate deliveries do not trigger another agent run. ## Inbound debouncing Rapid consecutive messages from the \*\*same sender\*\* can be batched into a single agent turn via `messages.inbound`. Debouncing is scoped per channel + conversation and uses the most recent message for reply threading/IDs. Config (global default + per-channel overrides): ```json5 { messages: { inbound: { debounceMs: 2000, byChannel: { whatsapp: 5000, slack: 1500, discord: 1500, }, }, }, } ``` Notes: - Debounce applies to \*\*text-only\*\* messages; media/attachments flush immediately. - Control commands bypass debouncing so they remain standalone. ## Sessions and devices Sessions are owned by the gateway, not by clients. - Direct chats collapse into the agent main session key. - Groups/channels get their own session keys. - The session store and transcripts live on the gateway host. Multiple devices/channels can map to the same session, but history is not fully synced back to every client. Recommendation: use one primary device for long conversations to avoid divergent context. The Control UI and TUI always show the gateway-backed session transcript, so they are the source of truth. Details: [Session management](/concepts/session). ## Inbound bodies and history context OpenClaw separates the \*\*prompt body\*\* from the \*\*command body\*\*: - `Body`: prompt text sent to the agent. This may include channel envelopes and optional history wrappers. - `CommandBody`: raw user text for directive/command parsing. - `RawBody`: legacy alias for `CommandBody` (kept for compatibility). When a channel supplies history, it uses a shared wrapper: - `[Chat messages since your last reply - for context]` - `[Current message - respond to this]` For \*\*non-direct chats\*\* (groups/channels/rooms), the \*\*current message body\*\* is prefixed with the sender label (same style used for history entries). This keeps real-time and queued/history messages consistent in the agent prompt. History buffers are \*\*pending-only\*\*: they include group messages that did \_not\_ trigger a run (for example, mention-gated messages) and \*\*exclude\*\* messages already in the session transcript. Directive stripping only applies to the \*\*current message\*\* section so history remains intact. Channels that wrap history should set `CommandBody` (or `RawBody`) to the original message text and keep `Body` as the combined prompt. History buffers are configurable via `messages.groupChat.historyLimit` (global default) and per-channel overrides like `channels.slack.historyLimit` or `channels.telegram.accounts..historyLimit` (set `0` to disable). ## Queueing and followups If a run is already active, inbound messages can be queued, steered into the current run, or collected for a followup turn. - Configure via `messages.queue` (and `messages.queue.byChannel`). - Modes: `interrupt`, `steer`, `followup`, `collect`, plus backlog variants. Details: [Queueing](/concepts/queue). ## Streaming, chunking, and batching Block streaming sends partial replies as the model produces text blocks. Chunking respects channel text limits and avoids splitting fenced code. Key settings: - `agents.defaults.blockStreamingDefault` (`on|off`, default off) - `agents.defaults.blockStreamingBreak` (`text\_end|message\_end`) - `agents.defaults.blockStreamingChunk` (`minChars|maxChars|breakPreference`) - `agents.defaults.blockStreamingCoalesce` (idle-based batching) - `agents.defaults.humanDelay` (human-like pause between block replies) - Channel overrides: `\*.blockStreaming` and `\*.blockStreamingCoalesce` (non-Telegram channels require explicit `\*.blockStreaming: true`) Details: [Streaming + chunking](/concepts/streaming). ## Reasoning visibility and tokens OpenClaw can expose or hide model reasoning: - `/reasoning
https://github.com/openclaw/openclaw/blob/main//docs/concepts/messages.md
main
opebclaw
[ -0.05131746083498001, -0.08885150402784348, -0.02273842692375183, 0.02681591920554638, 0.036269668489694595, -0.10927877575159073, 0.07833217829465866, -0.05447419360280037, 0.0666506364941597, 0.024126628413796425, 0.030661193653941154, 0.05152108147740364, -0.0010118200443685055, -0.00105571118183434, 0.07522282749414444, 0.028404422104358673, 0.0666530579328537, -0.12210990488529205, -0.10561051964759827, -0.03267405554652214, 0.0853177085518837, 0.031170524656772614, -0.033997904509305954, 0.0348038524389267, -0.051717571914196014, -0.016800735145807266, -0.04580267146229744, 0.005403562914580107, -0.01853412576019764, -0.04191335663199425, 0.040440090000629425, 0.03169022127985954, -0.059289414435625076, 0.04779398813843727, -0.007639959454536438, 0.046801935881376266, 0.03758489713072777, 0.02513686753809452, 0.008199622854590416, 0.04922309145331383, 0.029278909787535667, -0.041833117604255676, -0.07022089511156082, 0.002267032628878951, -0.0371723435819149, -0.03431381657719612, -0.06814241409301758, 0.021493736654520035, -0.04938790574669838, 0.0005772768054157495, -0.03852638229727745, -0.03642677143216133, -0.004043751861900091, 0.09833591431379318, 0.037181973457336426, 0.019684704020619392, -0.08134660869836807, 0.0316910482943058, 0.017301511019468307, -0.01132295187562704, -0.00666382722556591, -0.02611890435218811, -0.023203575983643532, 0.05410166457295418, -0.08281131833791733, 0.022981248795986176, 0.02415783889591694, 0.02015683427453041, 0.012017774395644665, 0.03759176656603813, -0.007275036070495844, 0.03054891526699066, -0.01936309039592743, 0.024800987914204597, 0.012519251555204391, -0.012254495173692703, 0.03450265899300575, 0.0019834002014249563, -0.1529334932565689, -0.07714633643627167, -0.010605675168335438, -0.06686204671859741, -0.025088056921958923, 0.021831315010786057, -0.01408854778856039, 0.027856837958097458, 0.017713608220219612, -0.01805291883647442, -0.008712438866496086, 0.03207363188266754, -0.06057420372962952, -0.06110098958015442, 0.04519161209464073, 0.09588725119829178, -0.029279660433530807, 0.033865317702293396, -0.04336242005228996, -0.0023662059102207422, -0.0006445597391575575, 0.05699186772108078, 0.05070898309350014, -0.036514922976493835, 0.020430227741599083, -0.005843978375196457, -0.008100545033812523, -0.03614204376935959, 0.019537055864930153, 0.05139229819178581, -0.01651580259203911, 0.016896989196538925, -0.022920172661542892, 0.01185996551066637, 0.14395558834075928, -0.020832916721701622, 0.014101756736636162, 0.08669964969158173, -0.012506498023867607, 0.018123721703886986, 0.048985805362463, 0.010633331723511219, 0.06777272373437881, -0.06829053908586502, -0.0008575262618251145, 0.0003988860989920795, 0.042420536279678345, 0.09999924153089523, 0.0794358178973198, 6.501275749366116e-33, -0.004292823374271393, -0.037136614322662354, -0.08945636451244354, 0.029430072754621506, 0.06480452418327332, 0.0575120747089386, 0.011112097650766373, 0.03850678354501724, -0.08900176733732224, 0.021115625277161598, -0.04546237736940384, 0.019210638478398323, -0.007169367745518684, -0.000043083335185656324, -0.03138245642185211, -0.07320790737867355, -0.034513089805841446, 0.059221573173999786, 0.05332159623503685, -0.014724768698215485, -0.010056483559310436, -0.06005115434527397, -0.058928798884153366, 0.03789152204990387, 0.05949495732784271, 0.05962106212973595, -0.029506467282772064, -0.08601915091276169, 0.027844935655593872, 0.036779165267944336, 0.012960375286638737, 0.0901414304971695, -0.033403050154447556, 0.05727648735046387, -0.009786838665604591, -0.003586066886782646, -0.11001699417829514, -0.05289705842733383, -0.033604491502046585, -0.06311331689357758, -0.049168359488248825, 0.003311751876026392, -0.14167650043964386, -0.052852652966976166, -0.06331631541252136, -0.08738964796066284, -0.051005326211452484, 0.06512986868619919, -0.02546001225709915, -0.01794980838894844, 0.0764412060379982, 0.03996853902935982, 0.030584920197725296, 0.020851904526352882, -0.006019511725753546, -0.02728004939854145, 0.017590127885341644, -0.026792362332344055, 0.025311680510640144, 0.10972272604703903, -0.006660717539489269, -0.040528491139411926, -0.019319705665111542, 0.0009737513610161841, 0.0667514055967331, 0.0430280826985836, -0.00332225626334548, 0.027144676074385643, -0.018761366605758667, -0.07041441649198532, -0.038126688450574875, -0.01436746958643198, 0.02441392093896866, 0.07671912759542465, -0.08117884397506714, -0.012799271382391453, -0.0415591299533844, 0.03941228613257408, 0.04558242857456207, -0.007965211756527424, -0.015468372963368893, 0.006407817825675011, 0.023681145161390305, 0.011910711415112019, -0.0140920365229249, -0.023549826815724373, 0.040901102125644684, -0.12544408440589905, -0.046739399433135986, 0.10100999474525452, -0.11385449767112732, 0.044837091118097305, 0.027236714959144592, 0.009259008802473545, 0.04429128021001816, -6.341146235477258e-33, -0.03725210949778557, 0.03155321255326271, -0.12076816707849503, 0.03954542800784111, -0.013575213961303234, 0.019565530121326447, 0.008997459895908833, 0.020965993404388428, 0.039909105747938156, -0.10176397860050201, -0.07290758192539215, 0.015012509189546108, 0.00115051562897861, -0.026489362120628357, -0.02359152026474476, -0.10066219419240952, 0.04432591050863266, -0.06698746234178543, -0.04193440079689026, -0.021094461902976036, 0.02751031517982483, -0.03995372727513313, -0.08972219377756119, -0.001330550410784781, 0.04005412384867668, 0.029100356623530388, 0.025332288816571236, 0.07948403060436249, -0.005564579274505377, -0.07591531425714493, 0.049443475902080536, 0.02705676294863224, -0.004234878811985254, -0.03871774300932884, 0.01797875575721264, 0.018869608640670776, 0.027264278382062912, 0.08798401802778244, 0.024849560111761093, 0.004433059133589268, 0.10324063897132874, 0.022924067452549934, -0.04250181466341019, -0.01153742615133524, -0.01553827989846468, 0.10880637913942337, -0.08564130961894989, -0.024128243327140808, -0.14996367692947388, 0.04398634284734726, 0.04785975441336632, -0.034458912909030914, 0.03969665616750717, 0.05569726228713989, 0.010824297554790974, 0.058296192437410355, 0.050126343965530396, -0.008847872726619244, 0.024567527696490288, -0.10219085961580276, 0.06436042487621307, -0.046446699649095535, -0.022033510729670525, 0.04870213568210602, 0.033241089433431625, -0.07161277532577515, 0.03766941651701927, -0.011022617109119892, 0.02412630431354046, -0.024155206978321075, 0.013767317868769169, -0.10706662386655807, -0.050612401217222214, -0.025021465495228767, 0.07375391572713852, 0.01478986069560051, -0.059109386056661606, -0.11311506479978561, -0.0893794447183609, 0.054946135729551315, -0.08505867421627045, 0.0403783842921257, 0.01964726485311985, 0.03641436994075775, 0.003529998706653714, 0.043469689786434174, 0.05267585813999176, 0.05658429488539696, 0.048194967210292816, 0.04179872199892998, -0.04178381338715553, 0.025879260152578354, -0.06926175206899643, 0.03911307826638222, 0.014692544005811214, -5.7573743106331676e-8, -0.09714706987142563, -0.06283088028430939, -0.05784964561462402, 0.03360208123922348, 0.0007080165669322014, -0.013529469259083271, 0.04649985954165459, 0.0554620660841465, -0.026406461372971535, -0.04721173644065857, 0.07499008625745773, 0.03087746724486351, -0.030362579971551895, -0.001161303254775703, 0.038818154484033585, 0.0250087920576334, -0.022980550304055214, -0.08901611715555191, -0.042380280792713165, -0.08801195025444031, 0.026314228773117065, 0.02324596419930458, 0.010307650081813335, 0.07748023420572281, -0.06694413721561432, -0.04589694365859032, 0.06730812788009644, 0.06011296808719635, 0.005637431517243385, -0.05007081478834152, -0.06989201158285141, -0.022181419655680656, 0.045636605471372604, -0.032485827803611755, -0.025523871183395386, 0.09499131888151169, -0.05180441215634346, -0.02187161333858967, 0.03187161684036255, 0.11770078539848328, 0.0876241996884346, -0.052793584764003754, -0.004072177689522505, -0.01953303813934326, -0.000040231869206763804, 0.06233319640159607, -0.06922949850559235, 0.039644043892621994, 0.021151568740606308, 0.02349855750799179, -0.04229775071144104, 0.04592832550406456, -0.0026099984534084797, 0.06740309298038483, 0.006330611649900675, -0.004085021559149027, 0.06672829389572144, -0.05574309080839157, 0.06076895073056221, 0.0481402687728405, -0.024548698216676712, 0.04940057918429375, -0.01598699949681759, -0.02978023700416088 ]
0.113343
(`on|off`, default off) - `agents.defaults.blockStreamingBreak` (`text\_end|message\_end`) - `agents.defaults.blockStreamingChunk` (`minChars|maxChars|breakPreference`) - `agents.defaults.blockStreamingCoalesce` (idle-based batching) - `agents.defaults.humanDelay` (human-like pause between block replies) - Channel overrides: `\*.blockStreaming` and `\*.blockStreamingCoalesce` (non-Telegram channels require explicit `\*.blockStreaming: true`) Details: [Streaming + chunking](/concepts/streaming). ## Reasoning visibility and tokens OpenClaw can expose or hide model reasoning: - `/reasoning on|off|stream` controls visibility. - Reasoning content still counts toward token usage when produced by the model. - Telegram supports reasoning stream into the draft bubble. Details: [Thinking + reasoning directives](/tools/thinking) and [Token use](/token-use). ## Prefixes, threading, and replies Outbound message formatting is centralized in `messages`: - `messages.responsePrefix`, `channels..responsePrefix`, and `channels..accounts..responsePrefix` (outbound prefix cascade), plus `channels.whatsapp.messagePrefix` (WhatsApp inbound prefix) - Reply threading via `replyToMode` and per-channel defaults Details: [Configuration](/gateway/configuration#messages) and channel docs.
https://github.com/openclaw/openclaw/blob/main//docs/concepts/messages.md
main
opebclaw
[ -0.058081094175577164, -0.0691622942686081, -0.055397965013980865, 0.005877701099961996, 0.04720737040042877, -0.048586711287498474, 0.017477158457040787, 0.033209796994924545, 0.0278339684009552, 0.021574262529611588, -0.016203688457608223, -0.04855208471417427, -0.006198681890964508, 0.024447260424494743, 0.10965746641159058, 0.025730585679411888, 0.07957440614700317, -0.07488591223955154, -0.054274532943964005, -0.07821359485387802, 0.061051663011312485, -0.0018344299169257283, 0.002057349542155862, 0.02560308761894703, 0.0014457739889621735, 0.0023252738174051046, -0.053299929946660995, -0.022839102894067764, 0.06300503015518188, -0.015162578783929348, 0.031769122928380966, -0.024282950907945633, 0.017863307148218155, 0.034297093749046326, 0.004290234297513962, 0.05868903547525406, 0.03710508346557617, -0.015501833520829678, 0.007425543386489153, 0.00012617200263775885, 0.000715685891918838, -0.08363472670316696, -0.11529694497585297, -0.017897913232445717, -0.036790378391742706, 0.00831073522567749, -0.038819216191768646, -0.018345965072512627, -0.06440186500549316, 0.05230318754911423, -0.12030211836099625, -0.025128401815891266, -0.008773401379585266, 0.11863560974597931, 0.04139311611652374, -0.023673467338085175, -0.05082668364048004, 0.05004236474633217, 0.03301732614636421, -0.02183488756418228, -0.050326261669397354, -0.05952072888612747, -0.029597444459795952, 0.0431574247777462, -0.06952198594808578, 0.01425862219184637, -0.0639728382229805, 0.12323389202356339, 0.06310703605413437, -0.010469128377735615, -0.04541924595832825, 0.010267270728945732, -0.05190405994653702, -0.01401317398995161, -0.009501833468675613, -0.04256565123796463, 0.08667587488889694, 0.04579350724816322, -0.06797804683446884, -0.11765776574611664, -0.04686199128627777, -0.04186969995498657, 0.023856807500123978, -0.017093561589717865, -0.03259209170937538, 0.0415952131152153, 0.04854395613074303, 0.0347679927945137, 0.036665987223386765, 0.041159726679325104, -0.025539273396134377, -0.01469118706882, 0.07842005789279938, 0.05522232502698898, 0.03051188215613365, 0.04995603859424591, -0.05898622050881386, -0.018060844391584396, -0.0492422878742218, 0.07482655346393585, 0.03548759967088699, 0.02320563606917858, 0.0226419810205698, -0.04215792566537857, 0.026399778202176094, -0.057224102318286896, 0.03671872615814209, 0.09458707273006439, 0.06529532372951508, -0.0018243909580633044, -0.007641620934009552, 0.05926560238003731, 0.03273650258779526, -0.0632769986987114, 0.04030492529273033, 0.00340262264944613, 0.015193642117083073, 0.025537999346852303, 0.0787147730588913, 0.08148729801177979, 0.12441407144069672, -0.029534880071878433, -0.009138369932770729, -0.024384019896388054, 0.07842831313610077, 0.04108334705233574, 0.04486740753054619, 4.476139591899249e-33, 0.046559061855077744, 0.004461285658180714, -0.07936395704746246, 0.0450490303337574, 0.04034757986664772, 0.05940796434879303, -0.009117216803133488, 0.0050490484572947025, -0.05337981507182121, -0.03643504157662392, -0.009608851745724678, 0.003347366815432906, -0.05518350750207901, 0.08958084881305695, -0.0120530491694808, -0.08771579712629318, -0.04367614910006523, 0.007134768646210432, 0.03899618983268738, -0.014969606883823872, 0.022033341228961945, -0.011490995064377785, -0.02189619652926922, 0.04596662148833275, 0.014055853709578514, 0.049355994910001755, 0.01990756019949913, -0.1208055391907692, -0.04546274244785309, 0.022703470662236214, -0.01833377033472061, -0.0075400955975055695, -0.021950673311948776, 0.038924600929021835, 0.048958584666252136, 0.019869720563292503, -0.06938360631465912, -0.04296556115150452, 0.003413471858948469, -0.07219753414392471, -0.08703891932964325, 0.004751248750835657, -0.05075596272945404, -0.06903959810733795, -0.0428982712328434, -0.08318230509757996, -0.03243136778473854, -0.03221502527594566, -0.02001282200217247, -0.01817226968705654, 0.08073322474956512, 0.015525110065937042, 0.04943537339568138, 0.0020553020294755697, 0.017658062279224396, -0.07283816486597061, -0.030049243941903114, -0.022512398660182953, 0.038029808551073074, 0.01606406271457672, -0.01786297746002674, 0.006307872012257576, 0.0411885641515255, -0.019765520468354225, 0.01763014681637287, 0.05491942539811134, -0.03401761129498482, -0.005546778440475464, 0.042727030813694, -0.016669761389493942, -0.10870426893234253, 0.05899292603135109, -0.005610860884189606, 0.06945180892944336, -0.10724584013223648, -0.019322821870446205, -0.006505095865577459, -0.05973513424396515, 0.021530717611312866, 0.015835464000701904, 0.0075079528614878654, -0.011810065247118473, -0.025733938440680504, -0.0046011582016944885, 0.005793621297925711, -0.018782032653689384, 0.0052382308058440685, -0.09697543829679489, -0.027714109048247337, 0.034482572227716446, -0.054657768458127975, 0.03304281830787659, 0.01856909692287445, -0.016676275059580803, -0.06122365593910217, -4.4809870367284524e-33, -0.012777253054082394, -0.0042145512998104095, -0.10045474022626877, 0.0029535526409745216, -0.02017589472234249, -0.010430026799440384, 0.03493840619921684, 0.01905694417655468, -0.01603713259100914, -0.055529411882162094, -0.04846309497952461, -0.0024398635141551495, -0.05806254595518112, 0.0004724189930129796, -0.005913520231842995, -0.08059269934892654, 0.008540845476090908, -0.09501957148313522, 0.00909525528550148, 0.006209515500813723, -0.07578138262033463, -0.01727842167019844, -0.1210908442735672, 0.08279208838939667, 0.0981806144118309, 0.039506059139966965, -0.0029593766666948795, 0.0702083557844162, 0.10912886261940002, -0.10278976708650589, 0.03279772773385048, -0.010205675847828388, -0.027170460671186447, -0.0750536099076271, 0.023886054754257202, 0.04793659225106239, 0.055239707231521606, 0.11463604867458344, -0.027299145236611366, 0.02618849091231823, 0.15190105140209198, -0.03761982545256615, -0.08186546713113785, 0.0005662167095579207, -0.042555034160614014, 0.09663719683885574, -0.0763167142868042, 0.0037925769574940205, -0.16870222985744476, 0.011236351914703846, 0.08836112916469574, -0.0934201031923294, 0.00492137623950839, -0.001266835955902934, -0.026464438065886497, -0.035318322479724884, 0.06787309050559998, -0.02049151062965393, -0.029134750366210938, -0.07180783897638321, 0.030009541660547256, -0.04360547661781311, 0.020825568586587906, -0.019191401079297066, 0.03287177532911301, -0.04109121114015579, -0.009537492878735065, 0.06489533931016922, -0.05347269028425217, -0.05334530398249626, 0.07356706261634827, -0.06508994102478027, -0.03200213238596916, -0.04280729219317436, 0.10341376811265945, 0.047686267644166946, -0.04911132901906967, -0.07553290575742722, -0.03300430625677109, 0.03022388182580471, -0.09018560498952866, 0.06779076904058456, 0.014780867844820023, 0.03933994844555855, 0.04163069278001785, 0.035397984087467194, 0.04512530565261841, 0.08225878328084946, -0.030028143897652626, -0.004680403042584658, -0.04667777568101883, 0.039275310933589935, -0.023716121912002563, 0.12022025883197784, -0.039583005011081696, -5.189863472310208e-8, -0.10184963047504425, -0.0853000283241272, -0.0017786154057830572, 0.00000893679589353269, -0.01680714637041092, 0.02822212129831314, 0.04876517504453659, -0.02755982242524624, 0.014232437126338482, -0.022268686443567276, 0.07174824178218842, -0.018955787643790245, -0.03714728355407715, -0.044444579631090164, 0.03682954981923103, 0.016121601685881615, -0.02780861407518387, -0.015290884301066399, -0.013051572255790234, -0.05684604495763779, 0.06244967505335808, -0.023884030058979988, -0.09136124700307846, 0.059634946286678314, 0.013258866965770721, -0.037880562245845795, 0.03862418606877327, 0.08274069428443909, -0.021097859367728233, -0.03221049904823303, 0.00071589311119169, 0.03283688798546791, 0.08658340573310852, -0.07335380464792252, 0.013899284414947033, 0.09188687056303024, -0.026173798367381096, -0.015115662477910519, 0.0018258898053318262, 0.06779170036315918, 0.05345117300748825, -0.0022129821591079235, -0.028996575623750687, -0.021255508065223694, -0.006573447026312351, -0.007409007754176855, -0.05861075595021248, -0.026267051696777344, 0.006862465757876635, -0.014485113322734833, -0.00018948818615172058, 0.02143915370106697, 0.025552691891789436, 0.11047779023647308, 0.02795669436454773, 0.024445531889796257, 0.08107703179121017, -0.05163492262363434, 0.04746950417757034, 0.01957947574555874, 0.0530674122273922, 0.07633290439844131, -0.012141690589487553, 0.0377478301525116 ]
0.205262
# Channels & routing OpenClaw routes replies \*\*back to the channel where a message came from\*\*. The model does not choose a channel; routing is deterministic and controlled by the host configuration. ## Key terms - \*\*Channel\*\*: `whatsapp`, `telegram`, `discord`, `slack`, `signal`, `imessage`, `webchat`. - \*\*AccountId\*\*: per‑channel account instance (when supported). - \*\*AgentId\*\*: an isolated workspace + session store (“brain”). - \*\*SessionKey\*\*: the bucket key used to store context and control concurrency. ## Session key shapes (examples) Direct messages collapse to the agent’s \*\*main\*\* session: - `agent::` (default: `agent:main:main`) Groups and channels remain isolated per channel: - Groups: `agent:::group:` - Channels/rooms: `agent:::channel:` Threads: - Slack/Discord threads append `:thread:` to the base key. - Telegram forum topics embed `:topic:` in the group key. Examples: - `agent:main:telegram:group:-1001234567890:topic:42` - `agent:main:discord:channel:123456:thread:987654` ## Routing rules (how an agent is chosen) Routing picks \*\*one agent\*\* for each inbound message: 1. \*\*Exact peer match\*\* (`bindings` with `peer.kind` + `peer.id`). 2. \*\*Guild match\*\* (Discord) via `guildId`. 3. \*\*Team match\*\* (Slack) via `teamId`. 4. \*\*Account match\*\* (`accountId` on the channel). 5. \*\*Channel match\*\* (any account on that channel). 6. \*\*Default agent\*\* (`agents.list[].default`, else first list entry, fallback to `main`). The matched agent determines which workspace and session store are used. ## Broadcast groups (run multiple agents) Broadcast groups let you run \*\*multiple agents\*\* for the same peer \*\*when OpenClaw would normally reply\*\* (for example: in WhatsApp groups, after mention/activation gating). Config: ```json5 { broadcast: { strategy: "parallel", "120363403215116621@g.us": ["alfred", "baerbel"], "+15555550123": ["support", "logger"], }, } ``` See: [Broadcast Groups](/broadcast-groups). ## Config overview - `agents.list`: named agent definitions (workspace, model, etc.). - `bindings`: map inbound channels/accounts/peers to agents. Example: ```json5 { agents: { list: [{ id: "support", name: "Support", workspace: "~/.openclaw/workspace-support" }], }, bindings: [ { match: { channel: "slack", teamId: "T123" }, agentId: "support" }, { match: { channel: "telegram", peer: { kind: "group", id: "-100123" } }, agentId: "support" }, ], } ``` ## Session storage Session stores live under the state directory (default `~/.openclaw`): - `~/.openclaw/agents//sessions/sessions.json` - JSONL transcripts live alongside the store You can override the store path via `session.store` and `{agentId}` templating. ## WebChat behavior WebChat attaches to the \*\*selected agent\*\* and defaults to the agent’s main session. Because of this, WebChat lets you see cross‑channel context for that agent in one place. ## Reply context Inbound replies include: - `ReplyToId`, `ReplyToBody`, and `ReplyToSender` when available. - Quoted context is appended to `Body` as a `[Replying to ...]` block. This is consistent across channels.
https://github.com/openclaw/openclaw/blob/main//docs/concepts/channel-routing.md
main
opebclaw
[ -0.006627656053751707, -0.06403552740812302, -0.035816457122564316, 0.0228001419454813, -0.037184279412031174, -0.06532913446426392, 0.06032503396272659, -0.03035121038556099, 0.07885386049747467, 0.0537397526204586, 0.04168158024549484, -0.03351535648107529, 0.01461217924952507, 0.022505667060613632, 0.11489681154489517, 0.05105829983949661, 0.03624728322029114, -0.1289292871952057, -0.06402948498725891, -0.0022775614634156227, 0.055646032094955444, 0.07669401168823242, -0.00867583230137825, 0.01166659314185381, -0.025618664920330048, -0.057846810668706894, 0.0020889935549348593, 0.020034976303577423, 0.03871729224920273, -0.03428817540407181, 0.05372317135334015, -0.003100659931078553, -0.07813774049282074, 0.05216347798705101, 0.03227250650525093, 0.06363070756196976, 0.014074192382395267, -0.014493310824036598, -0.008546524681150913, 0.037756793200969696, -0.004054458346217871, -0.030950935557484627, -0.0929478332400322, -0.006793636828660965, -0.037418432533741, -0.07135037332773209, -0.04439854994416237, -0.020588014274835587, -0.07672027498483658, -0.010684443637728691, -0.07078444957733154, -0.04132373258471489, -0.01888631470501423, 0.10570254921913147, 0.01802806742489338, 0.05483920872211456, -0.0833938866853714, 0.0847073346376419, 0.008004107512533665, -0.033503446727991104, 0.019824758172035217, -0.04672477766871452, -0.022266821935772896, -0.0019296801183372736, -0.07834606617689133, 0.0035004583187401295, -0.03390221297740936, -0.026715293526649475, 0.02216135524213314, -0.0389455109834671, -0.046988945454359055, -0.03770953044295311, -0.06991160660982132, -0.04214271530508995, 0.05676354467868805, -0.05114640295505524, 0.04466785117983818, 0.029525745660066605, -0.06937295943498611, -0.07012943923473358, -0.006120007485151291, -0.044197894632816315, -0.0375325009226799, 0.022283174097537994, 0.009437127970159054, 0.051691342145204544, -0.024241875857114792, -0.0031237907242029905, 0.011692412197589874, 0.019857127219438553, -0.07750358432531357, -0.09809701889753342, 0.05825252830982208, 0.06276095658540726, 0.01090079452842474, 0.0261253509670496, -0.01928744837641716, 0.04577329754829407, 0.010190325789153576, 0.0849652960896492, 0.03606051206588745, -0.0036319175269454718, 0.008845102041959763, 0.031114943325519562, -0.009278586134314537, 0.02344062551856041, 0.053189028054475784, 0.03975917026400566, 0.0240093395113945, -0.03268763795495033, -0.0690075010061264, 0.03232891485095024, 0.04910159111022949, 0.013157033361494541, 0.013095327652990818, 0.0196734219789505, -0.014159555546939373, 0.03546435758471489, 0.036851413547992706, 0.06023645028471947, 0.07456174492835999, -0.11744046956300735, 0.04437298700213432, 0.04084299877285957, -0.022118259221315384, 0.04699355363845825, 0.05364859849214554, 4.746192153927392e-33, 0.038606058806180954, -0.01885259710252285, -0.08168226480484009, 0.01161578856408596, 0.08116056770086288, 0.0710899755358696, -0.026405470445752144, 0.008744098246097565, -0.04681286960840225, 0.025989804416894913, -0.08793900161981583, -0.00479611661285162, -0.031141726300120354, 0.03813217580318451, -0.021308422088623047, -0.024205831810832024, -0.0380764976143837, 0.07864344865083694, 0.09906059503555298, -0.0452570915222168, 0.004983557388186455, 0.02122231014072895, -0.05938822403550148, -0.013403017073869705, 0.052625637501478195, 0.09790197014808655, -0.0003043768520001322, -0.08322430402040482, -0.013116276822984219, 0.033331677317619324, -0.0027926419861614704, 0.03416713327169418, 0.01521873939782381, 0.0403887964785099, 0.0008558609406463802, 0.051182981580495834, -0.05425083637237549, -0.007846611551940441, -0.055729836225509644, -0.03872912377119064, 0.001893624197691679, -0.006319897715002298, -0.06280870735645294, -0.058316927403211594, -0.041313301771879196, -0.10773621499538422, -0.024449434131383896, 0.04843364283442497, 0.0011200594017282128, 0.026102008298039436, -0.01617761328816414, 0.005514585878700018, 0.04841870442032814, 0.022999783977866173, 0.01388583891093731, -0.08696570992469788, -0.04899867624044418, 0.01887795887887478, 0.007896858267486095, 0.09658339619636536, -0.011438590474426746, 0.006319356616586447, -0.01748044788837433, 0.027729032561182976, 0.046994660049676895, 0.03434360772371292, -0.029543591663241386, 0.06991694122552872, 0.005900577642023563, -0.0069226715713739395, -0.1226373240351677, 0.05382537469267845, -0.024316122755408287, 0.06458400189876556, -0.12749038636684418, -0.08351927250623703, -0.06278575956821442, 0.020939840003848076, 0.01116175763309002, -0.0016573447501286864, -0.02841230109333992, 0.006852657999843359, -0.03526492416858673, 0.024173710495233536, -0.02120339497923851, 0.018058517947793007, 0.03282327577471733, -0.1103641539812088, -0.02348378300666809, 0.059577055275440216, -0.09053389728069305, 0.04306646063923836, 0.027885153889656067, 0.05916270241141319, -0.0013649548636749387, -6.524783432330654e-33, -0.01797201670706272, 0.026623426005244255, -0.1261870115995407, -0.014379515312612057, -0.029050122946500778, -0.027524197474122047, 0.07871174812316895, -0.020993366837501526, -0.05259433761239052, -0.016794588416814804, -0.03045579418540001, 0.002312596421688795, 0.05289442092180252, -0.0328482985496521, 0.048977941274642944, -0.048837289214134216, 0.013939986936748028, -0.10895729809999466, -0.051132798194885254, 0.0004260065616108477, -0.02632235549390316, 0.007223838474601507, -0.13410761952400208, 0.005954615771770477, 0.07406340539455414, -0.007753004785627127, 0.04001400247216225, 0.051010485738515854, 0.014913422055542469, -0.03367702662944794, 0.02689235657453537, -0.018834847956895828, -0.027297738939523697, -0.05134069547057152, -0.0032612672075629234, 0.029557520523667336, -0.06329123675823212, 0.09246627986431122, -0.0007429065881296992, -0.039902038872241974, 0.12770012021064758, -0.023221516981720924, -0.09545492380857468, 0.020163917914032936, -0.02420583739876747, 0.1312837153673172, -0.04858235642313957, -0.014021698385477066, -0.1492563933134079, 0.04085974767804146, 0.08947283029556274, -0.06722145527601242, 0.039961956441402435, -0.04009878262877464, -0.02993231825530529, 0.09084555506706238, 0.049781449139118195, 0.0002567636256571859, 0.019212061539292336, -0.12889990210533142, 0.04482370615005493, -0.0726943239569664, -0.0043389820493757725, 0.08824900537729263, 0.07252294570207596, -0.07065733522176743, 0.003268740838393569, 0.009547395631670952, -0.03731204569339752, -0.040393292903900146, 0.02754192426800728, -0.052128903567790985, -0.04487751051783562, 0.009793991222977638, 0.08543342351913452, -0.01149212196469307, -0.07072411477565765, -0.10457698255777359, -0.015574291348457336, 0.05821816250681877, -0.08162318170070648, 0.06949274986982346, 0.024837270379066467, 0.009443830698728561, 0.006071418523788452, 0.051971837878227234, -0.017677748575806618, 0.14288830757141113, -0.044649843126535416, 0.013225161470472813, -0.019769050180912018, 0.04569905996322632, -0.03169093653559685, 0.013508887961506844, 0.012733696028590202, -5.485003740091088e-8, -0.0636800155043602, -0.040654219686985016, -0.05268266052007675, 0.039435014128685, -0.015702102333307266, -0.026774130761623383, 0.06432565301656723, -0.01233277004212141, 0.02119516022503376, 0.01628701016306877, 0.014978493563830853, 0.05292024090886116, -0.06399771571159363, 0.017912616953253746, -0.036347586661577225, 0.006970229558646679, -0.04228030517697334, -0.019299980252981186, 0.0026068235747516155, -0.08968397974967957, 0.0017155692912638187, -0.031017960980534554, -0.008770818822085857, 0.08689860999584198, -0.01623525284230709, -0.011540469713509083, 0.011936735361814499, 0.10839854180812836, -0.02793172560632229, 0.007965106517076492, -0.013423950411379337, -0.02316090278327465, 0.011670373380184174, 0.009150550700724125, -0.13481739163398743, 0.11724959313869476, -0.0460389070212841, 0.005836438853293657, -0.010070442222058773, 0.03555911406874657, 0.06983871012926102, -0.0443347729742527, -0.002471665618941188, -0.02005680277943611, 0.020312529057264328, 0.03712626174092293, -0.03315912187099457, 0.017209568992257118, 0.0598306842148304, -0.0028677689842879772, -0.0917806327342987, 0.007628172170370817, 0.006897830870002508, 0.05345978960394859, 0.029117582365870476, 0.011792206205427647, 0.04667399823665619, -0.05608045309782028, 0.03285251185297966, 0.00037492881529033184, 0.013616915792226791, 0.07956308126449585, -0.055526215583086014, -0.09588631242513657 ]
0.166926
# Retry policy ## Goals - Retry per HTTP request, not per multi-step flow. - Preserve ordering by retrying only the current step. - Avoid duplicating non-idempotent operations. ## Defaults - Attempts: 3 - Max delay cap: 30000 ms - Jitter: 0.1 (10 percent) - Provider defaults: - Telegram min delay: 400 ms - Discord min delay: 500 ms ## Behavior ### Discord - Retries only on rate-limit errors (HTTP 429). - Uses Discord `retry\_after` when available, otherwise exponential backoff. ### Telegram - Retries on transient errors (429, timeout, connect/reset/closed, temporarily unavailable). - Uses `retry\_after` when available, otherwise exponential backoff. - Markdown parse errors are not retried; they fall back to plain text. ## Configuration Set retry policy per provider in `~/.openclaw/openclaw.json`: ```json5 { channels: { telegram: { retry: { attempts: 3, minDelayMs: 400, maxDelayMs: 30000, jitter: 0.1, }, }, discord: { retry: { attempts: 3, minDelayMs: 500, maxDelayMs: 30000, jitter: 0.1, }, }, }, } ``` ## Notes - Retries apply per request (message send, media upload, reaction, poll, sticker). - Composite flows do not retry completed steps.
https://github.com/openclaw/openclaw/blob/main//docs/concepts/retry.md
main
opebclaw
[ -0.05946730077266693, 0.04099808633327484, 0.06309134513139725, 0.05064993351697922, -0.01240120641887188, -0.0888495072722435, -0.029939761385321617, -0.044078487902879715, 0.023916877806186676, 0.03271635249257088, 0.02386467531323433, 0.0017178909620270133, -0.020695609971880913, 0.01933247037231922, 0.07011914253234863, 0.020726490765810013, 0.013707770965993404, -0.04016386345028877, -0.07880543172359467, -0.08115790784358978, 0.03706350177526474, 0.042442549020051956, 0.004308613482862711, 0.018480511382222176, -0.02082941308617592, -0.06673837453126907, -0.07350054383277893, 0.036632321774959564, -0.02146538347005844, -0.005611077416688204, 0.026091041043400764, -0.041001398116350174, -0.10320848971605301, -0.04024669528007507, 0.030377747491002083, 0.10784970223903656, -0.01645764894783497, -0.017190856859087944, 0.02219270169734955, 0.0457882434129715, 0.011328999884426594, -0.027373500168323517, -0.1246790885925293, -0.0018084634793922305, 0.06096596643328667, -0.07708501070737839, -0.04549982398748398, 0.02360374666750431, -0.02249068394303322, 0.04305461794137955, -0.005328399129211903, -0.011085922829806805, -0.013279316946864128, 0.05095852538943291, 0.05800677835941315, 0.057586245238780975, -0.03370598331093788, 0.05408596619963646, 0.03084808774292469, -0.03400329500436783, 0.04003818705677986, -0.10153783112764359, -0.054278288036584854, -0.05481703579425812, -0.03633043169975281, 0.018530312925577164, 0.019095884636044502, 0.006801893003284931, 0.004941259976476431, 0.07291577011346817, 0.09420263022184372, -0.004592582117766142, -0.059261176735162735, 0.003600937779992819, -0.035254478454589844, -0.010705091990530491, 0.01792706921696663, 0.023630909621715546, -0.11102243512868881, -0.01634756289422512, -0.04251584783196449, -0.06935000419616699, 0.0005176565609872341, 0.016380153596401215, -0.003970677498728037, 0.030033398419618607, 0.020231682807207108, 0.031103748828172684, 0.017546875402331352, 0.0002560287539381534, -0.0012021561851724982, -0.02928553894162178, 0.020552022382616997, 0.022341927513480186, 0.07333217561244965, 0.04938577115535736, -0.058553796261548996, -0.050048768520355225, -0.02708316408097744, 0.03659245744347572, 0.039898794144392014, -0.07544002681970596, 0.005008254665881395, -0.02405650168657303, 0.032925646752119064, -0.019358500838279724, 0.016994906589388847, 0.10804615914821625, 0.01852481998503208, 0.02654264122247696, -0.0050705550238490105, 0.03861312195658684, 0.11746677756309509, -0.0016445728251710534, 0.006166463252156973, 0.07110009342432022, -0.03538816422224045, 0.02914533019065857, 0.08763884752988815, -0.0010349091608077288, 0.1351235806941986, 0.008549764752388, 0.041308049112558365, -0.0662984624505043, 0.048105619847774506, 0.11533757299184799, 0.12200535833835602, 9.044072802970241e-33, 0.062254976481199265, 0.05119163170456886, -0.13205493986606598, -0.0039687808603048325, 0.0369381457567215, 0.030507341027259827, -0.01982186734676361, 0.01376398280262947, -0.06917800009250641, -0.022346515208482742, -0.04481452703475952, -0.02823617495596409, -0.024623118340969086, -0.04806168004870415, -0.06001747027039528, -0.06877826899290085, 0.05861850082874298, 0.054769884794950485, 0.04531353339552879, 0.03599506989121437, 0.0031215681228786707, -0.055394742637872696, -0.016224460676312447, 0.025130754336714745, -0.00098274031188339, 0.09568475931882858, 0.005132537800818682, -0.009920862503349781, -0.05243402719497681, 0.003702538786455989, 0.04067918658256531, 0.05069583281874657, -0.011648603715002537, -0.019693804904818535, 0.04610968381166458, -0.015390658751130104, -0.01004014816135168, -0.00972639862447977, -0.05916853994131088, -0.08945566415786743, -0.049102623015642166, 0.030124807730317116, -0.11990217119455338, -0.01378064975142479, -0.0025684493593871593, -0.13124169409275055, -0.03444623574614525, -0.044409267604351044, 0.013111461885273457, 0.0037398692220449448, 0.004223291762173176, 0.08615512400865555, 0.06308407336473465, -0.04177943989634514, 0.030247420072555542, -0.08169548958539963, -0.013777700252830982, -0.01064081396907568, -0.035211145877838135, 0.012994964607059956, 0.052168749272823334, -0.06521295011043549, -0.014316951856017113, -0.05178782343864441, 0.05897458270192146, 0.062296062707901, -0.051818449050188065, 0.03537397459149361, -0.014635597355663776, 0.0003478971484582871, -0.020751457661390305, 0.07217652350664139, 0.01421233732253313, 0.027101991698145866, -0.036037422716617584, -0.06260271370410919, 0.02562643773853779, 0.015571742318570614, 0.044288843870162964, -0.0546366311609745, 0.0028235693462193012, -0.052677661180496216, -0.021370695903897285, 0.004380769096314907, 0.03490734100341797, 0.04897598549723625, 0.051570311188697815, -0.07229871302843094, -0.015192811377346516, 0.0849020928144455, -0.06198021396994591, 0.04848488047719002, -0.010199750773608685, 0.001166867557913065, -0.0367511548101902, -7.176537009828041e-33, 0.006644281558692455, 0.006218746304512024, 0.010659336112439632, 0.021685374900698662, -0.006975455675274134, -0.037567704916000366, 0.05959609895944595, 0.057245973497629166, 0.024524709209799767, -0.02325429953634739, -0.019989533349871635, -0.048577386885881424, 0.0030131887178868055, -0.04779668152332306, -0.01761043630540371, -0.00361041072756052, -0.04362011328339577, -0.07170288264751434, 0.061193276196718216, 0.006374769378453493, 0.0014825412072241306, -0.06784713268280029, -0.05440352484583855, 0.05326420068740845, 0.00025594455655664206, 0.04797729477286339, -0.004205821081995964, -0.03131243586540222, 0.025624504312872887, -0.15490184724330902, 0.06879718601703644, -0.05393381789326668, -0.022935139015316963, 0.0745924785733223, 0.07486413419246674, 0.028518907725811005, 0.03734598308801651, 0.15568989515304565, -0.02940228395164013, 0.023613354191184044, 0.15304619073867798, 0.046624548733234406, -0.09595063328742981, 0.020896129310131073, -0.020286398008465767, 0.04433201998472214, -0.0021974488627165556, -0.004965856671333313, -0.1487138718366623, 0.005105955991894007, 0.04876776412129402, -0.0530271977186203, 0.04439293593168259, 0.07859276235103607, -0.006020369939506054, -0.018345823511481285, 0.059605833142995834, -0.06976483762264252, -0.0817531943321228, 0.020711300894618034, -0.017610380426049232, -0.08798490464687347, 0.0689103826880455, 0.114347904920578, 0.09323599934577942, -0.011159173212945461, -0.01628733053803444, 0.03384972736239433, -0.006448711268603802, -0.037885088473558426, 0.033322542905807495, -0.02728014811873436, -0.014303850941359997, -0.05502810701727867, 0.07968728244304657, -0.05875217914581299, -0.10309260338544846, -0.08974499255418777, -0.008285976015031338, 0.06515830755233765, -0.04345907270908356, 0.06412393599748611, -0.03158988058567047, 0.03398357704281807, 0.010159771889448166, 0.04119925945997238, 0.03645067662000656, 0.0964130312204361, 0.017904100939631462, 0.02650259993970394, -0.06941094994544983, 0.011039496399462223, 0.01048356480896473, 0.03783847764134407, 0.04443855583667755, -5.164930882983754e-8, -0.07899421453475952, -0.028622662648558617, -0.05368625745177269, -0.0060416520573198795, 0.014336205087602139, 0.0268140509724617, 0.004954806063324213, -0.043347638100385666, -0.0163442213088274, -0.044993769377470016, 0.03652876615524292, 0.05437767133116722, -0.024405598640441895, -0.043034881353378296, -0.07513648271560669, -0.03487446904182434, -0.061603959649801254, -0.01714230515062809, 0.029337793588638306, -0.017002787441015244, 0.008651250042021275, 0.03443243354558945, -0.008511867374181747, 0.010774106718599796, -0.056091781705617905, -0.003883725730702281, 0.06588970124721527, 0.11259452998638153, -0.01898984983563423, -0.07283183187246323, -0.09494119137525558, -0.06487078219652176, 0.10665430128574371, -0.022959742695093155, -0.04700687527656555, 0.029918739572167397, -0.025086265057325363, 0.019071217626333237, 0.06281311064958572, 0.004020149819552898, 0.0810493752360344, -0.007663818541914225, -0.011097305454313755, 0.00017469596059527248, -0.016180826351046562, -0.08134151995182037, -0.0770263820886612, 0.005515247583389282, 0.04420752823352814, -0.053740404546260834, -0.010541736148297787, -0.015574030578136444, 0.004013849422335625, 0.053636834025382996, 0.011062520556151867, 0.008047542534768581, 0.06982854008674622, -0.09584399312734604, -0.008174024522304535, 0.04199206829071045, 0.08124187588691711, -0.006146661937236786, -0.013900309801101685, -0.04937782511115074 ]
0.082761
# Context “Context” is \*\*everything OpenClaw sends to the model for a run\*\*. It is bounded by the model’s \*\*context window\*\* (token limit). Beginner mental model: - \*\*System prompt\*\* (OpenClaw-built): rules, tools, skills list, time/runtime, and injected workspace files. - \*\*Conversation history\*\*: your messages + the assistant’s messages for this session. - \*\*Tool calls/results + attachments\*\*: command output, file reads, images/audio, etc. Context is \_not the same thing\_ as “memory”: memory can be stored on disk and reloaded later; context is what’s inside the model’s current window. ## Quick start (inspect context) - `/status` → quick “how full is my window?” view + session settings. - `/context list` → what’s injected + rough sizes (per file + totals). - `/context detail` → deeper breakdown: per-file, per-tool schema sizes, per-skill entry sizes, and system prompt size. - `/usage tokens` → append per-reply usage footer to normal replies. - `/compact` → summarize older history into a compact entry to free window space. See also: [Slash commands](/tools/slash-commands), [Token use & costs](/token-use), [Compaction](/concepts/compaction). ## Example output Values vary by model, provider, tool policy, and what’s in your workspace. ### `/context list` ``` 🧠 Context breakdown Workspace: Bootstrap max/file: 20,000 chars Sandbox: mode=non-main sandboxed=false System prompt (run): 38,412 chars (~9,603 tok) (Project Context 23,901 chars (~5,976 tok)) Injected workspace files: - AGENTS.md: OK | raw 1,742 chars (~436 tok) | injected 1,742 chars (~436 tok) - SOUL.md: OK | raw 912 chars (~228 tok) | injected 912 chars (~228 tok) - TOOLS.md: TRUNCATED | raw 54,210 chars (~13,553 tok) | injected 20,962 chars (~5,241 tok) - IDENTITY.md: OK | raw 211 chars (~53 tok) | injected 211 chars (~53 tok) - USER.md: OK | raw 388 chars (~97 tok) | injected 388 chars (~97 tok) - HEARTBEAT.md: MISSING | raw 0 | injected 0 - BOOTSTRAP.md: OK | raw 0 chars (~0 tok) | injected 0 chars (~0 tok) Skills list (system prompt text): 2,184 chars (~546 tok) (12 skills) Tools: read, edit, write, exec, process, browser, message, sessions\_send, … Tool list (system prompt text): 1,032 chars (~258 tok) Tool schemas (JSON): 31,988 chars (~7,997 tok) (counts toward context; not shown as text) Tools: (same as above) Session tokens (cached): 14,250 total / ctx=32,000 ``` ### `/context detail` ``` 🧠 Context breakdown (detailed) … Top skills (prompt entry size): - frontend-design: 412 chars (~103 tok) - oracle: 401 chars (~101 tok) … (+10 more skills) Top tools (schema size): - browser: 9,812 chars (~2,453 tok) - exec: 6,240 chars (~1,560 tok) … (+N more tools) ``` ## What counts toward the context window Everything the model receives counts, including: - System prompt (all sections). - Conversation history. - Tool calls + tool results. - Attachments/transcripts (images/audio/files). - Compaction summaries and pruning artifacts. - Provider “wrappers” or hidden headers (not visible, still counted). ## How OpenClaw builds the system prompt The system prompt is \*\*OpenClaw-owned\*\* and rebuilt each run. It includes: - Tool list + short descriptions. - Skills list (metadata only; see below). - Workspace location. - Time (UTC + converted user time if configured). - Runtime metadata (host/OS/model/thinking). - Injected workspace bootstrap files under \*\*Project Context\*\*. Full breakdown: [System Prompt](/concepts/system-prompt). ## Injected workspace files (Project Context) By default, OpenClaw injects a fixed set of workspace files (if present): - `AGENTS.md` - `SOUL.md` - `TOOLS.md` - `IDENTITY.md` - `USER.md` - `HEARTBEAT.md` - `BOOTSTRAP.md` (first-run only) Large files are truncated per-file using `agents.defaults.bootstrapMaxChars` (default `20000` chars). `/context` shows \*\*raw vs injected\*\* sizes and whether truncation happened. ## Skills: what’s injected vs loaded on-demand The system prompt includes a compact \*\*skills list\*\* (name + description + location).
https://github.com/openclaw/openclaw/blob/main//docs/concepts/context.md
main
opebclaw
[ -0.025986121967434883, -0.006159087643027306, -0.08810251206159592, 0.07658515870571136, 0.02337866835296154, -0.08713832497596741, 0.057662233710289, 0.06774713099002838, 0.01570797525346279, -0.017624789848923683, 0.0365898534655571, -0.03306319937109947, 0.056596580892801285, -0.0239398293197155, 0.06233108043670654, 0.08297191560268402, 0.08425098657608032, -0.08200831711292267, -0.10165099799633026, 0.05861080437898636, 0.07839035242795944, 0.052718158811330795, -0.019087037071585655, -0.05010269954800606, -0.06514681130647659, 0.03410297632217407, -0.05528457090258598, -0.03435830399394035, 0.06660015136003494, -0.013008839450776577, 0.04499861225485802, 0.05368807911872864, 0.04400065168738365, 0.019282687455415726, 0.08684336394071579, 0.06090845540165901, 0.049618981778621674, -0.06629680097103119, -0.08104334771633148, -0.006325325462967157, -0.002372478600591421, 0.04854604974389076, -0.03369764983654022, -0.002261381596326828, -0.04081757739186287, -0.058231305330991745, -0.007936961948871613, -0.08095412701368332, -0.05042215809226036, -0.033715005964040756, -0.12558625638484955, -0.032297056168317795, -0.054605286568403244, -0.06419024616479874, 0.011053686961531639, 0.028607787564396858, 0.05054706707596779, -0.029449185356497765, -0.034635499119758606, 0.0008813583990558982, -0.01050387043505907, -0.026753151789307594, -0.10863569378852844, 0.036919619888067245, -0.04094327613711357, -0.00026655528927221894, -0.05807628482580185, -0.041166748851537704, 0.0233021043241024, -0.06452398002147675, -0.0729372426867485, 0.00851812306791544, -0.04207000508904457, 0.0055514005944132805, 0.044767510145902634, -0.0709877759218216, 0.055773891508579254, 0.0171612948179245, -0.024597879499197006, -0.12465354055166245, 0.016957275569438934, -0.014068840071558952, -0.01922435313463211, -0.013691257685422897, 0.014287003315985203, 0.10086088627576828, 0.010552451945841312, 0.0060380976647138596, 0.021550830453634262, 0.05657940357923508, 0.015685535967350006, -0.128365159034729, 0.00547035364434123, 0.04678717255592346, 0.05781879276037216, 0.002726798877120018, -0.0033386037684977055, -0.0034531818237155676, -0.043381478637456894, 0.07971812039613724, 0.014315295033156872, 0.01782981865108013, 0.052231792360544205, 0.0077926404774188995, -0.07384777814149857, 0.025457391515374184, -0.005714553873986006, 0.08077302575111389, -0.04309261590242386, -0.04205544665455818, 0.02470780909061432, 0.02280278317630291, 0.007873420603573322, -0.026824461296200752, 0.04917050153017044, -0.04830240085721016, -0.009181488305330276, -0.07005015760660172, 0.048905644565820694, 0.1388007551431656, 0.0742059201002121, -0.0004079180071130395, -0.038324542343616486, -0.006511101499199867, -0.019070902839303017, -0.041752152144908905, 0.005009956192225218, 3.441486729378749e-33, 0.029473664239048958, -0.053541552275419235, -0.016749802976846695, 0.060102496296167374, 0.10873522609472275, 0.05742557346820831, -0.0078501608222723, 0.05465029925107956, -0.005883987061679363, 0.06913028657436371, 0.011045434512197971, 0.09001172333955765, -0.07179305702447891, 0.004780813120305538, 0.042127035558223724, 0.039938244968652725, -0.06235680729150772, 0.07690085470676422, 0.050192032009363174, 0.0172552689909935, -0.01497101690620184, -0.012818975374102592, -0.10625307261943817, -0.011506764218211174, 0.03043638914823532, 0.09354712069034576, 0.0180991031229496, -0.026402559131383896, -0.01837589591741562, 0.033946599811315536, -0.03452689200639725, 0.020865904167294502, -0.028590720146894455, 0.032516080886125565, 0.013271883130073547, 0.04479954019188881, -0.01360846497118473, -0.03348325937986374, -0.010065092705190182, -0.11331278830766678, -0.030506398528814316, 0.014470245689153671, -0.040865473449230194, -0.015816858038306236, -0.1011861264705658, -0.1669040024280548, -0.04162281006574631, 0.08739719539880753, -0.014787458814680576, 0.07518630474805832, 0.07451242953538895, 0.029686978086829185, 0.07546073198318481, 0.04874984920024872, -0.07717561721801758, -0.010866832919418812, -0.005743158981204033, 0.0021160170435905457, 0.056667909026145935, 0.08320959657430649, 0.015273954719305038, 0.016964120790362358, 0.025288376957178116, 0.09129633754491806, 0.03560306131839752, 0.0035014504101127386, 0.029274223372340202, 0.00036439482937566936, 0.04033876955509186, 0.01043909415602684, -0.08478663116693497, 0.019000884145498276, -0.0005509357433766127, 0.031637005507946014, -0.01755722239613533, -0.06479337066411972, 0.00997846107929945, -0.014260148629546165, -0.06163322553038597, 0.03941887617111206, 0.03938593342900276, 0.014032001607120037, -0.0043131387792527676, -0.04102073609828949, -0.07521030306816101, 0.0344499796628952, 0.012284630909562111, -0.0803644061088562, 0.0041170911863446236, -0.03337293118238449, -0.006522417068481445, -0.0718906968832016, -0.06703263521194458, 0.013664298690855503, -0.020612036809325218, -5.8224185782166296e-33, 0.08365640044212341, -0.0015815066872164607, -0.06328020989894867, -0.055075667798519135, 0.0022658049128949642, -0.030173316597938538, 0.016786696389317513, -0.01011227909475565, -0.09614802151918411, -0.03614795207977295, -0.03774008899927139, 0.04046262055635452, 0.04685497283935547, -0.0234928410500288, 0.07117582857608795, -0.03463670611381531, -0.011529064737260342, -0.10726674646139145, -0.03983261436223984, 0.0064080446027219296, -0.008026767522096634, -0.009581134654581547, -0.0166087057441473, -0.007377819623798132, 0.0020005463156849146, -0.03519275411963463, -0.07982353121042252, 0.006459149532020092, 0.04547121003270149, 0.013439582660794258, 0.02214949205517769, 0.012575400061905384, 0.003426502225920558, 0.00979578960686922, -0.059412881731987, -0.01881016232073307, 0.0017243631882593036, -0.018788227811455727, 0.0490611307322979, 0.0015643432270735502, 0.10552199184894562, 0.018648453056812286, -0.01685180328786373, 0.005740778520703316, -0.009743128903210163, 0.11228355020284653, -0.0033096084371209145, -0.0679212361574173, -0.032396454364061356, -0.060170844197273254, 0.036388445645570755, 0.005545219872146845, -0.0013088628184050322, -0.010176576673984528, -0.030315151438117027, 0.0002085138694383204, 0.08226227760314941, -0.128497913479805, 0.0004705384199041873, -0.09135130047798157, 0.026703277602791786, -0.007204427849501371, -0.08615319430828094, -0.006856749299913645, -0.014876061119139194, -0.023631451651453972, -0.017768574878573418, -0.05618656426668167, -0.08584196120500565, -0.044465985149145126, -0.05865422636270523, -0.04041963815689087, -0.034399595111608505, -0.0000630034483037889, -0.029300235211849213, 0.041851956397295, 0.003042115131393075, -0.14242161810398102, -0.006336381193250418, 0.05322998762130737, -0.05028361827135086, -0.02601541206240654, 0.04807181656360626, 0.027194911614060402, -0.02553681842982769, -0.0005949749611318111, -0.01908579282462597, 0.11610587686300278, -0.020640460774302483, 0.02834934927523136, -0.07634489983320236, 0.03722221031785011, -0.009707733988761902, 0.05678924545645714, -0.010614876635372639, -5.342175057876375e-8, -0.1334650218486786, -0.01986277848482132, 0.004309161566197872, 0.046567607671022415, -0.04757881909608841, -0.014937288127839565, 0.003561335150152445, 0.08111388236284256, 0.027593785896897316, 0.048048172146081924, 0.06197158247232437, -0.009524988010525703, -0.083978071808815, -0.029139645397663116, -0.003152072662487626, 0.08669334650039673, 0.027127113193273544, -0.04441383108496666, 0.019606128334999084, -0.03952393680810928, 0.10128415375947952, -0.017801733687520027, 0.04956171661615372, 0.0323476642370224, -0.004036636091768742, -0.028011493384838104, -0.01644149050116539, 0.1468198299407959, -0.0443863570690155, -0.0171060711145401, 0.01576821692287922, 0.0170229971408844, -0.02726786397397518, 0.023851335048675537, -0.1203620508313179, 0.03591722249984741, 0.02274656854569912, -0.012105241417884827, 0.012650874443352222, -0.01891341619193554, 0.053776104003190994, 0.0000842997178551741, -0.04950292780995369, 0.013303452171385288, -0.02854427509009838, 0.11318043619394302, -0.01841251365840435, -0.04464421421289444, -0.02133314125239849, -0.013527097180485725, -0.0568731389939785, 0.053936999291181564, -0.041715074330568314, 0.10331042110919952, -0.05318300426006317, 0.0629158467054367, 0.05975094437599182, -0.03024890273809433, 0.0032300204038619995, 0.05296510457992554, -0.030979972332715988, 0.07816912978887558, 0.001933202613145113, -0.009299947880208492 ]
0.185305
- `IDENTITY.md` - `USER.md` - `HEARTBEAT.md` - `BOOTSTRAP.md` (first-run only) Large files are truncated per-file using `agents.defaults.bootstrapMaxChars` (default `20000` chars). `/context` shows \*\*raw vs injected\*\* sizes and whether truncation happened. ## Skills: what’s injected vs loaded on-demand The system prompt includes a compact \*\*skills list\*\* (name + description + location). This list has real overhead. Skill instructions are \_not\_ included by default. The model is expected to `read` the skill’s `SKILL.md` \*\*only when needed\*\*. ## Tools: there are two costs Tools affect context in two ways: 1. \*\*Tool list text\*\* in the system prompt (what you see as “Tooling”). 2. \*\*Tool schemas\*\* (JSON). These are sent to the model so it can call tools. They count toward context even though you don’t see them as plain text. `/context detail` breaks down the biggest tool schemas so you can see what dominates. ## Commands, directives, and “inline shortcuts” Slash commands are handled by the Gateway. There are a few different behaviors: - \*\*Standalone commands\*\*: a message that is only `/...` runs as a command. - \*\*Directives\*\*: `/think`, `/verbose`, `/reasoning`, `/elevated`, `/model`, `/queue` are stripped before the model sees the message. - Directive-only messages persist session settings. - Inline directives in a normal message act as per-message hints. - \*\*Inline shortcuts\*\* (allowlisted senders only): certain `/...` tokens inside a normal message can run immediately (example: “hey /status”), and are stripped before the model sees the remaining text. Details: [Slash commands](/tools/slash-commands). ## Sessions, compaction, and pruning (what persists) What persists across messages depends on the mechanism: - \*\*Normal history\*\* persists in the session transcript until compacted/pruned by policy. - \*\*Compaction\*\* persists a summary into the transcript and keeps recent messages intact. - \*\*Pruning\*\* removes old tool results from the \_in-memory\_ prompt for a run, but does not rewrite the transcript. Docs: [Session](/concepts/session), [Compaction](/concepts/compaction), [Session pruning](/concepts/session-pruning). ## What `/context` actually reports `/context` prefers the latest \*\*run-built\*\* system prompt report when available: - `System prompt (run)` = captured from the last embedded (tool-capable) run and persisted in the session store. - `System prompt (estimate)` = computed on the fly when no run report exists (or when running via a CLI backend that doesn’t generate the report). Either way, it reports sizes and top contributors; it does \*\*not\*\* dump the full system prompt or tool schemas.
https://github.com/openclaw/openclaw/blob/main//docs/concepts/context.md
main
opebclaw
[ -0.03606933727860451, -0.0004457916656974703, -0.05990331992506981, 0.011927342973649502, 0.05628957599401474, -0.06925307959318161, 0.02444514073431492, 0.023181717842817307, -0.023280059918761253, 0.0043166158720850945, 0.02287360280752182, 0.02131897211074829, 0.0944330245256424, -0.027547506615519524, -0.021742263808846474, 0.03632736951112747, -0.039109982550144196, -0.10969347506761551, -0.04722490534186363, 0.01867237500846386, -0.03906061127781868, 0.02324165590107441, -0.013532403856515884, 0.04721803218126297, -0.014119277708232403, -0.007839986123144627, -0.023312944918870926, -0.012039078399538994, 0.012834211811423302, -0.026128919795155525, 0.04068463668227196, 0.06460384279489517, 0.025932224467396736, -0.03173844516277313, 0.06231505796313286, 0.11993026733398438, 0.05003278702497482, 0.02670104056596756, -0.056401580572128296, -0.035830769687891006, 0.06696858257055283, -0.015935204923152924, -0.007226022891700268, 0.013546696864068508, -0.0039940159767866135, -0.10667391866445541, -0.028230542317032814, -0.06897537410259247, -0.02068653143942356, 0.024343183264136314, -0.10057474672794342, -0.03863900154829025, -0.0004672938375733793, 0.0030317220371216536, -0.05033009871840477, 0.016177289187908173, 0.011010280810296535, 0.025611139833927155, -0.09299296140670776, -0.03140225633978844, -0.03910256549715996, 0.016483260318636894, -0.10608930140733719, 0.053670335561037064, -0.0008185356273315847, 0.023284221068024635, -0.04600822180509567, -0.07294779270887375, 0.012333681806921959, 0.006981983315199614, -0.017348309978842735, -0.06827137619256973, -0.046577051281929016, 0.02633638121187687, 0.052429117262363434, 0.015515378676354885, 0.0054772705771028996, 0.05339851602911949, 0.028669575229287148, -0.13072924315929413, -0.05263487994670868, -0.06510075181722641, -0.014052793383598328, -0.06727728992700577, -0.01760011538863182, 0.053059373050928116, 0.00011688566155498847, -0.04263068735599518, 0.03299776837229729, -0.026730326935648918, 0.09743188321590424, -0.0948277935385704, 0.016324397176504135, 0.038087960332632065, 0.05508408322930336, 0.047047872096300125, -0.007619906682521105, 0.10799752920866013, -0.06511324644088745, 0.030472783371806145, -0.03827572986483574, -0.01481151394546032, 0.010433698073029518, 0.02714526653289795, -0.040293801575899124, 0.001607140526175499, 0.04769497737288475, 0.008836057037115097, -0.0024591616820544004, -0.03378698229789734, 0.07151222229003906, 0.04242505505681038, -0.031085114926099777, 0.026610465720295906, 0.1127115935087204, 0.08785537630319595, -0.018918698653578758, 0.013726292178034782, 0.0020729468669742346, 0.09799844771623611, 0.03660308197140694, -0.049220357090234756, -0.017265792936086655, -0.052905917167663574, 0.048723723739385605, 0.018907414749264717, -0.04884685203433037, 3.756730437040286e-33, 0.03283340483903885, -0.0012588340323418379, 0.059321753680706024, 0.07182834297418594, 0.08243542164564133, -0.01868152618408203, 0.01416994258761406, -0.015957258641719818, -0.02366003766655922, 0.12740272283554077, -0.07536175847053528, 0.09871116280555725, -0.03542177379131317, 0.013210170902311802, 0.003743899753317237, -0.024791615083813667, 0.00786451157182455, 0.06578215956687927, -0.012445138767361641, -0.0035071317106485367, 0.07015883177518845, -0.0059609077870845795, -0.09696836024522781, 0.019174890592694283, -0.003600380616262555, 0.13289718329906464, 0.01633468270301819, 0.03856274485588074, 0.01630318909883499, 0.02787845768034458, -0.04954201355576515, -0.012629557400941849, 0.002453957684338093, 0.05381834879517555, -0.0004889079136773944, 0.041849926114082336, 0.038207560777664185, -0.050314415246248245, -0.009339489974081516, -0.04365875944495201, 0.03892495110630989, -0.03917483985424042, 0.06546563655138016, -0.05957663804292679, -0.089251808822155, -0.052619412541389465, 0.013302149251103401, -0.037172358483076096, 0.013483839109539986, 0.1010512113571167, -0.006551272235810757, 0.018649181351065636, 0.06746033579111099, 0.007686953991651535, -0.020215541124343872, 0.0017020974773913622, 0.0042476048693060875, 0.03138779476284981, 0.06211342290043831, 0.08291655033826828, -0.0014622868038713932, -0.02859661355614662, 0.04405134171247482, 0.06945629417896271, 0.0994536355137825, -0.013888892717659473, -0.0069707646034657955, -0.04279990866780281, 0.09588132053613663, 0.0758543461561203, -0.07977399975061417, 0.002987760119140148, 0.0658387765288353, 0.02557564526796341, 0.03165214881300926, -0.12557052075862885, 0.022141044959425926, -0.03757571429014206, -0.03464781492948532, 0.048827286809682846, -0.032852642238140106, 0.02821269817650318, -0.09603095054626465, 0.005133857484906912, -0.009346292354166508, -0.03166869655251503, -0.004422702360898256, -0.08304888010025024, -0.011086205951869488, -0.050958506762981415, 0.023621544241905212, -0.007548680063337088, -0.07095448672771454, 0.004148345440626144, -0.1358213573694229, -6.289480320022742e-33, 0.0682520940899849, -0.10208120942115784, 0.002443416742607951, 0.004166929982602596, 0.04908766224980354, -0.030109256505966187, 0.049616001546382904, 0.03226669505238533, -0.011570044793188572, -0.06669718772172928, 0.05737975984811783, 0.005014096852391958, -0.04398610070347786, -0.026214003562927246, 0.06105819717049599, 0.02329057641327381, -0.03481093794107437, -0.09193219244480133, 0.08524385094642639, 0.007434921804815531, 0.04823786020278931, 0.06345093995332718, -0.07431425154209137, 0.09647086262702942, 0.01774531602859497, -0.05303610861301422, -0.06998870521783829, 0.020891238003969193, 0.006762782111763954, 0.0011484737042337656, 0.009643295779824257, 0.06115614250302315, -0.09991811960935593, -0.022621145471930504, -0.1123918816447258, -0.035760488361120224, -0.041667331010103226, 0.08073898404836655, -0.001328323152847588, 0.04678644612431526, 0.055969614535570145, 0.012084096670150757, -0.08230771124362946, 0.002043286105617881, 0.011052720248699188, -0.06965838372707367, -0.02656058967113495, -0.0908995121717453, 0.013296659104526043, 0.012350860051810741, 0.08107735961675644, -0.046242907643318176, 0.0441698357462883, 0.04073181375861168, -0.037470120936632156, -0.033894848078489304, 0.019270071759819984, -0.06488963961601257, -0.0000610998467891477, -0.03859616443514824, 0.03272257000207901, 0.06561481207609177, -0.10074175149202347, -0.07666458189487457, 0.025729790329933167, -0.009414554573595524, -0.028510313481092453, -0.01991436257958412, -0.018940532580018044, -0.005148241762071848, -0.07871683686971664, -0.07491941004991531, 0.009540975093841553, -0.004784618504345417, -0.02028842270374298, 0.0034643837716430426, -0.08378199487924576, -0.12828634679317474, 0.0047202701680362225, -0.015563894994556904, -0.00657170545309782, -0.03440361097455025, 0.002120000310242176, 0.00404086010530591, -0.048976629972457886, 0.06174929440021515, 0.005542237311601639, 0.11726094037294388, -0.02828911691904068, 0.04680964723229408, -0.024343077093362808, 0.024150650948286057, 0.02007872425019741, 0.053581371903419495, -0.1061490848660469, -5.985811668551833e-8, -0.06862540543079376, 0.07703325897455215, -0.03721269220113754, -0.05645056068897247, 0.043031077831983566, 0.009639046154916286, -0.050248149782419205, 0.05331621691584587, 0.011982783675193787, 0.06157197803258896, 0.07329448312520981, -0.05757031962275505, -0.02306991070508957, -0.03249309957027435, -0.010773955844342709, 0.03797614201903343, -0.04872015491127968, 0.05731865018606186, -0.06815611571073532, -0.11994102597236633, 0.06906931847333908, 0.026931757107377052, -0.06301053613424301, -0.012797285802662373, 0.06528017669916153, 0.04061693698167801, -0.04244297742843628, 0.10138951241970062, -0.057991500943899155, 0.07118809968233109, -0.049805983901023865, -0.034020815044641495, 0.03961165249347687, -0.0066382321529090405, -0.007119986694306135, 0.05752957984805107, 0.0682637095451355, -0.032290197908878326, -0.013294744305312634, -0.04110022634267807, -0.028847545385360718, -0.0068940287455916405, -0.03254242241382599, -0.018594209104776382, -0.050484176725149155, -0.0672367662191391, -0.10219062119722366, 0.05476612225174904, 0.0005389460129663348, -0.010075640864670277, 0.0068914261646568775, -0.025430303066968918, -0.06888686120510101, 0.013403200544416904, 0.047544773668050766, -0.005224146880209446, 0.05109395831823349, 0.0384194515645504, 0.02711813524365425, -0.0061495983973145485, 0.012663552537560463, -0.0068550435826182365, 0.03452160581946373, -0.07085886597633362 ]
0.069616
# Session Pruning Session pruning trims \*\*old tool results\*\* from the in-memory context right before each LLM call. It does \*\*not\*\* rewrite the on-disk session history (`\*.jsonl`). ## When it runs - When `mode: "cache-ttl"` is enabled and the last Anthropic call for the session is older than `ttl`. - Only affects the messages sent to the model for that request. - Only active for Anthropic API calls (and OpenRouter Anthropic models). - For best results, match `ttl` to your model `cacheControlTtl`. - After a prune, the TTL window resets so subsequent requests keep cache until `ttl` expires again. ## Smart defaults (Anthropic) - \*\*OAuth or setup-token\*\* profiles: enable `cache-ttl` pruning and set heartbeat to `1h`. - \*\*API key\*\* profiles: enable `cache-ttl` pruning, set heartbeat to `30m`, and default `cacheControlTtl` to `1h` on Anthropic models. - If you set any of these values explicitly, OpenClaw does \*\*not\*\* override them. ## What this improves (cost + cache behavior) - \*\*Why prune:\*\* Anthropic prompt caching only applies within the TTL. If a session goes idle past the TTL, the next request re-caches the full prompt unless you trim it first. - \*\*What gets cheaper:\*\* pruning reduces the \*\*cacheWrite\*\* size for that first request after the TTL expires. - \*\*Why the TTL reset matters:\*\* once pruning runs, the cache window resets, so follow‑up requests can reuse the freshly cached prompt instead of re-caching the full history again. - \*\*What it does not do:\*\* pruning doesn’t add tokens or “double” costs; it only changes what gets cached on that first post‑TTL request. ## What can be pruned - Only `toolResult` messages. - User + assistant messages are \*\*never\*\* modified. - The last `keepLastAssistants` assistant messages are protected; tool results after that cutoff are not pruned. - If there aren’t enough assistant messages to establish the cutoff, pruning is skipped. - Tool results containing \*\*image blocks\*\* are skipped (never trimmed/cleared). ## Context window estimation Pruning uses an estimated context window (chars ≈ tokens × 4). The base window is resolved in this order: 1. `models.providers.\*.models[].contextWindow` override. 2. Model definition `contextWindow` (from the model registry). 3. Default `200000` tokens. If `agents.defaults.contextTokens` is set, it is treated as a cap (min) on the resolved window. ## Mode ### cache-ttl - Pruning only runs if the last Anthropic call is older than `ttl` (default `5m`). - When it runs: same soft-trim + hard-clear behavior as before. ## Soft vs hard pruning - \*\*Soft-trim\*\*: only for oversized tool results. - Keeps head + tail, inserts `...`, and appends a note with the original size. - Skips results with image blocks. - \*\*Hard-clear\*\*: replaces the entire tool result with `hardClear.placeholder`. ## Tool selection - `tools.allow` / `tools.deny` support `\*` wildcards. - Deny wins. - Matching is case-insensitive. - Empty allow list => all tools allowed. ## Interaction with other limits - Built-in tools already truncate their own output; session pruning is an extra layer that prevents long-running chats from accumulating too much tool output in the model context. - Compaction is separate: compaction summarizes and persists, pruning is transient per request. See [/concepts/compaction](/concepts/compaction). ## Defaults (when enabled) - `ttl`: `"5m"` - `keepLastAssistants`: `3` - `softTrimRatio`: `0.3` - `hardClearRatio`: `0.5` - `minPrunableToolChars`: `50000` - `softTrim`: `{ maxChars: 4000, headChars: 1500, tailChars: 1500 }` - `hardClear`: `{ enabled: true, placeholder: "[Old tool result content cleared]" }` ## Examples Default (off): ```json5 { agent: { contextPruning: { mode: "off" }, }, } ``` Enable TTL-aware pruning: ```json5 { agent: { contextPruning: { mode: "cache-ttl", ttl: "5m" }, }, } ``` Restrict pruning to specific tools: ```json5 { agent: { contextPruning: { mode: "cache-ttl",
https://github.com/openclaw/openclaw/blob/main//docs/concepts/session-pruning.md
main
opebclaw
[ -0.020441798493266106, 0.052413828670978546, -0.02602028101682663, 0.04845936968922615, -0.02230890281498432, -0.0871206745505333, -0.05004165321588516, 0.012516818940639496, 0.026990149170160294, -0.0007675358792766929, 0.0536377914249897, 0.08112175017595291, -0.04224707558751106, -0.015693269670009613, 0.11156416684389114, 0.03779184818267822, -0.017829567193984985, -0.02011237107217312, -0.0926966443657875, -0.05253058299422264, 0.013573016971349716, 0.02740567736327648, 0.013670222833752632, 0.035190876573324203, -0.015463430434465408, -0.05955301597714424, -0.008883988484740257, -0.04609833285212517, 0.07905779778957367, -0.0227725338190794, 0.015722788870334625, 0.0736197978258133, -0.039362430572509766, -0.04323052987456322, 0.04991542920470238, 0.05957994982600212, -0.009290150366723537, -0.017961105331778526, -0.0023799824994057417, -0.08854316920042038, 0.046425092965364456, -0.015986617654561996, -0.13541917502880096, -0.03970811516046524, -0.03441907837986946, -0.02528434805572033, -0.01933680661022663, -0.07451940327882767, -0.07939207553863525, -0.004046945832669735, -0.005747596267610788, 0.027633579447865486, -0.0034664415288716555, 0.03137068450450897, -0.04146448150277138, 0.04397197067737579, -0.02173018269240856, 0.05232744663953781, -0.06807836890220642, 0.03593870997428894, -0.0055319988168776035, -0.04363880679011345, -0.03970668464899063, -0.03766229748725891, -0.04637414962053299, -0.047180403023958206, 0.08160927146673203, -0.07851554453372955, 0.10029099881649017, -0.001624039257876575, -0.015141497366130352, -0.009833667427301407, -0.02940160222351551, 0.017476744949817657, -0.01304637175053358, 0.06885115802288055, 0.04025197774171829, 0.001982378074899316, -0.01296521071344614, -0.0897703468799591, -0.026507265865802765, -0.07375641167163849, -0.0346822664141655, 0.018288888037204742, -0.008006696589291096, 0.006496186833828688, -0.050565000623464584, -0.02532282844185829, 0.07178271561861038, -0.003898879047483206, 0.00017145142192021012, -0.015819327905774117, -0.012776468880474567, 0.02589847333729267, -0.03762442618608475, 0.013164605014026165, 0.00898971501737833, 0.02133471518754959, -0.02283940464258194, 0.10038591176271439, -0.0065396330319345, 0.05426705628633499, -0.013697701506316662, 0.06384266912937164, 0.000862085958942771, 0.04124915972352028, -0.014438869431614876, 0.011421237140893936, 0.019008846953511238, 0.011742559261620045, 0.0754905417561531, 0.05160761624574661, 0.07914658635854721, 0.06309689581394196, -0.00454463018104434, -0.019480025395751, -0.0716201514005661, -0.011926866136491299, 0.039307910948991776, 0.09478452056646347, 0.06562093645334244, -0.057157181203365326, 0.0055101290345191956, 0.04635227844119072, 0.07257937639951706, 0.0018042309675365686, 0.05489076301455498, 5.332472900135885e-33, 0.06264928728342056, 0.02831581048667431, 0.006136961746960878, -0.0057445396669209, 0.05271179601550102, 0.019717229530215263, 0.03590589389204979, 0.04178584739565849, -0.009900466538965702, -0.0012468792265281081, -0.02466832473874092, 0.015100624412298203, -0.030044348910450935, -0.009906676597893238, -0.03501783311367035, -0.03836490213871002, -0.04053622484207153, 0.018550194799900055, 0.06437017023563385, -0.008753199130296707, 0.02110145427286625, 0.03579610213637352, -0.010439997538924217, -0.048900067806243896, 0.040221258997917175, 0.08852237462997437, 0.04789701849222183, -0.024961115792393684, -0.11496276408433914, 0.04634253308176994, 0.03918556869029999, 0.028108462691307068, -0.03416645899415016, 0.08104240149259567, 0.03493353724479675, 0.06545276194810867, 0.06747094541788101, 0.0183973740786314, -0.06308624893426895, -0.05014346167445183, -0.02500302903354168, 0.07854064553976059, -0.03334807604551315, -0.07620749622583389, -0.11726461350917816, -0.13531509041786194, -0.017195498570799828, 0.056455522775650024, 0.0685749351978302, 0.016194475814700127, -0.009297790937125683, 0.03741677477955818, 0.00038444751407951117, 0.0365021787583828, -0.07608126848936081, -0.11772380024194717, 0.032012272626161575, -0.041778262704610825, 0.014037157408893108, 0.0827699676156044, 0.026514464989304543, -0.04334908351302147, 0.001489055692218244, 0.039909977465867996, 0.07966163754463196, 0.06497766822576523, -0.05511690303683281, 0.0020807876717299223, -0.0052910419180989265, 0.0170845165848732, -0.004197506234049797, 0.118993379175663, 0.05473834648728371, -0.007404546719044447, -0.03019094280898571, -0.09128991514444351, 0.05426161363720894, 0.048184193670749664, -0.04088601842522621, -0.01466345228254795, 0.0714477002620697, 0.013504073023796082, -0.08324631303548813, 0.0739307552576065, 0.002793980063870549, -0.027140891179442406, 0.029697300866246223, -0.07862918078899384, -0.019792664796113968, 0.04191426932811737, 0.015479156747460365, -0.04584607854485512, 0.06587198376655579, 0.06579158455133438, -0.09113826602697372, -5.245605336978056e-33, -0.005460505839437246, -0.004991244059056044, -0.007342830300331116, 0.06874965876340866, 0.02010825276374817, -0.0725412517786026, 0.0043766312301158905, 0.12145169079303741, -0.10946755856275558, -0.06428370624780655, 0.005672031547874212, 0.0033443747088313103, 0.056738581508398056, 0.024619581177830696, 0.01973036676645279, 0.05401002615690231, 0.01187821477651596, -0.15167607367038727, 0.02501985803246498, 0.04231906682252884, 0.0143488934263587, 0.04979503154754639, -0.08452153950929642, 0.03214164450764656, 0.05278024077415466, -0.028865525498986244, -0.02197766676545143, -0.006970818620175123, -0.0563361793756485, -0.06315942108631134, 0.05331689864397049, 0.016180580481886864, -0.056256003677845, -0.05599416419863701, 0.0031941705383360386, 0.002576529746875167, -0.0164378359913826, 0.12733377516269684, 0.008805183693766594, 0.041460033506155014, 0.08157896995544434, -0.03052840754389763, -0.054822780191898346, 0.009581208229064941, 0.010224444791674614, 0.01917542703449726, -0.1037474200129509, -0.012287811376154423, -0.038025643676519394, 0.023730263113975525, 0.11476375162601471, -0.014689228497445583, -0.002842497080564499, 0.002712709829211235, 0.007591562811285257, -0.018468905240297318, 0.021122893318533897, -0.05408049002289772, -0.0667935386300087, -0.04196588695049286, 0.029513977468013763, -0.06962370872497559, -0.032255638390779495, -0.01182419341057539, 0.015862252563238144, -0.03410515561699867, 0.03296055644750595, 0.049979109317064285, -0.043700963258743286, 0.010547018609941006, -0.008541353046894073, 0.015682755038142204, -0.04037583991885185, 0.04233163595199585, 0.0051621501334011555, -0.04886579513549805, -0.022989092394709587, -0.14167574048042297, 0.0061212098225951195, 0.024758432060480118, -0.1410665661096573, -0.03054731711745262, -0.004229058977216482, -0.035448528826236725, -0.02726096287369728, 0.06255783885717392, -0.06302051991224289, 0.13822545111179352, 0.002647286280989647, 0.05252841114997864, -0.02454291470348835, 0.04168353229761124, -0.021708929911255836, 0.03807951137423515, -0.0033548641949892044, -5.009830417179728e-8, -0.024170327931642532, -0.06265752762556076, -0.09387924522161484, 0.17243832349777222, 0.03871048241853714, -0.04833614453673363, 0.008538983762264252, 0.1166701540350914, -0.005356116686016321, -0.06266642361879349, 0.06855475157499313, 0.06629510968923569, -0.04223908111453056, -0.048512812703847885, -0.021780000999569893, 0.007363201584666967, -0.04596863314509392, 0.009839593432843685, -0.0171356238424778, -0.10359904915094376, -0.0636327937245369, 0.01805780827999115, 0.01853540539741516, -0.04395260661840439, 0.013315211050212383, -0.02605569362640381, 0.06491245329380035, 0.1271234005689621, -0.004157038871198893, -0.03302869200706482, -0.08691205829381943, 0.0009959029266610742, 0.013901702128350735, -0.01690760627388954, -0.021935177966952324, 0.0008046003640629351, -0.012056976556777954, 0.016828469932079315, -0.014882393181324005, 0.006324305664747953, 0.019204307347536087, 0.04787854105234146, -0.024592358618974686, 0.02126586064696312, 0.01189076341688633, -0.03769438713788986, -0.04095907509326935, 0.02100794017314911, 0.07830040156841278, -0.05549640953540802, -0.013918090611696243, 0.04569997265934944, -0.05274716019630432, 0.012450795620679855, -0.03487515449523926, -0.005803541745990515, -0.011287419125437737, -0.010171842761337757, 0.03816709294915199, -0.006195355672389269, 0.08642604947090149, -0.04885856434702873, -0.08650892972946167, -0.08283834159374237 ]
0.037074
result content cleared]" }` ## Examples Default (off): ```json5 { agent: { contextPruning: { mode: "off" }, }, } ``` Enable TTL-aware pruning: ```json5 { agent: { contextPruning: { mode: "cache-ttl", ttl: "5m" }, }, } ``` Restrict pruning to specific tools: ```json5 { agent: { contextPruning: { mode: "cache-ttl", tools: { allow: ["exec", "read"], deny: ["\*image\*"] }, }, }, } ``` See config reference: [Gateway Configuration](/gateway/configuration)
https://github.com/openclaw/openclaw/blob/main//docs/concepts/session-pruning.md
main
opebclaw
[ -0.019521089270710945, 0.08764774352312088, -0.03389124944806099, 0.025715570896863937, -0.0026524034328758717, -0.03971685469150543, -0.030000554397702217, -0.04367382079362869, 0.009480481036007404, -0.02517484314739704, 0.05857475847005844, 0.07191287726163864, -0.008615929633378983, 0.04354294016957283, 0.05815606564283371, 0.02530287764966488, -0.054079461842775345, 0.024631353095173836, -0.08472409844398499, -0.19619496166706085, 0.008541302755475044, 0.022787928581237793, 0.016611436381936073, -0.03369271010160446, -0.0507042296230793, 0.0548490546643734, -0.04088536649942398, -0.015411630272865295, 0.056837454438209534, -0.06883726269006729, -0.011088413186371326, 0.02943306788802147, -0.0870671272277832, -0.007899543270468712, 0.008379003964364529, 0.10474182665348053, 0.014781445264816284, -0.07193237543106079, 0.07725132256746292, -0.040530286729335785, 0.12932322919368744, -0.0064140367321670055, -0.0633186623454094, -0.05653610825538635, 0.007925981655716896, -0.028726011514663696, -0.03078792802989483, -0.05103684589266777, -0.018834620714187622, -0.04018149524927139, -0.023501893505454063, 0.05590926855802536, -0.029643388465046883, 0.006902306340634823, 0.009896070696413517, 0.004949754569679499, -0.03562429919838905, 0.03539660573005676, 0.0002418717776890844, -0.0022358743008226156, 0.0007441865163855255, -0.033282287418842316, -0.05730676278471947, 0.008658411912620068, -0.05561545863747597, -0.026105865836143494, 0.039451662451028824, -0.08289995044469833, 0.057329583913087845, 0.021787216886878014, -0.009228148497641087, -0.01698019914329052, 0.009359942749142647, 0.013697045855224133, -0.0024496938567608595, 0.054106082767248154, 0.03520812839269638, -0.03872456029057503, -0.027266239747405052, -0.004355260636657476, 0.023648960515856743, -0.04914053902029991, 0.012802028097212315, 0.08821596205234528, -0.036288581788539886, 0.06274452060461044, -0.06939228624105453, -0.04382658004760742, 0.049439433962106705, -0.05947965011000633, -0.03435142710804939, -0.07709256559610367, -0.020423945039510727, 0.03324449807405472, -0.02313338778913021, 0.04526388645172119, -0.037669677287340164, -0.1026695966720581, -0.1122426763176918, 0.11077611893415451, -0.05527100712060928, -0.005266574677079916, 0.08656196296215057, 0.06735219061374664, 0.03317685425281525, 0.054228052496910095, 0.05682633817195892, 0.050628408789634705, 0.009319576434791088, 0.015901435166597366, -0.0006808092002756894, 0.018952496349811554, -0.023132944479584694, 0.04037055745720863, -0.025015652179718018, -0.02841951884329319, 0.005288308952003717, -0.005995124112814665, 0.006626787129789591, 0.08129513263702393, 0.0815211683511734, -0.017528237774968147, -0.0521433986723423, 0.01548786275088787, 0.05650690570473671, -0.022355198860168457, 0.05789196118712425, 3.5220863362528025e-33, 0.003679603571072221, -0.025202840566635132, 0.03483225032687187, 0.04333499073982239, 0.09646417200565338, -0.018575947731733322, 0.029484324157238007, -0.02457241900265217, -0.02673911675810814, 0.042394693940877914, 0.011500666849315166, 0.005731686484068632, -0.0850214958190918, 0.04220763221383095, -0.01947350986301899, -0.0004108469292987138, 0.05176923796534538, 0.04106828570365906, 0.05965267866849899, -0.007800407707691193, 0.05815262719988823, 0.004223731346428394, -0.021706441417336464, -0.034213751554489136, 0.004531069193035364, 0.009158198721706867, -0.005175362806767225, -0.044173408299684525, -0.02394796721637249, 0.0022499053739011288, 0.0273525882512331, 0.07223348319530487, 0.045441653579473495, 0.08614286780357361, -0.027520259842276573, 0.0194950420409441, 0.02723965235054493, 0.024443956092000008, -0.09399307519197464, 0.04113830626010895, -0.04030991718173027, 0.05263904482126236, -0.08210113644599915, -0.05463990941643715, -0.0557706244289875, -0.11609331518411636, -0.0960385650396347, -0.020892687141895294, 0.04220634698867798, -0.0008651913958601654, 0.007216372527182102, 0.10164642333984375, -0.020357197150588036, -0.05323104187846184, 0.02524890936911106, -0.10112922638654709, 0.023127147927880287, 0.041889142245054245, 0.016801944002509117, -0.0038393703289330006, 0.020982857793569565, 0.014055345207452774, 0.018427202478051186, 0.09135878086090088, 0.0891767144203186, 0.00798187404870987, -0.02525448054075241, 0.04368786886334419, -0.03752497211098671, 0.006215360481292009, -0.05114658549427986, 0.08573296666145325, 0.0003151287673972547, 0.019860509783029556, -0.030721932649612427, -0.11236365884542465, 0.005815638694912195, -0.0033118913415819407, 0.00358452252112329, 0.051844965666532516, 0.049817733466625214, -0.0010404490167275071, -0.012685229070484638, 0.013752346858382225, -0.03427905961871147, 0.02579663135111332, 0.05348743870854378, -0.060653604567050934, 0.06783588230609894, 0.009004812687635422, -0.02552124485373497, 0.058270394802093506, 0.006504412274807692, 0.007437034975737333, -0.0996798574924469, -4.779978065621932e-33, 0.03220009058713913, 0.002253600861877203, -0.038576640188694, 0.04801235720515251, -0.0470457524061203, -0.0833827406167984, 0.11755874007940292, 0.04330230876803398, 0.0208459310233593, 0.044537272304296494, 0.0707077607512474, 0.07865633070468903, 0.04039416462182999, -0.10015304386615753, -0.019755568355321884, -0.0029331445693969727, -0.0054372698068618774, -0.09130548685789108, 0.02541666105389595, 0.012891828082501888, 0.030489478260278702, 0.051038265228271484, -0.0037528525572270155, 0.01987610198557377, 0.04883262515068054, -0.021470576524734497, 0.014800511300563812, 0.000628226320259273, -0.11388557404279709, -0.047388818114995956, 0.005276952404528856, -0.0006048382492735982, -0.00951619353145361, -0.051460590213537216, 0.058337051421403885, -0.02230711653828621, -0.030492065474390984, 0.1591014713048935, -0.006836287677288055, 0.07864656299352646, 0.07561169564723969, 0.034132324159145355, -0.06882695853710175, 0.06915299594402313, 0.010833238251507282, -0.06906444579362869, 0.029321659356355667, -0.07752836495637894, 0.03629462048411369, -0.010767251253128052, 0.07138177007436752, -0.0072108726017177105, -0.03709675371646881, 0.018593043088912964, 0.009187450632452965, 0.03125092759728432, 0.06202680617570877, -0.01422990020364523, 0.03342084214091301, -0.015530845150351524, 0.02255483902990818, -0.11082450300455093, -0.1251467615365982, 0.040198713541030884, 0.08911577612161636, -0.06959427148103714, -0.07976324111223221, 0.025437159463763237, 0.010413275100290775, -0.02827506512403488, -0.03418048471212387, -0.036396585404872894, 0.047509510070085526, 0.06265343725681305, 0.05370127037167549, -0.09387172758579254, 0.02658173069357872, 0.006980723701417446, 0.019018640741705894, 0.035149142146110535, -0.036539915949106216, -0.0073283398523926735, -0.11990190297365189, -0.0037442571483552456, 0.048255980014801025, 0.0037042454350739717, -0.05885747820138931, 0.07904648035764694, 0.07133562862873077, 0.08237045258283615, 0.0014599189162254333, -0.00719415070489049, -0.040833357721567154, -0.0047455658204853535, -0.004545929841697216, -4.477652737477911e-8, -0.08501455187797546, -0.06615763157606125, -0.10227976739406586, 0.0626138374209404, 0.027538813650608063, -0.00838728342205286, 0.0007624548743478954, 0.006074225064367056, 0.042083047330379486, -0.052553825080394745, 0.06041250005364418, 0.07426194101572037, -0.09276628494262695, -0.011031527072191238, -0.01219280157238245, 0.015092480927705765, -0.08355055004358292, 0.028564227744936943, 0.0010909517295658588, -0.0921207144856453, -0.08288037031888962, -0.01119946874678135, -0.04467165842652321, -0.04063175618648529, -0.016804538667201996, 0.007315181661397219, 0.011001596227288246, 0.0547761432826519, -0.08499583601951599, -0.013417880982160568, -0.05881369113922119, -0.014924864284694195, 0.037855006754398346, -0.029133357107639313, -0.05997462943196297, 0.0607539601624012, 0.06030016019940376, 0.041257791221141815, -0.07252189517021179, -0.006093816831707954, -0.02162502333521843, -0.00511093670502305, -0.02176251821219921, 0.002942686900496483, -0.013571732677519321, -0.03038095124065876, 0.026540230959653854, 0.10793443024158478, 0.05539286509156227, -0.05914930999279022, -0.011932033114135265, -0.030431179329752922, -0.006804515607655048, 0.022744042798876762, -0.013739299029111862, -0.11037863045930862, 0.08870532363653183, -0.055042564868927, -0.030751079320907593, 0.0017076332587748766, 0.06948013603687286, -0.0188190545886755, 0.012334190309047699, -0.10218960791826248 ]
0.067121
# OAuth OpenClaw supports “subscription auth” via OAuth for providers that offer it (notably \*\*OpenAI Codex (ChatGPT OAuth)\*\*). For Anthropic subscriptions, use the \*\*setup-token\*\* flow. This page explains: - how the OAuth \*\*token exchange\*\* works (PKCE) - where tokens are \*\*stored\*\* (and why) - how to handle \*\*multiple accounts\*\* (profiles + per-session overrides) OpenClaw also supports \*\*provider plugins\*\* that ship their own OAuth or API‑key flows. Run them via: ```bash openclaw models auth login --provider ``` ## The token sink (why it exists) OAuth providers commonly mint a \*\*new refresh token\*\* during login/refresh flows. Some providers (or OAuth clients) can invalidate older refresh tokens when a new one is issued for the same user/app. Practical symptom: - you log in via OpenClaw \_and\_ via Claude Code / Codex CLI → one of them randomly gets “logged out” later To reduce that, OpenClaw treats `auth-profiles.json` as a \*\*token sink\*\*: - the runtime reads credentials from \*\*one place\*\* - we can keep multiple profiles and route them deterministically ## Storage (where tokens live) Secrets are stored \*\*per-agent\*\*: - Auth profiles (OAuth + API keys): `~/.openclaw/agents//agent/auth-profiles.json` - Runtime cache (managed automatically; don’t edit): `~/.openclaw/agents//agent/auth.json` Legacy import-only file (still supported, but not the main store): - `~/.openclaw/credentials/oauth.json` (imported into `auth-profiles.json` on first use) All of the above also respect `$OPENCLAW\_STATE\_DIR` (state dir override). Full reference: [/gateway/configuration](/gateway/configuration#auth-storage-oauth--api-keys) ## Anthropic setup-token (subscription auth) Run `claude setup-token` on any machine, then paste it into OpenClaw: ```bash openclaw models auth setup-token --provider anthropic ``` If you generated the token elsewhere, paste it manually: ```bash openclaw models auth paste-token --provider anthropic ``` Verify: ```bash openclaw models status ``` ## OAuth exchange (how login works) OpenClaw’s interactive login flows are implemented in `@mariozechner/pi-ai` and wired into the wizards/commands. ### Anthropic (Claude Pro/Max) setup-token Flow shape: 1. run `claude setup-token` 2. paste the token into OpenClaw 3. store as a token auth profile (no refresh) The wizard path is `openclaw onboard` → auth choice `setup-token` (Anthropic). ### OpenAI Codex (ChatGPT OAuth) Flow shape (PKCE): 1. generate PKCE verifier/challenge + random `state` 2. open `https://auth.openai.com/oauth/authorize?...` 3. try to capture callback on `http://127.0.0.1:1455/auth/callback` 4. if callback can’t bind (or you’re remote/headless), paste the redirect URL/code 5. exchange at `https://auth.openai.com/oauth/token` 6. extract `accountId` from the access token and store `{ access, refresh, expires, accountId }` Wizard path is `openclaw onboard` → auth choice `openai-codex`. ## Refresh + expiry Profiles store an `expires` timestamp. At runtime: - if `expires` is in the future → use the stored access token - if expired → refresh (under a file lock) and overwrite the stored credentials The refresh flow is automatic; you generally don't need to manage tokens manually. ## Multiple accounts (profiles) + routing Two patterns: ### 1) Preferred: separate agents If you want “personal” and “work” to never interact, use isolated agents (separate sessions + credentials + workspace): ```bash openclaw agents add work openclaw agents add personal ``` Then configure auth per-agent (wizard) and route chats to the right agent. ### 2) Advanced: multiple profiles in one agent `auth-profiles.json` supports multiple profile IDs for the same provider. Pick which profile is used: - globally via config ordering (`auth.order`) - per-session via `/model ...@` Example (session override): - `/model Opus@anthropic:work` How to see what profile IDs exist: - `openclaw channels list --json` (shows `auth[]`) Related docs: - [/concepts/model-failover](/concepts/model-failover) (rotation + cooldown rules) - [/tools/slash-commands](/tools/slash-commands) (command surface)
https://github.com/openclaw/openclaw/blob/main//docs/concepts/oauth.md
main
opebclaw
[ -0.0776875913143158, -0.055368583649396896, -0.05730397626757622, 0.028649702668190002, -0.0029718673322349787, -0.11666268855333328, 0.03473934158682823, 0.00293391733430326, 0.04094141721725464, -0.027921998873353004, -0.0070346444845199585, -0.03548862412571907, 0.047587938606739044, -0.009653969667851925, 0.11273086816072464, 0.10084696859121323, 0.0005387166165746748, 0.05580111965537071, -0.02886878326535225, -0.030194487422704697, -0.025898970663547516, 0.018185891211032867, -0.016663458198308945, 0.021485790610313416, -0.050089675933122635, -0.09983103722333908, -0.014448772184550762, -0.02919836714863777, -0.01944623328745365, 0.02092232182621956, 0.10043850541114807, -0.04025892913341522, -0.015022032894194126, -0.0021335165947675705, -0.014798264019191265, 0.00519694434478879, 0.036749713122844696, 0.014205901883542538, -0.06775261461734772, -0.006535220891237259, 0.04310796782374382, 0.0009438965353183448, -0.06846141070127487, -0.021273387596011162, -0.05901723355054855, -0.052106164395809174, -0.04269183799624443, -0.026469416916370392, -0.0428285077214241, 0.034345824271440506, 0.015343858860433102, -0.08673930168151855, -0.015583476051688194, -0.0061226654797792435, -0.052871305495500565, -0.01158664096146822, -0.012365714646875858, -0.017793750390410423, 0.07374966144561768, -0.06506159156560898, 0.07340766489505768, -0.03922130540013313, -0.02149050123989582, 0.05208825692534447, -0.11897578835487366, 0.027972033247351646, -0.08058854192495346, -0.017626341432332993, -0.03390071168541908, 0.03915748745203018, -0.03162621706724167, 0.02473544143140316, -0.04046213999390602, -0.051146842539310455, 0.046721450984478, 0.009347193874418736, 0.020766068249940872, 0.028971504420042038, -0.02590912953019142, -0.047727543860673904, -0.0275749322026968, 0.007158346474170685, -0.0218452550470829, 0.008086608722805977, 0.021173538640141487, 0.10827337205410004, -0.006948911119252443, 0.020721351727843285, -0.0029513901099562645, 0.0540304072201252, 0.010314686223864555, -0.04571886360645294, 0.04655195400118828, -0.08666656911373138, 0.054122187197208405, -0.034749675542116165, -0.021876847371459007, 0.01627681963145733, -0.01963632181286812, 0.08036352694034576, -0.047337960451841354, 0.021256769075989723, 0.013454116880893707, 0.018272656947374344, -0.019484058022499084, 0.009936634451150894, -0.0018892810912802815, 0.02567169815301895, 0.027661709114909172, 0.04701685905456543, 0.01854688487946987, -0.05519351363182068, 0.08551990240812302, -0.04219205677509308, -0.03611251339316368, 0.10283518582582474, -0.09890179336071014, 0.001617936883121729, 0.04128163680434227, 0.09991753101348877, 0.043376289308071136, 0.018110066652297974, 0.030720975250005722, -0.03396746516227722, 0.07922948151826859, 0.07649912685155869, 0.05811777338385582, 5.9170010577356986e-33, -0.014131728559732437, 0.029022976756095886, -0.004070001188665628, -0.02316751517355442, 0.09752801805734634, 0.036043137311935425, 0.050204016268253326, 0.006168472580611706, -0.0057547311298549175, 0.0009487184579484165, -0.0015674489550292492, 0.14274826645851135, -0.012936263345181942, 0.036140915006399155, -0.009899264201521873, -0.018476659432053566, -0.06766445934772491, 0.037845417857170105, 0.09240861982107162, 0.02155892737209797, -0.0029885927215218544, -0.001682115951552987, -0.027155226096510887, 0.0703267827630043, -0.013288426212966442, -0.009568159468472004, 0.02571357786655426, 0.008041608147323132, -0.05416729301214218, 0.03393350914120674, 0.10352609306573868, 0.006631192285567522, -0.04867344722151756, 0.03725915402173996, -0.04048014432191849, -0.013521760702133179, -0.05538424849510193, -0.04070204868912697, -0.029924333095550537, -0.08605857938528061, -0.0110285310074687, 0.003770101349800825, -0.05876040831208229, 0.01128795649856329, -0.03048906847834587, -0.0812269002199173, -0.030645234510302544, 0.084757961332798, 0.04885779693722725, 0.02342001534998417, 0.011603615246713161, 0.002516947453841567, -0.0469554103910923, -0.022345414385199547, -0.03516639024019241, -0.11051537841558456, -0.09165820479393005, -0.04750940576195717, -0.02387595921754837, -0.07497088611125946, -0.026204189285635948, -0.033114634454250336, 0.03436502441763878, 0.022792676463723183, -0.05614631250500679, 0.0049263909459114075, 0.0377584844827652, 0.022158043459057808, -0.045841284096241, 0.004301524255424738, 0.02706809714436531, 0.053834207355976105, -0.06961876153945923, -0.034441154450178146, -0.12188789993524551, -0.03039681725203991, 0.08645619451999664, 0.05836978927254677, 0.05115018039941788, 0.04074529558420181, 0.03777042776346207, -0.023854678496718407, -0.009742138907313347, 0.08129287511110306, -0.04867564141750336, 0.0408211424946785, 0.015649767592549324, -0.025724202394485474, -0.020591825246810913, 0.06100727617740631, 0.02277403138577938, -0.009877229109406471, 0.00132713932543993, 0.02012578211724758, 0.011077579110860825, -6.600646164312879e-33, 0.020939569920301437, -0.0047192820347845554, 0.041847046464681625, -0.014804339967668056, 0.013299483805894852, 0.025457100942730904, -0.013536091893911362, -0.030746448785066605, -0.020593345165252686, -0.08067237585783005, -0.08922965824604034, 0.04708979278802872, 0.03210920840501785, -0.0030161591712385416, 0.08788218349218369, -0.05646131560206413, -0.022210655733942986, -0.017744919285178185, -0.008875110186636448, -0.002185035962611437, -0.05617924779653549, -0.014469482935965061, -0.0015691922744736075, -0.026489244773983955, 0.11802418529987335, 0.022246841341257095, -0.025129185989499092, 0.013413242995738983, 0.008758277632296085, -0.019766593351960182, 0.010793809778988361, 0.04242679476737976, -0.019423935562372208, -0.0026597005780786276, -0.00017724084318615496, 0.0072070336900651455, 0.0007594370981678367, 0.11015679687261581, 0.002758793532848358, 0.01175170298665762, 0.05475633218884468, -0.05348479375243187, -0.005843552760779858, -0.024383125826716423, 0.0451774038374424, 0.08601650595664978, -0.041265472769737244, -0.03932137414813042, -0.10383325815200806, 0.029071057215332985, -0.0017245609778910875, 0.011768677271902561, 0.0365280918776989, 0.00017200828006025404, -0.012519476935267448, 0.06734390556812286, 0.09592925012111664, -0.011434626765549183, -0.0015024517197161913, -0.1360863298177719, -0.01830652356147766, -0.07253111153841019, 0.061114635318517685, 0.19063708186149597, -0.08197657763957977, -0.04733949527144432, 0.052445609122514725, 0.04423854127526283, -0.10963728278875351, -0.05817168205976486, -0.03555675223469734, -0.12239763140678406, -0.04378705471754074, -0.07100709527730942, -0.02862386964261532, 0.0016663349233567715, 0.01432079542428255, -0.09744592010974884, -0.047440774738788605, 0.07488474994897842, -0.06289546936750412, 0.0007776771089993417, 0.07197877019643784, 0.012427540495991707, -0.030810462310910225, -0.06594154983758926, -0.00929231010377407, 0.0724816545844078, 0.10979805141687393, 0.15416719019412994, -0.05888357758522034, 0.06038742884993553, -0.07949618250131607, -0.038533929735422134, 0.01833062618970871, -5.231194322163901e-8, -0.029583178460597992, -0.1048799678683281, -0.022319648414850235, 0.1090480238199234, -0.047666553407907486, -0.025822360068559647, -0.03145221248269081, 0.01893378421664238, -0.07355724275112152, 0.039065342396497726, 0.06675301492214203, 0.046887900680303574, 0.0011271076509729028, -0.06306248158216476, -0.041066233068704605, 0.0622267946600914, -0.005046455655246973, -0.08473601192235947, 0.012978236190974712, -0.03406091406941414, -0.075020432472229, 0.026593688875436783, 0.11202836781740189, 0.0026039457879960537, -0.12684762477874756, 0.013301337137818336, -0.006008950527757406, 0.042956676334142685, -0.01783776469528675, -0.0574832558631897, 0.00802143570035696, -0.004695504903793335, 0.04564639925956726, -0.08331737667322159, -0.050618384033441544, -0.03089904598891735, -0.04887431859970093, -0.016331462189555168, -0.040004294365644455, 0.029748285189270973, 0.02546611800789833, 0.027843333780765533, 0.0337560810148716, -0.033854372799396515, -0.03137001022696495, 0.05394110828638077, -0.02736673504114151, -0.01913161389529705, 0.08189995586872101, -0.027586301788687706, -0.03403091058135033, 0.03902808576822281, 0.01908686012029648, 0.0976729765534401, -0.04508528858423233, 0.03627520427107811, 0.006304515991359949, -0.03702251613140106, 0.032613713294267654, 0.003997317049652338, -0.05627020075917244, 0.028187723830342293, 0.07742268592119217, -0.0339980348944664 ]
0.033185
[/concepts/model-failover](/concepts/model-failover) (rotation + cooldown rules) - [/tools/slash-commands](/tools/slash-commands) (command surface)
https://github.com/openclaw/openclaw/blob/main//docs/concepts/oauth.md
main
opebclaw
[ -0.06045961752533913, -0.06399630755186081, -0.06125512719154358, 0.020379655063152313, 0.01253601536154747, 0.006548626348376274, -0.04534171149134636, 0.042539093643426895, -0.025822103023529053, 0.02521478198468685, 0.12586119771003723, -0.010712039656937122, 0.016731958836317062, -0.0016453656135126948, 0.0654502585530281, 0.05887340009212494, -0.0712418332695961, 0.06325652450323105, -0.021908096969127655, -0.023998195305466652, 0.03811853379011154, 0.08267030119895935, -0.0682857483625412, -0.009404528886079788, -0.10364209860563278, 0.02744172513484955, -0.004592536017298698, 0.003656471148133278, -0.0326569527387619, -0.05554705858230591, -0.008225623518228531, 0.027271097525954247, -0.047848161309957504, 0.022547118365764618, 0.0482015535235405, 0.04263060539960861, 0.09421548247337341, -0.062448497861623764, 0.022855358198285103, -0.07905846834182739, 0.0018645895179361105, 0.011442726477980614, 0.024608228355646133, -0.08449671417474747, -0.029091641306877136, -0.026645570993423462, -0.07380706816911697, -0.0860166996717453, 0.04314254969358444, 0.009982636198401451, -0.04901066794991493, -0.07809077948331833, -0.003033079206943512, 0.10230670124292374, 0.08080436289310455, 0.09292325377464294, -0.0341348722577095, -0.048928339034318924, 0.026487765833735466, 0.017082640901207924, 0.06987571716308594, 0.03399767354130745, -0.11693186312913895, 0.04762384667992592, -0.019078798592090607, -0.04456990957260132, -0.030441325157880783, -0.023599788546562195, -0.03225152567028999, 0.024335095658898354, -0.09167282283306122, -0.04385380074381828, -0.08346392214298248, -0.001994252437725663, 0.0473347045481205, -0.023081766441464424, 0.028248045593500137, -0.020974604412913322, -0.03164132311940193, -0.1070682629942894, -0.035791195929050446, -0.028749514371156693, -0.014630105346441269, 0.06713592261075974, 0.036764346063137054, 0.03986423462629318, -0.013963577337563038, 0.0015819657128304243, 0.12125499546527863, 0.026746220886707306, 0.005960565526038408, -0.03382101282477379, 0.055842652916908264, -0.01366364024579525, -0.07915522158145905, 0.06239013373851776, -0.00724070193246007, -0.027731137350201607, -0.05724555253982544, 0.0566374845802784, -0.027127595618367195, -0.04582258313894272, 0.02626504749059677, -0.029062282294034958, 0.04194163158535957, 0.004160394426435232, 0.02195851504802704, -0.008755449205636978, 0.0129920095205307, -0.007744102738797665, -0.050507862120866776, 0.052196383476257324, -0.050916776061058044, -0.018721673637628555, 0.04387269169092178, -0.023996157571673393, 0.015704570338129997, -0.04223940894007683, 0.021231869235634804, 0.03648242726922035, 0.03572893142700195, 0.02955850213766098, -0.00222959415987134, -0.009037643671035767, 0.04207109659910202, -0.018285280093550682, -0.056650470942258835, -4.0899356983823867e-33, 0.1541040986776352, -0.037800662219524384, -0.08067751675844193, 0.084260955452919, 0.10099893808364868, 0.03951749950647354, 0.038936443626880646, 0.04753384739160538, -0.04449731111526489, 0.04327228292822838, -0.026420030742883682, -0.029433034360408783, -0.04761318862438202, -0.08257529139518738, -0.016884174197912216, -0.05267244949936867, 0.037594884634017944, -0.021563390269875526, -0.006993313319981098, -0.03917887434363365, 0.01663127727806568, 0.05660289525985718, -0.047850750386714935, 0.020738480612635612, 0.02026527002453804, 0.13920579850673676, 0.050927989184856415, -0.0064815375953912735, 0.00017442918033339083, 0.06107252463698387, 0.02275119349360466, -0.06630633771419525, 0.006850495934486389, -0.0069949994795024395, -0.03962516784667969, 0.1233430802822113, -0.020445525646209717, 0.00826716423034668, -0.017270760610699654, -0.02782476507127285, -0.09322682023048401, -0.05283545330166817, -0.11781317740678787, -0.07580209523439407, 0.0007795789279043674, -0.09598975628614426, 0.027334030717611313, -0.04596029222011566, 0.12613272666931152, -0.007062481716275215, -0.007624923251569271, -0.005571739282459021, 0.09757055342197418, 0.015240912325680256, -0.017868220806121826, 0.0010086075635626912, -0.11219111829996109, 0.07689566910266876, 0.029904106631875038, 0.0617489293217659, -0.023838642984628677, 0.06534412503242493, -0.055526990443468094, -0.0055836462415754795, -0.0007971581653691828, 0.017719296738505363, -0.03430257737636566, -0.08311687409877777, 0.0327155664563179, -0.00926074106246233, -0.07401496171951294, -0.03753810375928879, 0.013537505641579628, 0.03677927702665329, -0.037664201110601425, -0.04389047250151634, -0.050453510135412216, -0.04734049364924431, 0.04984595626592636, -0.027384184300899506, -0.09965074807405472, -0.018314117565751076, -0.09016614407300949, 0.008917107246816158, 0.06836708635091782, -0.04314355179667473, 0.05435778573155403, -0.04806794598698616, -0.054341722279787064, -0.04495058208703995, -0.054396554827690125, -0.0602598562836647, -0.009401788003742695, -0.03236593306064606, 0.02276315912604332, 6.820261386154106e-34, 0.06465650349855423, -0.017207445576786995, -0.016564756631851196, 0.09889662265777588, -0.061392709612846375, -0.04965256527066231, 0.01585102267563343, -0.004522156901657581, -0.10404617339372635, -0.05301579460501671, 0.026854509487748146, 0.05726694315671921, 0.019672829657793045, -0.03269125893712044, 0.07626686990261078, -0.0035434849560260773, -0.06186608225107193, -0.11547783762216568, 0.023445459082722664, 0.04970593377947807, -0.015181492082774639, 0.06105908006429672, -0.03135980665683746, 0.07605753093957901, -0.05167407542467117, -0.0032374125439673662, 0.051443569362163544, 0.018398385494947433, 0.04308973252773285, 0.012010066770017147, 0.029719272628426552, -0.001197192003019154, 0.040643852204084396, 0.05247381329536438, -0.008721791207790375, 0.07966892421245575, -0.08586743474006653, 0.06060433387756348, 0.0466277152299881, 0.011110319755971432, 0.13430869579315186, 0.0012775742216035724, -0.038673751056194305, 0.05656425282359123, -0.020538337528705597, 0.04631055146455765, 0.015467731282114983, -0.007537243887782097, -0.030136926099658012, -0.03863298147916794, 0.0065495651215314865, -0.11534979939460754, -0.046206578612327576, 0.036028794944286346, -0.000944719766266644, 0.04417561739683151, 0.06971722841262817, -0.012479272671043873, -0.04312751814723015, 0.02553521655499935, -0.017453894019126892, -0.0492500402033329, 0.029275165870785713, 0.017827149480581284, 0.017916793003678322, -0.035413436591625214, -0.0655505508184433, 0.02980469912290573, -0.04886550456285477, -0.020009845495224, 0.022208120673894882, 0.15688852965831757, 0.04552624747157097, -0.058189552277326584, 0.06926411390304565, -0.12589512765407562, -0.01690644957125187, -0.021040448918938637, 0.021351218223571777, 0.039871953427791595, -0.022027384489774704, -0.015617188066244125, -0.024098291993141174, -0.01744571141898632, -0.011503738351166248, 0.008876491338014603, -0.051063548773527145, 0.12874582409858704, 0.012927542440593243, -0.04906509071588516, -0.0860738530755043, 0.05896218493580818, 0.05219374969601631, 0.048895906656980515, -0.042041074484586716, -3.149706628846616e-8, -0.10984595865011215, 0.03549827262759209, 0.10231001675128937, -0.01272484753280878, -0.018462931737303734, 0.0816243514418602, 0.04935358092188835, -0.029840294271707535, 0.000352226197719574, 0.0045077442191541195, -0.004239384084939957, 0.017680466175079346, -0.006804998964071274, 0.02316858433187008, -0.005078094080090523, 0.00702414708212018, -0.01288310345262289, 0.09576227515935898, -0.031399328261613846, 0.009759414941072464, -0.03445206210017204, -0.05311908945441246, 0.04126754403114319, 0.04361520707607269, 0.052201807498931885, 0.02584598772227764, -0.06140400469303131, -0.0016684627626091242, -0.05911344289779663, -0.022851988673210144, 0.02438284642994404, 0.04197071120142937, 0.043731894344091415, -0.0003805992309935391, 0.025014778599143028, 0.0757521241903305, -0.011556599289178848, 0.002973433118313551, 0.026427455246448517, -0.012320342473685741, -0.010239651426672935, -0.01901063323020935, -0.05793371424078941, 0.013960931450128555, 0.04248093441128731, 0.04102800786495209, 0.015161345712840557, -0.004839304834604263, -0.03839431330561638, -0.0309369508177042, -0.023379968479275703, -0.003513036761432886, -0.009046894498169422, 0.08795178681612015, -0.04308871552348137, 0.035287052392959595, 0.05634602904319763, -0.04313578084111214, -0.02903350628912449, -0.0033797756768763065, 0.04494765028357506, 0.07576658576726913, -0.04640108719468117, 0.038197990506887436 ]
0.131773
# Agent workspace The workspace is the agent's home. It is the only working directory used for file tools and for workspace context. Keep it private and treat it as memory. This is separate from `~/.openclaw/`, which stores config, credentials, and sessions. \*\*Important:\*\* the workspace is the \*\*default cwd\*\*, not a hard sandbox. Tools resolve relative paths against the workspace, but absolute paths can still reach elsewhere on the host unless sandboxing is enabled. If you need isolation, use [`agents.defaults.sandbox`](/gateway/sandboxing) (and/or per‑agent sandbox config). When sandboxing is enabled and `workspaceAccess` is not `"rw"`, tools operate inside a sandbox workspace under `~/.openclaw/sandboxes`, not your host workspace. ## Default location - Default: `~/.openclaw/workspace` - If `OPENCLAW\_PROFILE` is set and not `"default"`, the default becomes `~/.openclaw/workspace-`. - Override in `~/.openclaw/openclaw.json`: ```json5 { agent: { workspace: "~/.openclaw/workspace", }, } ``` `openclaw onboard`, `openclaw configure`, or `openclaw setup` will create the workspace and seed the bootstrap files if they are missing. If you already manage the workspace files yourself, you can disable bootstrap file creation: ```json5 { agent: { skipBootstrap: true } } ``` ## Extra workspace folders Older installs may have created `~/openclaw`. Keeping multiple workspace directories around can cause confusing auth or state drift, because only one workspace is active at a time. \*\*Recommendation:\*\* keep a single active workspace. If you no longer use the extra folders, archive or move them to Trash (for example `trash ~/openclaw`). If you intentionally keep multiple workspaces, make sure `agents.defaults.workspace` points to the active one. `openclaw doctor` warns when it detects extra workspace directories. ## Workspace file map (what each file means) These are the standard files OpenClaw expects inside the workspace: - `AGENTS.md` - Operating instructions for the agent and how it should use memory. - Loaded at the start of every session. - Good place for rules, priorities, and "how to behave" details. - `SOUL.md` - Persona, tone, and boundaries. - Loaded every session. - `USER.md` - Who the user is and how to address them. - Loaded every session. - `IDENTITY.md` - The agent's name, vibe, and emoji. - Created/updated during the bootstrap ritual. - `TOOLS.md` - Notes about your local tools and conventions. - Does not control tool availability; it is only guidance. - `HEARTBEAT.md` - Optional tiny checklist for heartbeat runs. - Keep it short to avoid token burn. - `BOOT.md` - Optional startup checklist executed on gateway restart when internal hooks are enabled. - Keep it short; use the message tool for outbound sends. - `BOOTSTRAP.md` - One-time first-run ritual. - Only created for a brand-new workspace. - Delete it after the ritual is complete. - `memory/YYYY-MM-DD.md` - Daily memory log (one file per day). - Recommended to read today + yesterday on session start. - `MEMORY.md` (optional) - Curated long-term memory. - Only load in the main, private session (not shared/group contexts). See [Memory](/concepts/memory) for the workflow and automatic memory flush. - `skills/` (optional) - Workspace-specific skills. - Overrides managed/bundled skills when names collide. - `canvas/` (optional) - Canvas UI files for node displays (for example `canvas/index.html`). If any bootstrap file is missing, OpenClaw injects a "missing file" marker into the session and continues. Large bootstrap files are truncated when injected; adjust the limit with `agents.defaults.bootstrapMaxChars` (default: 20000). `openclaw setup` can recreate missing defaults without overwriting existing files. ## What is NOT in the workspace These live under `~/.openclaw/` and should NOT be committed to the workspace repo: - `~/.openclaw/openclaw.json` (config) - `~/.openclaw/credentials/` (OAuth tokens, API keys) - `~/.openclaw/agents//sessions/` (session transcripts + metadata) - `~/.openclaw/skills/` (managed skills) If you need to migrate sessions or config, copy them separately and keep
https://github.com/openclaw/openclaw/blob/main//docs/concepts/agent-workspace.md
main
opebclaw
[ 0.0243058018386364, -0.0349055640399456, -0.11595216393470764, 0.05545088276267052, 0.022021641954779625, -0.05029882863163948, -0.016091063618659973, -0.03421081602573395, 0.005952651146799326, -0.04011812433600426, 0.038656800985336304, -0.0026807638350874186, 0.04259287938475609, 0.013770848512649536, 0.0598604716360569, 0.09176747500896454, 0.06375431269407272, 0.01474350318312645, 0.014153444208204746, 0.009822839871048927, 0.06892919540405273, 0.05260436236858368, 0.029644055292010307, -0.08980023115873337, -0.09290271997451782, -0.0027670073322951794, -0.03929295763373375, -0.03918159753084183, -0.04005900025367737, -0.03578757867217064, 0.07095681130886078, 0.027525199577212334, -0.12812232971191406, -0.009607411921024323, 0.16288329660892487, 0.07694768905639648, -0.005085816606879234, 0.023853152990341187, 0.015925569459795952, 0.01043778844177723, 0.08681032806634903, 0.08358500897884369, 0.037316132336854935, -0.06849132478237152, -0.12966392934322357, -0.015631014481186867, -0.004248382057994604, -0.09339715540409088, -0.008037405088543892, -0.03814311325550079, -0.037921495735645294, -0.055785033851861954, -0.007604281418025494, 0.014022724702954292, 0.060331687331199646, 0.04467390850186348, 0.05501333624124527, -0.006999904755502939, 0.029116256162524223, -0.0806126669049263, 0.05857161805033684, 0.01642017811536789, -0.013248850591480732, -0.02632136084139347, -0.06878960132598877, -0.006094674114137888, -0.05467362329363823, -0.00590940099209547, -0.04513315111398697, -0.03891509398818016, -0.07373009622097015, 0.03807895630598068, -0.07649990916252136, -0.02232552506029606, 0.05982900783419609, -0.02921382337808609, 0.003358872840180993, 0.044721122831106186, 0.03960437327623367, -0.11159899085760117, 0.02619803510606289, -0.008507992140948772, 0.0164472758769989, 0.02105698734521866, -0.01789797656238079, 0.09956097602844238, 0.0323890745639801, 0.07966651767492294, 0.11650609970092773, 0.030331723392009735, 0.016764122992753983, -0.09578676521778107, 0.009252825751900673, 0.004243716597557068, 0.06552082300186157, -0.08215465396642685, 0.0009041968733072281, 0.0823524221777916, -0.039613887667655945, 0.05753064900636673, 0.001607501762919128, -0.014908013865351677, 0.06465562433004379, 0.016600321978330612, 0.006058793980628252, 0.09670005738735199, -0.0002854843332897872, 0.025753850117325783, -0.016021808609366417, -0.001029552542604506, -0.019538655877113342, -0.007261299528181553, 0.052406564354896545, 0.042254216969013214, 0.06215466186404228, -0.023041857406497, 0.03616614639759064, 0.03627019375562668, 0.019791746512055397, 0.05629293620586395, 0.06890500336885452, -0.03948865830898285, 0.06148200109601021, 0.02023727260529995, 0.0832584947347641, 0.052662380039691925, 0.022681429982185364, 2.1574330875351234e-33, 0.05055559426546097, -0.08714623749256134, -0.036485057324171066, 0.07327932119369507, 0.1332917958498001, 0.00004705799437942915, 0.02104850858449936, 0.07154623419046402, -0.0061493669636547565, 0.07386448979377747, 0.008385795168578625, 0.047014445066452026, -0.08901525288820267, -0.03880702704191208, -0.0034768825862556696, 0.05428849160671234, -0.01960836537182331, 0.01916326954960823, 0.030005618929862976, 0.01393780205398798, -0.04932081326842308, 0.042194657027721405, -0.07115451991558075, 0.038585957139730453, 0.006072535645216703, -0.021388573572039604, -0.03456300124526024, -0.061070457100868225, 0.013986489735543728, 0.016843775287270546, 0.02728014998137951, 0.06427372992038727, 0.006363986060023308, 0.09953567385673523, -0.05359324440360069, 0.09371418505907059, -0.08353514969348907, -0.01063751894980669, -0.04865703731775284, -0.025492820888757706, 0.003816359443590045, -0.003995072096586227, 0.054637305438518524, -0.03952568396925926, -0.011059079319238663, -0.13846619427204132, -0.023152628913521767, 0.06462317705154419, 0.05821412056684494, 0.04496501386165619, 0.0005310673150233924, -0.01004783995449543, 0.04933691397309303, 0.006951170973479748, -0.0357184074819088, -0.0667303130030632, -0.06755384802818298, -0.004185945726931095, 0.018463803455233574, 0.04388681426644325, -0.03221900388598442, 0.009328951127827168, -0.0034923336934298277, 0.07919208705425262, 0.026216797530651093, -0.005083779338747263, 0.04199189320206642, 0.050853583961725235, 0.021571068093180656, 0.006387817207723856, -0.027538791298866272, 0.005660820286720991, -0.001073147519491613, -0.003375105559825897, -0.09019029140472412, -0.07184605300426483, 0.012165367603302002, -0.035556744784116745, -0.03150338679552078, -0.03830404952168465, -0.0008273118874058127, 0.07008547335863113, -0.02248070389032364, 0.0016232657944783568, -0.03586049750447273, 0.010366201400756836, -0.04961130768060684, -0.05398796498775482, 0.04549622908234596, 0.026179753243923187, 0.017003199085593224, -0.03324266895651817, -0.0685238465666771, 0.06057142838835716, -0.05633153021335602, -4.058031679675116e-33, 0.008161542937159538, -0.03242281824350357, -0.055252257734537125, -0.018911661580204964, -0.06144718453288078, 0.05341199412941933, 0.007995037361979485, -0.08639148622751236, -0.045559968799352646, -0.014697314240038395, -0.031187573447823524, 0.045364733785390854, 0.04440221190452576, -0.053691424429416656, 0.07767890393733978, -0.04908974468708038, 0.02834869548678398, -0.04672204330563545, -0.009569850750267506, -0.023768991231918335, -0.0036997785791754723, 0.02055422030389309, 0.027781492099165916, 0.0010990131413564086, 0.0662514939904213, -0.006297818850725889, -0.06554922461509705, 0.026777613908052444, 0.008494549430906773, -0.0026109139434993267, -0.0001763924228725955, 0.019620418548583984, -0.0430295467376709, -0.08846773952245712, -0.05033132806420326, -0.0027999449521303177, -0.13675525784492493, 0.04466567188501358, 0.021258573979139328, 0.00996121671050787, 0.01851390115916729, -0.015464110299944878, -0.1158585473895073, 0.0011016156058758497, -0.014415672048926353, 0.07847097516059875, -0.015878677368164062, -0.05580820515751839, -0.011334036476910114, -0.0017871030140668154, -0.009318499825894833, 0.005564380902796984, 0.021694861352443695, -0.04035875201225281, -0.016024325042963028, 0.13665521144866943, 0.01226652879267931, -0.009569047950208187, 0.0008685867651365697, -0.027077656239271164, 0.07525711506605148, 0.007232292555272579, -0.10921566188335419, 0.10253369063138962, -0.10307706147432327, -0.019189486280083656, -0.05555601790547371, 0.05465128645300865, -0.05843602120876312, -0.041939347982406616, -0.050609003752470016, -0.003555662464350462, -0.011444282718002796, -0.03589365631341934, 0.01086726225912571, -0.04265699163079262, 0.06212952733039856, -0.10381089150905609, -0.017362063750624657, 0.08071252703666687, -0.06507925689220428, 0.043115828186273575, -0.03503786399960518, -0.03142214193940163, -0.08474859595298767, -0.01836755871772766, -0.04746701940894127, 0.04171685501933098, 0.03044520877301693, 0.009318881668150425, -0.013724364340305328, -0.003803732804954052, -0.049964018166065216, -0.03964539244771004, -0.058975569903850555, -5.005752257147833e-8, -0.013837040401995182, 0.006634968798607588, -0.021399281919002533, 0.02136949636042118, -0.07207633554935455, -0.05234997719526291, 0.04655257239937782, 0.10219044983386993, -0.0017292092088609934, 0.09459123015403748, 0.07551669329404831, -0.01952645182609558, -0.01808880642056465, 0.004938452038913965, -0.08909434080123901, 0.04063950479030609, 0.030100665986537933, -0.019764062017202377, -0.0030593681149184704, -0.059205278754234314, 0.018691640347242355, -0.06068795919418335, 0.0482974611222744, 0.06749540567398071, -0.09372076392173767, -0.029675863683223724, -0.02314048260450363, 0.006356069352477789, -0.02947920374572277, 0.1105634868144989, -0.03157508000731468, 0.0029827672988176346, -0.02160150371491909, -0.00615877378731966, -0.12827570736408234, 0.04746829345822334, -0.035336293280124664, 0.03861306235194206, 0.03777924180030823, 0.016819100826978683, -0.04506906121969223, -0.0031859856098890305, 0.014552424661815166, -0.05376084893941879, -0.06893359869718552, -0.02023882418870926, -0.0266033336520195, 0.003498033620417118, 0.04199356585741043, -0.06548010557889938, -0.07410594075918198, 0.07481388747692108, -0.011514575220644474, 0.0761248841881752, 0.07267367839813232, 0.012797757983207703, 0.055060941725969315, -0.07184294611215591, -0.006411430425941944, 0.0581846758723259, -0.09461548924446106, 0.018064651638269424, 0.01758185587823391, -0.027290936559438705 ]
0.048059
is NOT in the workspace These live under `~/.openclaw/` and should NOT be committed to the workspace repo: - `~/.openclaw/openclaw.json` (config) - `~/.openclaw/credentials/` (OAuth tokens, API keys) - `~/.openclaw/agents//sessions/` (session transcripts + metadata) - `~/.openclaw/skills/` (managed skills) If you need to migrate sessions or config, copy them separately and keep them out of version control. ## Git backup (recommended, private) Treat the workspace as private memory. Put it in a \*\*private\*\* git repo so it is backed up and recoverable. Run these steps on the machine where the Gateway runs (that is where the workspace lives). ### 1) Initialize the repo If git is installed, brand-new workspaces are initialized automatically. If this workspace is not already a repo, run: ```bash cd ~/.openclaw/workspace git init git add AGENTS.md SOUL.md TOOLS.md IDENTITY.md USER.md HEARTBEAT.md memory/ git commit -m "Add agent workspace" ``` ### 2) Add a private remote (beginner-friendly options) Option A: GitHub web UI 1. Create a new \*\*private\*\* repository on GitHub. 2. Do not initialize with a README (avoids merge conflicts). 3. Copy the HTTPS remote URL. 4. Add the remote and push: ```bash git branch -M main git remote add origin git push -u origin main ``` Option B: GitHub CLI (`gh`) ```bash gh auth login gh repo create openclaw-workspace --private --source . --remote origin --push ``` Option C: GitLab web UI 1. Create a new \*\*private\*\* repository on GitLab. 2. Do not initialize with a README (avoids merge conflicts). 3. Copy the HTTPS remote URL. 4. Add the remote and push: ```bash git branch -M main git remote add origin git push -u origin main ``` ### 3) Ongoing updates ```bash git status git add . git commit -m "Update memory" git push ``` ## Do not commit secrets Even in a private repo, avoid storing secrets in the workspace: - API keys, OAuth tokens, passwords, or private credentials. - Anything under `~/.openclaw/`. - Raw dumps of chats or sensitive attachments. If you must store sensitive references, use placeholders and keep the real secret elsewhere (password manager, environment variables, or `~/.openclaw/`). Suggested `.gitignore` starter: ```gitignore .DS\_Store .env \*\*/\*.key \*\*/\*.pem \*\*/secrets\* ``` ## Moving the workspace to a new machine 1. Clone the repo to the desired path (default `~/.openclaw/workspace`). 2. Set `agents.defaults.workspace` to that path in `~/.openclaw/openclaw.json`. 3. Run `openclaw setup --workspace ` to seed any missing files. 4. If you need sessions, copy `~/.openclaw/agents//sessions/` from the old machine separately. ## Advanced notes - Multi-agent routing can use different workspaces per agent. See [Channel routing](/concepts/channel-routing) for routing configuration. - If `agents.defaults.sandbox` is enabled, non-main sessions can use per-session sandbox workspaces under `agents.defaults.sandbox.workspaceRoot`.
https://github.com/openclaw/openclaw/blob/main//docs/concepts/agent-workspace.md
main
opebclaw
[ -0.0673665702342987, -0.08416976034641266, -0.06222899258136749, 0.04452551528811455, 0.0055349236354231834, -0.05941975116729736, -0.016799671575427055, -0.04078331217169762, -0.029388107359409332, -0.004047780763357878, 0.03293174132704735, 0.05982257425785065, 0.03688174858689308, -0.0004239419649820775, 0.06372025609016418, 0.06871385127305984, -0.027579577639698982, 0.031681474298238754, -0.013227391056716442, 0.0051524643786251545, -0.027981404215097427, 0.013960727490484715, 0.013021682389080524, -0.06346556544303894, 0.02112702839076519, 0.011315840296447277, -0.0064908405765891075, 0.011383911594748497, -0.07530214637517929, -0.008478173054754734, 0.04868299886584282, 0.013542011380195618, -0.08400596678256989, -0.015795879065990448, 0.06791754066944122, 0.14977715909481049, 0.03003559447824955, -0.014911875128746033, -0.01271983701735735, -0.011484464630484581, 0.06708696484565735, 0.06211206316947937, -0.0040723164565861225, -0.05976810306310654, -0.046379487961530685, 0.0025925070513039827, 0.03767082467675209, -0.12439095228910446, 0.03596928343176842, -0.00660707987844944, -0.04352615773677826, -0.057392530143260956, 0.009095130488276482, 0.00048247340600937605, 0.041180212050676346, 0.03293837979435921, 0.08902209252119064, 0.010163958184421062, 0.047303423285484314, -0.07698293775320053, 0.08796743303537369, 0.03292704373598099, -0.039180658757686615, 0.0109535101801157, -0.11388252675533295, -0.025561561807990074, -0.04696720838546753, 0.002413031179457903, -0.003937044180929661, -0.0460268035531044, -0.05270393192768097, 0.009817619808018208, -0.11885948479175568, -0.04325392469763756, 0.01358384545892477, 0.02294239029288292, 0.06494729220867157, 0.02122058905661106, -0.0011919686803594232, -0.03710063919425011, 0.007143247406929731, -0.021370690315961838, -0.05308637022972107, 0.05141615495085716, -0.09576848149299622, 0.1304541379213333, 0.01618599332869053, 0.09782227873802185, 0.08987230807542801, 0.02541072852909565, 0.013978390023112297, -0.08095236122608185, 0.06189693510532379, -0.03849766030907631, 0.02796134538948536, -0.08985219150781631, 0.047391071915626526, 0.10686278343200684, -0.026260744780302048, 0.09123340249061584, -0.0096182432025671, -0.010340125299990177, 0.10041525959968567, -0.003445574315264821, -0.07125793397426605, 0.08946993201971054, 0.0635000690817833, 0.07838578522205353, -0.004864090587943792, 0.00996650941669941, 0.014757927507162094, 0.01596897840499878, 0.024452989920973778, 0.06715679913759232, 0.036796774715185165, 0.0710979774594307, -0.06480079889297485, -0.020490990951657295, -0.01928480714559555, 0.09565378725528717, 0.09656886011362076, -0.005378411151468754, 0.10804920643568039, -0.03506429120898247, 0.007480856031179428, 0.050863415002822876, 0.052683744579553604, 3.4097652796378405e-33, 0.05738285556435585, -0.005156219936907291, -0.02843519113957882, 0.059712331742048264, 0.16347667574882507, 0.03255658596754074, 0.02756091207265854, 0.02372896671295166, -0.027345502749085426, 0.023167753592133522, 0.020559489727020264, 0.07719585299491882, -0.08817902952432632, -0.05512039735913277, -0.00655166944488883, -0.030400501564145088, -0.042258135974407196, 0.04326801002025604, 0.06675996631383896, 0.016711361706256866, -0.013836480677127838, -0.011798088438808918, -0.017384491860866547, 0.03037445619702339, 0.023690545931458473, -0.03128024563193321, 0.024192312732338905, -0.022688860073685646, -0.034643400460481644, -0.007327444851398468, 0.005125137977302074, 0.02400040812790394, -0.01802038587629795, 0.014030241407454014, -0.07448236644268036, 0.05011824518442154, -0.07261072844266891, 0.0022530362475663424, -0.04760374501347542, -0.0425514318048954, 0.03115137480199337, 0.03739820420742035, 0.015944747254252434, -0.019808221608400345, 0.07275868207216263, -0.1142493411898613, 0.04033705219626427, 0.03364667296409607, 0.10968603193759918, 0.10812626779079437, 0.016294915229082108, -0.037882450968027115, 0.023701544851064682, -0.05257411673665047, -0.08249641954898834, -0.0037362375296652317, -0.044513072818517685, -0.019439341500401497, 0.025749973952770233, -0.022120017558336258, 0.003792907577008009, 0.012874550186097622, 0.020153261721134186, 0.06966099888086319, 0.040810368955135345, 0.01252048835158348, -0.010850679129362106, 0.07179651409387589, 0.015826817601919174, -0.007979150861501694, -0.024592077359557152, -0.03174906596541405, -0.051716066896915436, -0.006270099431276321, -0.05660659447312355, -0.04274631291627884, 0.05482964590191841, 0.012037950567901134, -0.06521233916282654, -0.009510903619229794, 0.050499312579631805, 0.013910077512264252, -0.06576784700155258, -0.00767872016876936, -0.013177820481359959, 0.07853800803422928, 0.059248004108667374, -0.06717539578676224, -0.005197644699364901, 0.10513980686664581, 0.02585570700466633, -0.0314871184527874, -0.051139019429683685, -0.0035474912729114294, -0.016242243349552155, -5.1982156495666404e-33, -0.02157675288617611, -0.07827692478895187, -0.024134695529937744, 0.002821949077770114, -0.026963716372847557, 0.008145692758262157, -0.0694086030125618, -0.012360414490103722, -0.0974024161696434, -0.042033545672893524, -0.050422873347997665, 0.02874329872429371, 0.08033157140016556, -0.06733059138059616, 0.019459670409560204, -0.08039110898971558, -0.03926520422101021, -0.029782293364405632, -0.015197684988379478, 0.022956322878599167, 0.055936478078365326, 0.038027144968509674, 0.013210044242441654, 0.025105629116296768, 0.04890277981758118, 0.05970194935798645, -0.046272072941064835, 0.043041422963142395, 0.033364925533533096, -0.01808694191277027, 0.03144783154129982, -0.009769706055521965, -0.04464567080140114, 0.015859780833125114, 0.012085748836398125, 0.0066657355055212975, -0.0698557049036026, 0.058156538754701614, 0.006970206741243601, 0.016920991241931915, 0.0396932028234005, -0.038733165711164474, -0.10730688273906708, -0.028318163007497787, -0.006312214769423008, 0.07675692439079285, -0.043588411062955856, -0.020268838852643967, -0.07151619344949722, -0.00548339681699872, 0.027585219591856003, 0.006463221739977598, -0.019969815388321877, -0.021987922489643097, 0.03256158158183098, 0.06893069297075272, 0.09227892011404037, 0.008481922559440136, -0.05366062372922897, -0.08567644655704498, -0.021258044987916946, -0.03203399106860161, -0.01578095369040966, 0.11885422468185425, -0.11343421041965485, -0.07754233479499817, -0.020909924060106277, 0.047361619770526886, -0.12270627915859222, -0.02889033406972885, -0.07906739413738251, 0.027538148686289787, 0.007267041131854057, -0.10491161048412323, 0.018252700567245483, -0.06696026027202606, 0.018940521404147148, -0.03531288355588913, -0.03032633662223816, 0.03960085287690163, -0.01572136953473091, -0.00009392637002747506, -0.016915978863835335, -0.05310935527086258, -0.004944027867168188, 0.010555419139564037, -0.010606748051941395, 0.04692428559064865, 0.044531434774398804, 0.01788492314517498, -0.06979963928461075, -0.0067281597293913364, -0.023794429376721382, -0.04332175478339195, 0.0233767107129097, -5.252392654142568e-8, -0.052207205444574356, 0.060131996870040894, -0.058207493275403976, 0.07903602719306946, -0.04108192026615143, -0.11895862966775894, 0.014064615592360497, 0.044947896152734756, 0.01983012445271015, 0.03361187130212784, 0.04735126346349716, 0.020439347252249718, -0.03598150610923767, 0.05613249912858009, -0.10921845585107803, 0.05647763982415199, 0.007140598259866238, -0.052327223122119904, 0.00245311064645648, -0.013958698138594627, -0.03603440523147583, -0.07702049612998962, 0.07136598974466324, 0.06035646051168442, -0.0551343597471714, -0.049823082983493805, 0.03696519136428833, 0.04880066215991974, -0.05778315290808678, 0.028740769252181053, -0.020219014957547188, -0.018768170848488808, -0.04129641875624657, -0.05283031985163689, -0.053566060960292816, -0.07110653072595596, 0.0015856338432058692, 0.01466798223555088, 0.06919994205236435, -0.01504614856094122, -0.08281329274177551, -0.01379513368010521, 0.005602927412837744, -0.04956730082631111, -0.12711235880851746, -0.0009797897655516863, -0.05252519249916077, 0.06281058490276337, -0.005040623713284731, -0.051606494933366776, -0.061187341809272766, 0.046386998146772385, -0.02090049721300602, 0.013608288951218128, 0.026034845039248466, 0.08694440871477127, 0.040238890796899796, 0.020031029358506203, 0.0009712366154417396, 0.007326330523937941, -0.03381870314478874, -0.03469794988632202, 0.006188397761434317, -0.0807948112487793 ]
-0.013391
# Multi-Agent Routing Goal: multiple \_isolated\_ agents (separate workspace + `agentDir` + sessions), plus multiple channel accounts (e.g. two WhatsApps) in one running Gateway. Inbound is routed to an agent via bindings. ## What is “one agent”? An \*\*agent\*\* is a fully scoped brain with its own: - \*\*Workspace\*\* (files, AGENTS.md/SOUL.md/USER.md, local notes, persona rules). - \*\*State directory\*\* (`agentDir`) for auth profiles, model registry, and per-agent config. - \*\*Session store\*\* (chat history + routing state) under `~/.openclaw/agents//sessions`. Auth profiles are \*\*per-agent\*\*. Each agent reads from its own: ``` ~/.openclaw/agents//agent/auth-profiles.json ``` Main agent credentials are \*\*not\*\* shared automatically. Never reuse `agentDir` across agents (it causes auth/session collisions). If you want to share creds, copy `auth-profiles.json` into the other agent's `agentDir`. Skills are per-agent via each workspace’s `skills/` folder, with shared skills available from `~/.openclaw/skills`. See [Skills: per-agent vs shared](/tools/skills#per-agent-vs-shared-skills). The Gateway can host \*\*one agent\*\* (default) or \*\*many agents\*\* side-by-side. \*\*Workspace note:\*\* each agent’s workspace is the \*\*default cwd\*\*, not a hard sandbox. Relative paths resolve inside the workspace, but absolute paths can reach other host locations unless sandboxing is enabled. See [Sandboxing](/gateway/sandboxing). ## Paths (quick map) - Config: `~/.openclaw/openclaw.json` (or `OPENCLAW\_CONFIG\_PATH`) - State dir: `~/.openclaw` (or `OPENCLAW\_STATE\_DIR`) - Workspace: `~/.openclaw/workspace` (or `~/.openclaw/workspace-`) - Agent dir: `~/.openclaw/agents//agent` (or `agents.list[].agentDir`) - Sessions: `~/.openclaw/agents//sessions` ### Single-agent mode (default) If you do nothing, OpenClaw runs a single agent: - `agentId` defaults to \*\*`main`\*\*. - Sessions are keyed as `agent:main:`. - Workspace defaults to `~/.openclaw/workspace` (or `~/.openclaw/workspace-` when `OPENCLAW\_PROFILE` is set). - State defaults to `~/.openclaw/agents/main/agent`. ## Agent helper Use the agent wizard to add a new isolated agent: ```bash openclaw agents add work ``` Then add `bindings` (or let the wizard do it) to route inbound messages. Verify with: ```bash openclaw agents list --bindings ``` ## Multiple agents = multiple people, multiple personalities With \*\*multiple agents\*\*, each `agentId` becomes a \*\*fully isolated persona\*\*: - \*\*Different phone numbers/accounts\*\* (per channel `accountId`). - \*\*Different personalities\*\* (per-agent workspace files like `AGENTS.md` and `SOUL.md`). - \*\*Separate auth + sessions\*\* (no cross-talk unless explicitly enabled). This lets \*\*multiple people\*\* share one Gateway server while keeping their AI “brains” and data isolated. ## One WhatsApp number, multiple people (DM split) You can route \*\*different WhatsApp DMs\*\* to different agents while staying on \*\*one WhatsApp account\*\*. Match on sender E.164 (like `+15551234567`) with `peer.kind: "dm"`. Replies still come from the same WhatsApp number (no per‑agent sender identity). Important detail: direct chats collapse to the agent’s \*\*main session key\*\*, so true isolation requires \*\*one agent per person\*\*. Example: ```json5 { agents: { list: [ { id: "alex", workspace: "~/.openclaw/workspace-alex" }, { id: "mia", workspace: "~/.openclaw/workspace-mia" }, ], }, bindings: [ { agentId: "alex", match: { channel: "whatsapp", peer: { kind: "dm", id: "+15551230001" } } }, { agentId: "mia", match: { channel: "whatsapp", peer: { kind: "dm", id: "+15551230002" } } }, ], channels: { whatsapp: { dmPolicy: "allowlist", allowFrom: ["+15551230001", "+15551230002"], }, }, } ``` Notes: - DM access control is \*\*global per WhatsApp account\*\* (pairing/allowlist), not per agent. - For shared groups, bind the group to one agent or use [Broadcast groups](/broadcast-groups). ## Routing rules (how messages pick an agent) Bindings are \*\*deterministic\*\* and \*\*most-specific wins\*\*: 1. `peer` match (exact DM/group/channel id) 2. `guildId` (Discord) 3. `teamId` (Slack) 4. `accountId` match for a channel 5. channel-level match (`accountId: "\*"`) 6. fallback to default agent (`agents.list[].default`, else first list entry, default: `main`) ## Multiple accounts / phone numbers Channels that support \*\*multiple accounts\*\* (e.g. WhatsApp) use `accountId` to identify each login. Each `accountId` can be routed to a different agent, so one server can host multiple phone numbers without mixing sessions.
https://github.com/openclaw/openclaw/blob/main//docs/concepts/multi-agent.md
main
opebclaw
[ -0.017617570236325264, -0.07225333154201508, -0.10182501375675201, -0.03642790764570236, -0.03742794319987297, -0.017337795346975327, 0.06377391517162323, -0.0300313550978899, 0.017877351492643356, -0.017297647893428802, 0.011879605241119862, -0.0003185365640092641, 0.025784512981772423, 0.028127597644925117, 0.08641276508569717, 0.09204211831092834, -0.02304418943822384, -0.00546289375051856, -0.03893313929438591, -0.0022563275415450335, 0.023814912885427475, 0.010694936849176884, -0.0213333647698164, -0.023149268701672554, -0.07471954822540283, -0.004522253293544054, -0.015360891819000244, -0.035801973193883896, -0.03528689593076706, 0.021502986550331116, 0.08003555983304977, 0.020079392939805984, -0.09151794016361237, 0.0107889948412776, 0.05901942402124405, 0.04029303044080734, -0.0049721719697117805, 0.0639718621969223, 0.04388348013162613, 0.01967700570821762, 0.06570114195346832, 0.041929274797439575, -0.015974171459674835, -0.04475611075758934, -0.08565276116132736, -0.06747608631849289, -0.06690067797899246, -0.019219081848859787, -0.0034075116273015738, -0.007433285936713219, -0.029659628868103027, -0.017809702083468437, 0.030915118753910065, 0.0829552561044693, 0.0008030403405427933, 0.036920756101608276, -0.0025275542866438627, 0.07263027876615524, -0.021755103021860123, -0.07609696686267853, -0.01113969087600708, -0.019839083775877953, -0.009907439351081848, 0.0006010528886690736, -0.041922491043806076, 0.006742533762007952, -0.08298589289188385, -0.06991562247276306, -0.02803642675280571, -0.032938290387392044, -0.09624965488910675, -0.02157711610198021, -0.0476662740111351, -0.04862334579229355, 0.05757315084338188, -0.0064118728041648865, -0.024461310356855392, 0.011348089203238487, -0.011383187025785446, -0.10592114180326462, 0.035276953130960464, 0.0006189436535350978, -0.004219620488584042, 0.01606566458940506, -0.02659914828836918, 0.03818885236978531, -0.017974834889173508, -0.00176646513864398, 0.03680393472313881, 0.003821589285507798, -0.007116355001926422, -0.03354652225971222, 0.09620238095521927, 0.005613299086689949, 0.05246192216873169, 0.03070349432528019, -0.05910758674144745, 0.04564172029495239, 0.009034747257828712, 0.07351566851139069, -0.06254711747169495, -0.013402719981968403, 0.044918958097696304, 0.08931784331798553, 0.025405799970030785, 0.03753739222884178, 0.03899582847952843, -0.022051502019166946, 0.03059867024421692, -0.024259936064481735, -0.03684768080711365, 0.025842681527137756, 0.036870237439870834, 0.05102810263633728, 0.07419339567422867, 0.026539532467722893, 0.014214342460036278, 0.0895594134926796, 0.028373440727591515, 0.0900990292429924, 0.06456318497657776, -0.10358381271362305, 0.09617985785007477, 0.033344801515340805, 0.11086319386959076, 0.039526548236608505, 0.032396215945482254, 6.351320139083625e-33, 0.028524724766612053, 0.011447448283433914, -0.02174879051744938, 0.06729698181152344, 0.09185397624969482, 0.039129018783569336, 0.008071407675743103, -0.004070180468261242, -0.036877818405628204, 0.03136551380157471, -0.0014199735596776009, 0.10347377508878708, -0.01946405880153179, -0.013108505867421627, -0.045748624950647354, 0.03642221540212631, -0.021252304315567017, 0.07894708961248398, 0.12672819197177887, 0.015162878669798374, 0.013367202132940292, 0.02284638024866581, 0.0013810874661430717, 0.03643343225121498, 0.018237262964248657, 0.03794905170798302, -0.01468395534902811, -0.056424304842948914, 0.054246045649051666, 0.007842457853257656, 0.046035703271627426, 0.05767013505101204, -0.0015477819833904505, 0.08789513260126114, -0.06034760922193527, 0.053364694118499756, -0.0365663506090641, -0.03495179861783981, -0.022042429074645042, -0.05385367572307587, -0.06265083700418472, -0.007670415099710226, 0.09186336398124695, -0.09516460448503494, -0.10180147737264633, -0.13014481961727142, -0.09584373235702515, 0.023576771840453148, 0.10510203242301941, 0.0261762086302042, -0.03713766485452652, -0.012608885765075684, 0.00723274378105998, 0.010820034891366959, 0.00859932042658329, -0.09981231391429901, -0.11208990216255188, 0.03701508790254593, 0.04661203920841217, 0.0005339063354767859, -0.016069045290350914, -0.018866481259465218, -0.04347366839647293, 0.0356547050178051, 0.054573118686676025, -0.040279462933540344, -0.04071374237537384, 0.051818568259477615, 0.02896025963127613, -0.00040964747313410044, -0.05069535970687866, 0.04280800372362137, -0.00031818405841477215, -0.001195825170725584, -0.11417940258979797, -0.07038553059101105, -0.004189939703792334, 0.04995488002896309, 0.012187669053673744, 0.009248471818864346, -0.06545902043581009, 0.05423761159181595, -0.08426075428724289, 0.05878980830311775, -0.035346414893865585, -0.0012515453854575753, -0.036680229008197784, -0.11437583714723587, -0.02815164625644684, 0.059400297701358795, -0.031973693519830704, 0.02799593098461628, -0.02346213161945343, 0.06786927580833435, -0.07559344917535782, -8.104451679216015e-33, -0.005802736151963472, -0.06450749933719635, -0.06907758116722107, -0.010820630006492138, 0.020968841388821602, -0.002517970744520426, 0.03911321610212326, -0.01945887878537178, -0.017356282100081444, -0.02019539661705494, -0.01009920984506607, 0.05627074092626572, 0.08266689628362656, -0.059026192873716354, 0.04983652010560036, -0.04670116305351257, 0.056277912110090256, -0.052490413188934326, -0.01088558230549097, -0.02924324758350849, 0.032189663499593735, 0.038475025445222855, -0.10017400979995728, -0.01828705333173275, 0.06247110664844513, -0.0061262245289981365, -0.006457652430981398, 0.022654930129647255, -0.04334896057844162, 0.031527090817689896, 0.03461959958076477, 0.02340663969516754, -0.06544957309961319, -0.061132851988077164, -0.03789597377181053, 0.00975123606622219, -0.10325977206230164, 0.093194380402565, -0.03100021742284298, 0.02117997780442238, 0.07835526019334793, -0.07856380939483643, -0.08771610260009766, -0.03931195288896561, 0.029179437085986137, 0.07232178747653961, -0.01696743443608284, 0.04336033761501312, -0.06753015518188477, 0.05756296589970589, -0.003155286191031337, -0.06361322849988937, 0.015064772218465805, -0.040525153279304504, -0.045239850878715515, 0.08295755833387375, 0.08878932893276215, -0.014906520955264568, 0.04935809224843979, -0.11230577528476715, 0.054175302386283875, -0.0065697962418198586, -0.05397705361247063, 0.15344327688217163, -0.06737291067838669, -0.05528255179524422, -0.03246551379561424, 0.03829628601670265, 0.008331261575222015, -0.022740712389349937, -0.03015178255736828, -0.07274685800075531, 0.006425517611205578, 0.026325635612010956, 0.07789862155914307, -0.0037209365982562304, 0.004203518852591515, -0.12533588707447052, -0.0003575212031137198, 0.03283651918172836, -0.10536797344684601, 0.03930683061480522, -0.03692956268787384, -0.031026173382997513, 0.0014660455053672194, 0.015231595374643803, -0.02983785606920719, 0.10877563059329987, 0.01843027025461197, 0.039420127868652344, -0.004158658441156149, 0.058856215327978134, -0.02630677819252014, -0.07570713758468628, -0.038534943014383316, -5.46128511302868e-8, -0.032781802117824554, -0.013617402873933315, 0.002459603128954768, 0.0013079685159027576, -0.06935068219900131, -0.03357764706015587, 0.03901022672653198, 0.020101677626371384, 0.001169022056274116, 0.046862997114658356, 0.07557711005210876, 0.019289931282401085, -0.016855919733643532, -0.020088909193873405, -0.06900119036436081, -0.0018055664841085672, -0.0192314013838768, -0.03136986494064331, -0.06397867947816849, -0.0928727239370346, -0.044433631002902985, -0.02970043756067753, 0.03908618539571762, 0.014208164066076279, -0.07616743445396423, 0.012327410280704498, -0.009362847544252872, -0.015495453961193562, -0.06077085807919502, 0.08586572855710983, -0.04676181077957153, 0.02434411458671093, 0.0003629191778600216, -0.020455162972211838, -0.10909496992826462, 0.06142864003777504, -0.0276302732527256, -0.012470471672713757, 0.003989503253251314, -0.011024673469364643, -0.0055445474572479725, -0.028593922033905983, 0.01636921428143978, -0.02948003262281418, 0.05564744770526886, -0.02476946823298931, -0.0596042200922966, 0.030592596158385277, 0.0854298323392868, -0.03503789007663727, -0.12540239095687866, 0.039826203137636185, 0.005228804424405098, 0.06971446424722672, 0.08850731700658798, -0.05889081582427025, 0.012674568220973015, -0.018198732286691666, 0.07966023683547974, -0.00732865184545517, -0.06347497552633286, 0.02409479208290577, -0.02211426943540573, -0.08525752276182175 ]
0.083143
fallback to default agent (`agents.list[].default`, else first list entry, default: `main`) ## Multiple accounts / phone numbers Channels that support \*\*multiple accounts\*\* (e.g. WhatsApp) use `accountId` to identify each login. Each `accountId` can be routed to a different agent, so one server can host multiple phone numbers without mixing sessions. ## Concepts - `agentId`: one “brain” (workspace, per-agent auth, per-agent session store). - `accountId`: one channel account instance (e.g. WhatsApp account `"personal"` vs `"biz"`). - `binding`: routes inbound messages to an `agentId` by `(channel, accountId, peer)` and optionally guild/team ids. - Direct chats collapse to `agent::` (per-agent “main”; `session.mainKey`). ## Example: two WhatsApps → two agents `~/.openclaw/openclaw.json` (JSON5): ```js { agents: { list: [ { id: "home", default: true, name: "Home", workspace: "~/.openclaw/workspace-home", agentDir: "~/.openclaw/agents/home/agent", }, { id: "work", name: "Work", workspace: "~/.openclaw/workspace-work", agentDir: "~/.openclaw/agents/work/agent", }, ], }, // Deterministic routing: first match wins (most-specific first). bindings: [ { agentId: "home", match: { channel: "whatsapp", accountId: "personal" } }, { agentId: "work", match: { channel: "whatsapp", accountId: "biz" } }, // Optional per-peer override (example: send a specific group to work agent). { agentId: "work", match: { channel: "whatsapp", accountId: "personal", peer: { kind: "group", id: "1203630...@g.us" }, }, }, ], // Off by default: agent-to-agent messaging must be explicitly enabled + allowlisted. tools: { agentToAgent: { enabled: false, allow: ["home", "work"], }, }, channels: { whatsapp: { accounts: { personal: { // Optional override. Default: ~/.openclaw/credentials/whatsapp/personal // authDir: "~/.openclaw/credentials/whatsapp/personal", }, biz: { // Optional override. Default: ~/.openclaw/credentials/whatsapp/biz // authDir: "~/.openclaw/credentials/whatsapp/biz", }, }, }, }, } ``` ## Example: WhatsApp daily chat + Telegram deep work Split by channel: route WhatsApp to a fast everyday agent and Telegram to an Opus agent. ```json5 { agents: { list: [ { id: "chat", name: "Everyday", workspace: "~/.openclaw/workspace-chat", model: "anthropic/claude-sonnet-4-5", }, { id: "opus", name: "Deep Work", workspace: "~/.openclaw/workspace-opus", model: "anthropic/claude-opus-4-5", }, ], }, bindings: [ { agentId: "chat", match: { channel: "whatsapp" } }, { agentId: "opus", match: { channel: "telegram" } }, ], } ``` Notes: - If you have multiple accounts for a channel, add `accountId` to the binding (for example `{ channel: "whatsapp", accountId: "personal" }`). - To route a single DM/group to Opus while keeping the rest on chat, add a `match.peer` binding for that peer; peer matches always win over channel-wide rules. ## Example: same channel, one peer to Opus Keep WhatsApp on the fast agent, but route one DM to Opus: ```json5 { agents: { list: [ { id: "chat", name: "Everyday", workspace: "~/.openclaw/workspace-chat", model: "anthropic/claude-sonnet-4-5", }, { id: "opus", name: "Deep Work", workspace: "~/.openclaw/workspace-opus", model: "anthropic/claude-opus-4-5", }, ], }, bindings: [ { agentId: "opus", match: { channel: "whatsapp", peer: { kind: "dm", id: "+15551234567" } } }, { agentId: "chat", match: { channel: "whatsapp" } }, ], } ``` Peer bindings always win, so keep them above the channel-wide rule. ## Family agent bound to a WhatsApp group Bind a dedicated family agent to a single WhatsApp group, with mention gating and a tighter tool policy: ```json5 { agents: { list: [ { id: "family", name: "Family", workspace: "~/.openclaw/workspace-family", identity: { name: "Family Bot" }, groupChat: { mentionPatterns: ["@family", "@familybot", "@Family Bot"], }, sandbox: { mode: "all", scope: "agent", }, tools: { allow: [ "exec", "read", "sessions\_list", "sessions\_history", "sessions\_send", "sessions\_spawn", "session\_status", ], deny: ["write", "edit", "apply\_patch", "browser", "canvas", "nodes", "cron"], }, }, ], }, bindings: [ { agentId: "family", match: { channel: "whatsapp", peer: { kind: "group", id: "120363999999999999@g.us" }, }, }, ], } ``` Notes: - Tool allow/deny lists are \*\*tools\*\*, not skills. If a skill needs to run a binary, ensure `exec` is
https://github.com/openclaw/openclaw/blob/main//docs/concepts/multi-agent.md
main
opebclaw
[ -0.05742321535944939, -0.03826967626810074, -0.06927699595689774, -0.015193554572761059, -0.06930875778198242, -0.024203788489103317, 0.06267496198415756, -0.0054889558814466, 0.05218281224370003, -0.01362255122512579, -0.0023723356425762177, 0.009328757412731647, 0.05023423582315445, 0.05456450209021568, 0.1339922696352005, 0.016982411965727806, -0.022917693480849266, -0.025762349367141724, -0.011764285154640675, -0.013309696689248085, 0.05621854215860367, 0.04372696205973625, -0.02081291750073433, -0.01912635751068592, -0.06182247772812843, -0.06732120364904404, -0.04497914761304855, -0.005996956489980221, -0.01612129993736744, 0.016179051250219345, 0.09573430567979813, 0.0633835643529892, -0.06899375468492508, 0.048783622682094574, -0.003256595227867365, 0.006593749392777681, 0.008095531724393368, 0.063199982047081, 0.014624356292188168, 0.06540951877832413, 0.019383752718567848, 0.03519423305988312, -0.0618322417140007, -0.04391816630959511, -0.029953880235552788, -0.05207318812608719, -0.11833027005195618, 0.01115525420755148, -0.0071111926808953285, 0.013557915575802326, -0.0068807415664196014, -0.01733006350696087, 0.021902352571487427, 0.08362524956464767, -0.042280636727809906, 0.024282066151499748, -0.11808571219444275, 0.05010304972529411, 0.055068861693143845, 0.023251907899975777, 0.023441972211003304, -0.03452138230204582, -0.009031240828335285, 0.021890368312597275, -0.0360720194876194, 0.0011336548486724496, -0.10331527143716812, -0.06056864932179451, -0.0123114800080657, 0.003631683299317956, -0.048433270305395126, -0.036865804344415665, -0.024044524878263474, -0.06628575176000595, -0.005074883811175823, -0.015294400043785572, -0.02976750209927559, 0.003584742546081543, -0.0754561498761177, -0.06916606426239014, -0.004961601458489895, -0.06398405879735947, -0.05908345803618431, 0.041843969374895096, -0.03909817337989807, 0.051585711538791656, -0.00867543462663889, 0.019763994961977005, -0.011559675447642803, -0.02381727285683155, -0.044292740523815155, -0.04741888865828514, 0.0940965786576271, 0.06534887850284576, 0.03406689688563347, 0.1178392618894577, -0.02567143924534321, 0.026800427585840225, 0.003270425833761692, 0.0601126030087471, -0.057894859462976456, 0.0005143717280589044, 0.035524316132068634, 0.06655777245759964, 0.0055708372965455055, -0.001971282297745347, 0.06776417046785355, -0.040970005095005035, 0.052548058331012726, -0.017098769545555115, -0.05122857168316841, 0.017247995361685753, 0.06935866922140121, 0.05628727748990059, 0.0375872403383255, 0.015478326007723808, 0.06370103359222412, 0.07315924763679504, 0.03609813377261162, 0.03082280047237873, 0.14544765651226044, -0.04972577095031738, 0.05756431818008423, 0.036474380642175674, 0.062328603118658066, 0.09425579011440277, 0.035873521119356155, 4.98869112837226e-33, 0.10053179413080215, 0.020214995369315147, -0.0098043791949749, 0.07291825115680695, 0.051829997450113297, 0.013697224669158459, 0.012157022953033447, -0.024410581216216087, -0.07739881426095963, 0.03772728517651558, 0.0073382556438446045, 0.09043432772159576, -0.00713323662057519, 0.0034783075097948313, -0.03850027546286583, 0.04044138640165329, 0.0015926429769024253, 0.041624706238508224, 0.15639269351959229, 0.009702986106276512, -0.05231298878788948, 0.026600029319524765, -0.011670331470668316, 0.019124669954180717, 0.12407662719488144, 0.1104835718870163, 0.003866270650178194, -0.04316721111536026, 0.038496796041727066, -0.00893043540418148, 0.04160594940185547, 0.011075506918132305, -0.027391398325562477, 0.0953374132514, -0.006398969329893589, 0.03458919748663902, -0.05892077460885048, -0.0014797506155446172, -0.06858145445585251, -0.03699507936835289, -0.02740197815001011, 0.00485640624538064, -0.045261405408382416, -0.044512536376714706, -0.049860529601573944, -0.09635243564844131, -0.05436842888593674, 0.03622741997241974, 0.04248911142349243, 0.01167510636150837, -0.07024435698986053, 0.02055191807448864, -0.030220894142985344, 0.028110651299357414, -0.0023295022547245026, -0.09731204807758331, -0.04206584766507149, 0.024538271129131317, -0.003582039615139365, -0.0034751789644360542, -0.019885629415512085, -0.0235113687813282, -0.060892894864082336, 0.013882595114409924, 0.03304541856050491, -0.044735465198755264, -0.057419002056121826, 0.03328719735145569, -0.010449999943375587, 0.004543724935501814, -0.04607075825333595, 0.07529803365468979, -0.03165818378329277, 0.051136478781700134, -0.10263534635305405, -0.0052675483748316765, -0.027867773547768593, 0.03878472372889519, -0.001388676930218935, 0.006685364060103893, 0.008721120655536652, 0.04361738637089729, -0.0920596569776535, 0.07293747365474701, -0.030750131234526634, 0.010113873519003391, 0.0283613670617342, -0.12214866280555725, -0.03738036006689072, 0.06728386133909225, -0.08218640089035034, 0.017580298706889153, 0.04553428292274475, 0.0490296334028244, -0.05717701092362404, -5.897498504429603e-33, -0.05386416241526604, -0.04871257394552231, -0.07513055205345154, -0.003918117377907038, 0.013370398432016373, -0.028219958767294884, 0.09477218985557556, -0.03960590437054634, -0.018845949321985245, -0.029888024553656578, -0.02472587674856186, 0.015026078559458256, 0.08150109648704529, -0.051002856343984604, 0.06320444494485855, 0.02789893001317978, 0.03364405035972595, -0.04766763746738434, -0.04645999148488045, -0.06952925026416779, 0.037574294954538345, 0.06113667041063309, -0.011387970298528671, 0.024043548852205276, 0.05928279459476471, -0.0068265595473349094, 0.03230949118733406, 0.02240155078470707, -0.014339246787130833, -0.04416995868086815, 0.033339522778987885, -0.0327099934220314, -0.033908627927303314, -0.01121144462376833, -0.020384488627314568, 0.023834645748138428, -0.07194444537162781, 0.15856927633285522, -0.010207983665168285, -0.04302077740430832, 0.09645092487335205, -0.09470250457525253, -0.07261127233505249, -0.014824898913502693, 0.007784292567521334, 0.05805679038167, -0.03287537768483162, 0.051482319831848145, -0.08789941668510437, 0.011108378879725933, 0.0025848473887890577, -0.08077839761972427, -0.0264595877379179, -0.048687536269426346, -0.012161122635006905, 0.046236224472522736, 0.1316952109336853, -0.005782504100352526, 0.05351538211107254, -0.0748545229434967, 0.04794393479824066, -0.05318329855799675, 0.023530103266239166, 0.11316285282373428, -0.028797151520848274, -0.09388106316328049, -0.06653182208538055, -0.003687744028866291, 0.02015811949968338, -0.03776485100388527, -0.019471846520900726, -0.10196926444768906, -0.03403010591864586, -0.005720317829400301, 0.061131253838539124, -0.01666422002017498, -0.061698656529188156, -0.10571778565645218, 0.01947721280157566, 0.07108011096715927, -0.044132474809885025, 0.1015942171216011, 0.020113134756684303, -0.016025086864829063, 0.017687510699033737, 0.026325806975364685, 0.040475279092788696, 0.146407350897789, 0.012599309906363487, 0.018749456852674484, -0.0192714910954237, 0.06220702454447746, -0.014418981969356537, -0.0595957450568676, -0.0625871792435646, -5.0353367697653084e-8, -0.05013985559344292, -0.052674781531095505, 0.004683842882514, 0.012428384274244308, -0.08819007873535156, -0.0833296924829483, 0.012693379074335098, 0.0026252656243741512, 0.04695909470319748, -0.00838008988648653, 0.023443415760993958, -0.012917445972561836, 0.013237113133072853, 0.035764433443546295, -0.01971356011927128, -0.01737598143517971, -0.0010108576389029622, -0.03039269894361496, -0.01874089613556862, -0.011333122849464417, -0.06250409036874771, -0.022990958765149117, 0.005603927653282881, 0.02932066284120083, -0.03291233256459236, -0.027675624936819077, -0.03159983828663826, 0.04496031254529953, -0.032962217926979065, 0.026600822806358337, -0.05349345505237579, -0.005206132307648659, -0.008081872016191483, -0.004222231917083263, -0.07418874651193619, 0.0075408886186778545, -0.06158316880464554, -0.04245220124721527, 0.007869051769375801, 0.017979931086301804, 0.042497146874666214, -0.06722103804349899, 0.002888650167733431, -0.002871639095246792, 0.026546286419034004, -0.020963063463568687, -0.03993434086441994, -0.06463406980037689, 0.1288912445306778, -0.054684899747371674, -0.1080426573753357, -0.025951437652111053, 0.08081439882516861, -0.0023141431156545877, 0.05494937673211098, -0.054162148386240005, 0.0370689332485199, -0.0330781452357769, 0.08585665374994278, 0.008824589662253857, -0.03659895807504654, 0.05160953104496002, -0.035227857530117035, -0.012159355916082859 ]
0.045705
"apply\_patch", "browser", "canvas", "nodes", "cron"], }, }, ], }, bindings: [ { agentId: "family", match: { channel: "whatsapp", peer: { kind: "group", id: "120363999999999999@g.us" }, }, }, ], } ``` Notes: - Tool allow/deny lists are \*\*tools\*\*, not skills. If a skill needs to run a binary, ensure `exec` is allowed and the binary exists in the sandbox. - For stricter gating, set `agents.list[].groupChat.mentionPatterns` and keep group allowlists enabled for the channel. ## Per-Agent Sandbox and Tool Configuration Starting with v2026.1.6, each agent can have its own sandbox and tool restrictions: ```js { agents: { list: [ { id: "personal", workspace: "~/.openclaw/workspace-personal", sandbox: { mode: "off", // No sandbox for personal agent }, // No tool restrictions - all tools available }, { id: "family", workspace: "~/.openclaw/workspace-family", sandbox: { mode: "all", // Always sandboxed scope: "agent", // One container per agent docker: { // Optional one-time setup after container creation setupCommand: "apt-get update && apt-get install -y git curl", }, }, tools: { allow: ["read"], // Only read tool deny: ["exec", "write", "edit", "apply\_patch"], // Deny others }, }, ], }, } ``` Note: `setupCommand` lives under `sandbox.docker` and runs once on container creation. Per-agent `sandbox.docker.\*` overrides are ignored when the resolved scope is `"shared"`. \*\*Benefits:\*\* - \*\*Security isolation\*\*: Restrict tools for untrusted agents - \*\*Resource control\*\*: Sandbox specific agents while keeping others on host - \*\*Flexible policies\*\*: Different permissions per agent Note: `tools.elevated` is \*\*global\*\* and sender-based; it is not configurable per agent. If you need per-agent boundaries, use `agents.list[].tools` to deny `exec`. For group targeting, use `agents.list[].groupChat.mentionPatterns` so @mentions map cleanly to the intended agent. See [Multi-Agent Sandbox & Tools](/multi-agent-sandbox-tools) for detailed examples.
https://github.com/openclaw/openclaw/blob/main//docs/concepts/multi-agent.md
main
opebclaw
[ -0.04340352863073349, 0.0125059112906456, -0.04105905070900917, 0.003625450422987342, 0.018378740176558495, -0.006799777038395405, 0.03324412554502487, -0.06214780732989311, -0.08285597711801529, 0.0027635139413177967, 0.041147831827402115, -0.0096701979637146, 0.019364601001143456, 0.05024075508117676, 0.08344035595655441, 0.07033311575651169, 0.012944415211677551, -0.043085817247629166, 0.01488532591611147, -0.06294071674346924, 0.0439952127635479, -0.00012135210272390395, 0.0354372039437294, -0.03709881007671356, -0.08875617384910583, -0.000016734629753045738, -0.06665574759244919, -0.06393790990114212, -0.010793833062052727, 0.0006789630278944969, 0.03904710337519646, 0.015638114884495735, -0.029627639800310135, 0.09324352443218231, 0.0507226288318634, 0.04348734766244888, -0.029308540746569633, 0.03361213207244873, 0.024723168462514877, 0.06252800673246384, -0.008959334343671799, 0.004408895969390869, -0.05826771259307861, -0.0976099893450737, 0.033488597720861435, -0.08864658325910568, -0.02629890851676464, -0.028427021577954292, -0.01683184877038002, 0.004683213774114847, -0.04069831222295761, -0.10278927534818649, 0.018145523965358734, 0.00433159526437521, 0.0024948320351541042, 0.014457574114203453, -0.03219905495643616, 0.0559881217777729, 0.08219233900308609, -0.013990932144224644, 0.042401328682899475, -0.034499626606702805, -0.015483701601624489, -0.015517654828727245, -0.031357571482658386, 0.04997345805168152, -0.04820854216814041, -0.02666541375219822, -0.03348197042942047, -0.005231202580034733, -0.054435230791568756, 0.018621159717440605, -0.014942625537514687, -0.02404576539993286, 0.02723160944879055, -0.04197193309664726, -0.0634935274720192, 0.004663283936679363, 0.009351019747555256, -0.10106461495161057, -0.037616465240716934, -0.10102472454309464, -0.004314873833209276, 0.04566989466547966, -0.034799180924892426, 0.108762226998806, 0.03914675861597061, 0.02692628838121891, 0.10321525484323502, -0.023020468652248383, -0.07427652925252914, -0.04771663248538971, 0.035868968814611435, 0.04605276882648468, 0.08587921410799026, 0.04259616881608963, -0.006308572366833687, 0.01413507666438818, -0.10252824425697327, 0.08849681168794632, -0.001968599855899811, -0.11396866291761398, -0.015753135085105896, 0.0014485877472907305, 0.060362283140420914, 0.06265221536159515, 0.02127925679087639, 0.00500976387411356, -0.02593824826180935, -0.01921846903860569, -0.07912541180849075, 0.09176458418369293, -0.01141452044248581, -0.041110068559646606, 0.02033347450196743, 0.029042543843388557, 0.06468646228313446, 0.029449554160237312, -0.03484984114766121, 0.066305011510849, 0.23062129318714142, -0.001133657991886139, 0.004255084320902824, 0.039237841963768005, 0.09003906697034836, 0.039775509387254715, 0.007821287028491497, 3.088793241067953e-33, 0.1416528820991516, -0.017106054350733757, -0.0340854786336422, 0.04408780112862587, 0.09305590391159058, 0.004758593160659075, 0.03767835348844528, 0.04164138063788414, -0.09750290960073471, 0.0021790077444165945, 0.006459169555455446, 0.01616349071264267, -0.04466966539621353, 0.034707535058259964, 0.04981838911771774, 0.024605348706245422, -0.011796681210398674, 0.016716981306672096, 0.0906011313199997, 0.03402955085039139, -0.020562777295708656, -0.034400053322315216, -0.10675788670778275, 0.05754275619983673, -0.04993714019656181, 0.06672181934118271, -0.04734392091631889, -0.007057902403175831, 0.06620095670223236, 0.020594531670212746, 0.019288504496216774, 0.02199736423790455, 0.023612789809703827, 0.08592008799314499, -0.06366345286369324, 0.010919362306594849, -0.06908805668354034, -0.03258107602596283, -0.02514541894197464, -0.04557665064930916, 0.06801094859838486, -0.03390107676386833, -0.02694001793861389, -0.06471528857946396, 0.04847750440239906, -0.08981672674417496, -0.013413412496447563, 0.0176222026348114, 0.005400513764470816, 0.020429391413927078, -0.029070015996694565, 0.09131435304880142, -0.02442753128707409, -0.0493750125169754, 0.016605637967586517, -0.041479092091321945, -0.03811797499656677, 0.054203830659389496, -0.001890827203169465, 0.06272989511489868, 0.02660621516406536, 0.016358621418476105, -0.007791514508426189, 0.056397538632154465, -0.0061202398501336575, -0.02164069190621376, 0.013733369298279285, 0.03499702364206314, 0.02448243275284767, -0.018715860322117805, -0.06241682171821594, 0.07805503159761429, 0.02003851719200611, 0.03149578347802162, -0.12825289368629456, -0.10972122848033905, 0.00024533827672712505, 0.04165252670645714, -0.037784695625305176, -0.06487328559160233, 0.023306841030716896, -0.0056333416141569614, -0.03876494988799095, -0.04538307711482048, -0.029992030933499336, -0.028865795582532883, -0.0033235896844416857, -0.02497783862054348, 0.013832831755280495, 0.013434539549052715, -0.03772460296750069, 0.013137571513652802, -0.0434831902384758, 0.01779073104262352, -0.05593985691666603, -4.8684648722480184e-33, 0.01774570718407631, -0.019544953480362892, -0.05319691449403763, 0.05152035877108574, 0.03514387458562851, -0.034838754683732986, 0.050493188202381134, -0.05282248556613922, 0.057238366454839706, 0.017297931015491486, -0.0023513149935752153, -0.0226315725594759, 0.03166932985186577, -0.10762468725442886, -0.010029114782810211, -0.008875398896634579, -0.09693826735019684, -0.01820107363164425, 0.052007969468832016, -0.08439116925001144, 0.024805743247270584, 0.08915811032056808, 0.006653196644037962, 0.1284276843070984, 0.03113538958132267, -0.061927154660224915, -0.033524200320243835, 0.009736260399222374, 0.01054561696946621, 0.026929732412099838, 0.013948895037174225, -0.026093531399965286, -0.07153154164552689, -0.01670955866575241, 0.043656811118125916, -0.014347064308822155, -0.03069327399134636, 0.1366373896598816, -0.021090583875775337, 0.030787838622927666, 0.07409173250198364, -0.07509970664978027, -0.14812473952770233, -0.022297270596027374, -0.02750582806766033, 0.06636331975460052, 0.00861786026507616, -0.008279320783913136, -0.048418231308460236, 0.016444142907857895, 0.0209422018378973, -0.052522458136081696, 0.058593250811100006, -0.054730772972106934, -0.006275102961808443, 0.022930553182959557, 0.03498951718211174, -0.06891024112701416, 0.04503436014056206, 0.014369379729032516, 0.05859612300992012, -0.07224083691835403, -0.025969697162508965, 0.08188968151807785, 0.04763943701982498, -0.09877041727304459, -0.11808063089847565, 0.10327642410993576, 0.0008998849662020802, 0.023495491594076157, 0.004741024691611528, -0.0436188280582428, 0.0050178649835288525, -0.03796234726905823, 0.050735846161842346, -0.02158222161233425, -0.03306763619184494, -0.08689814060926437, -0.026563601568341255, 0.09145768731832504, -0.05878779664635658, 0.06082291528582573, 0.0248912051320076, 0.00850070733577013, -0.03330377861857414, 0.055577460676431656, 0.019814517349004745, 0.09686344861984253, 0.005473490338772535, 0.0011988067999482155, -0.038617800921201706, -0.003140023909509182, 0.005059432238340378, -0.051040664315223694, -0.05240362137556076, -5.55981998218158e-8, -0.040811892598867416, 0.00453448761254549, -0.09061133116483688, 0.011003350839018822, 0.01476060226559639, 0.013559031300246716, -0.007703956216573715, 0.02160540036857128, 0.04247225448489189, 0.010014182887971401, 0.044523682445287704, -0.014389004558324814, 0.020511388778686523, 0.013223765417933464, 0.015060476027429104, -0.01690661907196045, -0.08777134120464325, 0.05831506475806236, -0.023175448179244995, -0.035764940083026886, 0.03492485731840134, -0.030345484614372253, 0.02269769459962845, 0.03642117977142334, -0.013935922645032406, -0.0426124706864357, -0.03260732814669609, 0.0469626784324646, -0.06925015151500702, 0.16213156282901764, -0.0859437957406044, -0.08857014775276184, -0.00983924325555563, -0.02689426578581333, -0.04908747971057892, 0.0024607302621006966, -0.04979976639151573, -0.03859846293926239, 0.032550305128097534, 0.060712870210409164, 0.017418136820197105, -0.018427681177854538, -0.022489871829748154, -0.02610931359231472, -0.0046466439962387085, -0.042057350277900696, -0.026766221970319748, -0.06594066321849823, 0.06921565532684326, -0.052655965089797974, -0.005859782919287682, 0.026855122298002243, -0.016907991841435432, 0.02109772339463234, 0.04612363129854202, 0.006660835351794958, 0.10140687227249146, -0.07385915517807007, 0.053571246564388275, 0.030987059697508812, -0.036207497119903564, 0.023107947781682014, 0.03334808722138405, 0.032573260366916656 ]
0.07018
# Timezones OpenClaw standardizes timestamps so the model sees a \*\*single reference time\*\*. ## Message envelopes (local by default) Inbound messages are wrapped in an envelope like: ``` [Provider ... 2026-01-05 16:26 PST] message text ``` The timestamp in the envelope is \*\*host-local by default\*\*, with minutes precision. You can override this with: ```json5 { agents: { defaults: { envelopeTimezone: "local", // "utc" | "local" | "user" | IANA timezone envelopeTimestamp: "on", // "on" | "off" envelopeElapsed: "on", // "on" | "off" }, }, } ``` - `envelopeTimezone: "utc"` uses UTC. - `envelopeTimezone: "user"` uses `agents.defaults.userTimezone` (falls back to host timezone). - Use an explicit IANA timezone (e.g., `"Europe/Vienna"`) for a fixed offset. - `envelopeTimestamp: "off"` removes absolute timestamps from envelope headers. - `envelopeElapsed: "off"` removes elapsed time suffixes (the `+2m` style). ### Examples \*\*Local (default):\*\* ``` [Signal Alice +1555 2026-01-18 00:19 PST] hello ``` \*\*Fixed timezone:\*\* ``` [Signal Alice +1555 2026-01-18 06:19 GMT+1] hello ``` \*\*Elapsed time:\*\* ``` [Signal Alice +1555 +2m 2026-01-18T05:19Z] follow-up ``` ## Tool payloads (raw provider data + normalized fields) Tool calls (`channels.discord.readMessages`, `channels.slack.readMessages`, etc.) return \*\*raw provider timestamps\*\*. We also attach normalized fields for consistency: - `timestampMs` (UTC epoch milliseconds) - `timestampUtc` (ISO 8601 UTC string) Raw provider fields are preserved. ## User timezone for the system prompt Set `agents.defaults.userTimezone` to tell the model the user's local time zone. If it is unset, OpenClaw resolves the \*\*host timezone at runtime\*\* (no config write). ```json5 { agents: { defaults: { userTimezone: "America/Chicago" } }, } ``` The system prompt includes: - `Current Date & Time` section with local time and timezone - `Time format: 12-hour` or `24-hour` You can control the prompt format with `agents.defaults.timeFormat` (`auto` | `12` | `24`). See [Date & Time](/date-time) for the full behavior and examples.
https://github.com/openclaw/openclaw/blob/main//docs/concepts/timezone.md
main
opebclaw
[ 0.0123105114325881, 0.04772789403796196, 0.00018453279335517436, 0.04047216475009918, 0.009648412466049194, -0.09346713125705719, -0.06481040269136429, -0.026022067293524742, 0.05188879370689392, -0.015211161226034164, -0.016001515090465546, -0.07559115439653397, -0.08523315191268921, 0.08864744007587433, 0.06666845828294754, 0.05237694829702377, 0.024408675730228424, -0.0723394900560379, -0.048729002475738525, -0.04123362898826599, 0.047529030591249466, 0.05105602741241455, 0.013425739482045174, -0.016889015212655067, -0.051746711134910583, -0.04654550924897194, -0.006864970084279776, 0.04849032685160637, 0.002064966131001711, 0.039282992482185364, 0.008115905337035656, 0.04899249225854874, -0.021322980523109436, 0.03278007730841637, 0.026642540469765663, 0.04755653813481331, 0.048392508178949356, -0.02003689855337143, 0.07417915016412735, 0.06153528392314911, 0.11005891859531403, 0.019865533336997032, -0.03752952069044113, 0.0012434389209374785, -0.04040350019931793, -0.07613761723041534, -0.01164219155907631, 0.03004792332649231, -0.029783304780721664, 0.10368695110082626, -0.0275717880576849, -0.012069648131728172, 0.00829991139471531, -0.06139810383319855, -0.021554019302129745, 0.05782898887991905, -0.04142700135707855, 0.042674291878938675, 0.028675759211182594, -0.0804249495267868, 0.017609110102057457, -0.03843286633491516, -0.10934381186962128, 0.002791489940136671, -0.04747381806373596, -0.02656453102827072, -0.06629955768585205, -0.04159286990761757, -0.034163329750299454, -0.03210068121552467, 0.0055173225700855255, -0.028094055131077766, -0.029954757541418076, -0.014507660642266273, 0.030083809047937393, -0.0062357098795473576, 0.005570166744291782, 0.014444371685385704, -0.00934565905481577, 0.004335156641900539, -0.03522246703505516, -0.09872991591691971, -0.06586066633462906, 0.03570971637964249, -0.011343221180140972, 0.024286167696118355, 0.026847299188375473, 0.05738307535648346, 0.06720830500125885, -0.038331180810928345, 0.02734498307108879, -0.11060593277215958, 0.02072838880121708, 0.05175790190696716, -0.03870119899511337, 0.025822967290878296, 0.006416504271328449, 0.06958308815956116, -0.04925886169075966, 0.10568864643573761, -0.010467317886650562, -0.010699664242565632, -0.0022651946637779474, 0.08287251740694046, 0.03020353801548481, 0.008449718356132507, -0.02964952029287815, 0.058750104159116745, -0.07136925309896469, 0.06188637390732765, 0.015671903267502785, 0.03169550746679306, 0.03062194027006626, -0.03590801730751991, 0.07665291428565979, 0.005035459063947201, -0.02966935746371746, 0.007628618273884058, 0.04044600576162338, -0.0034448138903826475, 0.03593893349170685, 0.014749179594218731, -0.04684443399310112, 0.010860285721719265, 0.06140480935573578, 0.08829625695943832, 0.09352410584688187, 5.445031259672919e-33, 0.03759213536977768, 0.046381302177906036, 0.06546477228403091, 0.01293946523219347, 0.04406115040183067, 0.014051754027605057, -0.04990644380450249, 0.006804761476814747, 0.01902785338461399, 0.0033611091785132885, -0.0037641567178070545, 0.024131586775183678, -0.012935941107571125, -0.11197589337825775, -0.04950253292918205, 0.06973955780267715, 0.012719444930553436, 0.02824406698346138, 0.11818036437034607, 0.06983166933059692, 0.008947999216616154, -0.04308081418275833, -0.04909715801477432, -0.027882609516382217, -0.03996814414858818, 0.034776847809553146, -0.01514468900859356, -0.07883200794458389, -0.03672982007265091, 0.014549016952514648, 0.020312154665589333, 0.08016689121723175, -0.02910364419221878, 0.10156918317079544, 0.05143911391496658, 0.08173102140426636, 0.025210360065102577, 0.013936339877545834, -0.062350958585739136, -0.0360233411192894, 0.0036191039253026247, 0.032205335795879364, -0.08970212191343307, -0.029871122911572456, -0.04308726266026497, -0.07700256258249283, -0.0313645675778389, -0.0010008724639192224, 0.05969664826989174, 0.03176514431834221, -0.002374309580773115, 0.028057819232344627, 0.07753711193799973, -0.06712978333234787, 0.0002920663100667298, -0.026946431025862694, 0.10130826383829117, 0.04526916891336441, 0.017146123573184013, -0.0003436384431552142, 0.016876820474863052, -0.028938619419932365, 0.06339751183986664, -0.05872785672545433, 0.07064016908407211, 0.006416868418455124, 0.01690700836479664, 0.04822004586458206, 0.007757744286209345, 0.05794950947165489, 0.008176319301128387, 0.10951022058725357, 0.02610233798623085, 0.10892296582460403, -0.053297605365514755, -0.10372865945100784, 0.1149352639913559, 0.045933451503515244, 0.0694989338517189, 0.01270419079810381, 0.011087683960795403, -0.04799114540219307, -0.05125490576028824, -0.02143547683954239, -0.028245331719517708, 0.0000661309968563728, 0.010383795946836472, 0.023963432759046555, 0.004988682456314564, 0.037439242005348206, -0.05277987942099571, -0.018198519945144653, -0.005078723654150963, 0.047113485634326935, -0.07158002257347107, -5.465777265596994e-33, -0.012274795211851597, -0.09764427691698074, -0.08438672125339508, 0.014243502169847488, -0.019375286996364594, -0.047368090599775314, 0.0063349539414048195, 0.11427625268697739, -0.019566332921385765, 0.03659270331263542, 0.05086749419569969, -0.05290035158395767, 0.02821492590010166, -0.04756928235292435, 0.02110375091433525, -0.027243047952651978, 0.0700048878788948, -0.07828240841627121, 0.007824073545634747, 0.0075212325900793076, 0.05202843248844147, -0.04428974911570549, -0.07199741154909134, 0.052117664366960526, 0.08409279584884644, -0.015910280868411064, -0.0011389600113034248, 0.015159733593463898, -0.06461761891841888, -0.09618469327688217, -0.038792870938777924, 0.0060554672963917255, 0.011745816096663475, -0.022316090762615204, -0.0686667263507843, 0.05607355386018753, -0.05532270669937134, 0.1320752054452896, 0.04806787148118019, 0.028337113559246063, -0.04056014493107796, 0.03267226368188858, -0.1796025186777115, 0.010767237283289433, -0.04401054233312607, 0.0818123146891594, -0.009434999898076057, 0.01831531897187233, -0.021622037515044212, -0.0051398989744484425, 0.01612878404557705, -0.017844179645180702, 0.03866326063871384, 0.02368205599486828, -0.02757737971842289, 0.06533264368772507, 0.030373428016901016, -0.14147184789180756, 0.04274136573076248, -0.034492578357458115, -0.045486949384212494, -0.05715945363044739, 0.0011711990227922797, 0.022920265793800354, 0.03408768028020859, -0.063230000436306, 0.006444529164582491, -0.054800476878881454, -0.012456304393708706, -0.06530214846134186, -0.016603000462055206, -0.048070237040519714, -0.06864860653877258, -0.04056750610470772, 0.0217956081032753, -0.01736517623066902, -0.0025149027351289988, 0.02689061313867569, -0.01664278842508793, 0.03999289870262146, -0.08077553659677505, 0.03506621718406677, 0.0028855500277131796, 0.06149934232234955, 0.01177414134144783, 0.03037513606250286, 0.03186282888054848, 0.10638149827718735, -0.0030863608699291945, 0.05920925363898277, -0.02402593195438385, 0.08413680642843246, -0.0774461105465889, -0.0002982438891194761, -0.06184030696749687, -5.325361485120084e-8, -0.07990791648626328, -0.02404756285250187, -0.06492388248443604, 0.03336739540100098, -0.08794081211090088, -0.02475138008594513, 0.024251142516732216, -0.01625092141330242, 0.07247871905565262, 0.00561778899282217, 0.0743076428771019, 0.07196609675884247, -0.0648091584444046, -0.02381567470729351, -0.016648927703499794, -0.013590005226433277, -0.06771048903465271, -0.012879827991127968, -0.036101944744586945, -0.037926048040390015, 0.012308462522923946, -0.014335022307932377, 0.07146239280700684, -0.04618242755532265, 0.041042305529117584, 0.017765246331691742, -0.10912216454744339, 0.06869528442621231, 0.010895724408328533, 0.030355529859662056, -0.07099169492721558, -0.030710594728589058, 0.014122303575277328, -0.03951183333992958, -0.1272975653409958, -0.044887613505125046, 0.00108551315497607, -0.019681356847286224, -0.03915023431181908, 0.03532690554857254, 0.08434612303972244, -0.05254563316702843, -0.18742084503173828, -0.031956009566783905, 0.022548342123627663, -0.0024302720557898283, 0.005377024412155151, 0.01878538355231285, 0.09625120460987091, -0.01699267327785492, -0.033470988273620605, 0.014596043154597282, 0.007911561988294125, -0.012338917702436447, 0.0032257484272122383, 0.0012616462772712111, 0.04427780583500862, -0.07889385521411896, 0.05482048541307449, -0.004764196462929249, -0.024859750643372536, 0.018381459638476372, -0.06912366300821304, -0.0059102680534124374 ]
0.027545
# Streaming + chunking OpenClaw has two separate “streaming” layers: - \*\*Block streaming (channels):\*\* emit completed \*\*blocks\*\* as the assistant writes. These are normal channel messages (not token deltas). - \*\*Token-ish streaming (Telegram only):\*\* update a \*\*draft bubble\*\* with partial text while generating; final message is sent at the end. There is \*\*no real token streaming\*\* to external channel messages today. Telegram draft streaming is the only partial-stream surface. ## Block streaming (channel messages) Block streaming sends assistant output in coarse chunks as it becomes available. ``` Model output └─ text\_delta/events ├─ (blockStreamingBreak=text\_end) │ └─ chunker emits blocks as buffer grows └─ (blockStreamingBreak=message\_end) └─ chunker flushes at message\_end └─ channel send (block replies) ``` Legend: - `text\_delta/events`: model stream events (may be sparse for non-streaming models). - `chunker`: `EmbeddedBlockChunker` applying min/max bounds + break preference. - `channel send`: actual outbound messages (block replies). \*\*Controls:\*\* - `agents.defaults.blockStreamingDefault`: `"on"`/`"off"` (default off). - Channel overrides: `\*.blockStreaming` (and per-account variants) to force `"on"`/`"off"` per channel. - `agents.defaults.blockStreamingBreak`: `"text\_end"` or `"message\_end"`. - `agents.defaults.blockStreamingChunk`: `{ minChars, maxChars, breakPreference? }`. - `agents.defaults.blockStreamingCoalesce`: `{ minChars?, maxChars?, idleMs? }` (merge streamed blocks before send). - Channel hard cap: `\*.textChunkLimit` (e.g., `channels.whatsapp.textChunkLimit`). - Channel chunk mode: `\*.chunkMode` (`length` default, `newline` splits on blank lines (paragraph boundaries) before length chunking). - Discord soft cap: `channels.discord.maxLinesPerMessage` (default 17) splits tall replies to avoid UI clipping. \*\*Boundary semantics:\*\* - `text\_end`: stream blocks as soon as chunker emits; flush on each `text\_end`. - `message\_end`: wait until assistant message finishes, then flush buffered output. `message\_end` still uses the chunker if the buffered text exceeds `maxChars`, so it can emit multiple chunks at the end. ## Chunking algorithm (low/high bounds) Block chunking is implemented by `EmbeddedBlockChunker`: - \*\*Low bound:\*\* don’t emit until buffer >= `minChars` (unless forced). - \*\*High bound:\*\* prefer splits before `maxChars`; if forced, split at `maxChars`. - \*\*Break preference:\*\* `paragraph` → `newline` → `sentence` → `whitespace` → hard break. - \*\*Code fences:\*\* never split inside fences; when forced at `maxChars`, close + reopen the fence to keep Markdown valid. `maxChars` is clamped to the channel `textChunkLimit`, so you can’t exceed per-channel caps. ## Coalescing (merge streamed blocks) When block streaming is enabled, OpenClaw can \*\*merge consecutive block chunks\*\* before sending them out. This reduces “single-line spam” while still providing progressive output. - Coalescing waits for \*\*idle gaps\*\* (`idleMs`) before flushing. - Buffers are capped by `maxChars` and will flush if they exceed it. - `minChars` prevents tiny fragments from sending until enough text accumulates (final flush always sends remaining text). - Joiner is derived from `blockStreamingChunk.breakPreference` (`paragraph` → `\n\n`, `newline` → `\n`, `sentence` → space). - Channel overrides are available via `\*.blockStreamingCoalesce` (including per-account configs). - Default coalesce `minChars` is bumped to 1500 for Signal/Slack/Discord unless overridden. ## Human-like pacing between blocks When block streaming is enabled, you can add a \*\*randomized pause\*\* between block replies (after the first block). This makes multi-bubble responses feel more natural. - Config: `agents.defaults.humanDelay` (override per agent via `agents.list[].humanDelay`). - Modes: `off` (default), `natural` (800–2500ms), `custom` (`minMs`/`maxMs`). - Applies only to \*\*block replies\*\*, not final replies or tool summaries. ## “Stream chunks or everything” This maps to: - \*\*Stream chunks:\*\* `blockStreamingDefault: "on"` + `blockStreamingBreak: "text\_end"` (emit as you go). Non-Telegram channels also need `\*.blockStreaming: true`. - \*\*Stream everything at end:\*\* `blockStreamingBreak: "message\_end"` (flush once, possibly multiple chunks if very long). - \*\*No block streaming:\*\* `blockStreamingDefault: "off"` (only final reply). \*\*Channel note:\*\* For non-Telegram channels, block streaming is \*\*off unless\*\* `\*.blockStreaming` is explicitly set to `true`. Telegram can stream drafts (`channels.telegram.streamMode`) without block replies. Config location reminder: the `blockStreaming\*` defaults live under `agents.defaults`, not the root config. ##
https://github.com/openclaw/openclaw/blob/main//docs/concepts/streaming.md
main
opebclaw
[ -0.06237626448273659, -0.05581201985478401, 0.044648148119449615, 0.018488474190235138, 0.042767856270074844, -0.12712521851062775, -0.02680589072406292, -0.011680214665830135, 0.0792609378695488, -0.006078875157982111, -0.0132873160764575, -0.060146138072013855, -0.03767869621515274, -0.015472372062504292, 0.10398584604263306, 0.016818175092339516, 0.08866731822490692, -0.10935552418231964, -0.09975919872522354, -0.06866990029811859, 0.03232453390955925, 0.041142214089632034, -0.02629469893872738, 0.0422525592148304, 0.015150865539908409, -0.006071029230952263, -0.025869276374578476, -0.011067631654441357, 0.05346429720520973, -0.039142850786447525, 0.023206207901239395, -0.03146403282880783, -0.032401204109191895, -0.0006043300381861627, 0.046277523040771484, 0.0668478012084961, 0.007880114018917084, -0.008846565149724483, -0.031409475952386856, -0.006322209723293781, 0.00988384522497654, -0.06969685107469559, -0.0832710713148117, 0.03180878609418869, -0.03199635073542595, -0.01759311370551586, -0.0048485323786735535, -0.009029916487634182, -0.07740499079227448, -0.004267706535756588, -0.07652664929628372, -0.04668835178017616, 0.004141076467931271, 0.08851221203804016, 0.02690744213759899, -0.009605408646166325, -0.016712365671992302, 0.012454218231141567, 0.025764713063836098, -0.0182670708745718, -0.042372897267341614, -0.02777913026511669, -0.031565457582473755, -0.000611956580542028, -0.04297075420618057, -0.027761166915297508, -0.03329290822148323, 0.12661248445510864, 0.03201945871114731, 0.010389953851699829, 0.018832052126526833, 0.037508320063352585, -0.07413917034864426, 0.02545037679374218, 0.03496928885579109, -0.03269711881875992, 0.09454263001680374, 0.06984250247478485, -0.0950135737657547, -0.05839039012789726, -0.06164408102631569, -0.039178621023893356, 0.016933120787143707, -0.06937945634126663, -0.03979313746094704, 0.05159630626440048, 0.036410436034202576, 0.03480503708124161, 0.01244313083589077, 0.05471568927168846, -0.012331432662904263, -0.04076666384935379, 0.06579428166151047, 0.05330510810017586, 0.02112439274787903, -0.0013500533532351255, -0.013386521488428116, -0.020138775929808617, -0.022283701226115227, 0.06755270808935165, 0.02668040432035923, 0.02050391584634781, 0.010331288911402225, 0.0008660780731588602, 0.005282551981508732, -0.059253059327602386, 0.0018834706861525774, 0.10802159458398819, 0.002853559795767069, -0.011640258133411407, 0.02422732673585415, -0.025133853778243065, 0.04775473102927208, -0.03896663710474968, 0.0029702638275921345, 0.023040471598505974, -0.0220804363489151, -0.01634269393980503, 0.03297634422779083, 0.07485050708055496, 0.05744043365120888, -0.06989529728889465, -0.056909240782260895, 0.0420173816382885, 0.025737090036273003, 0.039537712931632996, 0.11192510277032852, 5.585977440440327e-33, 0.03026369772851467, 0.010161714628338814, -0.10798180103302002, 0.011981384828686714, 0.03906402736902237, 0.05478470027446747, -0.0002920110709965229, -0.0038535522762686014, -0.023523032665252686, -0.022565728053450584, -0.08753859996795654, -0.02469717152416706, -0.01685090735554695, 0.07711047679185867, -0.007951539009809494, -0.09920603036880493, -0.038632769137620926, 0.0274993684142828, 0.018531667068600655, 0.04753069952130318, 0.02615508995950222, 0.0038013304583728313, -0.08117319643497467, -0.01691523753106594, -0.011908874846994877, 0.0602000392973423, 0.017692215740680695, -0.09760716557502747, -0.03516810014843941, 0.05160349979996681, -0.035120684653520584, 0.0024240254424512386, 0.029429778456687927, 0.00677221966907382, 0.07128097862005234, 0.0032088349107652903, -0.04926752299070358, -0.05324501171708107, -0.03254643455147743, -0.09466149657964706, -0.004969500005245209, 0.01615568995475769, -0.10721930116415024, -0.033134084194898605, -0.07834310829639435, -0.12465977668762207, -0.08157012611627579, -0.003233421826735139, -0.04012288153171539, -0.03882910683751106, 0.12513262033462524, 0.03296481817960739, 0.06384483724832535, 0.003314521163702011, 0.03718629106879234, -0.04134644940495491, 0.01059980969876051, -0.04973021149635315, 0.05246824771165848, 0.07206284254789352, 0.027838679030537605, 0.037409618496894836, 0.031585052609443665, 0.03378629684448242, 0.02200554683804512, 0.07732979953289032, 0.029158521443605423, 0.043463386595249176, 0.045514438301324844, -0.07683319598436356, -0.10564898699522018, 0.030373938381671906, -0.009846961125731468, 0.05077328532934189, -0.0715126097202301, -0.04044541344046593, 0.005601663142442703, -0.05126219987869263, 0.03205114230513573, 0.023354966193437576, -0.009094311855733395, -0.04957563057541847, 0.028160778805613518, -0.023300448432564735, 0.01033956091850996, 0.012271204963326454, 0.0019413871923461556, -0.07853273302316666, -0.022221237421035767, 0.05845743417739868, -0.0752045288681984, 0.004989888984709978, 0.033396147191524506, 0.015124458819627762, 0.004443312995135784, -5.689689470303454e-33, 0.00034569340641610324, 0.0266000684350729, -0.06818550080060959, -0.004087151028215885, -0.008795630186796188, -0.02423521876335144, 0.0466880202293396, 0.05991679057478905, -0.009102262556552887, -0.026673786342144012, -0.12582628428936005, -0.016801802441477776, -0.06660045683383942, 0.022251296788454056, -0.00037542119389399886, -0.09785585105419159, 0.02593507617712021, -0.07720692455768585, 0.0041059167124331, 0.03296099975705147, -0.0659257248044014, -0.08230314403772354, -0.08431506156921387, 0.057049836963415146, 0.04994015023112297, 0.02893809787929058, -0.020930631086230278, 0.07287106662988663, 0.04298115149140358, -0.07877158373594284, 0.013297941535711288, -0.0014487196458503604, -0.005107411183416843, -0.044654544442892075, -0.0020550100598484278, -0.0010010888800024986, 0.07515320926904678, 0.0838044285774231, 0.006734137888997793, -0.03293401747941971, 0.12988823652267456, 0.008465180173516273, -0.07662148773670197, 0.037926964461803436, -0.025633949786424637, 0.07431784272193909, -0.07748912274837494, -0.015084905549883842, -0.1608952283859253, 0.014400903135538101, 0.08064879477024078, 0.008849040605127811, 0.026451732963323593, 0.08115451782941818, -0.015048290602862835, -0.02536308392882347, 0.061864495277404785, -0.0015066573396325111, -0.043967101722955704, -0.06720209866762161, -0.021099146455526352, -0.05482684448361397, 0.05399886146187782, -0.01990736648440361, 0.12647351622581482, -0.05303160846233368, 0.05949195474386215, 0.009640628471970558, -0.06032348424196243, -0.03246400132775307, 0.08745749294757843, -0.03303194046020508, -0.052640151232481, -0.0018790127942338586, 0.09599332511425018, 0.04205969348549843, -0.0824812799692154, -0.11302657425403595, -0.030185366049408913, 0.07414451241493225, -0.12203903496265411, 0.061599478125572205, 0.05188388749957085, 0.057762667536735535, 0.038240209221839905, 0.019118376076221466, 0.0654279813170433, 0.05752177909016609, -0.032748762518167496, -0.015310878865420818, 0.008810619823634624, -0.007863753475248814, -0.01441992912441492, 0.09103693813085556, 0.024372534826397896, -4.9996341289215707e-8, -0.036160558462142944, -0.06426390260457993, -0.05158860981464386, 0.0490538626909256, -0.0459984689950943, 0.0021314288023859262, -0.0035061968956142664, -0.04060740768909454, 0.05306427925825119, -0.04071923345327377, 0.011362405493855476, -0.0166824609041214, -0.054177068173885345, -0.0681261271238327, 0.017668480053544044, 0.0320042259991169, 0.012006356380879879, -0.05992715433239937, -0.021717388182878494, -0.07672786712646484, 0.06758518517017365, 0.04622435197234154, -0.012164205312728882, 0.00005411315942183137, -0.03430899977684021, -0.04951629042625427, 0.030515393242239952, 0.11031848192214966, -0.017439143732190132, -0.13486416637897491, 0.00532524986192584, -0.008555659092962742, 0.054416999220848083, -0.010547129437327385, -0.009698820300400257, 0.08010230213403702, 0.0329173281788826, -0.02801559679210186, 0.018631774932146072, 0.09185351431369781, 0.08533962815999985, -0.0072417957708239555, -0.022507861256599426, -0.026282286271452904, 0.028577564284205437, 0.0325041189789772, -0.06169654428958893, -0.035666584968566895, -0.01809649169445038, 0.02779989503324032, 0.009289824403822422, 0.027157701551914215, -0.013719978742301464, 0.07621444016695023, 0.011757934466004372, -0.00635566608980298, 0.020315250381827354, -0.05561213567852974, 0.013626870699226856, 0.032980140298604965, 0.08305853605270386, 0.04707003012299538, -0.00319858780130744, 0.0021453893277794123 ]
0.161694
if very long). - \*\*No block streaming:\*\* `blockStreamingDefault: "off"` (only final reply). \*\*Channel note:\*\* For non-Telegram channels, block streaming is \*\*off unless\*\* `\*.blockStreaming` is explicitly set to `true`. Telegram can stream drafts (`channels.telegram.streamMode`) without block replies. Config location reminder: the `blockStreaming\*` defaults live under `agents.defaults`, not the root config. ## Telegram draft streaming (token-ish) Telegram is the only channel with draft streaming: - Uses Bot API `sendMessageDraft` in \*\*private chats with topics\*\*. - `channels.telegram.streamMode: "partial" | "block" | "off"`. - `partial`: draft updates with the latest stream text. - `block`: draft updates in chunked blocks (same chunker rules). - `off`: no draft streaming. - Draft chunk config (only for `streamMode: "block"`): `channels.telegram.draftChunk` (defaults: `minChars: 200`, `maxChars: 800`). - Draft streaming is separate from block streaming; block replies are off by default and only enabled by `\*.blockStreaming: true` on non-Telegram channels. - Final reply is still a normal message. - `/reasoning stream` writes reasoning into the draft bubble (Telegram only). When draft streaming is active, OpenClaw disables block streaming for that reply to avoid double-streaming. ``` Telegram (private + topics) └─ sendMessageDraft (draft bubble) ├─ streamMode=partial → update latest text └─ streamMode=block → chunker updates draft └─ final reply → normal message ``` Legend: - `sendMessageDraft`: Telegram draft bubble (not a real message). - `final reply`: normal Telegram message send.
https://github.com/openclaw/openclaw/blob/main//docs/concepts/streaming.md
main
opebclaw
[ -0.03481818735599518, -0.03542788699269295, 0.038437288254499435, 0.008699986152350903, 0.04561394453048706, -0.06631990522146225, -0.053236231207847595, -0.030522305518388748, 0.04053094610571861, 0.06413672864437103, -0.044790107756853104, -0.0008420361555181444, -0.02698509208858013, 0.01985628716647625, 0.05573326349258423, -0.014507674612104893, 0.05571099743247032, -0.13553336262702942, -0.02895282581448555, -0.02745073474943638, 0.011783179827034473, 0.027571575716137886, 0.01502138376235962, 0.06497897952795029, 0.06959691643714905, -0.004452499095350504, -0.04509164020419121, 0.03045724332332611, 0.02402239665389061, -0.009767883457243443, 0.012856987304985523, 0.012331326492130756, -0.06054576486349106, -0.026520363986492157, -0.022556735202670097, 0.04307044297456741, 0.043049316853284836, 0.029957043007016182, 0.04660459980368614, 0.014829805120825768, 0.014889496378600597, -0.05395432934165001, -0.11287719011306763, 0.0018006351310759783, -0.004831548314541578, 0.027917830273509026, -0.01863066665828228, 0.008637379854917526, -0.08549799770116806, 0.04803416505455971, -0.055495284497737885, -0.008801707066595554, -0.005182137247174978, 0.1228983998298645, 0.023156702518463135, 0.037760037928819656, -0.029385985806584358, 0.09019268304109573, 0.08118732273578644, -0.014121850952506065, -0.05771459639072418, -0.044082656502723694, -0.038721948862075806, -0.06955163180828094, -0.06991443783044815, -0.013655911199748516, -0.04119409620761871, 0.10512512922286987, 0.027829868718981743, -0.020850319415330887, 0.006640368606895208, 0.016718396916985512, -0.03435015678405762, 0.018503226339817047, 0.023007668554782867, -0.05482036992907524, 0.0896477922797203, 0.06298600882291794, -0.09875263273715973, -0.08194749802350998, -0.0320710726082325, -0.032910555601119995, 0.014500084333121777, -0.04286511614918709, -0.051753148436546326, 0.013570144772529602, 0.06166769936680794, -0.0013312584487721324, 0.024398939684033394, 0.0703677088022232, -0.0028700425755232573, 0.01804375648498535, 0.045512665063142776, 0.04158129543066025, 0.04104917123913765, -0.001309984945692122, -0.02572842501103878, 0.024592718109488487, -0.026689894497394562, 0.018553655594587326, 0.07522553950548172, -0.022755956277251244, 0.016147997230291367, -0.006297993939369917, 0.0430019311606884, -0.08172958344221115, 0.017884712666273117, 0.0497034527361393, 0.033850982785224915, -0.013779638335108757, -0.030461439862847328, 0.017604107037186623, 0.06629671156406403, -0.004295899998396635, 0.0378602109849453, 0.03942392021417618, 0.03597649186849594, 0.04668059200048447, 0.031009718775749207, 0.0748969092965126, 0.09114044159650803, -0.11119203269481659, -0.015608691610395908, 0.018731532618403435, 0.007098010741174221, 0.04536661133170128, 0.11205758899450302, 6.350883736805882e-33, 0.052069779485464096, -0.034287117421627045, -0.12401626259088516, 0.07989798486232758, -0.020080596208572388, 0.035506125539541245, 0.002567170187830925, -0.01960739865899086, -0.0051706875674426556, -0.07285747677087784, -0.04722069576382637, -0.05296437814831734, -0.013344665057957172, 0.11194636672735214, -0.04476706683635712, -0.0809260681271553, 0.008845420554280281, -0.016374267637729645, -0.00965619646012783, 0.057627368718385696, 0.005771272350102663, -0.008397195488214493, -0.045665644109249115, -0.01763237826526165, -0.02601448819041252, 0.04234396666288376, 0.015600215643644333, -0.11668591946363449, -0.045285165309906006, 0.018452923744916916, -0.05128905922174454, -0.007293205242604017, 0.047737397253513336, 0.021009603515267372, 0.0702415406703949, -0.00677126320078969, -0.09550434350967407, -0.019435899332165718, -0.057705577462911606, -0.037091437727212906, -0.03126935660839081, 0.012068402022123337, -0.07840906828641891, -0.06525595486164093, -0.003772178664803505, -0.06232582777738571, -0.03602498769760132, -0.045815762132406235, -0.024289319291710854, -0.04467148333787918, 0.09235500544309616, 0.06375297158956528, -0.011768951080739498, -0.02011529728770256, 0.057972390204668045, -0.0478033684194088, -0.03320438414812088, -0.059409793466329575, 0.029190856963396072, 0.015217003412544727, 0.008254365995526314, 0.000831513840239495, -0.0006314213969744742, -0.00729480292648077, 0.015513656660914421, 0.0629829466342926, -0.05401115119457245, 0.04795891046524048, 0.040650323033332825, -0.057170938700437546, -0.09075427800416946, 0.019509129226207733, -0.013339092954993248, 0.1054995134472847, -0.0859861895442009, -0.043174244463443756, -0.009561591781675816, -0.006436351221054792, 0.010204474441707134, 0.014322382397949696, -0.007678990252315998, 0.012422943487763405, 0.01647474616765976, -0.06275095790624619, 0.03949015215039253, -0.0010910143610090017, 0.030055589973926544, -0.07348985224962234, -0.007660604547709227, 0.024723242968320847, -0.10058798640966415, 0.04045988246798515, 0.009507479146122932, -0.017197301611304283, -0.005463661625981331, -6.085246992775e-33, 0.005401215516030788, 0.013443134725093842, -0.07712600380182266, -0.004996953997761011, -0.04935608431696892, -0.015861552208662033, 0.047394488006830215, 0.09089098125696182, 0.029592502862215042, -0.04901280254125595, -0.05167502909898758, -0.05780781805515289, -0.07919272780418396, 0.026035603135824203, -0.01784271001815796, -0.07004740089178085, -0.01989273726940155, -0.09339054673910141, -0.020000863820314407, -0.00798429548740387, -0.08898845314979553, -0.1233961284160614, -0.05082832649350166, 0.10237053036689758, 0.016254814341664314, -0.005368906073272228, -0.03200259432196617, 0.06255067884922028, 0.07337481528520584, -0.10746055096387863, 0.08761178702116013, -0.00764900166541338, -0.028335684910416603, -0.06517284363508224, 0.054768141359090805, 0.0008279255125671625, 0.029661139473319054, 0.12771545350551605, -0.031175928190350533, -0.00011428439756855369, 0.12717466056346893, 0.02320305071771145, -0.029649144038558006, 0.03387262672185898, -0.018296072259545326, 0.052252091467380524, -0.03466447815299034, 0.005162899848073721, -0.15305395424365997, 0.034329190850257874, 0.09936293214559555, -0.042392563074827194, 0.04069365933537483, 0.024222807958722115, 0.004872069228440523, -0.07266528904438019, 0.042944151908159256, 0.032869305461645126, 0.018341416493058205, -0.04753158986568451, 0.037750501185655594, -0.08255819231271744, 0.036669183522462845, -0.05085994303226471, 0.10509595274925232, 0.003009719541296363, 0.05405319482088089, 0.07712595909833908, -0.00043430188088677824, 0.029782501980662346, 0.07966887205839157, -0.09334439039230347, 0.007223975379019976, -0.028109444305300713, 0.12177344411611557, 0.02645007334649563, -0.05080876126885414, -0.03207021206617355, -0.01709575764834881, 0.033416520804166794, -0.10445080697536469, 0.06881348788738251, -0.05614883825182915, 0.05199436470866203, 0.02207288332283497, 0.02994748018682003, 0.048141662031412125, 0.05258422717452049, -0.038477905094623566, -0.04496968910098076, 0.05732947587966919, -0.04319889098405838, -0.01597064547240734, 0.057929445058107376, 0.056025393307209015, -4.7489514543030964e-8, -0.023915495723485947, -0.06940913200378418, -0.06688792258501053, 0.012690593488514423, -0.020607633516192436, 0.06230881065130234, 0.05582762509584427, -0.06828299909830093, 0.09081950783729553, -0.013624764047563076, -0.012752761133015156, -0.007332959212362766, -0.030338333919644356, -0.08367473632097244, -0.02552642486989498, -0.0034009343944489956, -0.06168317422270775, -0.010278748348355293, 0.0033386978320777416, -0.05094320327043533, 0.053416986018419266, -0.026849187910556793, -0.09780383855104446, 0.040189117193222046, 0.01707133837044239, -0.04079613462090492, 0.07634347677230835, 0.042720112949609756, -0.030778411775827408, -0.04184172675013542, -0.017752638086676598, -0.006497136317193508, 0.06830254197120667, -0.07685128599405289, -0.014609433710575104, 0.09859941899776459, -0.021644489839673042, 0.00045549904461950064, 0.031111055985093117, 0.0816778615117073, 0.05296788737177849, -0.04787947237491608, 0.03759114071726799, -0.05060726776719093, -0.028173508122563362, -0.04108331352472305, -0.02800675667822361, -0.02224760130047798, -0.012354467064142227, 0.00492084352299571, -0.0032620567362755537, 0.019001314416527748, 0.08641137927770615, 0.026250792667269707, 0.04356072470545769, 0.03246421366930008, 0.04793602600693703, -0.07643613964319229, 0.037025678902864456, -0.04266702011227608, 0.07881927490234375, 0.025417279452085495, -0.040293969213962555, 0.027455143630504608 ]
0.065136
# Model providers This page covers \*\*LLM/model providers\*\* (not chat channels like WhatsApp/Telegram). For model selection rules, see [/concepts/models](/concepts/models). ## Quick rules - Model refs use `provider/model` (example: `opencode/claude-opus-4-5`). - If you set `agents.defaults.models`, it becomes the allowlist. - CLI helpers: `openclaw onboard`, `openclaw models list`, `openclaw models set `. ## Built-in providers (pi-ai catalog) OpenClaw ships with the pi‑ai catalog. These providers require \*\*no\*\* `models.providers` config; just set auth + pick a model. ### OpenAI - Provider: `openai` - Auth: `OPENAI\_API\_KEY` - Example model: `openai/gpt-5.2` - CLI: `openclaw onboard --auth-choice openai-api-key` ```json5 { agents: { defaults: { model: { primary: "openai/gpt-5.2" } } }, } ``` ### Anthropic - Provider: `anthropic` - Auth: `ANTHROPIC\_API\_KEY` or `claude setup-token` - Example model: `anthropic/claude-opus-4-5` - CLI: `openclaw onboard --auth-choice token` (paste setup-token) or `openclaw models auth paste-token --provider anthropic` ```json5 { agents: { defaults: { model: { primary: "anthropic/claude-opus-4-5" } } }, } ``` ### OpenAI Code (Codex) - Provider: `openai-codex` - Auth: OAuth (ChatGPT) - Example model: `openai-codex/gpt-5.2` - CLI: `openclaw onboard --auth-choice openai-codex` or `openclaw models auth login --provider openai-codex` ```json5 { agents: { defaults: { model: { primary: "openai-codex/gpt-5.2" } } }, } ``` ### OpenCode Zen - Provider: `opencode` - Auth: `OPENCODE\_API\_KEY` (or `OPENCODE\_ZEN\_API\_KEY`) - Example model: `opencode/claude-opus-4-5` - CLI: `openclaw onboard --auth-choice opencode-zen` ```json5 { agents: { defaults: { model: { primary: "opencode/claude-opus-4-5" } } }, } ``` ### Google Gemini (API key) - Provider: `google` - Auth: `GEMINI\_API\_KEY` - Example model: `google/gemini-3-pro-preview` - CLI: `openclaw onboard --auth-choice gemini-api-key` ### Google Vertex, Antigravity, and Gemini CLI - Providers: `google-vertex`, `google-antigravity`, `google-gemini-cli` - Auth: Vertex uses gcloud ADC; Antigravity/Gemini CLI use their respective auth flows - Antigravity OAuth is shipped as a bundled plugin (`google-antigravity-auth`, disabled by default). - Enable: `openclaw plugins enable google-antigravity-auth` - Login: `openclaw models auth login --provider google-antigravity --set-default` - Gemini CLI OAuth is shipped as a bundled plugin (`google-gemini-cli-auth`, disabled by default). - Enable: `openclaw plugins enable google-gemini-cli-auth` - Login: `openclaw models auth login --provider google-gemini-cli --set-default` - Note: you do \*\*not\*\* paste a client id or secret into `openclaw.json`. The CLI login flow stores tokens in auth profiles on the gateway host. ### Z.AI (GLM) - Provider: `zai` - Auth: `ZAI\_API\_KEY` - Example model: `zai/glm-4.7` - CLI: `openclaw onboard --auth-choice zai-api-key` - Aliases: `z.ai/\*` and `z-ai/\*` normalize to `zai/\*` ### Vercel AI Gateway - Provider: `vercel-ai-gateway` - Auth: `AI\_GATEWAY\_API\_KEY` - Example model: `vercel-ai-gateway/anthropic/claude-opus-4.5` - CLI: `openclaw onboard --auth-choice ai-gateway-api-key` ### Other built-in providers - OpenRouter: `openrouter` (`OPENROUTER\_API\_KEY`) - Example model: `openrouter/anthropic/claude-sonnet-4-5` - xAI: `xai` (`XAI\_API\_KEY`) - Groq: `groq` (`GROQ\_API\_KEY`) - Cerebras: `cerebras` (`CEREBRAS\_API\_KEY`) - GLM models on Cerebras use ids `zai-glm-4.7` and `zai-glm-4.6`. - OpenAI-compatible base URL: `https://api.cerebras.ai/v1`. - Mistral: `mistral` (`MISTRAL\_API\_KEY`) - GitHub Copilot: `github-copilot` (`COPILOT\_GITHUB\_TOKEN` / `GH\_TOKEN` / `GITHUB\_TOKEN`) ## Providers via `models.providers` (custom/base URL) Use `models.providers` (or `models.json`) to add \*\*custom\*\* providers or OpenAI/Anthropic‑compatible proxies. ### Moonshot AI (Kimi) Moonshot uses OpenAI-compatible endpoints, so configure it as a custom provider: - Provider: `moonshot` - Auth: `MOONSHOT\_API\_KEY` - Example model: `moonshot/kimi-k2.5` Kimi K2 model IDs: {/\_ moonshot-kimi-k2-model-refs:start \_/ && null} - `moonshot/kimi-k2.5` - `moonshot/kimi-k2-0905-preview` - `moonshot/kimi-k2-turbo-preview` - `moonshot/kimi-k2-thinking` - `moonshot/kimi-k2-thinking-turbo` {/\_ moonshot-kimi-k2-model-refs:end \_/ && null} ```json5 { agents: { defaults: { model: { primary: "moonshot/kimi-k2.5" } }, }, models: { mode: "merge", providers: { moonshot: { baseUrl: "https://api.moonshot.ai/v1", apiKey: "${MOONSHOT\_API\_KEY}", api: "openai-completions", models: [{ id: "kimi-k2.5", name: "Kimi K2.5" }], }, }, }, } ``` ### Kimi Coding Kimi Coding uses Moonshot AI's Anthropic-compatible endpoint: - Provider: `kimi-coding` - Auth: `KIMI\_API\_KEY` - Example model: `kimi-coding/k2p5` ```json5 { env: { KIMI\_API\_KEY: "sk-..." }, agents: { defaults: { model: { primary: "kimi-coding/k2p5"
https://github.com/openclaw/openclaw/blob/main//docs/concepts/model-providers.md
main
opebclaw
[ -0.04515964165329933, -0.05439077317714691, -0.04426433518528938, 0.018379230052232742, 0.040881309658288956, -0.02943587861955166, -0.02425069361925125, -0.012908130884170532, 0.0213195588439703, 0.025205401703715324, 0.034456975758075714, -0.06818094104528427, -0.005670203361660242, 0.07182642072439194, 0.13657940924167633, 0.08852905035018921, 0.08027568459510803, -0.10586176067590714, -0.02525361254811287, 0.011180800385773182, 0.0715644508600235, 0.032477930188179016, 0.01244560070335865, -0.016625860705971718, -0.0775090679526329, -0.08004014939069748, -0.023217899724841118, 0.018138540908694267, 0.0018058910500258207, -0.015645809471607208, 0.03151588514447212, 0.026244860142469406, 0.043621063232421875, 0.036919962614774704, 0.03814776986837387, 0.025472285225987434, 0.011935340240597725, -0.04206541180610657, -0.020227298140525818, 0.02741885744035244, 0.052780862897634506, -0.002254115417599678, -0.09642712026834488, -0.04821014031767845, 0.04546962305903435, -0.05855001136660576, -0.028939049690961838, -0.04437318816781044, 0.0008670830866321921, -0.014338187873363495, -0.10003092885017395, -0.04062539339065552, 0.010845810174942017, -0.002613730961456895, 0.023167649284005165, 0.033066634088754654, -0.09790126234292984, 0.011605062521994114, 0.04014241695404053, -0.0711836889386177, 0.038651056587696075, -0.06489057093858719, -0.046504732221364975, -0.005684715695679188, -0.12088605016469955, 0.041226793080568314, -0.0960615947842598, -0.026587873697280884, -0.04272620379924774, -0.06738870590925217, 0.035382311791181564, 0.005459844600409269, -0.009865210391581059, -0.06493053585290909, 0.01267675869166851, 0.03263632208108902, 0.054742924869060516, 0.05482536554336548, -0.02349386364221573, -0.10009001195430756, -0.0767044723033905, -0.04931307211518288, -0.02586647868156433, 0.029980968683958054, -0.02440888248383999, 0.12478231638669968, 0.04356445372104645, 0.014264235273003578, 0.06365657597780228, 0.02887425571680069, 0.006606371141970158, -0.1041879653930664, -0.0020504891872406006, -0.008590488694608212, 0.026553351432085037, -0.0013307509943842888, -0.0407138466835022, -0.0014591276412829757, -0.0805148184299469, 0.0632735937833786, -0.017616020515561104, -0.04209093004465103, 0.025154463946819305, 0.024983908981084824, -0.055398862808942795, 0.015504692681133747, 0.05276860296726227, 0.055921006947755814, 0.01862439699470997, 0.03213835507631302, 0.00006273906910791993, 0.019322054460644722, 0.09285476058721542, -0.042596470564603806, 0.010757680051028728, 0.09058181941509247, -0.07175078988075256, 0.008468244224786758, 0.07548779994249344, 0.02087913639843464, 0.04381949082016945, -0.03660264238715172, 0.032927513122558594, 0.06925015151500702, 0.024451620876789093, 0.11525370925664902, -0.024147121235728264, 4.1299833215469635e-33, 0.058737821877002716, 0.02372988685965538, -0.046449121087789536, -0.008345331996679306, 0.04789429157972336, 0.04013459384441376, -0.005293233785778284, 0.0070195505395531654, -0.051925528794527054, 0.036213383078575134, -0.06695996969938278, 0.0761539489030838, -0.06621551513671875, 0.0008338852785527706, 0.052079278975725174, 0.018825139850378036, -0.05618726462125778, 0.01650548167526722, 0.10597896575927734, 0.014540151692926884, 0.040378548204898834, -0.018796544522047043, -0.039755284786224365, 0.0019096104661002755, 0.003320979420095682, 0.1227717250585556, -0.013280513696372509, -0.13243016600608826, 0.04086493328213692, 0.04763654246926308, 0.030469734221696854, -0.007106949109584093, 0.031625404953956604, 0.023169560357928276, -0.014221960678696632, 0.0587691105902195, -0.11273016035556793, 0.002912776777520776, -0.05117485299706459, -0.0437784269452095, 0.03215531259775162, -0.014887590892612934, -0.09343185275793076, -0.02259806916117668, -0.03216972202062607, -0.07370931655168533, -0.013736695982515812, 0.0024181916378438473, 0.02981448359787464, 0.022352561354637146, -0.05712811276316643, -0.014403857290744781, -0.03138364478945732, -0.013661142438650131, -0.0029405918903648853, -0.1260158121585846, -0.01714896596968174, -0.00538762379437685, 0.0070677753537893295, -0.025501232594251633, -0.01583969034254551, 0.005592363886535168, 0.009049925953149796, 0.027792539447546005, 0.030301766470074654, 0.041093166917562485, -0.043762531131505966, 0.02209899201989174, 0.03810534626245499, 0.019407732412219048, -0.0496501550078392, 0.03933694213628769, -0.03956371173262596, 0.07147128880023956, -0.10764488577842712, -0.08625704795122147, -0.01857292279601097, -0.013068350963294506, 0.06588499993085861, -0.010436953976750374, -0.03154221177101135, 0.006048813462257385, -0.03545629233121872, 0.08209428936243057, 0.009796458296477795, -0.024228883907198906, 0.0389917753636837, 0.00415478041395545, 0.004745380021631718, 0.061597589403390884, -0.08630228787660599, 0.02424347959458828, -0.021626964211463928, 0.04327884688973427, -0.0454702265560627, -4.602500826508829e-33, 0.01609322987496853, -0.054076187312603, 0.004927119240164757, -0.014453056268393993, 0.007634750101715326, -0.06068507209420204, 0.009808314964175224, 0.01220689807087183, 0.03553158417344093, -0.04148644208908081, 0.029075168073177338, -0.042221445590257645, 0.0878065973520279, -0.02985004149377346, 0.0629415214061737, -0.061853569000959396, -0.08436083048582077, -0.0697694644331932, -0.010986742563545704, 0.025713207200169563, -0.06840618699789047, -0.020842155441641808, -0.029864691197872162, 0.054590314626693726, 0.08488538861274719, 0.03182314336299896, 0.0371493361890316, 0.023624449968338013, 0.0451405830681324, -0.08465934544801712, -0.008765464648604393, 0.018393568694591522, -0.08274978399276733, 0.042407479137182236, -0.02252313122153282, 0.08396638184785843, 0.01645996980369091, 0.14490073919296265, 0.005981887690722942, -0.0006732936017215252, 0.07486631721258163, -0.04806026816368103, -0.11496665328741074, 0.008289105258882046, -0.06705760210752487, 0.040323346853256226, 0.018944164738059044, -0.020771941170096397, -0.08668934553861618, -0.06671661138534546, 0.02231629006564617, -0.045473549515008926, 0.05648588761687279, -0.03997550904750824, -0.055024031549692154, 0.04785677418112755, 0.11394528299570084, -0.051192719489336014, -0.0037754636723548174, -0.05155590549111366, 0.022371916100382805, -0.07411619275808334, 0.02580626867711544, 0.05414101853966713, -0.004407193046063185, -0.0771547481417656, 0.0018448069458827376, 0.08388889580965042, -0.030062848702073097, -0.07825189083814621, -0.07455040514469147, -0.11672057956457138, -0.011586600914597511, 0.008010258898139, 0.02757137082517147, -0.011191336438059807, -0.10313334316015244, -0.037115298211574554, 0.07352153956890106, 0.006012562662363052, -0.07392259687185287, -0.004030722193419933, 0.06271617859601974, 0.023970656096935272, 0.0666518434882164, 0.04632626846432686, 0.07434290647506714, 0.05781658738851547, 0.02556941844522953, 0.08898279070854187, -0.07657188922166824, 0.058751557022333145, 0.027403129264712334, 0.054435163736343384, -0.0695212334394455, -4.8820524511938856e-8, -0.07404402643442154, -0.09340375661849976, -0.008117957040667534, 0.045085784047842026, -0.01802072301506996, -0.03078373521566391, 0.0315004400908947, 0.0006249722791835666, -0.004743542522192001, 0.005937912501394749, 0.015199314802885056, 0.038849662989377975, -0.08075723052024841, -0.001298547605983913, 0.024349462240934372, 0.046663157641887665, -0.031486786901950836, 0.012325745075941086, 0.03238366171717644, -0.04828397557139397, -0.0034445917699486017, -0.04158652201294899, 0.03856900706887245, -0.01789296418428421, -0.01170316245406866, -0.08061665296554565, -0.06346598267555237, 0.031152993440628052, -0.04297083243727684, 0.09557658433914185, 0.0069429948925971985, -0.03330652788281441, 0.05910870060324669, -0.024091994389891624, 0.016060637310147285, 0.029075175523757935, -0.02611945942044258, -0.05362488329410553, -0.0017471765168011189, 0.005628214683383703, 0.05904624983668327, 0.033168207854032516, -0.07362881302833557, -0.08022444695234299, 0.03593328222632408, 0.01583537645637989, 0.0398062989115715, -0.11902479827404022, 0.08744503557682037, 0.04783886671066284, -0.030036993324756622, 0.003790551098063588, 0.04762546345591545, 0.05949772149324417, 0.004226196091622114, 0.05523506924510002, 0.0774167999625206, -0.07847083359956741, 0.02742227353155613, -0.0022596039343625307, -0.012304970994591713, 0.043896351009607315, 0.04679778590798378, 0.011885479092597961 ]
0.121581
api: "openai-completions", models: [{ id: "kimi-k2.5", name: "Kimi K2.5" }], }, }, }, } ``` ### Kimi Coding Kimi Coding uses Moonshot AI's Anthropic-compatible endpoint: - Provider: `kimi-coding` - Auth: `KIMI\_API\_KEY` - Example model: `kimi-coding/k2p5` ```json5 { env: { KIMI\_API\_KEY: "sk-..." }, agents: { defaults: { model: { primary: "kimi-coding/k2p5" } }, }, } ``` ### Qwen OAuth (free tier) Qwen provides OAuth access to Qwen Coder + Vision via a device-code flow. Enable the bundled plugin, then log in: ```bash openclaw plugins enable qwen-portal-auth openclaw models auth login --provider qwen-portal --set-default ``` Model refs: - `qwen-portal/coder-model` - `qwen-portal/vision-model` See [/providers/qwen](/providers/qwen) for setup details and notes. ### Synthetic Synthetic provides Anthropic-compatible models behind the `synthetic` provider: - Provider: `synthetic` - Auth: `SYNTHETIC\_API\_KEY` - Example model: `synthetic/hf:MiniMaxAI/MiniMax-M2.1` - CLI: `openclaw onboard --auth-choice synthetic-api-key` ```json5 { agents: { defaults: { model: { primary: "synthetic/hf:MiniMaxAI/MiniMax-M2.1" } }, }, models: { mode: "merge", providers: { synthetic: { baseUrl: "https://api.synthetic.new/anthropic", apiKey: "${SYNTHETIC\_API\_KEY}", api: "anthropic-messages", models: [{ id: "hf:MiniMaxAI/MiniMax-M2.1", name: "MiniMax M2.1" }], }, }, }, } ``` ### MiniMax MiniMax is configured via `models.providers` because it uses custom endpoints: - MiniMax (Anthropic‑compatible): `--auth-choice minimax-api` - Auth: `MINIMAX\_API\_KEY` See [/providers/minimax](/providers/minimax) for setup details, model options, and config snippets. ### Ollama Ollama is a local LLM runtime that provides an OpenAI-compatible API: - Provider: `ollama` - Auth: None required (local server) - Example model: `ollama/llama3.3` - Installation: https://ollama.ai ```bash # Install Ollama, then pull a model: ollama pull llama3.3 ``` ```json5 { agents: { defaults: { model: { primary: "ollama/llama3.3" } }, }, } ``` Ollama is automatically detected when running locally at `http://127.0.0.1:11434/v1`. See [/providers/ollama](/providers/ollama) for model recommendations and custom configuration. ### Local proxies (LM Studio, vLLM, LiteLLM, etc.) Example (OpenAI‑compatible): ```json5 { agents: { defaults: { model: { primary: "lmstudio/minimax-m2.1-gs32" }, models: { "lmstudio/minimax-m2.1-gs32": { alias: "Minimax" } }, }, }, models: { providers: { lmstudio: { baseUrl: "http://localhost:1234/v1", apiKey: "LMSTUDIO\_KEY", api: "openai-completions", models: [ { id: "minimax-m2.1-gs32", name: "MiniMax M2.1", reasoning: false, input: ["text"], cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, contextWindow: 200000, maxTokens: 8192, }, ], }, }, }, } ``` Notes: - For custom providers, `reasoning`, `input`, `cost`, `contextWindow`, and `maxTokens` are optional. When omitted, OpenClaw defaults to: - `reasoning: false` - `input: ["text"]` - `cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }` - `contextWindow: 200000` - `maxTokens: 8192` - Recommended: set explicit values that match your proxy/model limits. ## CLI examples ```bash openclaw onboard --auth-choice opencode-zen openclaw models set opencode/claude-opus-4-5 openclaw models list ``` See also: [/gateway/configuration](/gateway/configuration) for full configuration examples.
https://github.com/openclaw/openclaw/blob/main//docs/concepts/model-providers.md
main
opebclaw
[ -0.05135742202401161, -0.0011503025889396667, -0.04870936647057533, 0.013950576074421406, 0.04960789531469345, -0.02767864800989628, -0.011919884011149406, -0.03316294774413109, -0.0003860114957205951, -0.0010550820734351873, 0.051846571266651154, -0.08777447789907455, 0.04360524192452431, 0.027111312374472618, 0.15255671739578247, 0.11557304859161377, -0.02475406415760517, 0.006423252169042826, -0.03751228004693985, -0.07788506150245667, 0.041538938879966736, -0.008707715198397636, 0.027558568865060806, -0.0026292442344129086, -0.05643335357308388, -0.044551242142915726, 0.020619137212634087, 0.04280856251716614, -0.0015931514790281653, -0.02215675264596939, 0.04326866567134857, 0.03912845999002457, -0.015613215044140816, 0.014275250025093555, 0.07313789427280426, 0.04587816819548607, -0.026215583086013794, -0.03687325492501259, -0.07217398285865784, -0.07596980780363083, 0.04542803391814232, -0.010486222803592682, -0.12057587504386902, -0.04843002185225487, 0.034234292805194855, -0.07254795730113983, -0.044758621603250504, -0.0653577595949173, -0.004552076570689678, -0.05657878518104553, -0.08050315827131271, -0.060669928789138794, -0.014390521682798862, -0.01592300459742546, -0.03560502082109451, -0.005427264142781496, -0.12459804862737656, -0.011520994827151299, 0.055632881820201874, -0.05449304357171059, 0.05175623670220375, -0.01859525591135025, -0.018310006707906723, 0.007575704250484705, -0.02676762454211712, 0.04122529178857803, -0.09160314500331879, -0.03830920532345772, -0.010379604063928127, -0.07385579496622086, 0.04113924503326416, -0.08617495000362396, -0.02758508361876011, -0.058526478707790375, -0.007449806202203035, -0.012562322430312634, 0.029491402208805084, 0.06752555817365646, -0.03351913020014763, -0.05755600705742836, -0.04065316170454025, -0.035846322774887085, -0.040896929800510406, 0.1027294248342514, -0.008401802740991116, 0.09265559911727905, -0.032600633800029755, 0.02896713651716709, -0.0032305254135280848, 0.02917133830487728, -0.03154986724257469, -0.04532395303249359, -0.008224762976169586, -0.07215744256973267, 0.08212931454181671, -0.033456314355134964, -0.030452046543359756, -0.03376813232898712, -0.05230402946472168, 0.10004796832799911, -0.05400117486715317, -0.004470368381589651, 0.00015113764675334096, -0.00490829860791564, -0.010068939067423344, 0.00011395243200240657, 0.08709801733493805, 0.04187880828976631, 0.02115657925605774, 0.050670649856328964, -0.00631734961643815, -0.003039358416572213, 0.044725872576236725, -0.05735546723008156, 0.03464138135313988, 0.08767088502645493, -0.10414203256368637, 0.0740484669804573, 0.10104918479919434, 0.02842165157198906, 0.11124365031719208, -0.020612606778740883, -0.06604465842247009, 0.0002604220062494278, 0.028811072930693626, 0.016393866389989853, 0.0015304944245144725, 3.151002238823392e-33, 0.10814331471920013, 0.061842843890190125, 0.0781443789601326, -0.0013289196649566293, 0.07482284307479858, -0.031644467264413834, 0.03524863347411156, -0.017054365947842598, -0.0678112804889679, -0.023281430825591087, -0.062385935336351395, 0.07707314938306808, -0.0637684166431427, 0.002342344494536519, 0.00027359439991414547, 0.013862080872058868, -0.08279833942651749, 0.03867819532752037, 0.09273865073919296, 0.09819543361663818, 0.03911297395825386, -0.02895207516849041, -0.03481648862361908, 0.03539477288722992, 0.026922278106212616, 0.10396683216094971, 0.0005167968920432031, -0.05550580844283104, 0.022047623991966248, 0.036718595772981644, 0.048051416873931885, 0.004535010550171137, 0.0012879659188911319, -0.022265974432229996, -0.09492375701665878, -0.0029173502698540688, -0.07999102026224136, 0.011991499923169613, -0.10427972674369812, -0.06403058022260666, 0.04347681254148483, 0.0038067896384745836, -0.08378248661756516, -0.024897361174225807, -0.07782702147960663, -0.04002926126122475, 0.010516506619751453, 0.013589829206466675, 0.08059985190629959, 0.03438307344913483, -0.03885845094919205, -0.04070159047842026, -0.04155786707997322, -0.014193875715136528, 0.021253634244203568, -0.07717893272638321, 0.02283937856554985, -0.01764603517949581, 0.007947530597448349, -0.05124983936548233, -0.019147081300616264, -0.0013017968740314245, 0.007715961895883083, 0.05447588115930557, 0.01694611832499504, 0.020339645445346832, -0.03258759155869484, 0.028371484950184822, 0.024860240519046783, 0.007247477769851685, -0.07821442931890488, 0.07722137868404388, 0.015440315939486027, 0.031990766525268555, -0.06762238591909409, -0.08300062268972397, -0.0002544668677728623, -0.035508107393980026, 0.04567493125796318, 0.05178159475326538, -0.019164469093084335, -0.04968723654747009, -0.05472142994403839, 0.08197075873613358, 0.02903568185865879, 0.008351754397153854, 0.017165951430797577, -0.019430221989750862, -0.02609923668205738, 0.05725801736116409, -0.03331674262881279, -0.05940978601574898, -0.005040875636041164, 0.015622659586369991, -0.08550244569778442, -4.119898682042862e-33, 0.050328027456998825, -0.10178998857736588, 0.027370339259505272, -0.01028409693390131, 0.013943801634013653, -0.04651818796992302, 0.03411926329135895, 0.012998609803617, 0.00649659289047122, 0.02158072032034397, 0.018410906195640564, -0.006235695444047451, 0.06869843602180481, -0.0032354758586734533, 0.05892206355929375, -0.03934101387858391, -0.026523489505052567, -0.0032835600432008505, 0.03474002331495285, 0.05998680740594864, -0.004818640649318695, 0.06334947049617767, -0.004328256007283926, -0.03929297626018524, 0.07597684860229492, 0.07098642736673355, 0.04066457971930504, 0.05041130632162094, 0.002485972596332431, -0.03853750601410866, 0.02758529968559742, 0.029061609879136086, -0.12492195516824722, -0.03757813945412636, 0.011301952414214611, 0.027718540281057358, -0.02144915983080864, 0.11551731824874878, -0.030246734619140625, 0.023221073672175407, 0.04404311254620552, -0.06565188616514206, -0.08636036515235901, 0.06901726871728897, 0.010945155285298824, 0.006870497949421406, 0.013648984022438526, 0.018122060224413872, -0.040033578872680664, -0.08377420902252197, 0.05468796566128731, 0.026888752356171608, -0.05849810317158699, -0.022679511457681656, -0.02296883799135685, 0.047578223049640656, 0.07496906071901321, -0.02920864149928093, 0.007468005642294884, -0.073642797768116, 0.004512579180300236, -0.11630755662918091, 0.0504036545753479, 0.072529636323452, -0.06103942543268204, -0.10164313018321991, 0.04982639476656914, 0.08448028564453125, -0.025488251820206642, -0.0615919828414917, -0.10456743091344833, -0.08278700709342957, 0.0916309580206871, 0.051789481192827225, 0.049285098910331726, 0.01905161328613758, -0.05531628057360649, 0.051094748079776764, 0.1129106730222702, 0.00943018402904272, -0.06426069140434265, -0.009136177599430084, 0.01816389709711075, 0.03633526712656021, 0.06171036139130592, -0.0003935910062864423, 0.02969134785234928, 0.08716750890016556, 0.06216441094875336, 0.05449764430522919, -0.10287259519100189, 0.08980903774499893, 0.003589691361412406, 0.05470283329486847, -0.07971449196338654, -4.918479845628099e-8, -0.02468918263912201, -0.07593569904565811, -0.022695327177643776, 0.03591279685497284, -0.03319744020700455, 0.013372235000133514, -0.00013908495020586997, 0.015058164484798908, 0.016145016998052597, -0.04071764275431633, 0.08976110816001892, 0.05254054814577103, -0.056715596467256546, -0.024641945958137512, -0.02650444395840168, 0.037907470017671585, -0.0006731559988111258, 0.05794018134474754, 0.04378286749124527, -0.038387250155210495, -0.030622895807027817, -0.021650781854987144, 0.021170228719711304, -0.09999717026948929, -0.002282603643834591, -0.008432346396148205, -0.04205021262168884, 0.031285252422094345, -0.05529260262846947, -0.025885993614792824, 0.03440086171030998, -0.00930679403245449, 0.07190974801778793, -0.01889960840344429, -0.021648531779646873, -0.010800773277878761, -0.026524119079113007, -0.030260389670729637, -0.00455194478854537, -0.06751398742198944, 0.011351771652698517, 0.015173223800957203, -0.05881037563085556, -0.06700649857521057, 0.020436417311429977, 0.023744992911815643, 0.058967623859643936, -0.00019225645519327372, 0.054693471640348434, -0.0074796369299292564, -0.09014841914176941, -0.06901796162128448, -0.0059203882701694965, 0.07055435329675674, 0.02107337862253189, 0.03753965348005295, 0.06663071364164352, -0.08868107199668884, 0.050182439386844635, 0.005586886778473854, 0.03815121576189995, -0.0133614931255579, -0.0221187025308609, 0.02129245735704899 ]
0.097434
# Typing indicators Typing indicators are sent to the chat channel while a run is active. Use `agents.defaults.typingMode` to control \*\*when\*\* typing starts and `typingIntervalSeconds` to control \*\*how often\*\* it refreshes. ## Defaults When `agents.defaults.typingMode` is \*\*unset\*\*, OpenClaw keeps the legacy behavior: - \*\*Direct chats\*\*: typing starts immediately once the model loop begins. - \*\*Group chats with a mention\*\*: typing starts immediately. - \*\*Group chats without a mention\*\*: typing starts only when message text begins streaming. - \*\*Heartbeat runs\*\*: typing is disabled. ## Modes Set `agents.defaults.typingMode` to one of: - `never` — no typing indicator, ever. - `instant` — start typing \*\*as soon as the model loop begins\*\*, even if the run later returns only the silent reply token. - `thinking` — start typing on the \*\*first reasoning delta\*\* (requires `reasoningLevel: "stream"` for the run). - `message` — start typing on the \*\*first non-silent text delta\*\* (ignores the `NO\_REPLY` silent token). Order of “how early it fires”: `never` → `message` → `thinking` → `instant` ## Configuration ```json5 { agent: { typingMode: "thinking", typingIntervalSeconds: 6, }, } ``` You can override mode or cadence per session: ```json5 { session: { typingMode: "message", typingIntervalSeconds: 4, }, } ``` ## Notes - `message` mode won’t show typing for silent-only replies (e.g. the `NO\_REPLY` token used to suppress output). - `thinking` only fires if the run streams reasoning (`reasoningLevel: "stream"`). If the model doesn’t emit reasoning deltas, typing won’t start. - Heartbeats never show typing, regardless of mode. - `typingIntervalSeconds` controls the \*\*refresh cadence\*\*, not the start time. The default is 6 seconds.
https://github.com/openclaw/openclaw/blob/main//docs/concepts/typing-indicators.md
main
opebclaw
[ -0.054928891360759735, -0.08551354706287384, 0.0011123532894998789, 0.10623891651630402, -0.009919523261487484, -0.015294687822461128, 0.07840283215045929, -0.01031300239264965, 0.09064920991659164, -0.03293551132082939, 0.005720982328057289, -0.04535577818751335, -0.031074747443199158, 0.016215402632951736, 0.04656188562512398, 0.06507063657045364, 0.0906905010342598, -0.157302588224411, -0.03825758770108223, 0.030403070151805878, 0.053215738385915756, 0.038092322647571564, 0.008679098449647427, 0.004766189958900213, -0.05209066718816757, -0.05892222374677658, -0.04035920649766922, -0.04428994655609131, 0.037358444184064865, 0.006465861573815346, -0.016104400157928467, 0.040217265486717224, 0.06816226989030838, 0.04895610734820366, 0.04617205262184143, 0.07019497454166412, -0.014927365817129612, 0.03548187017440796, -0.0448768176138401, -0.0011938393581658602, -0.017146211117506027, -0.07419690489768982, -0.016737885773181915, -0.05819262936711311, -0.015100841410458088, -0.05756380781531334, -0.05521351099014282, -0.05689767003059387, -0.05182722955942154, 0.042976245284080505, -0.0979081243276596, -0.006470702588558197, 0.05062516778707504, -0.040727805346250534, 0.05559564754366875, 0.04945288598537445, 0.04314212128520012, 0.04011073336005211, 0.036445554345846176, -0.08130279183387756, -0.010067167691886425, -0.03569595515727997, -0.045495543628931046, -0.03704329952597618, -0.05914765223860741, 0.07867097109556198, -0.06645837426185608, -0.02413301169872284, 0.036697641015052795, 0.0583646260201931, 0.02679322101175785, 0.042964205145835876, -0.060972727835178375, -0.0475340411067009, 0.01714026741683483, 0.01832040399312973, 0.005071502178907394, -0.042550552636384964, 0.007531313691288233, -0.06103994697332382, -0.08149460703134537, -0.057871632277965546, -0.025543740019202232, -0.006465594284236431, 0.04427872598171234, 0.09102658927440643, 0.005222476087510586, 0.016990872099995613, 0.026060713455080986, 0.0175379179418087, -0.0010303626768290997, -0.08258344233036041, 0.043615855276584625, 0.0746377632021904, 0.01553328987210989, 0.066351518034935, 0.00014466603170149028, 0.015694232657551765, -0.05544140189886093, 0.0695842057466507, 0.020566584542393684, 0.014581666328012943, 0.021310821175575256, 0.0379178412258625, -0.007811006624251604, -0.012839809991419315, 0.0686032846570015, 0.05291834473609924, -0.027738861739635468, -0.06760967522859573, 0.012094126082956791, -0.041527241468429565, 0.11761850118637085, 0.01672353968024254, -0.02308466099202633, 0.06594585627317429, -0.031439486891031265, 0.013601137325167656, 0.030896523967385292, 0.16024909913539886, 0.14497101306915283, -0.04490303993225098, -0.02306268736720085, -0.04140951484441757, 0.06518660485744476, 0.08926497399806976, 0.011314352974295616, 7.55486472385241e-33, 0.036729879677295685, -0.03272417187690735, -0.05137837678194046, 0.07022356986999512, 0.03879089280962944, -0.0014528752071782947, -0.0381145179271698, 0.018069734796881676, -0.06476130336523056, -0.010334264487028122, 0.017229821532964706, 0.0001583689881954342, -0.05708479881286621, 0.00046075478894636035, 0.004032603930681944, -0.0616111159324646, 0.03969148173928261, 0.03211429342627525, 0.01203463226556778, -0.04171430319547653, 0.07211325317621231, -0.014113505370914936, -0.05964348465204239, 0.019457217305898666, 0.0015256729675456882, 0.11682798713445663, -0.010369041003286839, -0.042188115417957306, 0.020527441054582596, 0.05857643112540245, 0.017630456015467644, 0.014607366174459457, -0.08924920111894608, 0.015205064788460732, -0.04755408316850662, 0.013915777206420898, -0.04532460868358612, -0.004239204339683056, -0.002549900207668543, -0.07666567713022232, -0.045648008584976196, -0.0019700778648257256, -0.0780818909406662, -0.09119854122400284, -0.011108697392046452, -0.14719361066818237, -0.05868850275874138, 0.11520739644765854, -0.03722813352942467, 0.031547773629426956, 0.01862838678061962, 0.04612812027335167, 0.03458273783326149, 0.02403010055422783, -0.04586125537753105, -0.015354803763329983, -0.03303166478872299, 0.006759242154657841, 0.028701234608888626, 0.04789912700653076, -0.01529561448842287, 0.001674625207670033, 0.04868347942829132, 0.0053627449087798595, 0.03230052441358566, 0.00475297961384058, 0.02760683372616768, -0.002505931304767728, -0.04312365874648094, -0.004544069990515709, 0.007306958083063364, 0.034990910440683365, -0.018180862069129944, 0.02747964859008789, -0.0748203918337822, -0.06206759437918663, -0.024862321093678474, -0.026177462190389633, -0.05118454992771149, -0.0177905336022377, 0.05023547634482384, -0.038501299917697906, -0.03157311677932739, -0.006798634305596352, 0.020931724458932877, -0.08466925472021103, -0.03655329346656799, -0.05380928888916969, -0.06235019490122795, 0.07815611362457275, 0.0006595897139050066, -0.001993447309359908, -0.021284716203808784, 0.002742721000686288, -0.07262715697288513, -7.889646249650566e-33, 0.03790710121393204, 0.03455687314271927, -0.07160480320453644, -0.020198898389935493, -0.016309376806020737, -0.015841450542211533, 0.003114200197160244, 0.010851024650037289, -0.01810554787516594, -0.07496129721403122, 0.03897412493824959, 0.028961485251784325, -0.0008992991643026471, -0.011096624657511711, 0.01764475181698799, 0.03278297930955887, -0.015951797366142273, -0.04403988644480705, -0.0003936337016057223, 0.027999918907880783, -0.013934770599007607, -0.09355510026216507, -0.1097470372915268, 0.07043816894292831, 0.0052011809311807156, 0.013257749378681183, -0.02141743339598179, 0.1067810207605362, 0.004068013746291399, -0.03205590695142746, 0.01792510412633419, 0.1103881299495697, -0.07055763155221939, 0.028778262436389923, -0.03435220569372177, 0.01150667853653431, 0.008866929449141026, 0.00944849755614996, 0.005809324327856302, 0.050083715468645096, 0.1674206554889679, -0.006016687024384737, -0.019977737218141556, -0.0023678012657910585, -0.001498198020271957, 0.044148772954940796, -0.04611603170633316, -0.06480446457862854, -0.08369220048189163, -0.01950809359550476, 0.04894454777240753, -0.06489046663045883, 0.08098646253347397, -0.03706252574920654, -0.0858556479215622, 0.027112765237689018, 0.05400339514017105, -0.04676935821771622, -0.07516752928495407, -0.029616598039865494, 0.023031119257211685, -0.049402590841054916, -0.026121407747268677, 0.01855998858809471, 0.015975067391991615, -0.08424645662307739, -0.0005389264551922679, 0.03670947253704071, 0.02810174785554409, -0.08738008886575699, 0.09495551139116287, -0.011452657170593739, -0.07244188338518143, -0.04243214428424835, -0.014051255770027637, 0.012294163927435875, -0.03648417815566063, -0.11040100455284119, 0.00085729657439515, -0.02319951355457306, -0.0605805478990078, 0.026799259707331657, 0.07160837948322296, -0.025595778599381447, -0.058675527572631836, 0.0717870444059372, -0.04955397918820381, 0.15991108119487762, -0.024625830352306366, 0.07236919552087784, -0.08634121716022491, 0.0019358157878741622, 0.0007420889451168478, 0.026329955086112022, -0.06471944600343704, -5.981584649816796e-8, -0.0913727805018425, -0.07122468948364258, -0.0010727487970143557, 0.02174454741179943, -0.008923301473259926, -0.04137517884373665, 0.02284690923988819, -0.02014215663075447, -0.016415506601333618, -0.005852395202964544, 0.0378190279006958, -0.009710585698485374, -0.020523305982351303, -0.05826408043503761, 0.0453437902033329, 0.01122442539781332, -0.02709527313709259, -0.04034050926566124, -0.04092160984873772, -0.11231262236833572, 0.0823383629322052, -0.021360870450735092, 0.00442799087613821, 0.04886329919099808, -0.04634372144937515, -0.06008239462971687, -0.004119022283703089, 0.054411135613918304, -0.037072885781526566, 0.025779929012060165, -0.03728552162647247, 0.01682968996465206, 0.028650835156440735, -0.008743577636778355, -0.03926847130060196, 0.06553933769464493, 0.03068540245294571, -0.03555789217352867, 0.013409892097115517, 0.012623167596757412, 0.11345084756612778, 0.02302289381623268, -0.12217925488948822, -0.0851101353764534, 0.003208512207493186, 0.008020916022360325, 0.0007901162025518715, -0.02066883072257042, 0.0720270648598671, -0.005076151341199875, -0.042042769491672516, 0.07488669455051422, -0.014216268435120583, 0.10139472782611847, -0.005258259363472462, 0.09720519930124283, 0.09394694864749908, 0.03202425688505173, 0.037979427725076675, 0.03155616298317909, 0.06198599934577942, 0.012295159511268139, -0.013954607769846916, -0.03481161966919899 ]
0.187907
# Model failover OpenClaw handles failures in two stages: 1. \*\*Auth profile rotation\*\* within the current provider. 2. \*\*Model fallback\*\* to the next model in `agents.defaults.model.fallbacks`. This doc explains the runtime rules and the data that backs them. ## Auth storage (keys + OAuth) OpenClaw uses \*\*auth profiles\*\* for both API keys and OAuth tokens. - Secrets live in `~/.openclaw/agents//agent/auth-profiles.json` (legacy: `~/.openclaw/agent/auth-profiles.json`). - Config `auth.profiles` / `auth.order` are \*\*metadata + routing only\*\* (no secrets). - Legacy import-only OAuth file: `~/.openclaw/credentials/oauth.json` (imported into `auth-profiles.json` on first use). More detail: [/concepts/oauth](/concepts/oauth) Credential types: - `type: "api\_key"` → `{ provider, key }` - `type: "oauth"` → `{ provider, access, refresh, expires, email? }` (+ `projectId`/`enterpriseUrl` for some providers) ## Profile IDs OAuth logins create distinct profiles so multiple accounts can coexist. - Default: `provider:default` when no email is available. - OAuth with email: `provider:` (for example `google-antigravity:user@gmail.com`). Profiles live in `~/.openclaw/agents//agent/auth-profiles.json` under `profiles`. ## Rotation order When a provider has multiple profiles, OpenClaw chooses an order like this: 1. \*\*Explicit config\*\*: `auth.order[provider]` (if set). 2. \*\*Configured profiles\*\*: `auth.profiles` filtered by provider. 3. \*\*Stored profiles\*\*: entries in `auth-profiles.json` for the provider. If no explicit order is configured, OpenClaw uses a round‑robin order: - \*\*Primary key:\*\* profile type (\*\*OAuth before API keys\*\*). - \*\*Secondary key:\*\* `usageStats.lastUsed` (oldest first, within each type). - \*\*Cooldown/disabled profiles\*\* are moved to the end, ordered by soonest expiry. ### Session stickiness (cache-friendly) OpenClaw \*\*pins the chosen auth profile per session\*\* to keep provider caches warm. It does \*\*not\*\* rotate on every request. The pinned profile is reused until: - the session is reset (`/new` / `/reset`) - a compaction completes (compaction count increments) - the profile is in cooldown/disabled Manual selection via `/model …@` sets a \*\*user override\*\* for that session and is not auto‑rotated until a new session starts. Auto‑pinned profiles (selected by the session router) are treated as a \*\*preference\*\*: they are tried first, but OpenClaw may rotate to another profile on rate limits/timeouts. User‑pinned profiles stay locked to that profile; if it fails and model fallbacks are configured, OpenClaw moves to the next model instead of switching profiles. ### Why OAuth can “look lost” If you have both an OAuth profile and an API key profile for the same provider, round‑robin can switch between them across messages unless pinned. To force a single profile: - Pin with `auth.order[provider] = ["provider:profileId"]`, or - Use a per-session override via `/model …` with a profile override (when supported by your UI/chat surface). ## Cooldowns When a profile fails due to auth/rate‑limit errors (or a timeout that looks like rate limiting), OpenClaw marks it in cooldown and moves to the next profile. Format/invalid‑request errors (for example Cloud Code Assist tool call ID validation failures) are treated as failover‑worthy and use the same cooldowns. Cooldowns use exponential backoff: - 1 minute - 5 minutes - 25 minutes - 1 hour (cap) State is stored in `auth-profiles.json` under `usageStats`: ```json { "usageStats": { "provider:profile": { "lastUsed": 1736160000000, "cooldownUntil": 1736160600000, "errorCount": 2 } } } ``` ## Billing disables Billing/credit failures (for example “insufficient credits” / “credit balance too low”) are treated as failover‑worthy, but they’re usually not transient. Instead of a short cooldown, OpenClaw marks the profile as \*\*disabled\*\* (with a longer backoff) and rotates to the next profile/provider. State is stored in `auth-profiles.json`: ```json { "usageStats": { "provider:profile": { "disabledUntil": 1736178000000, "disabledReason": "billing" } } } ``` Defaults: - Billing backoff starts at \*\*5 hours\*\*, doubles per billing failure, and caps at \*\*24 hours\*\*. - Backoff counters reset if the profile hasn’t failed for \*\*24 hours\*\* (configurable). ## Model fallback If all
https://github.com/openclaw/openclaw/blob/main//docs/concepts/model-failover.md
main
opebclaw
[ -0.035460859537124634, -0.01048616785556078, -0.05835700035095215, 0.0814080610871315, 0.0547347217798233, -0.10420487821102142, -0.06828140467405319, 0.0062948050908744335, -0.021641533821821213, -0.08013992011547089, 0.05402529612183571, -0.0048457360826432705, 0.08655320852994919, -0.020695488899946213, 0.0916314348578453, 0.14133961498737335, 0.024996332824230194, 0.01555220503360033, -0.04375104233622551, 0.010672281496226788, -0.005269608460366726, 0.04325578734278679, -0.023645061999559402, -0.03316234052181244, -0.10264474153518677, -0.09275548160076141, -0.05824912711977959, -0.02275249920785427, -0.03585011884570122, -0.012843308039009571, 0.060393691062927246, -0.021254992112517357, -0.08642955869436264, 0.026221079751849174, 0.044354990124702454, 0.009855695068836212, 0.06814020127058029, -0.055065374821424484, -0.029716765508055687, 0.022275080904364586, 0.0510069839656353, 0.07171068340539932, -0.028555791825056076, -0.048781123012304306, -0.0932006984949112, -0.09383445978164673, -0.00400917511433363, -0.05927696079015732, -0.03446917235851288, 0.030892284587025642, -0.06868305057287216, -0.03928474336862564, -0.004711117595434189, 0.0041176932863891125, -0.003625899087637663, 0.013371612876653671, -0.013797699473798275, -0.021945014595985413, 0.005026546306908131, -0.019553672522306442, 0.12172190099954605, -0.022298507392406464, -0.05718458443880081, 0.015148872509598732, -0.07186462730169296, -0.016688892617821693, -0.04146412014961243, -0.11242810636758804, -0.03428955376148224, -0.004064986016601324, -0.03401761129498482, -0.00753446901217103, -0.05530676245689392, -0.06021364405751228, 0.038709212094545364, 0.01488467212766409, 0.013607270084321499, 0.00470290333032608, -0.008888361044228077, -0.09675735980272293, -0.06800200045108795, -0.06869152188301086, -0.07306282222270966, 0.061700694262981415, 0.01451261155307293, 0.11020267754793167, 0.0010237388778477907, 0.006363579537719488, -0.0015709934523329139, 0.014163344167172909, 0.0385468453168869, -0.0708681121468544, 0.01916906237602234, -0.019931895658373833, 0.0973082110285759, 0.026273177936673164, 0.019089501351118088, 0.029339628294110298, -0.05966217443346977, 0.0843721404671669, -0.07856174558401108, -0.026965895667672157, 0.06615673750638962, 0.05682186409831047, 0.02224150113761425, 0.0310236606746912, 0.030468089506030083, 0.02140769176185131, -0.020446082577109337, 0.03712557256221771, 0.07095810025930405, -0.009098098613321781, 0.07839491963386536, -0.009445998817682266, 0.011099041439592838, 0.062252480536699295, -0.08017873764038086, -0.00787370465695858, 0.033911868929862976, 0.07426135987043381, 0.07118473201990128, 0.03109760396182537, 0.10788784176111221, -0.004709049127995968, 0.06208157539367676, 0.046781476587057114, 0.058523278683423996, 4.899396904063953e-33, 0.04311468452215195, 0.01387262623757124, -0.02100851945579052, -0.0005499519174918532, 0.11520847678184509, -0.013900152407586575, 0.04774576053023338, -0.020985661074519157, -0.02091856673359871, 0.0069906325079500675, -0.0151792261749506, 0.07220841944217682, -0.04661460965871811, -0.054348789155483246, 0.016012627631425858, 0.0193012785166502, -0.020347444340586662, 0.03002997674047947, 0.09203049540519714, 0.03785857558250427, 0.0817224383354187, -0.03338528797030449, -0.005903927609324455, 0.04559178277850151, -0.00936916097998619, 0.05697304382920265, -0.008583886548876762, -0.038232505321502686, -0.058805398643016815, 0.04587341845035553, 0.09354203194379807, 0.04934350773692131, -0.004478623624891043, 0.020128682255744934, -0.059295617043972015, 0.016266435384750366, -0.015184617601335049, -0.03622528910636902, -0.04564586654305458, -0.12142696231603622, -0.04489867016673088, 0.035390403121709824, -0.013556169345974922, -0.023727890104055405, -0.048210643231868744, -0.14750544726848602, 0.030063075944781303, 0.08981587737798691, 0.10525716096162796, 0.045705150812864304, -0.022972675040364265, -0.05189856141805649, 0.019818847998976707, -0.002327617025002837, -0.02741575986146927, -0.06069733202457428, -0.03234776481986046, -0.039631765335798264, -0.00044399010948836803, -0.00869167223572731, 0.0021723872050642967, -0.039582110941410065, -0.006895516533404589, 0.005931143648922443, -0.026255659759044647, -0.012891361489892006, 0.025396395474672318, 0.004043886438012123, -0.03603849187493324, -0.017147600650787354, -0.01314723864197731, -0.009327811188995838, -0.05814680457115173, 0.016173819079995155, -0.05944232642650604, -0.076339952647686, 0.07629097998142242, -0.012127796187996864, 0.0961611419916153, -0.02756095677614212, 0.033473607152700424, 0.025426147505640984, -0.06731415539979935, 0.06266636401414871, -0.08167655020952225, 0.06295236945152283, 0.026685940101742744, -0.01777033880352974, -0.01742042414844036, 0.08215203881263733, 0.018794668838381767, -0.03984984755516052, -0.01935439184308052, 0.009060597978532314, -0.014372117817401886, -5.9795072351567045e-33, -0.04096720740199089, -0.06969154626131058, 0.027050700038671494, 0.007264604326337576, 0.002122539794072509, -0.009771010838449001, -0.010699690319597721, 0.003970318008214235, -0.023139923810958862, -0.0462506040930748, -0.026543185114860535, 0.033967144787311554, 0.04839526489377022, -0.029607823118567467, 0.03976336866617203, -0.09963945299386978, -0.014378279447555542, -0.04962849244475365, 0.052436742931604385, -0.00303977751173079, 0.03961142525076866, 0.013171354308724403, -0.0545119047164917, -0.0038262500893324614, 0.07426611334085464, 0.050386942923069, -0.037672773003578186, -0.0020822109654545784, 0.0012139491736888885, -0.05779973790049553, 0.09531930088996887, 0.034172553569078445, -0.012286268174648285, 0.02754318155348301, -0.021228818222880363, 0.05763769894838333, -0.09731952846050262, 0.08972109854221344, -0.020434916019439697, -0.008838548325002193, 0.061035074293613434, -0.013506881892681122, -0.07714401185512543, -0.009217205457389355, 0.02291366644203663, 0.08210420608520508, 0.0010200076503679156, -0.022270847111940384, -0.06951827555894852, -0.017635419964790344, 0.03580019250512123, 0.0344744548201561, 0.0350014753639698, 0.013806999661028385, -0.028332972899079323, 0.10674575716257095, 0.11398804187774658, -0.02653391845524311, -0.008701590821146965, -0.07527925074100494, -0.027892692014575005, -0.036943115293979645, 0.05223189666867256, 0.13144297897815704, -0.08505772054195404, -0.04178532958030701, -0.01443845871835947, 0.08367138355970383, -0.049646902829408646, -0.026078836992383003, -0.08393797278404236, -0.041952796280384064, 0.010347036644816399, -0.06786831468343735, 0.03346928581595421, -0.03182077780365944, -0.034783873707056046, -0.06274600327014923, 0.0036659673787653446, 0.0442383773624897, -0.10407120734453201, -0.0013050513807684183, 0.016495121642947197, -0.0008559921407140791, 0.04102455452084541, -0.013333720155060291, 0.015965644270181656, 0.09785337746143341, 0.07216314226388931, 0.13625003397464752, -0.08874130249023438, 0.04208798706531525, -0.06920501589775085, -0.056276220828294754, -0.0016200367826968431, -4.8664027474387694e-8, -0.07929478585720062, 0.033745113760232925, -0.018483728170394897, 0.0351775661110878, -0.04247187450528145, -0.03406721353530884, 0.046996161341667175, 0.00990244373679161, -0.030095834285020828, 0.032489705830812454, 0.04659823700785637, 0.0753217488527298, -0.0719633623957634, -0.04175635427236557, -0.08879492431879044, 0.05919012799859047, 0.033849913626909256, -0.03426378592848778, -0.004548091907054186, -0.0435398630797863, -0.07111545652151108, -0.017880499362945557, 0.05970367416739464, -0.007322132121771574, -0.05928575620055199, 0.019041726365685463, -0.012182647362351418, 0.02926523983478546, -0.03889315947890282, 0.03418085351586342, -0.06344541162252426, -0.020518751814961433, 0.05448272079229355, -0.06952698528766632, -0.117217518389225, 0.06441768258810043, -0.015141810290515423, -0.006979205645620823, 0.010888218879699707, -0.025493845343589783, 0.03331005573272705, 0.019871782511472702, -0.015167786739766598, -0.04335232079029083, 0.002710313070565462, 0.07285193353891373, -0.024262560531497, 0.00891341082751751, 0.05454551428556442, -0.024405308067798615, -0.09691838920116425, -0.040756989270448685, -0.046768203377723694, 0.10120172798633575, -0.02960270456969738, 0.015787191689014435, 0.002062335144728422, -0.04766344279050827, 0.05965050682425499, -0.019352059811353683, -0.014324450865387917, -0.016770051792263985, 0.05391297489404678, -0.009816386736929417 ]
-0.002955
`auth-profiles.json`: ```json { "usageStats": { "provider:profile": { "disabledUntil": 1736178000000, "disabledReason": "billing" } } } ``` Defaults: - Billing backoff starts at \*\*5 hours\*\*, doubles per billing failure, and caps at \*\*24 hours\*\*. - Backoff counters reset if the profile hasn’t failed for \*\*24 hours\*\* (configurable). ## Model fallback If all profiles for a provider fail, OpenClaw moves to the next model in `agents.defaults.model.fallbacks`. This applies to auth failures, rate limits, and timeouts that exhausted profile rotation (other errors do not advance fallback). When a run starts with a model override (hooks or CLI), fallbacks still end at `agents.defaults.model.primary` after trying any configured fallbacks. ## Related config See [Gateway configuration](/gateway/configuration) for: - `auth.profiles` / `auth.order` - `auth.cooldowns.billingBackoffHours` / `auth.cooldowns.billingBackoffHoursByProvider` - `auth.cooldowns.billingMaxHours` / `auth.cooldowns.failureWindowHours` - `agents.defaults.model.primary` / `agents.defaults.model.fallbacks` - `agents.defaults.imageModel` routing See [Models](/concepts/models) for the broader model selection and fallback overview.
https://github.com/openclaw/openclaw/blob/main//docs/concepts/model-failover.md
main
opebclaw
[ -0.05533677712082863, 0.006319382227957249, -0.056439951062202454, 0.09280730783939362, 0.011940152384340763, -0.047033969312906265, -0.028361178934574127, 0.014050199650228024, -0.024439571425318718, -0.048805445432662964, 0.03213915973901749, 0.016703126952052116, 0.042273957282304764, 0.00029472040478140116, 0.03188456594944, 0.06503022462129593, 0.010949044488370419, -0.021388357505202293, -0.015591835603117943, 0.011057236231863499, -0.01633894443511963, 0.05107215791940689, -0.030125228688120842, 0.029239928349852562, -0.07683458179235458, -0.05836636945605278, -0.06960896402597427, -0.05002576857805252, -0.04585833102464676, -0.0020414043683558702, 0.024553995579481125, 0.004194083157926798, -0.06722742319107056, -0.03239412233233452, 0.08192412555217743, 0.041904598474502563, 0.036539822816848755, -0.007334045134484768, 0.005516567267477512, 0.014559848234057426, 0.08277801424264908, 0.02923550270497799, -0.030804548412561417, -0.07561921328306198, -0.030427178367972374, -0.08657898753881454, -0.005082591436803341, -0.04497228562831879, -0.03503220155835152, 0.05804577097296715, 0.0018930098740383983, 0.0008637552382424474, 0.028007792308926582, -0.03190043941140175, 0.022180873900651932, 0.039601460099220276, 0.017585627734661102, -0.009688320569694042, 0.016813553869724274, -0.02462015487253666, 0.06667143106460571, -0.05345998704433441, -0.09416710585355759, 0.02870188280940056, -0.07842668145895004, 0.032347485423088074, -0.06109010800719261, -0.06704492121934891, -0.04912295565009117, 0.059032682329416275, 0.004791252315044403, 0.03578263893723488, -0.0830700546503067, -0.0627523735165596, 0.08123879879713058, 0.029279742389917374, 0.03574337810277939, -0.004059412982314825, 0.011093243025243282, -0.08013635873794556, -0.04197457805275917, -0.0927993580698967, -0.056779973208904266, 0.04848778620362282, 0.009199404157698154, 0.04202542454004288, -0.005017746239900589, -0.004204377997666597, 0.03896305710077286, -0.0014996860409155488, 0.04811542481184006, -0.024157319217920303, 0.03164934366941452, 0.004215820226818323, 0.039719197899103165, 0.032519858330488205, 0.005169072188436985, -0.031706083565950394, -0.05920589715242386, 0.06884238868951797, -0.040959589183330536, 0.0088269654661417, 0.12032432109117508, 0.09414831548929214, 0.05670906975865364, 0.010639249347150326, 0.06319587677717209, 0.027485335245728493, -0.027977144345641136, -0.00279057864099741, 0.0664847120642662, 0.02077532187104225, 0.15043458342552185, 0.0017266565700992942, 0.03171241283416748, 0.06878331303596497, -0.046010397374629974, -0.0015217643231153488, -0.005393818952143192, 0.061117783188819885, 0.10015509277582169, 0.05568995326757431, 0.04550599306821823, -0.06481639295816422, 0.051531292498111725, 0.11079483479261398, 0.028742335736751556, 4.987291922752797e-33, 0.05938330292701721, -0.008959495462477207, -0.023785606026649475, 0.005899291019886732, 0.13723045587539673, -0.029418885707855225, -0.0026028291322290897, 0.025059962645173073, -0.03114391677081585, 0.030671048909425735, 0.008288426324725151, 0.0417487658560276, -0.023051349446177483, -0.026428744196891785, -0.01788715273141861, 0.014908526092767715, 0.041923053562641144, 0.06294815987348557, 0.07035843282938004, 0.04941237345337868, 0.06933335214853287, -0.08954492211341858, -0.037651654332876205, 0.03173917531967163, -0.015089981257915497, 0.07440949976444244, -0.01990734413266182, 0.0049592675641179085, -0.04497898742556572, 0.03453519940376282, 0.07653754949569702, 0.06943701207637787, 0.011305836029350758, 0.03515138104557991, -0.022654645144939423, 0.013751636259257793, -0.023381467908620834, -0.02682836912572384, -0.04972154274582863, -0.09989200532436371, -0.0866171345114708, 0.054895926266908646, -0.08508361130952835, -0.01267875824123621, -0.08239870518445969, -0.15869870781898499, 0.05950869992375374, 0.02629060111939907, 0.05778016149997711, 0.07486177980899811, -0.014967231079936028, -0.007876907475292683, -0.027514884248375893, 0.00987047329545021, -0.04675206542015076, -0.04784873127937317, -0.04042495787143707, -0.00018110733071807772, -0.0021426731254905462, -0.00765339657664299, 0.055512767285108566, -0.04752923175692558, -0.03494272008538246, -0.05771983042359352, 0.00102585821878165, -0.005546079482883215, -0.016687331721186638, 0.001350590493530035, -0.06330175697803497, 0.030608735978603363, -0.0038066846318542957, 0.02414366789162159, -0.08410444855690002, 0.01772930659353733, -0.05433530732989311, -0.08284161239862442, 0.06538733094930649, -0.00903680082410574, 0.024925442412495613, 0.014712761156260967, 0.0261284988373518, -0.00379375834017992, -0.05306059122085571, -0.0073973205871880054, -0.041013870388269424, 0.03655043616890907, 0.0335954949259758, -0.031716588884592056, -0.013036041520535946, 0.03020486980676651, 0.0056997025385499, -0.03704975172877312, 0.019683849066495895, 0.03955555707216263, -0.05179939046502113, -5.815334388043002e-33, -0.05955655872821808, -0.06750389188528061, 0.006757670547813177, -0.002347046509385109, 0.024869846180081367, -0.022114522755146027, 0.019435163587331772, 0.08823041617870331, 0.01705153100192547, -0.05883116275072098, 0.011424656957387924, 0.04668666049838066, 0.004709153901785612, -0.019902491942048073, 0.05230692774057388, -0.06164936348795891, -0.0170911718159914, -0.07920163869857788, 0.024239428341388702, -0.011718794703483582, 0.0458027645945549, 0.036768775433301926, -0.08596928417682648, -0.015232312493026257, 0.0033008172176778316, 0.06181512027978897, -0.09880869835615158, 0.014734401367604733, -0.004620587918907404, -0.06456362456083298, 0.04727226868271828, -0.010302278213202953, -0.031153889372944832, 0.04308823123574257, -0.025489699095487595, 0.038437992334365845, -0.14057642221450806, 0.1423112452030182, -0.040087368339300156, 0.01608322747051716, 0.1022598147392273, 0.03066372312605381, -0.04810404032468796, 0.03039262443780899, 0.06006377190351486, 0.03939006105065346, 0.02790425345301628, -0.06391195952892303, -0.0010551766026765108, 0.007914183661341667, -0.047455232590436935, -0.02694285288453102, 0.13383735716342926, 0.11971569806337357, -0.03830371052026749, 0.06657719612121582, 0.1617031693458557, -0.08229918032884598, 0.008296131156384945, -0.06852512806653976, -0.02768188901245594, -0.053216978907585144, 0.02902158349752426, 0.08296030759811401, -0.03261705860495567, -0.04436514899134636, -0.010648081079125404, 0.02385079115629196, 0.027047691866755486, -0.07623927295207977, -0.06679759174585342, -0.05341115966439247, -0.006912753917276859, -0.05034962296485901, -0.02657967619597912, -0.018273741006851196, -0.126475527882576, -0.08815741539001465, -0.044384658336639404, 0.02758854441344738, -0.07256641983985901, -0.0008951577474363148, -0.031248988583683968, -0.012635499238967896, -0.004539307206869125, -0.06613169610500336, -0.0006966046057641506, 0.10359684377908707, 0.04325862228870392, 0.13969328999519348, -0.07674208283424377, 0.008474755100905895, -0.09938502311706543, 0.012569420970976353, -0.04457634314894676, -5.066464581204855e-8, -0.08389721810817719, 0.0065231011249125, -0.05144919455051422, 0.038096070289611816, 0.010804122313857079, -0.06264548003673553, 0.03358099237084389, -0.011796683073043823, -0.04615185037255287, 0.008570251055061817, 0.049020953476428986, 0.06652726233005524, -0.011447589844465256, -0.023471198976039886, -0.03496623411774635, 0.01641664281487465, -0.005829143337905407, -0.02500648982822895, -0.0370098277926445, -0.01891767606139183, -0.09417372941970825, -0.01521312352269888, 0.009469683282077312, -0.0010430171387270093, -0.06227234750986099, 0.01610419899225235, 0.009932389482855797, 0.06130049750208855, -0.03289444372057915, 0.0032242611050605774, -0.07285914570093155, 0.03270017355680466, 0.050746820867061615, -0.029540061950683594, -0.10129879415035248, 0.05404597148299217, -0.017086850479245186, -0.029249830171465874, 0.01919834315776825, 0.01865195296704769, 0.09275703132152557, 0.014217015355825424, -0.03823387622833252, -0.015254553407430649, 0.012327929027378559, 0.012355480343103409, -0.03252709284424782, 0.05607964098453522, 0.09969452768564224, -0.06335616111755371, -0.09446945786476135, -0.009062501601874828, -0.0011039568344131112, 0.069890595972538, -0.01589430682361126, -0.026678819209337234, 0.0411786213517189, -0.05098442733287811, 0.026793133467435837, 0.006996875163167715, -0.00937848724424839, -0.04686642438173294, 0.03503875806927681, -0.04826102778315544 ]
0.008922
# Memory OpenClaw memory is \*\*plain Markdown in the agent workspace\*\*. The files are the source of truth; the model only "remembers" what gets written to disk. Memory search tools are provided by the active memory plugin (default: `memory-core`). Disable memory plugins with `plugins.slots.memory = "none"`. ## Memory files (Markdown) The default workspace layout uses two memory layers: - `memory/YYYY-MM-DD.md` - Daily log (append-only). - Read today + yesterday at session start. - `MEMORY.md` (optional) - Curated long-term memory. - \*\*Only load in the main, private session\*\* (never in group contexts). These files live under the workspace (`agents.defaults.workspace`, default `~/clawd`). See [Agent workspace](/concepts/agent-workspace) for the full layout. ## When to write memory - Decisions, preferences, and durable facts go to `MEMORY.md`. - Day-to-day notes and running context go to `memory/YYYY-MM-DD.md`. - If someone says "remember this," write it down (do not keep it in RAM). - This area is still evolving. It helps to remind the model to store memories; it will know what to do. - If you want something to stick, \*\*ask the bot to write it\*\* into memory. ## Automatic memory flush (pre-compaction ping) When a session is \*\*close to auto-compaction\*\*, OpenClaw triggers a \*\*silent, agentic turn\*\* that reminds the model to write durable memory \*\*before\*\* the context is compacted. The default prompts explicitly say the model \_may reply\_, but usually `NO\_REPLY` is the correct response so the user never sees this turn. This is controlled by `agents.defaults.compaction.memoryFlush`: ```json5 { agents: { defaults: { compaction: { reserveTokensFloor: 20000, memoryFlush: { enabled: true, softThresholdTokens: 4000, systemPrompt: "Session nearing compaction. Store durable memories now.", prompt: "Write any lasting notes to memory/YYYY-MM-DD.md; reply with NO\_REPLY if nothing to store.", }, }, }, }, } ``` Details: - \*\*Soft threshold\*\*: flush triggers when the session token estimate crosses `contextWindow - reserveTokensFloor - softThresholdTokens`. - \*\*Silent\*\* by default: prompts include `NO\_REPLY` so nothing is delivered. - \*\*Two prompts\*\*: a user prompt plus a system prompt append the reminder. - \*\*One flush per compaction cycle\*\* (tracked in `sessions.json`). - \*\*Workspace must be writable\*\*: if the session runs sandboxed with `workspaceAccess: "ro"` or `"none"`, the flush is skipped. For the full compaction lifecycle, see [Session management + compaction](/reference/session-management-compaction). ## Vector memory search OpenClaw can build a small vector index over `MEMORY.md` and `memory/\*.md` so semantic queries can find related notes even when wording differs. Defaults: - Enabled by default. - Watches memory files for changes (debounced). - Uses remote embeddings by default. If `memorySearch.provider` is not set, OpenClaw auto-selects: 1. `local` if a `memorySearch.local.modelPath` is configured and the file exists. 2. `openai` if an OpenAI key can be resolved. 3. `gemini` if a Gemini key can be resolved. 4. Otherwise memory search stays disabled until configured. - Local mode uses node-llama-cpp and may require `pnpm approve-builds`. - Uses sqlite-vec (when available) to accelerate vector search inside SQLite. Remote embeddings \*\*require\*\* an API key for the embedding provider. OpenClaw resolves keys from auth profiles, `models.providers.\*.apiKey`, or environment variables. Codex OAuth only covers chat/completions and does \*\*not\*\* satisfy embeddings for memory search. For Gemini, use `GEMINI\_API\_KEY` or `models.providers.google.apiKey`. When using a custom OpenAI-compatible endpoint, set `memorySearch.remote.apiKey` (and optional `memorySearch.remote.headers`). ### QMD backend (experimental) Set `memory.backend = "qmd"` to swap the built-in SQLite indexer for [QMD](https://github.com/tobi/qmd): a local-first search sidecar that combines BM25 + vectors + reranking. Markdown stays the source of truth; OpenClaw shells out to QMD for retrieval. Key points: \*\*Prereqs\*\* - Disabled by default. Opt in per-config (`memory.backend = "qmd"`). - Install the QMD CLI separately (`bun install -g github.com/tobi/qmd` or grab a release) and make sure the `qmd` binary is on the gateway’s
https://github.com/openclaw/openclaw/blob/main//docs/concepts/memory.md
main
opebclaw
[ 0.016076339408755302, 0.021671166643500328, -0.1188412681221962, 0.11086111515760422, 0.003255744930356741, 0.01407179981470108, -0.03174273297190666, 0.0026396941393613815, 0.013424628414213657, 0.017045391723513603, 0.02876666933298111, 0.10129180550575256, 0.029580840840935707, -0.004771062638610601, 0.027689311653375626, 0.07400327175855637, -0.007744001690298319, 0.0030532064847648144, -0.03948262706398964, 0.01735731214284897, 0.10547711700201035, 0.04159880056977272, 0.007854033261537552, -0.017802665010094643, -0.06454389542341232, 0.021230436861515045, -0.053800735622644424, -0.05236218497157097, 0.013811158947646618, -0.054026659578084946, 0.0816841796040535, 0.0642913356423378, -0.01974916271865368, 0.03511906787753105, 0.1046392023563385, 0.11178478598594666, -0.07592203468084335, -0.0662526786327362, -0.03392200917005539, -0.04131760820746422, 0.015312123112380505, 0.07956285774707794, -0.027029387652873993, -0.02144022099673748, -0.022533494979143143, -0.013947434723377228, 0.005237211938947439, -0.08657362312078476, -0.000154811394168064, -0.0072454544715583324, -0.07758774608373642, 0.011510614305734634, -0.047104787081480026, -0.003134075552225113, 0.05245096608996391, 0.04117384925484657, 0.024116521701216698, -0.037200164049863815, -0.07067576795816422, 0.0006624723318964243, 0.0036171902902424335, -0.04632294550538063, -0.05043582245707512, -0.022697702050209045, -0.07360588759183884, 0.03348373994231224, 0.031233087182044983, -0.03738600015640259, -0.010998818092048168, -0.03364237770438194, -0.07810350507497787, 0.004163909237831831, -0.004972857888787985, -0.011163989081978798, 0.011240116320550442, 0.033373039215803146, 0.05824258178472519, -0.0024488302879035473, -0.005338452756404877, -0.14885833859443665, -0.04250422120094299, -0.035501353442668915, 0.00948898121714592, 0.0313321053981781, -0.00986036378890276, 0.10984145849943161, 0.03798484429717064, -0.005004846025258303, 0.06346874684095383, -0.04595290869474411, 0.08145390450954437, -0.08887781947851181, -0.016394753009080887, 0.0037877794820815325, 0.005872945301234722, -0.0266376081854105, 0.04999488964676857, 0.06872621178627014, -0.05229682847857475, 0.038472749292850494, 0.07505828142166138, 0.08874738961458206, 0.06579723209142685, 0.024367237463593483, -0.05728766694664955, 0.0302901491522789, 0.08436166495084763, 0.07621607929468155, -0.07930488139390945, -0.04725678637623787, 0.04796874150633812, 0.024241941049695015, 0.0358068123459816, 0.011875460855662823, 0.06371144950389862, -0.05468957871198654, -0.02925627864897251, -0.04348176717758179, -0.011850743554532528, 0.11241447180509567, 0.06865185499191284, 0.01511191762983799, -0.0026803691871464252, -0.020920511335134506, -0.04241247847676277, 0.02946675382554531, -0.005748118739575148, 3.414678846024278e-33, 0.06504230946302414, -0.09358400106430054, -0.05983155593276024, 0.0432402640581131, 0.07232067734003067, -0.017223326489329338, -0.013194741681218147, 0.04709992930293083, -0.069575235247612, 0.05079547315835953, 0.05116007849574089, -0.012963423505425453, -0.07771346718072891, 0.04432942718267441, 0.0307504553347826, -0.021031631156802177, -0.04777419939637184, 0.055794764310121536, 0.03247160464525223, -0.004656835924834013, -0.014761170372366905, 0.04609173163771629, -0.03760736063122749, -0.03475124388933182, 0.015937265008687973, 0.07505530118942261, -0.025368589907884598, -0.057067107409238815, -0.003939571790397167, 0.010491546243429184, -0.005309617146849632, 0.010386228561401367, -0.052616462111473083, -0.0005185226909816265, -0.03203251585364342, 0.056800615042448044, -0.09109228849411011, -0.027863573282957077, -0.02010074071586132, -0.12813188135623932, 0.05439190939068794, 0.05389241874217987, 0.04133336618542671, -0.07541867345571518, -0.10227691382169724, -0.11694574356079102, 0.024797536432743073, 0.028432883322238922, 0.0414862185716629, 0.038737308233976364, 0.0358160100877285, 0.021368352696299553, -0.004544211085885763, 0.02518901415169239, -0.02904023975133896, 0.008922895416617393, -0.02192450687289238, -0.024422118440270424, 0.08943963050842285, 0.09822217375040054, 0.007181063294410706, -0.018812300637364388, 0.03337865322828293, 0.047594014555215836, -0.0051926965825259686, 0.04715539887547493, 0.07346721738576889, 0.0763331949710846, -0.025540495291352272, -0.008638015948235989, -0.010065239854156971, -0.061650510877370834, 0.06582764536142349, 0.021942662075161934, -0.025468576699495316, -0.09709955006837845, 0.04285265505313873, -0.08691666275262833, -0.09839503467082977, -0.034059662371873856, 0.053656477481126785, -0.031030889600515366, -0.007760439533740282, -0.03341130167245865, -0.03423120081424713, -0.029625462368130684, 0.03660847246646881, -0.10708852857351303, 0.0375150628387928, 0.028913401067256927, -0.023120949044823647, -0.07341530174016953, -0.010386991314589977, -0.00006945124914636835, -0.057119932025671005, -4.871645319150962e-33, 0.02583133801817894, -0.04550058767199516, -0.048671308904886246, -0.00003818417098955251, -0.06733681261539459, -0.03486126661300659, -0.03838975727558136, -0.008780633099377155, -0.08954457938671112, -0.061366789042949677, -0.032401762902736664, 0.06344866007566452, 0.033238645642995834, -0.06026070937514305, -0.030603531748056412, -0.005895940586924553, 0.05183570459485054, -0.072610042989254, -0.008465140126645565, -0.014806434512138367, -0.045085057616233826, 0.023807857185602188, 0.0362820066511631, 0.03471411019563675, 0.06907086819410324, 0.05612872540950775, -0.01937101036310196, 0.020249245688319206, 0.046136148273944855, -0.03373259678483009, 0.020216593518853188, 0.041172146797180176, -0.07922092080116272, -0.03395954892039299, -0.04141157492995262, -0.01758904941380024, -0.07028203457593918, 0.014551722444593906, 0.0032603805884718895, 0.04580271244049072, 0.11243706941604614, 0.03764057531952858, -0.05280594900250435, -0.008384200744330883, 0.010121705941855907, 0.04261283203959465, -0.08645077049732208, 0.029304997995495796, 0.0676223561167717, -0.006855557672679424, -0.0011093600187450647, -0.017455976456403732, -0.0036996465642005205, -0.05105827748775482, -0.007052415981888771, 0.028138911351561546, 0.05670380964875221, -0.07698732614517212, -0.0299912691116333, -0.07356709241867065, -0.03178839758038521, -0.02032572403550148, -0.11102719604969025, -0.016191717237234116, -0.05287319794297218, -0.0075956182554364204, 0.01520686037838459, 0.016883209347724915, -0.062117211520671844, 0.013124736957252026, -0.03625081852078438, -0.021649252623319626, -0.009635859169065952, -0.04475264623761177, 0.004594700876623392, 0.031049085780978203, -0.028613358736038208, -0.05532269924879074, -0.0006395442760549486, -0.00031810926157049835, -0.021769072860479355, 0.020836563780903816, 0.02145884372293949, 0.050301969051361084, -0.043299153447151184, 0.018295999616384506, -0.10743365436792374, 0.09178153425455093, -0.06189277395606041, 0.012300212867558002, -0.06607885658740997, -0.0073760561645030975, -0.014051967300474644, 0.05239738151431084, -0.008304467424750328, -5.548741555116976e-8, -0.06902524828910828, -0.04884489253163338, 0.06133100017905235, 0.004898048471659422, -0.008063321933150291, -0.10682452470064163, -0.008361347019672394, 0.14935189485549927, 0.013640274293720722, 0.04153070226311684, 0.15066860616207123, -0.03359053656458855, -0.11539125442504883, -0.018278878182172775, -0.042778097093105316, 0.08486490696668625, 0.01770908758044243, -0.01558260340243578, -0.015979904681444168, -0.09206953644752502, 0.0007767747156322002, -0.03585583344101906, 0.07835134118795395, 0.05711253732442856, 0.04454386606812477, -0.001222199760377407, 0.051343973726034164, 0.11266720294952393, -0.030292276293039322, 0.11327295005321503, 0.037139564752578735, 0.022029239684343338, 0.03461170196533203, -0.04076768830418587, 0.03021339327096939, 0.04465475305914879, 0.03152352198958397, 0.03113958239555359, 0.028401700779795647, 0.05105099827051163, 0.025254400447010994, -0.00038317678263410926, -0.00020491219765972346, -0.009977935813367367, -0.023244250565767288, 0.008623520843684673, -0.10185448080301285, 0.028052030131220818, 0.03267714008688927, -0.07158560305833817, -0.08653536438941956, 0.07143643498420715, -0.007328645326197147, 0.10818325728178024, -0.013750987127423286, 0.002966527594253421, 0.07848449051380157, -0.014876880683004856, 0.05267898738384247, 0.010480036027729511, 0.017409401014447212, -0.004076031036674976, -0.019415417686104774, -0.011623541824519634 ]
0.11528
Markdown stays the source of truth; OpenClaw shells out to QMD for retrieval. Key points: \*\*Prereqs\*\* - Disabled by default. Opt in per-config (`memory.backend = "qmd"`). - Install the QMD CLI separately (`bun install -g github.com/tobi/qmd` or grab a release) and make sure the `qmd` binary is on the gateway’s `PATH`. - QMD needs an SQLite build that allows extensions (`brew install sqlite` on macOS). - QMD runs fully locally via Bun + `node-llama-cpp` and auto-downloads GGUF models from HuggingFace on first use (no separate Ollama daemon required). - The gateway runs QMD in a self-contained XDG home under `~/.openclaw/agents//qmd/` by setting `XDG\_CONFIG\_HOME` and `XDG\_CACHE\_HOME`. - OS support: macOS and Linux work out of the box once Bun + SQLite are installed. Windows is best supported via WSL2. \*\*How the sidecar runs\*\* - The gateway writes a self-contained QMD home under `~/.openclaw/agents//qmd/` (config + cache + sqlite DB). - Collections are rewritten from `memory.qmd.paths` (plus default workspace memory files) into `index.yml`, then `qmd update` + `qmd embed` run on boot and on a configurable interval (`memory.qmd.update.interval`, default 5 m). - Searches run via `qmd query --json`. If QMD fails or the binary is missing, OpenClaw automatically falls back to the builtin SQLite manager so memory tools keep working. - \*\*First search may be slow\*\*: QMD may download local GGUF models (reranker/query expansion) on the first `qmd query` run. - OpenClaw sets `XDG\_CONFIG\_HOME`/`XDG\_CACHE\_HOME` automatically when it runs QMD. - If you want to pre-download models manually (and warm the same index OpenClaw uses), run a one-off query with the agent’s XDG dirs. OpenClaw’s QMD state lives under your \*\*state dir\*\* (defaults to `~/.openclaw`). You can point `qmd` at the exact same index by exporting the same XDG vars OpenClaw uses: ```bash # Pick the same state dir OpenClaw uses STATE\_DIR="${OPENCLAW\_STATE\_DIR:-$HOME/.openclaw}" if [ -d "$HOME/.moltbot" ] && [ ! -d "$HOME/.openclaw" ] \ && [ -z "${OPENCLAW\_STATE\_DIR:-}" ]; then STATE\_DIR="$HOME/.moltbot" fi export XDG\_CONFIG\_HOME="$STATE\_DIR/agents/main/qmd/xdg-config" export XDG\_CACHE\_HOME="$STATE\_DIR/agents/main/qmd/xdg-cache" # (Optional) force an index refresh + embeddings qmd update qmd embed # Warm up / trigger first-time model downloads qmd query "test" -c memory-root --json >/dev/null 2>&1 ``` \*\*Config surface (`memory.qmd.\*`)\*\* - `command` (default `qmd`): override the executable path. - `includeDefaultMemory` (default `true`): auto-index `MEMORY.md` + `memory/\*\*/\*.md`. - `paths[]`: add extra directories/files (`path`, optional `pattern`, optional stable `name`). - `sessions`: opt into session JSONL indexing (`enabled`, `retentionDays`, `exportDir`). - `update`: controls refresh cadence (`interval`, `debounceMs`, `onBoot`, `embedInterval`). - `limits`: clamp recall payload (`maxResults`, `maxSnippetChars`, `maxInjectedChars`, `timeoutMs`). - `scope`: same schema as [`session.sendPolicy`](/gateway/configuration#session). Default is DM-only (`deny` all, `allow` direct chats); loosen it to surface QMD hits in groups/channels. - Snippets sourced outside the workspace show up as `qmd//` in `memory\_search` results; `memory\_get` understands that prefix and reads from the configured QMD collection root. - When `memory.qmd.sessions.enabled = true`, OpenClaw exports sanitized session transcripts (User/Assistant turns) into a dedicated QMD collection under `~/.openclaw/agents//qmd/sessions/`, so `memory\_search` can recall recent conversations without touching the builtin SQLite index. - `memory\_search` snippets now include a `Source: ` footer when `memory.citations` is `auto`/`on`; set `memory.citations = "off"` to keep the path metadata internal (the agent still receives the path for `memory\_get`, but the snippet text omits the footer and the system prompt warns the agent not to cite it). \*\*Example\*\* ```json5 memory: { backend: "qmd", citations: "auto", qmd: { includeDefaultMemory: true, update: { interval: "5m", debounceMs: 15000 }, limits: { maxResults: 6, timeoutMs: 4000 }, scope: { default: "deny", rules: [{ action: "allow", match: { chatType: "direct" } }] }, paths: [ { name: "docs", path: "~/notes", pattern: "\*\*/\*.md" } ] } } ``` \*\*Citations & fallback\*\* - `memory.citations` applies regardless of
https://github.com/openclaw/openclaw/blob/main//docs/concepts/memory.md
main
opebclaw
[ -0.03590930998325348, -0.013998620212078094, -0.0645570382475853, 0.006309633143246174, -0.01409865077584982, -0.011763684451580048, -0.08852588385343552, 0.04089094325900078, 0.013071868568658829, 0.016234328970313072, 0.04100187495350838, -0.027591601014137268, 0.004599283915013075, 0.005149435717612505, 0.08191166818141937, 0.0786525160074234, 0.06595218926668167, -0.008454271592199802, 0.07293879985809326, -0.00202960055321455, -0.021978843957185745, 0.0343216173350811, 0.04780525714159012, -0.03845879063010216, -0.01342680025845766, -0.025475533679127693, -0.057499609887599945, -0.0044642845168709755, 0.010978111997246742, -0.044193416833877563, 0.03952015936374664, 0.030994553118944168, -0.009954460896551609, -0.02987784519791603, 0.09280915558338165, 0.1180942952632904, 0.052097123116254807, -0.08767234534025192, -0.12149474769830704, -0.04235232621431351, 0.04088436812162399, 0.027836177498102188, -0.05410806089639664, -0.038520265370607376, 0.04748177155852318, -0.10188762098550797, -0.009121199138462543, 0.010103831067681313, 0.004986415151506662, -0.05502708628773689, -0.049414314329624176, -0.07378838956356049, 0.0037380403373390436, 0.033943403512239456, 0.06023256480693817, 0.0978899896144867, -0.053178682923316956, -0.06111391633749008, -0.0010702373692765832, 0.008125572465360165, -0.038091521710157394, 0.020208699628710747, -0.08755580335855484, 0.03996224328875542, -0.025821376591920853, 0.01560975145548582, 0.02423998713493347, -0.019301068037748337, 0.030567236244678497, -0.0485125407576561, -0.052821703255176544, -0.036249104887247086, 0.001325020333752036, -0.0037632822059094906, -0.03435502201318741, 0.07127043604850769, 0.06805679202079773, 0.051098596304655075, -0.0976204201579094, -0.0768357366323471, -0.03800758346915245, -0.02768806554377079, -0.041118524968624115, 0.0659756064414978, -0.022537441924214363, 0.08376231789588928, -0.006773774977773428, 0.027592003345489502, 0.007170313503593206, -0.012092082761228085, 0.09165829420089722, -0.06399250030517578, -0.008792717009782791, -0.05322347208857536, 0.012714732438325882, -0.07766227424144745, 0.09582525491714478, -0.006185626611113548, 0.018943294882774353, 0.05035945028066635, 0.012247863225638866, 0.006192411296069622, -0.0037228490691632032, 0.001961528090760112, -0.03326175734400749, 0.053111929446458817, 0.07596321403980255, 0.04986121878027916, -0.024633772671222687, -0.019191039726138115, -0.009715395979583263, -0.03424135595560074, 0.059240445494651794, -0.056077416986227036, -0.01981968618929386, 0.04673309251666069, 0.00005855235212948173, 0.002848974661901593, -0.013860229402780533, -0.0008755871094763279, 0.022648697718977928, -0.006168070249259472, 0.011204863898456097, -0.0055009606294333935, 0.04936981201171875, 0.09710947424173355, -0.01004821341484785, 3.39789315403652e-33, 0.13527901470661163, -0.012157108634710312, 0.004526969976723194, -0.040050946176052094, 0.0796937346458435, 0.010792892426252365, 0.029536480084061623, -0.015042386949062347, -0.12050680071115494, 0.065693698823452, 0.03257360681891441, 0.03574580326676369, -0.10734988003969193, 0.013921651989221573, 0.0645490363240242, -0.00927839893847704, -0.1083354726433754, -0.000933069852180779, 0.022315042093396187, 0.02628530003130436, -0.00826080422848463, -0.05079026520252228, -0.09177036583423615, 0.023999260738492012, 0.018895074725151062, 0.09217846393585205, 0.042267460376024246, 0.011560709215700626, -0.011461681686341763, 0.03175373747944832, -0.041249435395002365, -0.06425479799509048, -0.06295955181121826, -0.056797467172145844, -0.12418123334646225, 0.04924910143017769, -0.16752269864082336, -0.037094492465257645, -0.054810672998428345, -0.06802808493375778, 0.01396975852549076, 0.019448142498731613, -0.014805840328335762, -0.09512320160865784, -0.017681235447525978, -0.059525810182094574, -0.019267268478870392, -0.04998554289340973, 0.052672211080789566, -0.007406312972307205, 0.024515079334378242, -0.021000642329454422, -0.030623789876699448, 0.025185706093907356, -0.028213337063789368, 0.02096892148256302, -0.02163807302713394, -0.00467620138078928, 0.06437907367944717, 0.0850255936384201, 0.021129406988620758, 0.02789940871298313, 0.028808750212192535, 0.04585355520248413, -0.023008087649941444, 0.047074880450963974, 0.019598189741373062, -0.018900902941823006, -0.05262430012226105, 0.12633970379829407, -0.04836861416697502, -0.027426976710557938, 0.05522724241018295, 0.07809846848249435, 0.07805093377828598, -0.0682370588183403, -0.06426354497671127, -0.02691952884197235, -0.004058704245835543, -0.03452827408909798, 0.009953329339623451, 0.008291274309158325, -0.012014255858957767, 0.03265881910920143, 0.08137588948011398, -0.032282788306474686, 0.07947006821632385, -0.0939466580748558, -0.04862485080957413, 0.03433302044868469, 0.005355038680136204, -0.04977855086326599, 0.02741256356239319, 0.0034833690151572227, -0.09543292224407196, -3.90076449453051e-33, 0.02893807552754879, -0.050297562032938004, 0.023796623572707176, -0.014671023003757, -0.09650973230600357, -0.009428071789443493, -0.02339973859488964, -0.004315740428864956, -0.016013318672776222, -0.05624709278345108, -0.019923711195588112, 0.09721086174249649, 0.06391099095344543, -0.09200011193752289, -0.0022581592202186584, -0.01112058013677597, 0.04907504469156265, -0.1277526170015335, -0.03196336328983307, 0.004799374844878912, -0.03515313193202019, -0.02040773071348667, 0.01599613018333912, -0.01137436181306839, 0.06941919028759003, 0.023039711639285088, 0.09897401928901672, 0.03765280544757843, -0.04780721664428711, -0.05346274748444557, -0.007898415438830853, -0.01775936782360077, -0.08741727471351624, -0.05848534777760506, -0.03559539094567299, 0.05529434233903885, -0.03632575273513794, 0.08587993681430817, -0.035474278032779694, 0.03278331086039543, 0.09512126445770264, 0.02310839481651783, -0.08134619146585464, 0.008193008601665497, -0.045435693114995956, 0.051450684666633606, -0.12728789448738098, -0.012037387117743492, -0.005387129262089729, 0.010911750607192516, 0.028044702485203743, 0.040053922683000565, 0.043886493891477585, 0.08126524090766907, 0.014979756437242031, 0.04766815900802612, 0.027890317142009735, 0.010188807733356953, -0.07808303087949753, 0.004232214763760567, -0.02774156630039215, -0.029771825298666954, -0.07127391546964645, 0.02302117832005024, 0.012735718861222267, -0.049334023147821426, 0.03932714834809303, 0.04613072797656059, -0.06303440034389496, -0.07641800493001938, -0.050585463643074036, -0.03408646583557129, 0.1295035481452942, 0.01269582286477089, 0.08818448334932327, 0.0747193917632103, -0.09817478060722351, -0.04269816726446152, -0.014836838468909264, 0.00021694329916499555, 0.04558124765753746, -0.011495755985379219, 0.042236048728227615, 0.0551702119410038, -0.006253569852560759, -0.03277374804019928, 0.023790115490555763, 0.10842809826135635, 0.03869180753827095, 0.050217386335134506, -0.045447662472724915, 0.044304922223091125, 0.027194594964385033, 0.07815586030483246, 0.015091137029230595, -5.856189488895325e-8, -0.03736642748117447, -0.06439435482025146, -0.032222189009189606, -0.020552555099129677, -0.02514621801674366, 0.006858800072222948, 0.007202122826129198, 0.04189996421337128, -0.040051594376564026, 0.028487952426075935, 0.05840639770030975, 0.04831298440694809, -0.09181493520736694, 0.025449395179748535, -0.05064054951071739, 0.09729993343353271, 0.01324461679905653, -0.0040179891511797905, -0.02339846082031727, -0.059419937431812286, -0.05317464470863342, 0.05205695331096649, 0.023036761209368706, 0.03219218924641609, 0.009872166439890862, 0.009799618273973465, 0.0011576383840292692, 0.03592682257294655, -0.0025012651458382607, 0.034808121621608734, 0.01733444444835186, -0.018707040697336197, 0.03833368048071861, 0.04168914631009102, -0.007808096706867218, 0.00588965741917491, -0.026560146361589432, 0.033353812992572784, 0.07283054292201996, 0.04695301130414009, 0.011481775902211666, -0.006827319506555796, -0.04696217179298401, -0.05306962504982948, -0.0829927921295166, 0.015000448562204838, -0.09562192857265472, 0.04463919624686241, -0.022629251703619957, 0.04622620344161987, 0.004137820098549128, -0.06631629914045334, 0.033680353313684464, 0.04130999743938446, 0.006982874125242233, -0.02290283516049385, 0.02708236128091812, -0.06991640478372574, 0.02876509167253971, 0.005501291248947382, 0.06499655544757843, -0.06304113566875458, 0.12054294347763062, 0.06327378749847412 ]
0.05407
{ interval: "5m", debounceMs: 15000 }, limits: { maxResults: 6, timeoutMs: 4000 }, scope: { default: "deny", rules: [{ action: "allow", match: { chatType: "direct" } }] }, paths: [ { name: "docs", path: "~/notes", pattern: "\*\*/\*.md" } ] } } ``` \*\*Citations & fallback\*\* - `memory.citations` applies regardless of backend (`auto`/`on`/`off`). - When `qmd` runs, we tag `status().backend = "qmd"` so diagnostics show which engine served the results. If the QMD subprocess exits or JSON output can’t be parsed, the search manager logs a warning and returns the builtin provider (existing Markdown embeddings) until QMD recovers. ### Additional memory paths If you want to index Markdown files outside the default workspace layout, add explicit paths: ```json5 agents: { defaults: { memorySearch: { extraPaths: ["../team-docs", "/srv/shared-notes/overview.md"] } } } ``` Notes: - Paths can be absolute or workspace-relative. - Directories are scanned recursively for `.md` files. - Only Markdown files are indexed. - Symlinks are ignored (files or directories). ### Gemini embeddings (native) Set the provider to `gemini` to use the Gemini embeddings API directly: ```json5 agents: { defaults: { memorySearch: { provider: "gemini", model: "gemini-embedding-001", remote: { apiKey: "YOUR\_GEMINI\_API\_KEY" } } } } ``` Notes: - `remote.baseUrl` is optional (defaults to the Gemini API base URL). - `remote.headers` lets you add extra headers if needed. - Default model: `gemini-embedding-001`. If you want to use a \*\*custom OpenAI-compatible endpoint\*\* (OpenRouter, vLLM, or a proxy), you can use the `remote` configuration with the OpenAI provider: ```json5 agents: { defaults: { memorySearch: { provider: "openai", model: "text-embedding-3-small", remote: { baseUrl: "https://api.example.com/v1/", apiKey: "YOUR\_OPENAI\_COMPAT\_API\_KEY", headers: { "X-Custom-Header": "value" } } } } } ``` If you don't want to set an API key, use `memorySearch.provider = "local"` or set `memorySearch.fallback = "none"`. Fallbacks: - `memorySearch.fallback` can be `openai`, `gemini`, `local`, or `none`. - The fallback provider is only used when the primary embedding provider fails. Batch indexing (OpenAI + Gemini): - Enabled by default for OpenAI and Gemini embeddings. Set `agents.defaults.memorySearch.remote.batch.enabled = false` to disable. - Default behavior waits for batch completion; tune `remote.batch.wait`, `remote.batch.pollIntervalMs`, and `remote.batch.timeoutMinutes` if needed. - Set `remote.batch.concurrency` to control how many batch jobs we submit in parallel (default: 2). - Batch mode applies when `memorySearch.provider = "openai"` or `"gemini"` and uses the corresponding API key. - Gemini batch jobs use the async embeddings batch endpoint and require Gemini Batch API availability. Why OpenAI batch is fast + cheap: - For large backfills, OpenAI is typically the fastest option we support because we can submit many embedding requests in a single batch job and let OpenAI process them asynchronously. - OpenAI offers discounted pricing for Batch API workloads, so large indexing runs are usually cheaper than sending the same requests synchronously. - See the OpenAI Batch API docs and pricing for details: - https://platform.openai.com/docs/api-reference/batch - https://platform.openai.com/pricing Config example: ```json5 agents: { defaults: { memorySearch: { provider: "openai", model: "text-embedding-3-small", fallback: "openai", remote: { batch: { enabled: true, concurrency: 2 } }, sync: { watch: true } } } } ``` Tools: - `memory\_search` — returns snippets with file + line ranges. - `memory\_get` — read memory file content by path. Local mode: - Set `agents.defaults.memorySearch.provider = "local"`. - Provide `agents.defaults.memorySearch.local.modelPath` (GGUF or `hf:` URI). - Optional: set `agents.defaults.memorySearch.fallback = "none"` to avoid remote fallback. ### How the memory tools work - `memory\_search` semantically searches Markdown chunks (~400 token target, 80-token overlap) from `MEMORY.md` + `memory/\*\*/\*.md`. It returns snippet text (capped ~700 chars), file path, line range, score, provider/model, and whether we fell back from local → remote embeddings. No full file payload is returned. - `memory\_get` reads a specific
https://github.com/openclaw/openclaw/blob/main//docs/concepts/memory.md
main
opebclaw
[ -0.09444921463727951, 0.03346100077033043, -0.02251295931637287, 0.034459251910448074, -0.019644180312752724, -0.025576554238796234, -0.06681867688894272, 0.012534497305750847, 0.07641307264566422, 0.014504600316286087, -0.032020460814237595, 0.041514765471220016, 0.013151509687304497, 0.05018387362360954, -0.005248020403087139, 0.10410231351852417, 0.004338651895523071, -0.06328019499778748, -0.02778550609946251, -0.06607386469841003, 0.060032106935977936, 0.11463052034378052, 0.016287436708807945, -0.011210518889129162, -0.01188809797167778, 0.02064141444861889, -0.11467650532722473, -0.010732071474194527, 0.04013330116868019, 0.022524014115333557, 0.04230422154068947, 0.037704311311244965, 0.018599525094032288, -0.016987372189760208, 0.0330837219953537, 0.14205755293369293, -0.021111369132995605, -0.08926527202129364, 0.037123553454875946, -0.030055399984121323, 0.06786340475082397, 0.10598501563072205, -0.09760153293609619, -0.042351629585027695, 0.05265659838914871, -0.07605479657649994, -0.02521313726902008, -0.01738586090505123, -0.08681942522525787, 0.014182659797370434, -0.046921730041503906, 0.019276024773716927, -0.0014799657510593534, 0.03938456252217293, 0.002198769710958004, 0.045424144715070724, -0.034995514899492264, 0.057320594787597656, -0.03991817310452461, 0.0036566294729709625, -0.007120938040316105, -0.07286784797906876, -0.08929959684610367, -0.05389348790049553, 0.0002768244012258947, 0.003959138412028551, 0.013748561963438988, -0.026334039866924286, 0.019191039726138115, 0.045065540820360184, -0.005952333100140095, -0.03427733853459358, -0.044998008757829666, -0.017666533589363098, -0.0013866942608729005, 0.015570380724966526, -0.0589982233941555, -0.05314866453409195, -0.05356893688440323, -0.15143819153308868, 0.019005052745342255, -0.17903022468090057, 0.04447118565440178, -0.00815872848033905, -0.002903405111283064, 0.03418349474668503, -0.01226338092237711, -0.016346031799912453, 0.01900859922170639, -0.004520189482718706, 0.02992234379053116, -0.10972350090742111, 0.04466324299573898, -0.019731301814317703, 0.07970178127288818, -0.011201107874512672, 0.03030121885240078, -0.008501601405441761, 0.11715876311063766, -0.006503381300717592, 0.07403167337179184, 0.06182243674993515, 0.013499113731086254, -0.014142056927084923, 0.07080008089542389, 0.038004763424396515, 0.038812801241874695, 0.07749485224485397, -0.04103643074631691, -0.017497994005680084, -0.011483940295875072, 0.0845804363489151, 0.0955185741186142, -0.017577730119228363, 0.009378221817314625, 0.055004317313432693, 0.03288942575454712, 0.01765243336558342, -0.030221158638596535, 0.09130953997373581, 0.04781830683350563, 0.005312603898346424, -0.035822946578264236, -0.052578408271074295, -0.005129577592015266, 0.061147291213274, -0.09816612303256989, 3.3610671200771656e-33, 0.0712280347943306, -0.08318483829498291, -0.006081482395529747, -0.03798374906182289, 0.05148923024535179, -0.010060897096991539, -0.023922601714730263, 0.015844088047742844, -0.05956776440143585, -0.014353781938552856, 0.044541701674461365, 0.04486771300435066, 0.015883618965744972, -0.03967063128948212, 0.004638239275664091, -0.020741822198033333, 0.05784379318356514, 0.02797129563987255, 0.04869117587804794, 0.02686828188598156, 0.0447472520172596, -0.07586168497800827, -0.10493141412734985, 0.05195273086428642, 0.030131878331303596, 0.08182922750711441, 0.04654930531978607, 0.06212296336889267, -0.049475282430648804, -0.00044688605703413486, -0.14220014214515686, -0.006346969399601221, -0.016704058274626732, -0.07639076560735703, 0.008399931713938713, 0.06046855449676514, -0.05346641689538956, 0.058142129331827164, -0.04506441205739975, -0.13153713941574097, 0.004038405604660511, 0.0048114401288330555, -0.08294558525085449, -0.07822718471288681, -0.10782274603843689, -0.07678429037332535, -0.017314394935965538, -0.032683443278074265, 0.049219872802495956, 0.05666022375226021, -0.01934847980737686, 0.03055078163743019, 0.00914864894002676, 0.020299311727285385, 0.042071759700775146, -0.019575748592615128, 0.013195659033954144, -0.0032455455511808395, 0.002182925585657358, 0.06210332363843918, 0.06443952769041061, -0.015298844315111637, -0.020588595420122147, 0.04339926317334175, 0.009753110818564892, 0.004551104735583067, -0.006097329780459404, 0.037311919033527374, -0.028047483414411545, 0.1369134485721588, -0.019083959981799126, 0.07158169895410538, 0.03111596405506134, 0.05139022320508957, 0.049992822110652924, -0.12675458192825317, -0.032548464834690094, 0.009831264615058899, -0.04161282256245613, -0.043858908116817474, 0.03864961862564087, -0.04179010167717934, -0.05157102644443512, 0.0071400790475308895, 0.049948155879974365, -0.0618126206099987, 0.0073183635249733925, -0.10411100089550018, -0.055340178310871124, -0.03854549676179886, -0.02438821829855442, -0.0428905226290226, 0.006892278790473938, 0.00040499676833860576, -0.11402487009763718, -3.849798365556717e-33, 0.0882192999124527, -0.03891626000404358, -0.019105510786175728, 0.0379101037979126, -0.030990121886134148, -0.005718111991882324, 0.020780541002750397, 0.08679811656475067, 0.0068768467754125595, -0.023299487307667732, 0.013509144075214863, 0.053987056016922, 0.05007662624120712, -0.005964426789432764, -0.05655942112207413, 0.024389270693063736, 0.007743458729237318, -0.10659640282392502, 0.010401582345366478, -0.03301582857966423, 0.009461886249482632, -0.005701293237507343, 0.04029122367501259, 0.08110649138689041, -0.04235155135393143, 0.03291686251759529, -0.009568614885210991, -0.04308097064495087, -0.0449245423078537, -0.050438303500413895, 0.011377410031855106, -0.08531450480222702, -0.1329415738582611, -0.05314194783568382, 0.00872348714619875, -0.018973946571350098, -0.03163556382060051, 0.07897952944040298, -0.027289900928735733, 0.010943492874503136, 0.12109143286943436, 0.06391206383705139, -0.04429427534341812, 0.0546078197658062, 0.0112588070333004, -0.023396825417876244, -0.05285351723432541, 0.006781606003642082, 0.007212725933641195, -0.04319271072745323, 0.039878036826848984, -0.013770787045359612, 0.06816571205854416, 0.016408339142799377, -0.02601899951696396, -0.046460919082164764, 0.07626195251941681, -0.018419673666357994, -0.07318607717752457, 0.03843534737825394, 0.010719831101596355, -0.0219806507229805, -0.11191651225090027, 0.027529440820217133, 0.02297041192650795, -0.031618326902389526, -0.002981564262881875, 0.07631605118513107, 0.05592542886734009, -0.03568281605839729, 0.03116064891219139, -0.001033934997394681, 0.037299055606126785, 0.03557056188583374, -0.000012912519196106587, 0.03179221972823143, -0.05022255331277847, -0.10057254880666733, 0.047800563275814056, 0.006726316176354885, 0.028427187353372574, 0.017965955659747124, -0.019022352993488312, 0.10618013143539429, -0.03594302386045456, -0.023704901337623596, -0.06975414603948593, 0.06524385511875153, -0.04951364919543266, 0.008097995072603226, 0.03982304036617279, -0.024370163679122925, -0.04216128587722778, 0.07770860940217972, 0.02481195330619812, -6.012120934428822e-8, -0.06437293440103531, 0.006514602806419134, -0.06320720165967941, 0.034815456718206406, 0.04670700430870056, -0.007135732565075159, 0.0049524749629199505, 0.019805705174803734, 0.04572482779622078, -0.0147066256031394, 0.05268608778715134, -0.0492045097053051, -0.04953836649656296, 0.0007427230011671782, -0.025991026312112808, -0.01658894680440426, -0.013042070902884007, -0.0037458522710949183, -0.011944846250116825, -0.07606041431427002, -0.03728688880801201, 0.022239504382014275, -0.02374858409166336, -0.017212582752108574, 0.052482929080724716, -0.002546301344409585, 0.048289768397808075, 0.07114969938993454, -0.021948974579572678, 0.020706912502646446, -0.007616641465574503, -0.008252632804214954, -0.0484214685857296, 0.034462980926036835, -0.05724983289837837, -0.058481570333242416, 0.013859933242201805, -0.03802957013249397, 0.002679572207853198, 0.09121935069561005, -0.0013302636798471212, 0.013926022686064243, -0.04507835581898689, 0.03095332346856594, -0.08281271904706955, -0.012260130606591702, -0.04684211313724518, 0.07010748237371445, 0.0712612196803093, -0.005604367237538099, 0.012814313173294067, -0.027343543246388435, 0.04415978491306305, 0.0356818325817585, 0.017997417598962784, -0.0003302249242551625, 0.06072196736931801, -0.013093851506710052, 0.02729206159710884, -0.012871164828538895, 0.11407982558012009, -0.03153928369283676, 0.06299682706594467, 0.03481985628604889 ]
0.069785
work - `memory\_search` semantically searches Markdown chunks (~400 token target, 80-token overlap) from `MEMORY.md` + `memory/\*\*/\*.md`. It returns snippet text (capped ~700 chars), file path, line range, score, provider/model, and whether we fell back from local → remote embeddings. No full file payload is returned. - `memory\_get` reads a specific memory Markdown file (workspace-relative), optionally from a starting line and for N lines. Paths outside `MEMORY.md` / `memory/` are rejected. - Both tools are enabled only when `memorySearch.enabled` resolves true for the agent. ### What gets indexed (and when) - File type: Markdown only (`MEMORY.md`, `memory/\*\*/\*.md`). - Index storage: per-agent SQLite at `~/.openclaw/memory/.sqlite` (configurable via `agents.defaults.memorySearch.store.path`, supports `{agentId}` token). - Freshness: watcher on `MEMORY.md` + `memory/` marks the index dirty (debounce 1.5s). Sync is scheduled on session start, on search, or on an interval and runs asynchronously. Session transcripts use delta thresholds to trigger background sync. - Reindex triggers: the index stores the embedding \*\*provider/model + endpoint fingerprint + chunking params\*\*. If any of those change, OpenClaw automatically resets and reindexes the entire store. ### Hybrid search (BM25 + vector) When enabled, OpenClaw combines: - \*\*Vector similarity\*\* (semantic match, wording can differ) - \*\*BM25 keyword relevance\*\* (exact tokens like IDs, env vars, code symbols) If full-text search is unavailable on your platform, OpenClaw falls back to vector-only search. #### Why hybrid? Vector search is great at “this means the same thing”: - “Mac Studio gateway host” vs “the machine running the gateway” - “debounce file updates” vs “avoid indexing on every write” But it can be weak at exact, high-signal tokens: - IDs (`a828e60`, `b3b9895a…`) - code symbols (`memorySearch.query.hybrid`) - error strings (“sqlite-vec unavailable”) BM25 (full-text) is the opposite: strong at exact tokens, weaker at paraphrases. Hybrid search is the pragmatic middle ground: \*\*use both retrieval signals\*\* so you get good results for both “natural language” queries and “needle in a haystack” queries. #### How we merge results (the current design) Implementation sketch: 1. Retrieve a candidate pool from both sides: - \*\*Vector\*\*: top `maxResults \* candidateMultiplier` by cosine similarity. - \*\*BM25\*\*: top `maxResults \* candidateMultiplier` by FTS5 BM25 rank (lower is better). 2. Convert BM25 rank into a 0..1-ish score: - `textScore = 1 / (1 + max(0, bm25Rank))` 3. Union candidates by chunk id and compute a weighted score: - `finalScore = vectorWeight \* vectorScore + textWeight \* textScore` Notes: - `vectorWeight` + `textWeight` is normalized to 1.0 in config resolution, so weights behave as percentages. - If embeddings are unavailable (or the provider returns a zero-vector), we still run BM25 and return keyword matches. - If FTS5 can’t be created, we keep vector-only search (no hard failure). This isn’t “IR-theory perfect”, but it’s simple, fast, and tends to improve recall/precision on real notes. If we want to get fancier later, common next steps are Reciprocal Rank Fusion (RRF) or score normalization (min/max or z-score) before mixing. Config: ```json5 agents: { defaults: { memorySearch: { query: { hybrid: { enabled: true, vectorWeight: 0.7, textWeight: 0.3, candidateMultiplier: 4 } } } } } ``` ### Embedding cache OpenClaw can cache \*\*chunk embeddings\*\* in SQLite so reindexing and frequent updates (especially session transcripts) don't re-embed unchanged text. Config: ```json5 agents: { defaults: { memorySearch: { cache: { enabled: true, maxEntries: 50000 } } } } ``` ### Session memory search (experimental) You can optionally index \*\*session transcripts\*\* and surface them via `memory\_search`. This is gated behind an experimental flag. ```json5 agents: { defaults: { memorySearch: { experimental: { sessionMemory: true }, sources: ["memory", "sessions"] } } } ``` Notes: - Session indexing is \*\*opt-in\*\* (off by default). - Session updates
https://github.com/openclaw/openclaw/blob/main//docs/concepts/memory.md
main
opebclaw
[ 0.009926130063831806, 0.016214948147535324, -0.10599066317081451, 0.07276918739080429, -0.002780328970402479, -0.0031024315394461155, -0.030844461172819138, 0.028051529079675674, -0.008790775202214718, 0.006623093970119953, -0.023742245510220528, 0.08599502593278885, 0.050231847912073135, 0.020873431116342545, 0.03168441727757454, 0.05462873354554176, -0.014578809030354023, 0.03230833634734154, 0.005063106771558523, 0.03392984718084335, 0.0803913027048111, 0.08170285075902939, 0.040701817721128464, -0.012905050069093704, -0.02630937285721302, -0.02900613099336624, -0.0756777822971344, -0.06598451733589172, 0.011114470660686493, -0.006360664498060942, 0.06739712506532669, 0.0199256781488657, -0.0719350054860115, 0.09733950346708298, 0.10618788748979568, 0.14447207748889923, -0.03505181893706322, -0.061135176569223404, -0.02005939371883869, -0.05761829763650894, 0.08455467969179153, 0.09384823590517044, -0.04023751616477966, 0.004430546425282955, -0.011575864627957344, -0.02642635442316532, 0.011760463938117027, -0.0651128813624382, -0.03567836061120033, -0.07396341860294342, -0.11910238116979599, 0.024557258933782578, -0.05075054615736008, 0.05865423008799553, 0.0386623740196228, 0.02562391199171543, -0.037488702684640884, -0.03657326474785805, -0.05106601119041443, -0.0009473329409956932, -0.03782861307263374, -0.05358317494392395, -0.011858675628900528, -0.0628620833158493, -0.04046322777867317, 0.010418840683996677, 0.04513252526521683, -0.024074794724583626, 0.01891685277223587, -0.053901687264442444, -0.05204372480511665, -0.04244010150432587, -0.08329792320728302, 0.0400417260825634, -0.023036682978272438, 0.11710388213396072, 0.045779332518577576, 0.009776587598025799, 0.013938740827143192, -0.1721523106098175, -0.06628723442554474, -0.11717410385608673, 0.03586544841527939, 0.0274812001734972, 0.0033497028052806854, 0.015688173472881317, 0.04773464426398277, -0.03960772976279259, 0.1131737157702446, -0.03905559331178665, 0.05774068459868431, -0.05571836605668068, -0.046942587941884995, 0.028451181948184967, 0.04273630678653717, -0.02733486331999302, 0.050842609256505966, 0.05479147657752037, -0.020380955189466476, 0.03438671678304672, 0.04551979899406433, 0.07450588047504425, 0.06356172263622284, -0.006260459311306477, -0.04830767214298248, 0.04837426543235779, 0.07102426141500473, 0.0481070950627327, -0.027239788323640823, -0.03592945262789726, 0.003819218371063471, 0.03327041491866112, 0.04550662264227867, -0.005790733266621828, 0.05331902578473091, -0.018154269084334373, -0.0009696113411337137, -0.05416988953948021, -0.04164046421647072, 0.10779666900634766, 0.005068028345704079, -0.009838447906076908, -0.05391924828290939, -0.027238406240940094, -0.010019576177001, 0.04729252681136131, -0.027439387515187263, 2.8053609819335603e-33, 0.03899514675140381, -0.05619283393025398, 0.0002772812149487436, 0.02901003509759903, 0.053932953625917435, 0.009825562126934528, -0.01687932014465332, 0.04984523728489876, -0.07543601840734482, 0.04705522209405899, -0.030879484489560127, -0.02212069183588028, -0.026155810803174973, 0.05104350298643112, 0.009815631434321404, -0.021553440019488335, 0.0073289694264531136, 0.01204457227140665, -0.03410518169403076, 0.06765653192996979, -0.050168365240097046, 0.04894697293639183, -0.047654155641794205, -0.041278939694166183, -0.016643110662698746, 0.016218196600675583, -0.04729905351996422, -0.0941128358244896, 0.05069167539477348, 0.013301996514201164, -0.07737428694963455, -0.023575501516461372, -0.03137286379933357, 0.0062964786775410175, 0.006727717816829681, 0.03451645001769066, -0.06049491837620735, -0.021390240639448166, -0.06086959317326546, -0.08152695745229721, 0.08386555314064026, 0.028166860342025757, 0.03194795176386833, -0.051590822637081146, -0.1331973373889923, -0.09908291697502136, -0.04069933667778969, -0.041468217968940735, 0.011806356720626354, 0.019769633188843727, 0.027136554941534996, 0.03654623031616211, -0.01015615463256836, 0.01882142201066017, 0.06274774670600891, -0.01486777700483799, -0.01599639467895031, 0.037980031222105026, 0.09554141014814377, 0.08745496720075607, -0.03556646406650543, -0.04904203861951828, 0.06504388898611069, 0.044106896966695786, 0.08221903443336487, -0.0029678933788090944, 0.052988726645708084, 0.07912859320640564, -0.010143186897039413, 0.06772071123123169, 0.017281783744692802, 0.018718194216489792, 0.09937521815299988, 0.02743644081056118, 0.005853013601154089, -0.09994365274906158, 0.008459575474262238, -0.09145619720220566, -0.029753290116786957, -0.01119355857372284, 0.02192552015185356, -0.04416835308074951, -0.02410716935992241, -0.016678839921951294, -0.03610481694340706, -0.038842152804136276, -0.015076476149260998, -0.14085978269577026, 0.016725504770874977, -0.04829147830605507, 0.02809356339275837, -0.0735030472278595, -0.018276125192642212, -0.05023811757564545, -0.10261907428503036, -4.357212991716635e-33, 0.01604427769780159, -0.0644133910536766, -0.04493105411529541, 0.004516492132097483, -0.05781056731939316, -0.05943239852786064, 0.022137735038995743, -0.013578664511442184, -0.07051530480384827, -0.0036080011632293463, -0.018014509230852127, -0.0004044946108479053, 0.045368731021881104, -0.07594316452741623, -0.05724780261516571, 0.04047538712620735, 0.04119182378053665, -0.08980558067560196, 0.059841472655534744, 0.00275409291498363, -0.040807392448186874, 0.043668754398822784, 0.04182345047593117, 0.10083404183387756, 0.03185851499438286, 0.07339567691087723, 0.0007326460909098387, 0.023294975981116295, -0.020158471539616585, -0.05722952261567116, 0.008628034964203835, 0.038055021315813065, -0.07844383269548416, -0.04386191442608833, -0.08514255285263062, -0.003981881774961948, -0.05662591755390167, 0.039758116006851196, -0.0041356575675308704, 0.0018959959270432591, 0.13213616609573364, 0.056135743856430054, -0.041093047708272934, 0.021485410630702972, 0.02659681811928749, -0.024002917110919952, -0.060213007032871246, 0.08333513885736465, 0.06526201963424683, -0.007493691053241491, 0.018860481679439545, -0.030674511566758156, 0.016308534890413284, -0.001316429115831852, -0.01637565717101097, -0.04192044213414192, 0.016608774662017822, -0.03400217741727829, -0.07703446596860886, -0.05488758534193039, 0.003749098163098097, 0.0007029687985777855, -0.1086549386382103, -0.050938189029693604, -0.02646659128367901, 0.03392190858721733, 0.019428860396146774, 0.007117613684386015, -0.030807575210928917, -0.0018431908683851361, -0.005907001439481974, -0.0448145717382431, 0.035724081099033356, 0.03411171957850456, 0.040280986577272415, 0.10180526971817017, -0.03138059377670288, -0.04372682049870491, 0.00724700465798378, 0.012441297061741352, -0.010575585067272186, 0.0461239293217659, 0.00006996579759288579, 0.06294216960668564, 0.0220094695687294, 0.002776108914986253, -0.13492222130298615, 0.13742481172084808, -0.07812594622373581, -0.02060777135193348, -0.013849197886884212, -0.038367126137018204, -0.039077308028936386, 0.05702342838048935, 0.011895625852048397, -5.368861621946053e-8, -0.0081082284450531, -0.009048200212419033, -0.029607605189085007, -0.015304586850106716, -0.00878934282809496, -0.030634228140115738, -0.02618340030312538, 0.08601409196853638, 0.02840747870504856, 0.0072691780515015125, 0.0963326096534729, -0.09304271638393402, -0.10633981227874756, 0.007516064681112766, -0.015596214681863785, 0.020497966557741165, 0.011911815963685513, 0.01757594384253025, -0.04636218771338463, -0.06469801068305969, -0.05367725342512131, 0.028174612671136856, -0.0006413673399947584, 0.03338896483182907, 0.04935421049594879, 0.05380762740969658, 0.02116321213543415, 0.11328930407762527, -0.04564979299902916, 0.023265415802598, 0.05540240556001663, 0.014051102101802826, -0.007389651611447334, -0.019978130236268044, 0.018458692356944084, 0.048045236617326736, 0.04928809776902199, -0.0032497115898877382, 0.005873250309377909, 0.03028756007552147, 0.04570908471941948, 0.008336685597896576, 0.007341440767049789, -0.01013239286839962, -0.004405864514410496, -0.02601061761379242, -0.08482812345027924, 0.051070183515548706, 0.06070145592093468, -0.05573897808790207, -0.039198581129312515, 0.033412765711545944, -0.0315338633954525, 0.09090675413608551, 0.019902359694242477, -0.053150419145822525, 0.004584446549415588, -0.04547564312815666, 0.035648927092552185, 0.02351604960858822, 0.06928624212741852, -0.08900099247694016, 0.002884572371840477, 0.021608369424939156 ]
0.057889
(experimental) You can optionally index \*\*session transcripts\*\* and surface them via `memory\_search`. This is gated behind an experimental flag. ```json5 agents: { defaults: { memorySearch: { experimental: { sessionMemory: true }, sources: ["memory", "sessions"] } } } ``` Notes: - Session indexing is \*\*opt-in\*\* (off by default). - Session updates are debounced and \*\*indexed asynchronously\*\* once they cross delta thresholds (best-effort). - `memory\_search` never blocks on indexing; results can be slightly stale until background sync finishes. - Results still include snippets only; `memory\_get` remains limited to memory files. - Session indexing is isolated per agent (only that agent’s session logs are indexed). - Session logs live on disk (`~/.openclaw/agents//sessions/\*.jsonl`). Any process/user with filesystem access can read them, so treat disk access as the trust boundary. For stricter isolation, run agents under separate OS users or hosts. Delta thresholds (defaults shown): ```json5 agents: { defaults: { memorySearch: { sync: { sessions: { deltaBytes: 100000, // ~100 KB deltaMessages: 50 // JSONL lines } } } } } ``` ### SQLite vector acceleration (sqlite-vec) When the sqlite-vec extension is available, OpenClaw stores embeddings in a SQLite virtual table (`vec0`) and performs vector distance queries in the database. This keeps search fast without loading every embedding into JS. Configuration (optional): ```json5 agents: { defaults: { memorySearch: { store: { vector: { enabled: true, extensionPath: "/path/to/sqlite-vec" } } } } } ``` Notes: - `enabled` defaults to true; when disabled, search falls back to in-process cosine similarity over stored embeddings. - If the sqlite-vec extension is missing or fails to load, OpenClaw logs the error and continues with the JS fallback (no vector table). - `extensionPath` overrides the bundled sqlite-vec path (useful for custom builds or non-standard install locations). ### Local embedding auto-download - Default local embedding model: `hf:ggml-org/embeddinggemma-300M-GGUF/embeddinggemma-300M-Q8\_0.gguf` (~0.6 GB). - When `memorySearch.provider = "local"`, `node-llama-cpp` resolves `modelPath`; if the GGUF is missing it \*\*auto-downloads\*\* to the cache (or `local.modelCacheDir` if set), then loads it. Downloads resume on retry. - Native build requirement: run `pnpm approve-builds`, pick `node-llama-cpp`, then `pnpm rebuild node-llama-cpp`. - Fallback: if local setup fails and `memorySearch.fallback = "openai"`, we automatically switch to remote embeddings (`openai/text-embedding-3-small` unless overridden) and record the reason. ### Custom OpenAI-compatible endpoint example ```json5 agents: { defaults: { memorySearch: { provider: "openai", model: "text-embedding-3-small", remote: { baseUrl: "https://api.example.com/v1/", apiKey: "YOUR\_REMOTE\_API\_KEY", headers: { "X-Organization": "org-id", "X-Project": "project-id" } } } } } ``` Notes: - `remote.\*` takes precedence over `models.providers.openai.\*`. - `remote.headers` merge with OpenAI headers; remote wins on key conflicts. Omit `remote.headers` to use the OpenAI defaults.
https://github.com/openclaw/openclaw/blob/main//docs/concepts/memory.md
main
opebclaw
[ -0.05244947597384453, 0.08337228000164032, -0.0659525915980339, 0.08275305479764938, 0.03982362523674965, -0.02177453599870205, 0.031266551464796066, -0.025966420769691467, 0.020203962922096252, 0.02003440074622631, -0.019294893369078636, 0.05675097182393074, -0.01879291795194149, 0.005598868243396282, 0.04494708776473999, 0.006475139409303665, -0.013101594522595406, 0.050691694021224976, -0.04431891441345215, -0.06304115802049637, 0.06026090681552887, 0.04008001834154129, -0.0010296291438862681, -0.051212139427661896, -0.06758564710617065, 0.017102239653468132, -0.05771584436297417, -0.10175617784261703, 0.07747605443000793, 0.0074695320799946785, -0.032012101262807846, 0.08280900865793228, -0.04083244875073433, 0.033811233937740326, 0.029106849804520607, 0.046125996857881546, -0.04948178306221962, -0.040837086737155914, 0.05085035786032677, -0.05606643110513687, 0.03366236388683319, 0.08148405700922012, -0.09508602321147919, 0.004995930939912796, -0.02240162156522274, -0.05132409930229187, -0.05528382211923599, -0.058133624494075775, -0.06905080378055573, -0.017748622223734856, -0.10443636775016785, 0.05197354406118393, 0.0344574972987175, 0.02064351551234722, -0.022818004712462425, 0.00985442940145731, -0.02851635403931141, 0.0027412313502281904, -0.04278659075498581, 0.04869353398680687, 0.011621125973761082, -0.05890943855047226, -0.06339343637228012, -0.020904498174786568, -0.031474463641643524, -0.04726269096136093, 0.09001141786575317, -0.03338836878538132, 0.1166573166847229, -0.030740339308977127, -0.0275292806327343, -0.001789514091797173, -0.04274739325046539, -0.03835950046777725, -0.0051947725005447865, 0.03564966097474098, 0.028168797492980957, -0.03109009936451912, -0.02231754921376705, -0.08411688357591629, -0.05921090021729469, -0.09783034026622772, 0.08886297047138214, -0.013903876766562462, -0.06336434930562973, -0.005581495352089405, -0.008147134445607662, -0.014410682953894138, 0.04135805740952492, 0.02912464737892151, 0.0237431637942791, -0.08607794344425201, -0.04255238175392151, -0.03024989366531372, 0.018092233687639236, 0.061744462698698044, 0.04088546335697174, 0.06658998876810074, 0.0391506627202034, 0.0711866021156311, 0.05856902152299881, 0.067406564950943, 0.011608663015067577, 0.08143484592437744, -0.055241797119379044, 0.022474728524684906, 0.003163084853440523, -0.025852283462882042, -0.025204025208950043, 0.0007167165749706328, 0.00386373745277524, 0.08569483458995819, 0.07498001307249069, -0.0022855419665575027, 0.0014531459892168641, -0.016748884692788124, 0.011537272483110428, -0.018354712054133415, 0.023817071691155434, 0.16670601069927216, 0.12786172330379486, -0.018117833882570267, 0.04486723244190216, 0.010249486193060875, 0.02157452143728733, 0.05349753051996231, -0.01831940934062004, 3.438294160190313e-33, 0.07125630229711533, -0.039311498403549194, -0.03356006368994713, -0.026191208511590958, -0.05676346272230148, 0.04316328465938568, 0.053841449320316315, 0.02717338502407074, -0.041229672729969025, 0.03533923625946045, -0.08011581003665924, 0.07132966816425323, -0.0011619842844083905, 0.019427886232733727, -0.01006547175347805, -0.015433752909302711, -0.034983791410923004, 0.047985468059778214, 0.02446151338517666, 0.02619735710322857, 0.01807626709342003, 0.02230515331029892, 0.015975596383213997, -0.017263058573007584, 0.026228876784443855, -0.022233622148633003, -0.022291772067546844, -0.06622201204299927, -0.008330251090228558, 0.043065570294857025, -0.016902059316635132, 0.01708870194852352, 0.00912731233984232, 0.03640967234969139, 0.08852585405111313, 0.07067064195871353, -0.06584787368774414, 0.03181453421711922, -0.014627437107264996, -0.12752629816532135, -0.02100280113518238, 0.03751596063375473, -0.040053971111774445, -0.06949807703495026, -0.11543052643537521, -0.10328762978315353, -0.11315841227769852, -0.03717392310500145, 0.021870514377951622, 0.022550811991095543, -0.018857479095458984, 0.09797793626785278, -0.040337663143873215, 0.008967883884906769, 0.05097578838467598, 0.019450755789875984, 0.0617256723344326, 0.01920982636511326, 0.012090370059013367, 0.12572483718395233, -0.011826987378299236, -0.032551359385252, 0.0003799332771450281, 0.012024383060634136, -0.003728927345946431, 0.055037543177604675, -0.03255927562713623, 0.02611967921257019, 0.006314249709248543, 0.04334917664527893, -0.021640164777636528, 0.07440035790205002, 0.051759060472249985, -0.015317082405090332, -0.019199693575501442, -0.09109798818826675, 0.012571600265800953, 0.04538973420858383, -0.05374995619058609, -0.0180667657405138, 0.10792705416679382, -0.046533674001693726, -0.018330687656998634, 0.0612916462123394, -0.04509776830673218, -0.034371815621852875, -0.023321937769651413, -0.08720842003822327, 0.002068767324090004, -0.0395112968981266, 0.007912353612482548, -0.020902538672089577, 0.0166854839771986, -0.053176019340753555, -0.07877662777900696, -5.0822751723770996e-33, 0.009327848441898823, -0.0698474869132042, -0.017219943925738335, 0.02205490879714489, -0.056881632655858994, -0.04289400577545166, 0.024124151095747948, -0.07947394996881485, -0.07716252654790878, -0.02045532315969467, -0.04230888932943344, 0.04223211854696274, 0.037931784987449646, -0.012008020654320717, -0.04879472404718399, 0.09414961189031601, -0.002905795583501458, -0.038938652724027634, 0.013866197317838669, 0.034410785883665085, -0.026293471455574036, 0.07479926198720932, -0.006327210925519466, 0.03809488192200661, 0.023947976529598236, -0.05824047699570656, -0.01530004944652319, -0.006410342641174793, -0.036578696221113205, -0.04962151497602463, 0.022324372082948685, -0.0059534781612455845, -0.08340813219547272, -0.02785654179751873, 0.011299323290586472, -0.0019947285763919353, 0.004162587691098452, 0.04168866574764252, -0.04784175381064415, 0.029890049248933792, 0.0786404013633728, 0.05889173224568367, -0.02944980375468731, 0.013173844665288925, 0.04109354317188263, 0.001115588005632162, -0.18209855258464813, 0.06402937322854996, -0.04630766436457634, -0.00779788987711072, 0.0033556770067662, 0.0025266027078032494, -0.03175730258226395, -0.050604235380887985, -0.006573186721652746, -0.0734720528125763, -0.02291656658053398, -0.025193307548761368, -0.04766395688056946, 0.01387549377977848, 0.014286253601312637, -0.05891411006450653, -0.10876590013504028, 0.022072071209549904, 0.0062945252284407616, -0.05008365958929062, 0.002273335587233305, 0.013640839606523514, 0.023373475298285484, -0.022829635068774223, 0.03646881878376007, -0.09672049432992935, -0.022014077752828598, 0.0657445564866066, 0.006046860478818417, 0.038187652826309204, 0.0008786166436038911, -0.1311805248260498, 0.01519568171352148, 0.02819811925292015, -0.11114215105772018, 0.0639968290925026, -0.005651611834764481, 0.056672848761081696, 0.03271957486867905, 0.053346723318099976, -0.06721960753202438, 0.11721456050872803, -0.04071477800607681, -0.02631429396569729, -0.026751186698675156, -0.009043131023645401, -0.08376216143369675, -0.007511175237596035, 0.08286529034376144, -4.982030432643114e-8, -0.02001626417040825, -0.09172852337360382, 0.021568594500422478, 0.13437366485595703, 0.03607943654060364, -0.032304659485816956, -0.01117582619190216, 0.10352923721075058, -0.013519354164600372, -0.009745010174810886, 0.11653220653533936, 0.008795861154794693, -0.0620562769472599, -0.021592674776911736, 0.019137416034936905, 0.05183432623744011, -0.0131737245246768, 0.012553543783724308, -0.028345709666609764, -0.059809036552906036, -0.04959645867347717, 0.07380212098360062, 0.06483033299446106, 0.025168990716338158, 0.022047197446227074, -0.029537640511989594, 0.07662053406238556, 0.09895054996013641, -0.0367339551448822, -0.01633911021053791, 0.0025967243127524853, 0.021183423697948456, -0.012570693157613277, -0.04887111112475395, 0.03482639789581299, -0.0034750078339129686, -0.02776901051402092, -0.02114463597536087, -0.06262534856796265, 0.07514537125825882, 0.005108857527375221, 0.027300063520669937, 0.022893046960234642, 0.04690023139119148, 0.010457275435328484, 0.0028902441263198853, -0.08868051320314407, 0.03540981560945511, 0.08563210070133209, -0.08443722128868103, -0.024236397817730904, -0.006934757810086012, -0.05307013913989067, 0.08706209063529968, 0.015946974977850914, 0.01586112007498741, 0.02168848365545273, -0.02384541742503643, 0.07680507749319077, 0.0058570983819663525, 0.06569594889879227, 0.013571945950388908, -0.06277067959308624, -0.0826428234577179 ]
0.143296
# TypeBox as protocol source of truth Last updated: 2026-01-10 TypeBox is a TypeScript-first schema library. We use it to define the \*\*Gateway WebSocket protocol\*\* (handshake, request/response, server events). Those schemas drive \*\*runtime validation\*\*, \*\*JSON Schema export\*\*, and \*\*Swift codegen\*\* for the macOS app. One source of truth; everything else is generated. If you want the higher-level protocol context, start with [Gateway architecture](/concepts/architecture). ## Mental model (30 seconds) Every Gateway WS message is one of three frames: - \*\*Request\*\*: `{ type: "req", id, method, params }` - \*\*Response\*\*: `{ type: "res", id, ok, payload | error }` - \*\*Event\*\*: `{ type: "event", event, payload, seq?, stateVersion? }` The first frame \*\*must\*\* be a `connect` request. After that, clients can call methods (e.g. `health`, `send`, `chat.send`) and subscribe to events (e.g. `presence`, `tick`, `agent`). Connection flow (minimal): ``` Client Gateway |---- req:connect -------->| |<---- res:hello-ok --------| |<---- event:tick ----------| |---- req:health ---------->| |<---- res:health ----------| ``` Common methods + events: | Category | Examples | Notes | | --------- | --------------------------------------------------------- | ---------------------------------- | | Core | `connect`, `health`, `status` | `connect` must be first | | Messaging | `send`, `poll`, `agent`, `agent.wait` | side-effects need `idempotencyKey` | | Chat | `chat.history`, `chat.send`, `chat.abort`, `chat.inject` | WebChat uses these | | Sessions | `sessions.list`, `sessions.patch`, `sessions.delete` | session admin | | Nodes | `node.list`, `node.invoke`, `node.pair.\*` | Gateway WS + node actions | | Events | `tick`, `presence`, `agent`, `chat`, `health`, `shutdown` | server push | Authoritative list lives in `src/gateway/server.ts` (`METHODS`, `EVENTS`). ## Where the schemas live - Source: `src/gateway/protocol/schema.ts` - Runtime validators (AJV): `src/gateway/protocol/index.ts` - Server handshake + method dispatch: `src/gateway/server.ts` - Node client: `src/gateway/client.ts` - Generated JSON Schema: `dist/protocol.schema.json` - Generated Swift models: `apps/macos/Sources/OpenClawProtocol/GatewayModels.swift` ## Current pipeline - `pnpm protocol:gen` - writes JSON Schema (draft‑07) to `dist/protocol.schema.json` - `pnpm protocol:gen:swift` - generates Swift gateway models - `pnpm protocol:check` - runs both generators and verifies the output is committed ## How the schemas are used at runtime - \*\*Server side\*\*: every inbound frame is validated with AJV. The handshake only accepts a `connect` request whose params match `ConnectParams`. - \*\*Client side\*\*: the JS client validates event and response frames before using them. - \*\*Method surface\*\*: the Gateway advertises the supported `methods` and `events` in `hello-ok`. ## Example frames Connect (first message): ```json { "type": "req", "id": "c1", "method": "connect", "params": { "minProtocol": 2, "maxProtocol": 2, "client": { "id": "openclaw-macos", "displayName": "macos", "version": "1.0.0", "platform": "macos 15.1", "mode": "ui", "instanceId": "A1B2" } } } ``` Hello-ok response: ```json { "type": "res", "id": "c1", "ok": true, "payload": { "type": "hello-ok", "protocol": 2, "server": { "version": "dev", "connId": "ws-1" }, "features": { "methods": ["health"], "events": ["tick"] }, "snapshot": { "presence": [], "health": {}, "stateVersion": { "presence": 0, "health": 0 }, "uptimeMs": 0 }, "policy": { "maxPayload": 1048576, "maxBufferedBytes": 1048576, "tickIntervalMs": 30000 } } } ``` Request + response: ```json { "type": "req", "id": "r1", "method": "health" } ``` ```json { "type": "res", "id": "r1", "ok": true, "payload": { "ok": true } } ``` Event: ```json { "type": "event", "event": "tick", "payload": { "ts": 1730000000 }, "seq": 12 } ``` ## Minimal client (Node.js) Smallest useful flow: connect + health. ```ts import { WebSocket } from "ws"; const ws = new WebSocket("ws://127.0.0.1:18789"); ws.on("open", () => { ws.send( JSON.stringify({ type: "req", id: "c1", method: "connect", params: { minProtocol: 3, maxProtocol: 3, client: { id: "cli", displayName: "example", version: "dev", platform: "node", mode: "cli", }, }, }), ); }); ws.on("message", (data) => { const msg = JSON.parse(String(data)); if (msg.type === "res" && msg.id === "c1" && msg.ok) { ws.send(JSON.stringify({ type: "req", id: "h1", method: "health"
https://github.com/openclaw/openclaw/blob/main//docs/concepts/typebox.md
main
opebclaw
[ -0.020540833473205566, -0.030534442514181137, -0.001371055725030601, 0.02081719972193241, -0.009632095694541931, -0.040377359837293625, 0.0230368934571743, -0.028555456548929214, 0.008196856826543808, -0.044449854642152786, -0.07227936387062073, -0.03380359709262848, -0.07757166028022766, 0.08628316223621368, 0.06774219870567322, 0.03491015359759331, 0.08641423285007477, -0.08593718707561493, -0.006665709428489208, -0.05773741751909256, 0.044197384268045425, -0.038709063082933426, -0.005454304162412882, 0.04681449010968208, -0.080299973487854, -0.024358218535780907, 0.017965182662010193, -0.04936760663986206, 0.0368475504219532, 0.008150078356266022, 0.013307922519743443, 0.014510867185890675, -0.05830005183815956, 0.04311176389455795, 0.024396264925599098, 0.009364399127662182, 0.08815880119800568, -0.014959178864955902, -0.048096999526023865, -0.024694250896573067, -0.0035454262979328632, -0.0393035002052784, 0.019819458946585655, 0.0345320850610733, 0.030270209535956383, -0.04077693074941635, -0.03348059579730034, -0.001917754183523357, -0.05588006600737572, -0.033041346818208694, -0.0287115927785635, 0.0138566754758358, -0.019041679799556732, 0.06417451798915863, 0.10467485338449478, 0.025771260261535645, -0.04545337334275246, 0.042726460844278336, 0.018071215599775314, 0.011557130143046379, -0.0015822411514818668, -0.03276129439473152, 0.022484581917524338, -0.007185062393546104, -0.018401898443698883, 0.06671418249607086, -0.026837807148694992, 0.00923486240208149, 0.027212508022785187, 0.015623985789716244, 0.0067156776785850525, -0.011010480113327503, -0.03220458701252937, 0.000164607452461496, -0.01783783920109272, -0.04202866554260254, 0.05049438029527664, -0.018976395949721336, -0.03464266285300255, -0.0030934400856494904, -0.015577198937535286, -0.010089147835969925, -0.02420169860124588, 0.12754327058792114, 0.02714918553829193, -0.016637533903121948, -0.05381971597671509, -0.012224231846630573, -0.007103668991476297, 0.12893621623516083, -0.02739792689681053, -0.06674954295158386, 0.04195079207420349, 0.06028951704502106, 0.0740610659122467, 0.054118864238262177, -0.07379355281591415, -0.05430461838841438, -0.03155936300754547, 0.04076046124100685, -0.027352573350071907, -0.03941496089100838, 0.01875791698694229, -0.01114350464195013, 0.06196977198123932, 0.01671472378075123, -0.008330211974680424, 0.023427803069353104, -0.007010360714048147, 0.08610998094081879, -0.04133499413728714, 0.0016728071495890617, 0.014309561811387539, -0.002875111997127533, -0.08027715981006622, 0.057847119867801666, -0.06817023456096649, 0.036219991743564606, -0.0047734822146594524, 0.054067857563495636, 0.06792770326137543, -0.004755366127938032, 0.028999043628573418, 0.014241648837924004, 0.02189621701836586, -0.06042641028761864, 0.06961914151906967, 6.519383505156565e-33, -0.06579248607158661, 0.013303868472576141, -0.062200553715229034, 0.03651142865419388, 0.05718724802136421, -0.02453632652759552, 0.08215857297182083, -0.021301282569766045, -0.06022915989160538, 0.0037141030188649893, -0.047072410583496094, 0.011128721758723259, -0.07089533656835556, -0.02481437847018242, 0.005150503944605589, -0.039419546723365784, -0.016612771898508072, 0.03016219101846218, 0.03578507527709007, 0.0705161765217781, 0.02977145090699196, -0.02461090311408043, -0.05788514390587807, 0.01025629322975874, -0.019998697564005852, 0.03165159374475479, 0.0043547749519348145, 0.0177900530397892, -0.013413503766059875, 0.011792178265750408, -0.0023698783479630947, -0.02311198227107525, 0.022937607020139694, -0.001008473103865981, 0.06422391533851624, -0.033597540110349655, 0.04906631261110306, -0.029962731525301933, -0.07148795574903488, 0.00685921311378479, -0.024920986965298653, -0.001436621998436749, -0.16139335930347443, 0.018396226689219475, 0.016561072319746017, -0.08704157173633575, -0.05532367527484894, 0.0070008039474487305, 0.013495211489498615, -0.021395433694124222, -0.06319448351860046, 0.012742561288177967, 0.02734919637441635, -0.01841956004500389, 0.05663089454174042, -0.07365076243877411, 0.03366779163479805, 0.0733216181397438, 0.049154482781887054, 0.018262024968862534, -0.03242659196257591, -0.06327394396066666, -0.01260269246995449, -0.08053223788738251, 0.10719691216945648, 0.05762213096022606, -0.1539517641067505, -0.07029006630182266, -0.07399643212556839, -0.02221999317407608, 0.0009167129755951464, 0.0940655991435051, -0.059614431113004684, 0.05735176429152489, -0.039451468735933304, -0.03480260819196701, 0.0062203798443078995, 0.07036406546831131, -0.013135750778019428, -0.039154645055532455, 0.0031331090722233057, 0.009152851067483425, -0.0019357866840437055, 0.1033494770526886, 0.03730176016688347, 0.051998335868120193, -0.02307300828397274, -0.03270509093999863, -0.051277559250593185, 0.06355094909667969, -0.10275840014219284, -0.03919857740402222, 0.07818600535392761, -0.021929088979959488, -0.09075674414634705, -5.99453372638006e-33, 0.003005694132298231, 0.024668067693710327, -0.09853218495845795, 0.06794702261686325, -0.04318912699818611, -0.05428466945886612, 0.021020570769906044, 0.06582612544298172, 0.03236982971429825, 0.051798366010189056, 0.012486767023801804, -0.07118485867977142, 0.06696995347738266, -0.06100745499134064, -0.014097764156758785, -0.04105645418167114, -0.011274205520749092, -0.11704094707965851, -0.010723789222538471, 0.017326267436146736, 0.005999387241899967, 0.0019904247019439936, -0.058335620909929276, -0.01093233935534954, -0.029045579954981804, 0.06200231611728668, 0.02706974931061268, 0.055030517280101776, -0.099471814930439, -0.00009953494736691937, -0.014053227379918098, 0.0034580365754663944, 0.01371642667800188, -0.0163758285343647, 0.02535112015902996, 0.0241395290941, 0.0879625603556633, 0.09541304409503937, 0.016147401183843613, -0.005777495913207531, 0.07601357996463776, -0.0005969342309981585, -0.09315561503171921, -0.003471612697467208, -0.0023314307909458876, 0.1020844578742981, -0.07951656728982925, 0.06763365119695663, 0.004072946030646563, -0.03419896215200424, 0.04835394397377968, -0.03526420146226883, -0.01674909144639969, 0.025579702109098434, -0.013026668690145016, 0.03890546038746834, 0.026734374463558197, -0.07037825137376785, 0.028026696294546127, -0.008137347176671028, 0.014121798798441887, -0.12534454464912415, -0.006438512820750475, 0.016118528321385384, 0.10339098423719406, -0.07062438130378723, -0.08256734162569046, -0.025658411905169487, 0.011960389092564583, 0.025971194729208946, 0.0028170854784548283, 0.01005984004586935, -0.05233638361096382, 0.022352982312440872, 0.053597934544086456, -0.09023789316415787, 0.043118152767419815, -0.07159025967121124, 0.12209494411945343, 0.08206065744161606, -0.06391087174415588, 0.11309891194105148, 0.08960870653390884, 0.0033187735825777054, 0.1002500057220459, 0.03638093173503876, -0.019658969715237617, 0.0920998603105545, 0.004798053298145533, 0.10313402116298676, -0.06733971834182739, 0.025894658640027046, -0.04048196226358414, -0.01007422897964716, -0.01603609137237072, -5.754306897642891e-8, -0.07758641242980957, -0.07673889398574829, -0.08114069700241089, 0.01625741831958294, -0.005567837972193956, 0.03937262296676636, -0.04792538657784462, -0.09978245198726654, 0.08454278111457825, -0.05197479948401451, -0.039581503719091415, 0.02432798594236374, -0.07744209468364716, -0.02164192497730255, 0.0576082319021225, 0.011938993819057941, -0.01378872524946928, -0.033765796571969986, -0.024021217599511147, -0.10652671754360199, 0.111565500497818, -0.03483212739229202, 0.00076284323586151, 0.03069341368973255, 0.0063850535079836845, 0.043469708412885666, 0.08799853175878525, 0.055902477353811264, -0.06365619599819183, 0.025189436972141266, -0.14762014150619507, -0.045285534113645554, 0.0199185349047184, -0.01506296917796135, -0.02895703911781311, 0.06167527660727501, -0.018435897305607796, 0.01366843655705452, 0.048364851623773575, -0.006996988784521818, 0.0286458358168602, 0.0109206922352314, -0.09860016405582428, 0.003207107773050666, 0.04565240815281868, 0.043610941618680954, -0.010103241540491581, 0.06446356326341629, -0.015773337334394455, 0.05064732953906059, -0.009863054379820824, -0.023480813950300217, -0.027613086625933647, 0.0748414695262909, -0.04594661667943001, -0.0001429138646926731, 0.05406574904918671, -0.11829950660467148, -0.02083001285791397, -0.01327595580369234, 0.07350210100412369, 0.06837820261716843, 0.01518954336643219, -0.04637230560183525 ]
0.177378
"connect", params: { minProtocol: 3, maxProtocol: 3, client: { id: "cli", displayName: "example", version: "dev", platform: "node", mode: "cli", }, }, }), ); }); ws.on("message", (data) => { const msg = JSON.parse(String(data)); if (msg.type === "res" && msg.id === "c1" && msg.ok) { ws.send(JSON.stringify({ type: "req", id: "h1", method: "health" })); } if (msg.type === "res" && msg.id === "h1") { console.log("health:", msg.payload); ws.close(); } }); ``` ## Worked example: add a method end‑to‑end Example: add a new `system.echo` request that returns `{ ok: true, text }`. 1. \*\*Schema (source of truth)\*\* Add to `src/gateway/protocol/schema.ts`: ```ts export const SystemEchoParamsSchema = Type.Object( { text: NonEmptyString }, { additionalProperties: false }, ); export const SystemEchoResultSchema = Type.Object( { ok: Type.Boolean(), text: NonEmptyString }, { additionalProperties: false }, ); ``` Add both to `ProtocolSchemas` and export types: ```ts SystemEchoParams: SystemEchoParamsSchema, SystemEchoResult: SystemEchoResultSchema, ``` ```ts export type SystemEchoParams = Static; export type SystemEchoResult = Static; ``` 2. \*\*Validation\*\* In `src/gateway/protocol/index.ts`, export an AJV validator: ```ts export const validateSystemEchoParams = ajv.compile(SystemEchoParamsSchema); ``` 3. \*\*Server behavior\*\* Add a handler in `src/gateway/server-methods/system.ts`: ```ts export const systemHandlers: GatewayRequestHandlers = { "system.echo": ({ params, respond }) => { const text = String(params.text ?? ""); respond(true, { ok: true, text }); }, }; ``` Register it in `src/gateway/server-methods.ts` (already merges `systemHandlers`), then add `"system.echo"` to `METHODS` in `src/gateway/server.ts`. 4. \*\*Regenerate\*\* ```bash pnpm protocol:check ``` 5. \*\*Tests + docs\*\* Add a server test in `src/gateway/server.\*.test.ts` and note the method in docs. ## Swift codegen behavior The Swift generator emits: - `GatewayFrame` enum with `req`, `res`, `event`, and `unknown` cases - Strongly typed payload structs/enums - `ErrorCode` values and `GATEWAY\_PROTOCOL\_VERSION` Unknown frame types are preserved as raw payloads for forward compatibility. ## Versioning + compatibility - `PROTOCOL\_VERSION` lives in `src/gateway/protocol/schema.ts`. - Clients send `minProtocol` + `maxProtocol`; the server rejects mismatches. - The Swift models keep unknown frame types to avoid breaking older clients. ## Schema patterns and conventions - Most objects use `additionalProperties: false` for strict payloads. - `NonEmptyString` is the default for IDs and method/event names. - The top-level `GatewayFrame` uses a \*\*discriminator\*\* on `type`. - Methods with side effects usually require an `idempotencyKey` in params (example: `send`, `poll`, `agent`, `chat.send`). ## Live schema JSON Generated JSON Schema is in the repo at `dist/protocol.schema.json`. The published raw file is typically available at: - https://raw.githubusercontent.com/openclaw/openclaw/main/dist/protocol.schema.json ## When you change schemas 1. Update the TypeBox schemas. 2. Run `pnpm protocol:check`. 3. Commit the regenerated schema + Swift models.
https://github.com/openclaw/openclaw/blob/main//docs/concepts/typebox.md
main
opebclaw
[ -0.03537807613611221, 0.067760169506073, -0.018393460661172867, 0.05112295225262642, -0.020635880529880524, -0.0654032751917839, 0.057758599519729614, 0.12123054265975952, 0.04148176312446594, -0.044168345630168915, -0.06581293046474457, -0.010674258694052696, -0.004896054044365883, 0.023270374163985252, 0.03255822882056236, 0.04742179438471794, -0.02269049547612667, -0.06489691883325577, -0.061642277985811234, -0.03820096701383591, 0.035029102116823196, 0.03664228320121765, 0.02780459076166153, 0.003427206538617611, -0.05711357668042183, 0.009710992686450481, -0.0027576726861298084, -0.021051688119769096, 0.002113473368808627, 0.12323718518018723, -0.004601793829351664, -0.10557668656110764, -0.03825206309556961, 0.016187680885195732, 0.030193980783224106, 0.07586317509412766, 0.0492507703602314, -0.010403666645288467, -0.07009065896272659, -0.024953845888376236, 0.051618535071611404, 0.04302392154932022, -0.06012712046504021, 0.018030628561973572, 0.09618878364562988, -0.09501928836107254, -0.12495416402816772, 0.06176915019750595, -0.021486744284629822, 0.03776877373456955, -0.04279522970318794, -0.0718458890914917, -0.026150576770305634, 0.06118641048669815, 0.03435821831226349, -0.042016398161649704, -0.08022487908601761, 0.06148329749703407, 0.0022605187259614468, -0.05497005581855774, 0.009349243715405464, -0.11771411448717117, 0.08722742646932602, -0.01062619686126709, 0.0159782525151968, -0.031196916475892067, -0.04717694967985153, 0.04508376494050026, -0.06016533821821213, 0.045521680265665054, -0.0016296339454129338, 0.004243768751621246, -0.08764708042144775, -0.012447896413505077, -0.06243746727705002, 0.02736540511250496, 0.021530766040086746, 0.00581678980961442, -0.04516134038567543, 0.04829598218202591, -0.01464025303721428, -0.040113747119903564, -0.05728907138109207, 0.08992014080286026, 0.00624376954510808, 0.06779535114765167, -0.0841439738869667, -0.015194270759820938, -0.017237333580851555, -0.004908701870590448, -0.11027830839157104, -0.02816835790872574, -0.08452481031417847, 0.045282211154699326, 0.015475469641387463, 0.06272599846124649, -0.03171466663479805, -0.015210384503006935, -0.026370132341980934, 0.07179785519838333, -0.037274494767189026, -0.06116725876927376, 0.048869989812374115, -0.03813747316598892, 0.05191949009895325, -0.010279111564159393, -0.04161791875958443, 0.06813661754131317, -0.0053383721970021725, 0.018534591421484947, -0.038671087473630905, 0.11856342107057571, 0.00018828695465344936, 0.03364938870072365, 0.011726491153240204, -0.01727481372654438, 0.06008029729127884, -0.015284830704331398, -0.008974910713732243, 0.024686230346560478, 0.1207893043756485, -0.0582699328660965, -0.041384365409612656, -0.03430312126874924, 0.0806930810213089, 0.02408619225025177, 0.1386430412530899, 2.2951416997209774e-33, 0.02680951915681362, -0.05461226403713226, 0.07713625580072403, 0.05756368115544319, 0.05037006735801697, -0.023090260103344917, 0.04617017135024071, -0.04949880763888359, -0.06130572780966759, -0.02723734825849533, -0.09041181206703186, -0.020203905180096626, 0.0805218368768692, -0.08640220761299133, -0.046848125755786896, -0.0609409362077713, 0.09503549337387085, 0.041827958077192307, 0.028573350980877876, 0.028624702244997025, 0.020741213113069534, -0.06348525732755661, 0.03965200111269951, -0.013412551023066044, 0.03235036879777908, -0.0325465127825737, -0.02240472473204136, 0.05640214681625366, -0.007527486886829138, -0.0368913859128952, 0.022649576887488365, 0.0030523387249559164, -0.025474386289715767, 0.015024355612695217, -0.04202365502715111, -0.02171926759183407, 0.03881257399916649, -0.00015337299555540085, -0.07936705648899078, -0.022781919687986374, 0.04926320165395737, -0.019553935155272484, -0.05531620606780052, 0.0710647702217102, 0.033922478556632996, -0.08732195943593979, -0.04084927961230278, -0.04694177210330963, 0.009001939557492733, -0.0581471212208271, -0.04493779316544533, 0.05982184037566185, 0.04891832172870636, -0.04878100007772446, 0.051839422434568405, -0.023403428494930267, 0.02867128886282444, 0.016735251992940903, -0.08685246109962463, -0.019690195098519325, -0.020714206621050835, 0.003480836283415556, 0.032076165080070496, -0.019054925069212914, 0.12028321623802185, -0.013471395708620548, -0.07122515887022018, -0.03153126686811447, -0.06267043948173523, -0.0070891245268285275, 0.0030492364894598722, 0.06129949167370796, -0.015058792196214199, 0.006946418900042772, -0.022991396486759186, -0.00801276694983244, -0.005035131238400936, 0.04186366870999336, -0.02032901905477047, -0.004965101834386587, 0.050045643001794815, 0.017903747037053108, -0.05992649495601654, 0.1037803664803505, 0.02787886932492256, 0.04894893616437912, -0.048849914222955704, -0.004107728134840727, -0.0281300600618124, 0.03680526092648506, -0.0721551775932312, 0.054414208978414536, -0.009829026646912098, -0.018435895442962646, -0.03143149986863136, -2.5900954565323596e-33, -0.025889674201607704, 0.021213090047240257, 0.037627026438713074, -0.0022992496378719807, 0.012024810537695885, -0.0231853686273098, -0.0033333045430481434, -0.03845958411693573, -0.01851397007703781, 0.03459419310092926, 0.0942717120051384, -0.04797789454460144, -0.02154485695064068, 0.04303792119026184, -0.02456209622323513, 0.11101347208023071, -0.03210436552762985, -0.04160703346133232, 0.06811009347438812, -0.061209727078676224, 0.032525237649679184, 0.05416419357061386, 0.021269971504807472, 0.018599890172481537, -0.07976565510034561, -0.02583262510597706, -0.04370972141623497, 0.010090823285281658, -0.07334131747484207, -0.05519067123532295, 0.002762741642072797, 0.013159489259123802, 0.0380287766456604, 0.05831234157085419, 0.06131381168961525, -0.028762338683009148, 0.049691587686538696, 0.04377450793981552, 0.040850959718227386, 0.04083873704075813, 0.07204978913068771, -0.06109929084777832, -0.09479714184999466, 0.028494054451584816, 0.03474012017250061, -0.009794943034648895, 0.0019160150550305843, 0.03639870136976242, -0.06282997876405716, 0.030717987567186356, 0.024066386744379997, -0.04856636002659798, -0.03157060965895653, 0.08534111827611923, 0.044816140085458755, -0.05639413744211197, -0.014452613890171051, -0.1046198382973671, -0.045751478523015976, -0.05601389706134796, 0.0386895015835762, -0.14686192572116852, -0.009197523817420006, 0.05376559495925903, 0.032505955547094345, -0.051432862877845764, -0.030925219878554344, -0.03333444148302078, 0.041605886071920395, -0.03702707588672638, -0.05848655849695206, 0.024641402065753937, 0.0023023136891424656, 0.02832668274641037, 0.10453290492296219, -0.051885005086660385, -0.048361264169216156, -0.1036275252699852, 0.013355149887502193, 0.06615187972784042, -0.012709911912679672, 0.02839496359229088, 0.02373114973306656, 0.012172142043709755, 0.05566275492310524, -0.0002601195592433214, -0.004031449556350708, 0.07836615294218063, -0.045648593455553055, -0.00016015287837944925, -0.026360351592302322, 0.01850130967795849, -0.007709079422056675, -0.018603401258587837, -0.07434265315532684, -6.055663703818936e-8, -0.07346262037754059, -0.020982475951313972, -0.0844174325466156, 0.005225587170571089, -0.01377585344016552, 0.045649584382772446, -0.0646875724196434, -0.09172830730676651, 0.04813343286514282, 0.02986431121826172, -0.07831411808729172, 0.018131978809833527, 0.051909491419792175, -0.06358864158391953, 0.034996747970581055, -0.046385083347558975, -0.06212123855948448, -0.035321298986673355, 0.04121357575058937, 0.019860344007611275, 0.11931584030389786, -0.0018239475321024656, -0.015512811951339245, 0.02812032587826252, 0.1031043529510498, -0.012082235887646675, 0.056886136531829834, 0.0029214429669082165, -0.08812285959720612, 0.002302641049027443, -0.07684654742479324, -0.00840297993272543, 0.03492268919944763, 0.10572453588247299, 0.004368842579424381, -0.014879757538437843, 0.028066085651516914, 0.05477944016456604, -0.0028300764970481396, 0.07383232563734055, 0.09953802824020386, 0.0947035551071167, -0.08128014951944351, 0.027111651375889778, 0.020606834441423416, 0.028730453923344612, 0.05625652149319649, 0.07153033465147018, 0.03183797374367714, -0.014938603155314922, -0.0024587458465248346, -0.07533980906009674, 0.05542995408177376, -0.042050428688526154, -0.07113201171159744, -0.023492081090807915, 0.031161589547991753, -0.014970684424042702, -0.010615101084113121, 0.06829728186130524, 0.0412273071706295, 0.02591979131102562, -0.02236277610063553, -0.017465578392148018 ]
0.060424
# Models CLI See [/concepts/model-failover](/concepts/model-failover) for auth profile rotation, cooldowns, and how that interacts with fallbacks. Quick provider overview + examples: [/concepts/model-providers](/concepts/model-providers). ## How model selection works OpenClaw selects models in this order: 1. \*\*Primary\*\* model (`agents.defaults.model.primary` or `agents.defaults.model`). 2. \*\*Fallbacks\*\* in `agents.defaults.model.fallbacks` (in order). 3. \*\*Provider auth failover\*\* happens inside a provider before moving to the next model. Related: - `agents.defaults.models` is the allowlist/catalog of models OpenClaw can use (plus aliases). - `agents.defaults.imageModel` is used \*\*only when\*\* the primary model can’t accept images. - Per-agent defaults can override `agents.defaults.model` via `agents.list[].model` plus bindings (see [/concepts/multi-agent](/concepts/multi-agent)). ## Quick model picks (anecdotal) - \*\*GLM\*\*: a bit better for coding/tool calling. - \*\*MiniMax\*\*: better for writing and vibes. ## Setup wizard (recommended) If you don’t want to hand-edit config, run the onboarding wizard: ```bash openclaw onboard ``` It can set up model + auth for common providers, including \*\*OpenAI Code (Codex) subscription\*\* (OAuth) and \*\*Anthropic\*\* (API key recommended; `claude setup-token` also supported). ## Config keys (overview) - `agents.defaults.model.primary` and `agents.defaults.model.fallbacks` - `agents.defaults.imageModel.primary` and `agents.defaults.imageModel.fallbacks` - `agents.defaults.models` (allowlist + aliases + provider params) - `models.providers` (custom providers written into `models.json`) Model refs are normalized to lowercase. Provider aliases like `z.ai/\*` normalize to `zai/\*`. Provider configuration examples (including OpenCode Zen) live in [/gateway/configuration](/gateway/configuration#opencode-zen-multi-model-proxy). ## “Model is not allowed” (and why replies stop) If `agents.defaults.models` is set, it becomes the \*\*allowlist\*\* for `/model` and for session overrides. When a user selects a model that isn’t in that allowlist, OpenClaw returns: ``` Model "provider/model" is not allowed. Use /model to list available models. ``` This happens \*\*before\*\* a normal reply is generated, so the message can feel like it “didn’t respond.” The fix is to either: - Add the model to `agents.defaults.models`, or - Clear the allowlist (remove `agents.defaults.models`), or - Pick a model from `/model list`. Example allowlist config: ```json5 { agent: { model: { primary: "anthropic/claude-sonnet-4-5" }, models: { "anthropic/claude-sonnet-4-5": { alias: "Sonnet" }, "anthropic/claude-opus-4-5": { alias: "Opus" }, }, }, } ``` ## Switching models in chat (`/model`) You can switch models for the current session without restarting: ``` /model /model list /model 3 /model openai/gpt-5.2 /model status ``` Notes: - `/model` (and `/model list`) is a compact, numbered picker (model family + available providers). - `/model <#>` selects from that picker. - `/model status` is the detailed view (auth candidates and, when configured, provider endpoint `baseUrl` + `api` mode). - Model refs are parsed by splitting on the \*\*first\*\* `/`. Use `provider/model` when typing `/model `. - If the model ID itself contains `/` (OpenRouter-style), you must include the provider prefix (example: `/model openrouter/moonshotai/kimi-k2`). - If you omit the provider, OpenClaw treats the input as an alias or a model for the \*\*default provider\*\* (only works when there is no `/` in the model ID). Full command behavior/config: [Slash commands](/tools/slash-commands). ## CLI commands ```bash openclaw models list openclaw models status openclaw models set openclaw models set-image openclaw models aliases list openclaw models aliases add openclaw models aliases remove openclaw models fallbacks list openclaw models fallbacks add openclaw models fallbacks remove openclaw models fallbacks clear openclaw models image-fallbacks list openclaw models image-fallbacks add openclaw models image-fallbacks remove openclaw models image-fallbacks clear ``` `openclaw models` (no subcommand) is a shortcut for `models status`. ### `models list` Shows configured models by default. Useful flags: - `--all`: full catalog - `--local`: local providers only - `--provider `: filter by provider - `--plain`: one model per line - `--json`: machine‑readable output ### `models status` Shows the resolved primary model, fallbacks, image model, and an auth overview of configured providers. It also surfaces OAuth expiry status for profiles
https://github.com/openclaw/openclaw/blob/main//docs/concepts/models.md
main
opebclaw
[ -0.02044876106083393, -0.055748164653778076, -0.040866587311029434, 0.1002403199672699, 0.08336778730154037, -0.05121072754263878, -0.028554392978549004, 0.01055977027863264, -0.01952320709824562, -0.043712690472602844, 0.07806717604398727, 0.005736805032938719, 0.08290886133909225, -0.010117298923432827, 0.04276975989341736, 0.09203342348337173, 0.03259313479065895, -0.003120590467005968, -0.054574254900217056, 0.023825889453291893, -0.024171793833374977, 0.01842166855931282, -0.05814310908317566, -0.015423092991113663, -0.11495824158191681, -0.06468980759382248, -0.05090298503637314, -0.06257060915231705, -0.029210012406110764, -0.03750963136553764, 0.01056906022131443, 0.02018650807440281, -0.10416039079427719, 0.0030480939894914627, 0.08257269859313965, 0.022706909105181694, 0.041314806789159775, -0.02784547209739685, -0.011580774560570717, 0.025372689589858055, 0.07589266449213028, 0.05885951220989227, 0.014959951862692833, -0.13103528320789337, -0.06028738617897034, -0.08798708766698837, -0.012957326136529446, -0.047783706337213516, 0.00011226325295865536, -0.014455809257924557, -0.08005812019109726, -0.06798770278692245, -0.012515619397163391, 0.026130031794309616, 0.00378726446069777, 0.055454857647418976, 0.0020584759768098593, -0.09251866489648819, -0.03579273819923401, -0.018674226477742195, 0.10358946770429611, -0.02585945650935173, -0.13827866315841675, 0.025659119710326195, -0.017785577103495598, 0.021237770095467567, -0.03336331620812416, -0.08058127015829086, -0.017950812354683876, 0.0007286448962986469, -0.029833093285560608, 0.00003137801104458049, -0.0342407301068306, -0.03524896875023842, 0.05867965146899223, -0.022502047941088676, 0.07167444378137589, 0.03717593103647232, 0.00620271498337388, -0.1378289759159088, -0.04603254795074463, -0.029597459360957146, -0.050490133464336395, 0.032918915152549744, 0.01748368702828884, 0.04558350518345833, -0.030189016833901405, 0.021804723888635635, 0.05054589360952377, 0.027226390317082405, -0.01178750116378069, -0.06333918869495392, 0.029017338529229164, 0.009368328377604485, 0.050361137837171555, 0.06414613872766495, 0.03907649964094162, -0.029541438445448875, -0.0277879536151886, 0.07709101587533951, -0.038568612188100815, -0.03490380197763443, 0.10946042090654373, 0.07049069553613663, 0.020672529935836792, -0.02266404964029789, 0.03237619996070862, 0.011948664672672749, 0.001174485543742776, 0.02120746485888958, 0.017748942598700523, 0.03218279406428337, 0.09219853579998016, -0.028051625937223434, 0.006493167951703072, 0.02377473935484886, -0.03948475047945976, -0.026140980422496796, -0.002488881815224886, -0.0053892736323177814, 0.09391061216592789, 0.0732785165309906, 0.12409135699272156, -0.05653961002826691, 0.06816592067480087, 0.06294077634811401, -0.022698786109685898, 5.4859627076525204e-33, 0.07682431489229202, -0.026198500767350197, -0.019438449293375015, 0.035729724913835526, 0.1368776112794876, 0.025079378858208656, 0.01833627186715603, -0.028028955683112144, -0.042556650936603546, 0.011566124856472015, -0.019939608871936798, 0.04603615403175354, -0.0547647587954998, -0.018953368067741394, -0.0004315668484196067, 0.02403598092496395, -0.0043616509065032005, 0.046795401722192764, 0.07282174378633499, 0.05957018584012985, 0.04356595501303673, 0.003888190956786275, -0.03966914862394333, 0.03295544907450676, -0.03039492852985859, 0.10187436640262604, -0.04054010659456253, -0.01362003292888403, -0.05282203480601311, 0.04575181379914284, 0.07540135830640793, 0.0021988952066749334, -0.008324390277266502, 0.03980462998151779, -0.04217180237174034, 0.06744927167892456, -0.057985205203294754, -0.051360148936510086, -0.040981143712997437, -0.08632290363311768, -0.03203744813799858, -0.005613336805254221, -0.06496122479438782, -0.01651843450963497, -0.06237824633717537, -0.13260424137115479, 0.031661808490753174, 0.04336829483509064, 0.07842234522104263, 0.018268927931785583, 0.017137400805950165, -0.0328628346323967, 0.018196439370512962, -0.0024461252614855766, -0.04136000573635101, -0.00024164404021576047, -0.07753544300794601, -0.00773035129532218, 0.018086090683937073, 0.013478404842317104, 0.013835228979587555, -0.04909553378820419, -0.035193655639886856, -0.022259321063756943, 0.007977986708283424, -0.0015165547374635935, 0.009377816691994667, -0.05349216237664223, -0.012686723843216896, -0.025521833449602127, -0.04932576045393944, 0.017101220786571503, -0.07524760067462921, 0.020534824579954147, -0.014889124780893326, -0.08635464310646057, 0.017931783571839333, -0.030341047793626785, 0.06587395817041397, -0.026482870802283287, -0.01701171137392521, 0.0059670754708349705, -0.08154860883951187, 0.017278330400586128, -0.07346178591251373, 0.025831075385212898, 0.03472317010164261, -0.041993509978055954, -0.03599461913108826, 0.02193325385451317, -0.001227283850312233, -0.050723377615213394, -0.005390322767198086, 0.04613693431019783, 0.025750529021024704, -6.501907577579683e-33, -0.014050373807549477, -0.08283250033855438, 0.026300815865397453, -0.010537357069551945, 0.010249593295156956, -0.01891837827861309, 0.024259617552161217, -0.006299894768744707, -0.033728115260601044, -0.10704934597015381, 0.03870423510670662, 0.031274233013391495, 0.024650679901242256, -0.03758913651108742, 0.050012800842523575, -0.06991205364465714, 0.008022589609026909, -0.12518280744552612, 0.01657055877149105, 0.011122247204184532, 0.059599362313747406, 0.03255699202418327, -0.06851412355899811, 0.02310742251574993, 0.019904786720871925, 0.06579186022281647, -0.043818410485982895, 0.003942628391087055, 0.06514938920736313, -0.05399925634264946, 0.046384915709495544, 0.03553353250026703, -0.01007850095629692, 0.0691971555352211, -0.00498619070276618, 0.09366258978843689, -0.16610613465309143, 0.10617141425609589, -0.051146239042282104, 0.05592596158385277, 0.09216330200433731, 0.005438880063593388, -0.08752302825450897, 0.037795472890138626, 0.000524589791893959, 0.07835985720157623, 0.004094687290489674, -0.03331749886274338, 0.021111320704221725, 0.000297082238830626, -0.018913811072707176, -0.028148945420980453, 0.024796226993203163, 0.06753340363502502, -0.017471618950366974, 0.0987338125705719, 0.15757708251476288, -0.041798580437898636, 0.05204925686120987, -0.02742871642112732, -0.020799735561013222, -0.045420192182064056, 0.06071477755904198, 0.04982931166887283, -0.077608123421669, -0.02029893361032009, -0.06183440610766411, 0.0550987534224987, -0.03771189972758293, -0.019685182720422745, -0.06791713088750839, -0.019170109182596207, -0.004575466271489859, -0.09141113609075546, 0.04394761472940445, -0.04758267477154732, -0.07354402542114258, -0.03750429302453995, 0.017485342919826508, -0.0006258241483010352, -0.08835894614458084, -0.0051654246635735035, 0.02374277450144291, 0.021976172924041748, 0.014975869096815586, -0.028330646455287933, 0.018054986372590065, 0.09889402985572815, 0.07259727269411087, 0.044274136424064636, -0.06655416637659073, 0.02018842101097107, -0.019594036042690277, -0.01972639560699463, -0.04684482142329216, -5.3220976070633697e-8, -0.1270848959684372, 0.02192986197769642, 0.002776643494144082, 0.0025079483166337013, -0.026740550994873047, -0.0312664769589901, 0.05458293482661247, 0.010242686606943607, -0.03839540854096413, 0.023763809353113174, 0.012964271008968353, 0.04102907329797745, 0.01088804192841053, -0.013143550604581833, -0.029633572325110435, 0.0705636739730835, 0.05336228758096695, -0.0020889383740723133, -0.014453200623393059, -0.034273214638233185, -0.09135012328624725, -0.060122471302747726, 0.034755852073431015, 0.028038766235113144, -0.0375048853456974, 0.055383194237947464, -0.06911427527666092, 0.02977784536778927, 0.02498495951294899, 0.0879831314086914, -0.022793222218751907, 0.020009580999612808, 0.07460114359855652, -0.02391582727432251, -0.06002334505319595, 0.08236312121152878, -0.020375674590468407, -0.03491506353020668, 0.028490351513028145, -0.01890486665070057, 0.047296080738306046, 0.008189445361495018, -0.036674316972494125, -0.020444681867957115, 0.022685987874865532, 0.038972701877355576, 0.013772652484476566, -0.04043876752257347, 0.06290124356746674, -0.021961215883493423, -0.07772663980722427, -0.06909588724374771, -0.014312746934592724, 0.12512356042861938, -0.03591691330075264, -0.011271596886217594, 0.05570736527442932, -0.06252184510231018, 0.0493759922683239, 0.04636826366186142, -0.057729654014110565, -0.05488872528076172, 0.022287696599960327, 0.051932357251644135 ]
0.018045
`--all`: full catalog - `--local`: local providers only - `--provider `: filter by provider - `--plain`: one model per line - `--json`: machine‑readable output ### `models status` Shows the resolved primary model, fallbacks, image model, and an auth overview of configured providers. It also surfaces OAuth expiry status for profiles found in the auth store (warns within 24h by default). `--plain` prints only the resolved primary model. OAuth status is always shown (and included in `--json` output). If a configured provider has no credentials, `models status` prints a \*\*Missing auth\*\* section. JSON includes `auth.oauth` (warn window + profiles) and `auth.providers` (effective auth per provider). Use `--check` for automation (exit `1` when missing/expired, `2` when expiring). Preferred Anthropic auth is the Claude Code CLI setup-token (run anywhere; paste on the gateway host if needed): ```bash claude setup-token openclaw models status ``` ## Scanning (OpenRouter free models) `openclaw models scan` inspects OpenRouter’s \*\*free model catalog\*\* and can optionally probe models for tool and image support. Key flags: - `--no-probe`: skip live probes (metadata only) - `--min-params **`: minimum parameter size (billions) - `--max-age-days `: skip older models - `--provider `: provider prefix filter - `--max-candidates `: fallback list size - `--set-default`: set `agents.defaults.model.primary` to the first selection - `--set-image`: set `agents.defaults.imageModel.primary` to the first image selection Probing requires an OpenRouter API key (from auth profiles or `OPENROUTER\_API\_KEY`). Without a key, use `--no-probe` to list candidates only. Scan results are ranked by: 1. Image support 2. Tool latency 3. Context size 4. Parameter count Input - OpenRouter `/models` list (filter `:free`) - Requires OpenRouter API key from auth profiles or `OPENROUTER\_API\_KEY` (see [/environment](/environment)) - Optional filters: `--max-age-days`, `--min-params`, `--provider`, `--max-candidates` - Probe controls: `--timeout`, `--concurrency` When run in a TTY, you can select fallbacks interactively. In non‑interactive mode, pass `--yes` to accept defaults. ## Models registry (`models.json`) Custom providers in `models.providers` are written into `models.json` under the agent directory (default `~/.openclaw/agents//models.json`). This file is merged by default unless `models.mode` is set to `replace`.**
https://github.com/openclaw/openclaw/blob/main//docs/concepts/models.md
main
opebclaw
[ -0.021547509357333183, 0.029180385172367096, -0.08088983595371246, 0.02706882357597351, 0.07080481201410294, -0.0716298371553421, -0.016388682648539543, 0.02686665765941143, -0.02749994397163391, -0.04337291046977043, 0.05907468497753143, -0.025050748139619827, 0.031111186370253563, 0.016059614717960358, 0.029022367671132088, 0.07487870752811432, 0.024642454460263252, -0.04349649325013161, -0.0030381425749510527, -0.06450942903757095, -0.04063423350453377, -0.04923175647854805, -0.02720440924167633, 0.022711746394634247, -0.021715369075536728, -0.06825024634599686, -0.021549656987190247, -0.0014544271398335695, -0.011057151481509209, 0.012633784674108028, -0.021623259410262108, 0.01846344769001007, -0.0101761594414711, 0.008589845150709152, 0.058662187308073044, 0.013588366098701954, 0.17063525319099426, 0.0026918603107333183, 0.003783916588872671, -0.09806791692972183, 0.09513784945011139, -0.014125517569482327, -0.08988107740879059, -0.03593343868851662, -0.0008033688645809889, -0.06878416240215302, -0.04424844682216644, -0.04110591113567352, -0.057348303496837616, -0.0110386423766613, 0.010037212632596493, 0.015230040065944195, -0.00966334342956543, -0.007987701334059238, 0.004074179567396641, 0.04353872314095497, -0.07691136747598648, -0.009730180725455284, 0.015961486846208572, 0.03204605355858803, -0.014978288672864437, -0.0012947492068633437, -0.06583612412214279, 0.053965628147125244, -0.06400000303983688, 0.02180083841085434, -0.009444834664463997, -0.057565875351428986, -0.002106726635247469, 0.005815991200506687, -0.06276576966047287, -0.018875662237405777, -0.0866740420460701, -0.032201413065195084, 0.018964601680636406, 0.031033745035529137, 0.04511580243706703, 0.023705990985035896, 0.013491073623299599, -0.07182548195123672, -0.032454151660203934, 0.0029317494481801987, 0.006509898696094751, 0.09947042912244797, -0.0024298010393977165, 0.02234472893178463, -0.01701170764863491, 0.011025842279195786, 0.04682239145040512, 0.05440277233719826, 0.002276598010212183, -0.036503251641988754, -0.06480313092470169, -0.05912788584828377, 0.06844986230134964, 0.020004328340291977, 0.01664174161851406, -0.0047357818111777306, -0.0899384394288063, 0.07495071738958359, -0.11052719503641129, -0.012583115138113499, 0.13143819570541382, -0.01673145778477192, 0.036127932369709015, 0.0289551243185997, -0.033638641238212585, 0.019010303542017937, 0.09310809522867203, 0.08396304398775101, -0.004380073864012957, -0.037693191319704056, 0.015244076028466225, -0.03511803597211838, 0.020462175831198692, 0.10436338931322098, -0.060274042189121246, 0.05002424493432045, 0.026159130036830902, 0.019118372350931168, 0.04517379403114319, 0.016117112711071968, 0.04098459333181381, -0.016516737639904022, 0.05855310708284378, 0.0730324238538742, 0.011789754964411259, 3.5017447738538075e-33, 0.03808203712105751, 0.0621962808072567, 0.03315562382340431, 0.02897310070693493, 0.05369049310684204, 0.028171993792057037, 0.06315642595291138, -0.038232531398534775, 0.01870124600827694, 0.008964117616415024, -0.061555854976177216, 0.06766145676374435, -0.056480079889297485, 0.05597153678536415, -0.021608935669064522, 0.049654778093099594, 0.07343873381614685, -0.01358283031731844, 0.06323648244142532, 0.12353689223527908, 0.06206724792718887, -0.006885202135890722, -0.01020483486354351, 0.05008736625313759, 0.05358010157942772, -0.016882356256246567, 0.0494777150452137, -0.007707740180194378, -0.060260288417339325, 0.017946718260645866, 0.048752304166555405, -0.01611083559691906, 0.019303051754832268, -0.013919074088335037, -0.01475643739104271, -0.001194757642224431, -0.009951549582183361, -0.019062234088778496, -0.015331956557929516, -0.1027633398771286, -0.016336282715201378, 0.008505498990416527, -0.08945540338754654, -0.009490069933235645, -0.04671649634838104, -0.08504971116781235, -0.03007695823907852, -0.0006511812680400908, 0.12043611705303192, 0.08722779899835587, -0.09548179060220718, 0.0008264653151854873, -0.0732196792960167, -0.06114617735147476, -0.03288688883185387, -0.07621651887893677, -0.02287898398935795, 0.0199204720556736, -0.01027496438473463, -0.12272712588310242, 0.039231084287166595, -0.04087904468178749, -0.03037283942103386, -0.009736119769513607, 0.003961779642850161, 0.032813601195812225, -0.10400491207838058, -0.03613068535923958, 0.022239336743950844, 0.05774255096912384, -0.0664706751704216, 0.046383343636989594, -0.03901262581348419, 0.02166164480149746, -0.02938995696604252, -0.09401780366897583, 0.050360891968011856, -0.00005242062616162002, 0.05728114768862724, 0.03891370818018913, 0.0835915058851242, 0.02983207441866398, -0.036137111485004425, 0.08937934041023254, -0.03630700707435608, 0.0254669189453125, 0.05091356858611107, 0.08427301049232483, -0.04235395789146423, -0.011678839102387428, 0.05344003438949585, 0.0005534894298762083, 0.05590969696640968, 0.011855345219373703, -0.13436439633369446, -5.543960496896138e-33, 0.026471681892871857, -0.0937197208404541, 0.06279107183218002, -0.02718019299209118, -0.01807710900902748, -0.00015119316230993718, 0.013893879018723965, 0.07605981081724167, -0.009031868539750576, -0.05194510519504547, 0.10222205519676208, 0.03645946457982063, 0.007874508388340473, -0.024040138348937035, 0.061064720153808594, 0.015369126573204994, -0.07669920474290848, -0.05618320778012276, 0.08653239160776138, 0.04106557369232178, -0.05681723728775978, 0.028098829090595245, -0.0024037985131144524, 0.018317466601729393, 0.0034035120625048876, 0.011040948331356049, -0.009501605294644833, -0.040290430188179016, -0.04450864717364311, -0.0882672518491745, 0.07661116868257523, 0.05264551192522049, -0.07330020517110825, 0.005103944335132837, 0.004904580768197775, -0.010260502807796001, -0.031807612627744675, 0.14841525256633759, -0.06689594686031342, 0.021624641492962837, 0.05307568609714508, -0.03923753276467323, -0.11195097118616104, 0.04769662022590637, -0.006647821981459856, 0.028654707595705986, 0.03128885477781296, -0.038862444460392, -0.06303078681230545, 0.031060822308063507, 0.02871791459619999, -0.042838018387556076, 0.09533421695232391, 0.023269427940249443, -0.04116419702768326, 0.010918463580310345, 0.06214255467057228, -0.031795356422662735, 0.011079969815909863, -0.05035858228802681, -0.003426499431952834, -0.11057884246110916, -0.013378506526350975, 0.08961737155914307, -0.12192010134458542, -0.03669555485248566, -0.014903001487255096, 0.05123987793922424, -0.02381409890949726, -0.025406314060091972, -0.020108887925744057, -0.0702420026063919, -0.038473013788461685, -0.012788326479494572, 0.007077069487422705, -0.035380080342292786, -0.06734908372163773, -0.07430539280176163, -0.008009175769984722, 0.07576394081115723, -0.0774187222123146, 0.004081844352185726, -0.04742247238755226, 0.008775354363024235, 0.014689086936414242, -0.09468238800764084, -0.009401104412972927, 0.08081421256065369, 0.07718091458082199, 0.11839083582162857, -0.03683631494641304, 0.037622928619384766, -0.10683633387088776, 0.007417351473122835, -0.019462240859866142, -5.289368942840156e-8, 0.01136715803295374, -0.07185278832912445, -0.039659302681684494, 0.009185919538140297, 0.017846224829554558, 0.04032858461141586, 0.03149687126278877, -0.06486760824918747, -0.028670459985733032, -0.003895904403179884, 0.010974820703268051, 0.03969864919781685, -0.09005561470985413, -0.05977534502744675, -0.012611694633960724, 0.026749789714813232, 0.007732504513114691, 0.021817170083522797, -0.00007628653111169115, -0.025611400604248047, -0.09592260420322418, -0.03761249780654907, -0.003621746553108096, -0.03530880808830261, -0.010272219777107239, 0.027007294818758965, 0.029025260359048843, 0.0596747025847435, -0.020775441080331802, 0.026448929682374, -0.0182944443076849, 0.015242206864058971, 0.07553012669086456, -0.11336884647607803, -0.0572446808218956, 0.006605716422200203, -0.06388638913631439, -0.025418991222977638, 0.006255132146179676, -0.02216482348740101, 0.037246089428663254, 0.06671346724033356, 0.012785845436155796, -0.03562270477414131, 0.0687386766076088, 0.0015733703039586544, 0.0740649402141571, -0.006617757957428694, 0.044103220105171204, -0.035997677594423294, -0.04253818839788437, -0.02016596682369709, -0.01431094016879797, 0.08731260895729065, -0.08375278860330582, -0.03715314716100693, -0.01857929304242134, -0.05473991110920906, 0.0874290019273758, -0.05166308581829071, -0.005347900558263063, -0.04186075180768967, 0.05519747734069824, -0.03518803417682648 ]
0.010634
# Agent Loop (OpenClaw) An agentic loop is the full “real” run of an agent: intake → context assembly → model inference → tool execution → streaming replies → persistence. It’s the authoritative path that turns a message into actions and a final reply, while keeping session state consistent. In OpenClaw, a loop is a single, serialized run per session that emits lifecycle and stream events as the model thinks, calls tools, and streams output. This doc explains how that authentic loop is wired end-to-end. ## Entry points - Gateway RPC: `agent` and `agent.wait`. - CLI: `agent` command. ## How it works (high-level) 1. `agent` RPC validates params, resolves session (sessionKey/sessionId), persists session metadata, returns `{ runId, acceptedAt }` immediately. 2. `agentCommand` runs the agent: - resolves model + thinking/verbose defaults - loads skills snapshot - calls `runEmbeddedPiAgent` (pi-agent-core runtime) - emits \*\*lifecycle end/error\*\* if the embedded loop does not emit one 3. `runEmbeddedPiAgent`: - serializes runs via per-session + global queues - resolves model + auth profile and builds the pi session - subscribes to pi events and streams assistant/tool deltas - enforces timeout -> aborts run if exceeded - returns payloads + usage metadata 4. `subscribeEmbeddedPiSession` bridges pi-agent-core events to OpenClaw `agent` stream: - tool events => `stream: "tool"` - assistant deltas => `stream: "assistant"` - lifecycle events => `stream: "lifecycle"` (`phase: "start" | "end" | "error"`) 5. `agent.wait` uses `waitForAgentJob`: - waits for \*\*lifecycle end/error\*\* for `runId` - returns `{ status: ok|error|timeout, startedAt, endedAt, error? }` ## Queueing + concurrency - Runs are serialized per session key (session lane) and optionally through a global lane. - This prevents tool/session races and keeps session history consistent. - Messaging channels can choose queue modes (collect/steer/followup) that feed this lane system. See [Command Queue](/concepts/queue). ## Session + workspace preparation - Workspace is resolved and created; sandboxed runs may redirect to a sandbox workspace root. - Skills are loaded (or reused from a snapshot) and injected into env and prompt. - Bootstrap/context files are resolved and injected into the system prompt report. - A session write lock is acquired; `SessionManager` is opened and prepared before streaming. ## Prompt assembly + system prompt - System prompt is built from OpenClaw’s base prompt, skills prompt, bootstrap context, and per-run overrides. - Model-specific limits and compaction reserve tokens are enforced. - See [System prompt](/concepts/system-prompt) for what the model sees. ## Hook points (where you can intercept) OpenClaw has two hook systems: - \*\*Internal hooks\*\* (Gateway hooks): event-driven scripts for commands and lifecycle events. - \*\*Plugin hooks\*\*: extension points inside the agent/tool lifecycle and gateway pipeline. ### Internal hooks (Gateway hooks) - \*\*`agent:bootstrap`\*\*: runs while building bootstrap files before the system prompt is finalized. Use this to add/remove bootstrap context files. - \*\*Command hooks\*\*: `/new`, `/reset`, `/stop`, and other command events (see Hooks doc). See [Hooks](/hooks) for setup and examples. ### Plugin hooks (agent + gateway lifecycle) These run inside the agent loop or gateway pipeline: - \*\*`before\_agent\_start`\*\*: inject context or override system prompt before the run starts. - \*\*`agent\_end`\*\*: inspect the final message list and run metadata after completion. - \*\*`before\_compaction` / `after\_compaction`\*\*: observe or annotate compaction cycles. - \*\*`before\_tool\_call` / `after\_tool\_call`\*\*: intercept tool params/results. - \*\*`tool\_result\_persist`\*\*: synchronously transform tool results before they are written to the session transcript. - \*\*`message\_received` / `message\_sending` / `message\_sent`\*\*: inbound + outbound message hooks. - \*\*`session\_start` / `session\_end`\*\*: session lifecycle boundaries. - \*\*`gateway\_start` / `gateway\_stop`\*\*: gateway lifecycle events. See [Plugins](/plugin#plugin-hooks) for the hook API and registration details. ## Streaming + partial replies - Assistant deltas are streamed from pi-agent-core and emitted as `assistant` events. - Block streaming can
https://github.com/openclaw/openclaw/blob/main//docs/concepts/agent-loop.md
main
opebclaw
[ -0.030445309355854988, -0.03626398742198944, -0.15161728858947754, 0.012150431983172894, 0.016231708228588104, -0.07589345425367355, 0.0013023328501731157, -0.011461975984275341, 0.061443254351615906, -0.025808651000261307, 0.017678245902061462, 0.001303599332459271, 0.0012510457308962941, -0.022357044741511345, 0.04947244003415108, 0.04111921414732933, 0.05410104990005493, -0.017681829631328583, -0.013870247639715672, -0.049887970089912415, 0.06825506687164307, 0.032848332077264786, -0.02672560140490532, -0.0321534164249897, -0.11252357810735703, -0.00021712847228627652, -0.027210043743252754, -0.05287233740091324, 0.004562932997941971, -0.004515951499342918, 0.08708862215280533, 0.035174410790205, -0.04400455579161644, 0.021527133882045746, 0.11086130142211914, 0.0879894569516182, -0.010449972935020924, -0.00892927497625351, -0.04584632068872452, 0.07800997793674469, 0.08161965012550354, -0.037170108407735825, -0.047603458166122437, -0.062222033739089966, -0.023193780332803726, -0.04833591729402542, -0.0948091521859169, -0.04202951490879059, -0.04183271527290344, -0.002287772949784994, -0.10906369984149933, -0.021508876234292984, 0.007992029190063477, -0.011365714482963085, 0.025441696867346764, 0.021837761625647545, -0.0056899543851614, 0.01952727697789669, -0.0015612798742949963, -0.10180117189884186, 0.02575838565826416, -0.05779578536748886, -0.059335075318813324, 0.0813850685954094, -0.03972424939274788, -0.018557129427790642, -0.08261355012655258, -0.055719777941703796, 0.09883761405944824, -0.08040797710418701, -0.049454957246780396, -0.01278508547693491, -0.08329896628856659, -0.06916163861751556, 0.016176581382751465, -0.009801911190152168, 0.07565732300281525, 0.018130412325263023, -0.025849197059869766, -0.08295144885778427, -0.05653681606054306, -0.000529926095623523, 0.004305928945541382, 0.015808332711458206, -0.004868151620030403, 0.07564941793680191, 0.06858734786510468, 0.047247160226106644, 0.04933439567685127, 0.04270313307642937, -0.006412819493561983, -0.0008616750128567219, 0.0013922287616878748, 0.002142223995178938, 0.034087248146533966, 0.08830775320529938, 0.008058622479438782, -0.00960402749478817, -0.05993451550602913, 0.061793308705091476, -0.016087662428617477, -0.020372727885842323, -0.011097927577793598, 0.010567204095423222, -0.029168928042054176, -0.03981096297502518, -0.010490255430340767, 0.07530135661363602, -0.03566402941942215, -0.06076997518539429, 0.007660814095288515, -0.03330577164888382, 0.11654897034168243, 0.02423722669482231, 0.05809589475393295, 0.05093581601977348, -0.02489847131073475, 0.06479764729738235, 0.020921120420098305, 0.03623855113983154, 0.07180386781692505, 0.025134533643722534, 0.03313053399324417, 0.015651149675250053, 0.11335355788469315, 0.047617945820093155, 0.06600575894117355, 2.6965550207695416e-33, 0.012680761516094208, -0.05048111081123352, -0.019788211211562157, 0.02716202475130558, 0.05227314308285713, 0.04506968706846237, 0.05493653565645218, -0.015016837976872921, -0.026386111974716187, 0.06934447586536407, 0.028121523559093475, 0.050047971308231354, -0.05887830629944801, 0.0169919952750206, 0.007301006466150284, -0.015593092888593674, -0.06805597990751266, 0.022952156141400337, 0.03551030531525612, 0.03079155460000038, 0.07214188575744629, -0.024779215455055237, 0.0046362001448869705, 0.022669894620776176, -0.0038892216980457306, 0.029025908559560776, -0.04563969746232033, -0.025930697098374367, 0.0013986598933115602, 0.03954479470849037, 0.06270910054445267, 0.09611522406339645, -0.03905685991048813, 0.05805007740855217, -0.05911063402891159, -0.029009757563471794, -0.018935900181531906, -0.08101461082696915, -0.01609536074101925, -0.03900882974267006, -0.07172168791294098, 0.013611389324069023, -0.024727467447519302, -0.02535596862435341, -0.07060811668634415, -0.20352217555046082, -0.05934637412428856, 0.07827811688184738, 0.014667648822069168, 0.09542854875326157, 0.03747649863362312, 0.020879412069916725, 0.11001463979482651, -0.01483427919447422, -0.025320982560515404, -0.011368351057171822, -0.007481790147721767, 0.034415774047374725, -0.0064286417327821255, 0.10991551727056503, 0.03264380618929863, 0.025912631303071976, -0.07516182959079742, 0.020015373826026917, 0.023629920557141304, 0.01628478430211544, 0.04545217007398605, 0.01491918507963419, 0.022624073550105095, 0.027966445311903954, -0.030575232580304146, 0.01989787630736828, -0.0002980934514198452, 0.011920236051082611, -0.004509036894887686, -0.06819680333137512, -0.02559351734817028, -0.026167023926973343, 0.013189351186156273, -0.011982617899775505, 0.006304224021732807, 0.02734924666583538, -0.060665205121040344, 0.013773653656244278, 0.008941525593400002, 0.029636818915605545, -0.054010938853025436, -0.0909419059753418, 0.01158012356609106, 0.06850544363260269, -0.052544303238391876, -0.03966636583209038, -0.005634001921862364, 0.08067596703767776, 0.03128940984606743, -3.4158018104712976e-33, 0.034885331988334656, -0.07245922833681107, -0.08518558740615845, 0.045551665127277374, -0.004233809188008308, -0.03805684298276901, -0.021314822137355804, -0.06345216184854507, -0.023735420778393745, -0.0650613084435463, -0.026454558596014977, 0.05032317340373993, -0.006220819428563118, 0.05775969475507736, 0.08959563821554184, -0.12157034128904343, -0.00048258365131914616, -0.11162621527910233, 0.003130190772935748, 0.002094131661579013, -0.02640802040696144, -0.014381884597241879, -0.04188273847103119, -0.044205471873283386, 0.06239117681980133, 0.02870880998671055, 0.01701197773218155, 0.060297153890132904, 0.053513649851083755, -0.04403518885374069, 0.03854495659470558, 0.04451342299580574, -0.039226893335580826, 0.04476378113031387, -0.006353527307510376, 0.06420684605836868, 0.013140132650732994, 0.01599050499498844, 0.04315133020281792, 0.01596362516283989, 0.061415065079927444, -0.09959692507982254, -0.05627350136637688, -0.04383135959506035, -0.002149184001609683, 0.02436082623898983, -0.045257411897182465, 0.030635202303528786, -0.0733831375837326, -0.023728011175990105, -0.012931237928569317, 0.033562853932380676, 0.018006308004260063, 0.03729182481765747, -0.05078333616256714, 0.04766296222805977, 0.03676662966609001, -0.03338425233960152, 0.01829269900918007, -0.10900339484214783, 0.028789270669221878, 0.0017692834371700883, -0.02396215870976448, 0.08735260367393494, -0.0071339597925543785, 0.020641639828681946, 0.0017712441040202975, -0.002484117401763797, -0.014356670901179314, -0.02910851314663887, 0.03479244187474251, -0.0749705508351326, -0.04889822378754616, -0.018602954223752022, 0.04603568837046623, -0.010692374780774117, -0.10132366418838501, -0.12074416875839233, 0.02771470881998539, 0.0058534592390060425, -0.12405280023813248, 0.06600001454353333, 0.00028099026530981064, 0.015527896583080292, 0.0034167433623224497, 0.004152740351855755, -0.025553617626428604, 0.05380391329526901, 0.04042038694024086, 0.05642347410321236, 0.01754412055015564, -0.0038260624278336763, -0.04751596599817276, 0.03862940892577171, -0.05474625155329704, -5.053109575214876e-8, -0.0515252985060215, -0.044741980731487274, 0.01882222853600979, 0.07588017731904984, 0.04179869219660759, -0.026920337229967117, 0.04774909466505051, -0.03782542794942856, -0.011058618314564228, 0.05138612538576126, 0.12081073224544525, -0.01281790155917406, 0.0052789137698709965, -0.017453590407967567, 0.04459381848573685, 0.05323898047208786, 0.027105242013931274, -0.048792868852615356, -0.00856059230864048, -0.09088350832462311, -0.018547989428043365, -0.05384763702750206, -0.018174385651946068, 0.03248434513807297, -0.07763059437274933, -0.005906007252633572, 0.03602929785847664, 0.08691158890724182, -0.0526101179420948, 0.01080982107669115, -0.0008490891777910292, -0.023649780079722404, 0.07172804325819016, 0.035602495074272156, -0.03336850926280022, 0.06693588942289352, -0.023464752361178398, -0.02918248623609543, 0.06133788079023361, -0.029756110161542892, 0.0005464057321660221, 0.046288710087537766, -0.02996002696454525, -0.052424393594264984, 0.0095286313444376, 0.06596474349498749, -0.09580183774232864, -0.02562480792403221, 0.05752956494688988, -0.03581124171614647, -0.12119637429714203, -0.00020607425540219992, -0.07819286733865738, 0.10235030204057693, 0.018308132886886597, 0.015066631138324738, 0.08016080409288406, -0.14616335928440094, 0.05828424543142319, 0.07660993933677673, -0.0514969602227211, 0.04972162842750549, 0.014348452910780907, -0.07560069113969803 ]
0.131687
`message\_sent`\*\*: inbound + outbound message hooks. - \*\*`session\_start` / `session\_end`\*\*: session lifecycle boundaries. - \*\*`gateway\_start` / `gateway\_stop`\*\*: gateway lifecycle events. See [Plugins](/plugin#plugin-hooks) for the hook API and registration details. ## Streaming + partial replies - Assistant deltas are streamed from pi-agent-core and emitted as `assistant` events. - Block streaming can emit partial replies either on `text\_end` or `message\_end`. - Reasoning streaming can be emitted as a separate stream or as block replies. - See [Streaming](/concepts/streaming) for chunking and block reply behavior. ## Tool execution + messaging tools - Tool start/update/end events are emitted on the `tool` stream. - Tool results are sanitized for size and image payloads before logging/emitting. - Messaging tool sends are tracked to suppress duplicate assistant confirmations. ## Reply shaping + suppression - Final payloads are assembled from: - assistant text (and optional reasoning) - inline tool summaries (when verbose + allowed) - assistant error text when the model errors - `NO\_REPLY` is treated as a silent token and filtered from outgoing payloads. - Messaging tool duplicates are removed from the final payload list. - If no renderable payloads remain and a tool errored, a fallback tool error reply is emitted (unless a messaging tool already sent a user-visible reply). ## Compaction + retries - Auto-compaction emits `compaction` stream events and can trigger a retry. - On retry, in-memory buffers and tool summaries are reset to avoid duplicate output. - See [Compaction](/concepts/compaction) for the compaction pipeline. ## Event streams (today) - `lifecycle`: emitted by `subscribeEmbeddedPiSession` (and as a fallback by `agentCommand`) - `assistant`: streamed deltas from pi-agent-core - `tool`: streamed tool events from pi-agent-core ## Chat channel handling - Assistant deltas are buffered into chat `delta` messages. - A chat `final` is emitted on \*\*lifecycle end/error\*\*. ## Timeouts - `agent.wait` default: 30s (just the wait). `timeoutMs` param overrides. - Agent runtime: `agents.defaults.timeoutSeconds` default 600s; enforced in `runEmbeddedPiAgent` abort timer. ## Where things can end early - Agent timeout (abort) - AbortSignal (cancel) - Gateway disconnect or RPC timeout - `agent.wait` timeout (wait-only, does not stop agent)
https://github.com/openclaw/openclaw/blob/main//docs/concepts/agent-loop.md
main
opebclaw
[ -0.06734863668680191, -0.06633787602186203, -0.009343307465314865, 0.014608935452997684, 0.05064060911536217, -0.04701276868581772, 0.0529891774058342, -0.013660101220011711, 0.056889645755290985, 0.01356162503361702, -0.02000896818935871, -0.04843418672680855, -0.021663906052708626, 0.00899107288569212, 0.04319487512111664, 0.028482044115662575, 0.09221973270177841, -0.09767301380634308, -0.06203899532556534, -0.13241633772850037, 0.04436340928077698, -0.02249392494559288, -0.036160778254270554, 0.06312993913888931, -0.06587330996990204, 0.0005941267008893192, 0.026298535987734795, -0.030272850766777992, -0.0060011944733560085, -0.023709934204816818, -0.009723423980176449, -0.012796840630471706, -0.04861060529947281, 0.033877283334732056, -0.013376185670495033, 0.06098897010087967, 0.027412936091423035, -0.008150816895067692, -0.0375293493270874, -0.03273860737681389, 0.021852955222129822, -0.07442458719015121, -0.039212822914123535, -0.038649123162031174, 0.020695064216852188, -0.02049912139773369, -0.04315660521388054, -0.004645684268325567, -0.10020225495100021, 0.040654804557561874, -0.0026508395094424486, -0.009057160466909409, 0.006905045825988054, 0.14897853136062622, 0.017506850883364677, 0.023592283949255943, -0.012508181855082512, 0.03273872286081314, -0.033465854823589325, -0.012584145180881023, -0.0862327367067337, -0.07714587450027466, -0.06894443184137344, 0.023810014128684998, -0.06886360794305801, 0.0028353314846754074, -0.0829877182841301, 0.04148831591010094, 0.059497199952602386, 0.006553959101438522, -0.06198866665363312, -0.0223854873329401, -0.10294238477945328, -0.017077071592211723, 0.05039490759372711, -0.004101349972188473, 0.04339452087879181, 0.0519416369497776, -0.05743464455008507, -0.08216245472431183, -0.02547461912035942, -0.032378893345594406, 0.042619213461875916, 0.01736706867814064, -0.009126158431172371, 0.027479609474539757, 0.024981990456581116, 0.04649580642580986, 0.022449633106589317, 0.05876700207591057, -0.027699796482920647, -0.013498556800186634, 0.05448141694068909, 0.04301215708255768, -0.020086994394659996, 0.09443777799606323, -0.07427189499139786, -0.09202366322278976, 0.005223136395215988, 0.049516040831804276, 0.00858704186975956, 0.04111265763640404, -0.009915606118738651, -0.02171856164932251, 0.024918273091316223, -0.05573544278740883, -0.037625014781951904, 0.014903140254318714, -0.011167794466018677, -0.03920191153883934, -0.04585559293627739, -0.03242635354399681, 0.10525733977556229, -0.02309388853609562, 0.09293977171182632, 0.029802266508340836, 0.03580494225025177, 0.04073772579431534, 0.032731473445892334, 0.015458055771887302, 0.033918239176273346, -0.06533404439687729, -0.06697408109903336, 0.03045654110610485, 0.13001403212547302, 0.030161676928400993, 0.02537377178668976, 4.060450259301933e-33, 0.06286142766475677, -0.01197822391986847, -0.03429418057203293, 0.08400256186723709, 0.006150770001113415, 0.08141449093818665, 0.02456062100827694, 0.0011235587298870087, -0.008436080068349838, -0.0021699792705476284, -0.05777269974350929, 0.01672409661114216, 0.0022076622117310762, 0.037864528596401215, -0.014996069483458996, -0.061469875276088715, -0.0131356380879879, 0.04428907483816147, 0.0019848188385367393, 0.015296520665287971, 0.007910347543656826, -0.036923788487911224, -0.06993217021226883, 0.06821184605360031, 0.0901174396276474, 0.010882792994379997, 0.014342166483402252, -0.03666006028652191, -0.028815902769565582, 0.011717653833329678, -0.052005618810653687, 0.03054971434175968, 0.015851207077503204, 0.057615213096141815, 0.015826428309082985, -0.07631192356348038, -0.07812730222940445, -0.036033399403095245, -0.02978595905005932, -0.005793098360300064, -0.034729111939668655, 0.02351696789264679, -0.09033287316560745, -0.07062003016471863, -0.10371269285678864, -0.1007639542222023, -0.05193495750427246, -0.041648007929325104, 0.0737648457288742, -0.03281219303607941, 0.08463618159294128, 0.030761726200580597, 0.09787430614233017, -0.014406445436179638, 0.0260342787951231, -0.03766994923353195, -0.025928154587745667, 0.06290075927972794, 0.02134057506918907, 0.02985263429582119, 0.03616751357913017, -0.000314717908622697, -0.019653990864753723, 0.010120331309735775, 0.07058355212211609, 0.02608666382730007, -0.014984240755438805, 0.024746274575591087, 0.018468089401721954, -0.03565802797675133, -0.08589761704206467, 0.01176554523408413, 0.042780835181474686, 0.04127645120024681, -0.0045517822727561, -0.05816597118973732, -0.0298595167696476, 0.020734615623950958, 0.05583886429667473, 0.017108673229813576, -0.01351071521639824, -0.03395587205886841, -0.004420851822942495, 0.021649012342095375, 0.011797812767326832, -0.041515953838825226, 0.014461006969213486, -0.09334142506122589, -0.04157014191150665, 0.035174645483493805, -0.13037218153476715, 0.028387008234858513, 0.0511896125972271, 0.09287066757678986, -0.030700044706463814, -4.9864602604995904e-33, -0.01683718152344227, 0.026790931820869446, -0.14450734853744507, 0.015329444780945778, -0.05633828416466713, -0.006079507060348988, 0.07752639055252075, 0.06707953661680222, 0.06865796446800232, -0.007166244089603424, -0.04863051325082779, 0.014799258671700954, -0.003936931025236845, 0.011756213381886482, -0.014812595210969448, -0.07515063881874084, 0.014075957238674164, -0.06880423426628113, 0.005688412580639124, -0.0039411382749676704, -0.06661422550678253, -0.01684214547276497, -0.07720425724983215, -0.04877606779336929, 0.02070937678217888, -0.009261094033718109, 0.04124956205487251, 0.05362116917967796, -0.012030019424855709, -0.0426228828728199, -0.005486368667334318, 0.042501598596572876, -0.021696245297789574, 0.01636693999171257, -0.02608676813542843, -0.06343890726566315, 0.09223733097314835, 0.016534995287656784, -0.0016147885471582413, 0.011364883743226528, 0.14707139134407043, -0.030215615406632423, -0.04258127138018608, 0.0009374383371323347, 0.03154006227850914, -0.0014401217922568321, -0.07623299956321716, -0.0026630249340087175, -0.11541289836168289, 0.013996139168739319, -0.036117859184741974, -0.019687283784151077, 0.009729447774589062, 0.09635137021541595, -0.022015811875462532, -0.02409627102315426, 0.12150459736585617, 0.007709341589361429, 0.015249532647430897, -0.0701836347579956, -0.0351705364882946, -0.06516121327877045, 0.03984503448009491, -0.00024948923964984715, 0.08672371506690979, 0.044526517391204834, 0.06551013886928558, -0.005172328557819128, 0.027528144419193268, -0.020504891872406006, 0.13046085834503174, -0.05034792795777321, -0.029710622504353523, 0.013062587939202785, 0.13925468921661377, -0.0028523369692265987, -0.06023721769452095, -0.14348378777503967, -0.06426125019788742, 0.0053419084288179874, -0.11845596879720688, 0.0064824302680790424, -0.014262942597270012, 0.05862966179847717, 0.01974852755665779, -0.00975433923304081, -0.022826438769698143, 0.05928637459874153, 0.03352459520101547, -0.004813082981854677, 0.016399631276726723, -0.01717022992670536, -0.02942691743373871, 0.06516602635383606, -0.04467399790883064, -5.3410978750889626e-8, -0.02523515187203884, -0.08524198830127716, -0.010313162580132484, 0.0679788738489151, 0.028841683641076088, 0.053690649569034576, 0.024333825334906578, 0.02451147884130478, 0.011232572607696056, -0.04350452870130539, 0.02526259981095791, 0.0020677547436207533, 0.012340158224105835, -0.033412132412195206, 0.09376278519630432, 0.0322876051068306, 0.007682648953050375, -0.05084206536412239, -0.03998461738228798, -0.0804261565208435, 0.04563098028302193, 0.018210958689451218, -0.05647381767630577, 0.005347328260540962, -0.029818933457136154, -0.020154597237706184, 0.05413959175348282, 0.09010139107704163, -0.08721615374088287, -0.08973091840744019, -0.011689870618283749, -0.016659602522850037, 0.05357619374990463, -0.017972534522414207, 0.024545036256313324, 0.09913503378629684, -0.005554518662393093, -0.049462150782346725, 0.028694946318864822, 0.05534110218286514, 0.030127037316560745, 0.012618012726306915, -0.05829973518848419, -0.024874987080693245, 0.07972656935453415, 0.055682532489299774, -0.04464319720864296, -0.049472760409116745, 0.006141760386526585, 0.06996670365333557, -0.03625618666410446, 0.02024211548268795, 0.020842812955379486, 0.054417528212070465, 0.004299401771277189, -0.03790045902132988, 0.07408546656370163, -0.12391716986894608, 0.054376233369112015, 0.042397722601890564, 0.06118465214967728, 0.10225539654493332, 0.013304310850799084, -0.065952830016613 ]
0.168117
# Markdown formatting OpenClaw formats outbound Markdown by converting it into a shared intermediate representation (IR) before rendering channel-specific output. The IR keeps the source text intact while carrying style/link spans so chunking and rendering can stay consistent across channels. ## Goals - \*\*Consistency:\*\* one parse step, multiple renderers. - \*\*Safe chunking:\*\* split text before rendering so inline formatting never breaks across chunks. - \*\*Channel fit:\*\* map the same IR to Slack mrkdwn, Telegram HTML, and Signal style ranges without re-parsing Markdown. ## Pipeline 1. \*\*Parse Markdown -> IR\*\* - IR is plain text plus style spans (bold/italic/strike/code/spoiler) and link spans. - Offsets are UTF-16 code units so Signal style ranges align with its API. - Tables are parsed only when a channel opts into table conversion. 2. \*\*Chunk IR (format-first)\*\* - Chunking happens on the IR text before rendering. - Inline formatting does not split across chunks; spans are sliced per chunk. 3. \*\*Render per channel\*\* - \*\*Slack:\*\* mrkdwn tokens (bold/italic/strike/code), links as ``. - \*\*Telegram:\*\* HTML tags (`**`, `*`, `~~`, ````` `, ` ``` `, ``). - **Signal:** plain text + `text-style` ranges; links become `label (url)` when label differs. ## IR example Input Markdown: ```markdown Hello **world** — see [docs](https://docs.openclaw.ai). ``` IR (schematic): ```json { "text": "Hello world — see docs.", "styles": [{ "start": 6, "end": 11, "style": "bold" }], "links": [{ "start": 19, "end": 23, "href": "https://docs.openclaw.ai" }] } ``` ## Where it is used - Slack, Telegram, and Signal outbound adapters render from the IR. - Other channels (WhatsApp, iMessage, MS Teams, Discord) still use plain text or their own formatting rules, with Markdown table conversion applied before chunking when enabled. ## Table handling Markdown tables are not consistently supported across chat clients. Use `markdown.tables` to control conversion per channel (and per account). - `code`: render tables as code blocks (default for most channels). - `bullets`: convert each row into bullet points (default for Signal + WhatsApp). - `off`: disable table parsing and conversion; raw table text passes through. Config keys: ```yaml channels: discord: markdown: tables: code accounts: work: markdown: tables: off ``` ## Chunking rules - Chunk limits come from channel adapters/config and are applied to the IR text. - Code fences are preserved as a single block with a trailing newline so channels render them correctly. - List prefixes and blockquote prefixes are part of the IR text, so chunking does not split mid-prefix. - Inline styles (bold/italic/strike/inline-code/spoiler) are never split across chunks; the renderer reopens styles inside each chunk. If you need more on chunking behavior across channels, see [Streaming + chunking](/concepts/streaming). ## Link policy - **Slack:** `[label](url)` -> ``; bare URLs remain bare. Autolink is disabled during parse to avoid double-linking. - **Telegram:** `[label](url)` -> `label` (HTML parse mode). - **Signal:** `[label](url)` -> `label (url)` unless label matches the URL. ## Spoilers Spoiler markers (`||spoiler||`) are parsed only for Signal, where they map to SPOILER style ranges. Other channels treat them as plain text. ## How to add or update a channel formatter 1. **Parse once:** use the shared `markdownToIR(...)` helper with channel-appropriate options (autolink, heading style, blockquote prefix). 2. **Render:** implement a renderer with `renderMarkdownWithMarkers(...)` and a style marker map (or Signal style ranges). 3. **Chunk:** call `chunkMarkdownIR(...)` before rendering; render each chunk. 4. **Wire adapter:** update the channel outbound adapter to use the new chunker and renderer. 5. **Test:** add or update format tests and an outbound delivery test if the channel uses chunking. ## Common gotchas - Slack angle-bracket tokens (`<@U123>`, `<#C123>`, ``) must be preserved; escape raw HTML safely. - Telegram HTML requires escaping text outside tags
https://github.com/openclaw/openclaw/blob/main//docs/concepts/markdown-formatting.md
main
opebclaw
[ -0.043157730251550674, 0.03434517979621887, 0.020932752639055252, 0.03226003050804138, 0.036313001066446304, -0.059807389974594116, -0.05870551988482475, 0.007411098573356867, 0.0025115865282714367, 0.013752617873251438, -0.07358933985233307, -0.03168874233961105, -0.00822532456368208, -0.015600823797285557, 0.0944361761212349, 0.06130656599998474, 0.025101391598582268, -0.00906775239855051, -0.07141594588756561, 0.005212592426687479, 0.0878136083483696, 0.013814663514494896, -0.0149839473888278, 0.018430527299642563, 0.039473939687013626, -0.028645040467381477, -0.029949430376291275, 0.0441795252263546, 0.06135396286845207, -0.03670508414506912, 0.027592716738581657, -0.09302688390016556, 0.01986398547887802, 0.013884187676012516, 0.0747053399682045, 0.10007154941558838, 0.06835559010505676, -0.008605774492025375, -0.033601053059101105, 0.060259860008955, -0.023128872737288475, -0.08351443707942963, -0.03541906923055649, -0.057371221482753754, -0.01564653217792511, -0.049919795244932175, -0.0148959094658494, -0.024769140407443047, -0.10767004638910294, -0.03837082162499428, -0.09220705181360245, 0.0010669284965842962, -0.041853006929159164, 0.05880884826183319, -0.004857436753809452, -0.008561783470213413, -0.06166146323084831, -0.04127923399209976, 0.00421540392562747, -0.060996271669864655, -0.07062388956546783, 0.0007019807817414403, 0.024459807202219963, -0.0007677809335291386, 0.012818722985684872, 0.04885987564921379, -0.013691941276192665, 0.01418647076934576, 0.005885298829525709, 0.028287839144468307, -0.06913963705301285, -0.021463951095938683, -0.050060853362083435, -0.01122630201280117, -0.002841651439666748, 0.05499062314629555, 0.0657031312584877, 0.0674351304769516, -0.07483614981174469, -0.07296217232942581, -0.004060683771967888, -0.032685793936252594, -0.028694070875644684, 0.04470956698060036, -0.03129671514034271, 0.06670710444450378, 0.01538743358105421, -0.0484386682510376, -0.033613286912441254, 0.042842891067266464, -0.013303386978805065, -0.04839475080370903, 0.05649180710315704, 0.054543495178222656, -0.04527599737048149, -0.002063174033537507, 0.009556985460221767, -0.044734545052051544, 0.03204550966620445, 0.06259419023990631, -0.0066185565665364265, -0.011599905788898468, 0.008998253382742405, -0.0673450380563736, -0.04908127337694168, -0.043137650936841965, 0.0014315905282273889, 0.12594808638095856, 0.012011822313070297, -0.039470333606004715, 0.07261617481708527, 0.01617065630853176, -0.0399695560336113, -0.09841007739305496, 0.02109132893383503, 0.005575359798967838, -0.042771123349666595, -0.06423994898796082, 0.10159672051668167, 0.05884632468223572, 0.0366535559296608, 0.02736656181514263, -0.09366728365421295, 0.06336526572704315, 0.0843425914645195, 0.016169842332601547, 0.07485411316156387, 8.702720263750988e-33, 0.07257083803415298, 0.0028759113047271967, -0.07670662552118301, -0.0219634547829628, 0.07239668071269989, 0.07439219951629639, -0.10226429998874664, -0.04252004623413086, -0.04454416781663895, 0.0669708102941513, 0.07977872341871262, -0.0832660123705864, -0.02586228772997856, -0.014809788204729557, 0.011788426898419857, -0.034061841666698456, -0.03002006746828556, -0.0058580669574439526, -0.06059486046433449, 0.05696626752614975, -0.07352445274591446, 0.0033573806285858154, -0.03831111639738083, 0.008738917298614979, -0.03406747430562973, 0.08304812759160995, -0.02842397801578045, 0.0030096336267888546, -0.10085619240999222, 0.009039988741278648, 0.034041572362184525, -0.025381747633218765, -0.005291273817420006, -0.030450807884335518, 0.006591275334358215, 0.008925178088247776, -0.05084376782178879, -0.05496928468346596, -0.034571509808301926, 0.025715483352541924, -0.02894684486091137, 0.0488441064953804, -0.0031316045206040144, -0.034995805472135544, 0.0007600472890771925, -0.0708203837275505, 0.002256682375445962, 0.073937326669693, -0.023765506222844124, -0.028920041397213936, 0.059787195175886154, 0.08737639337778091, 0.08806786686182022, -0.00724380137398839, 0.032291799783706665, -0.052160073071718216, -0.010586284101009369, -0.03738335892558098, 0.15133239328861237, 0.06953929364681244, -0.03365790843963623, -0.04821249842643738, 0.018250402063131332, 0.006786634214222431, -0.05520373582839966, 0.05495583266019821, 0.049606967717409134, 0.025759568437933922, -0.02769079990684986, -0.027427135035395622, -0.07360728085041046, 0.05153319612145424, 0.005092418286949396, 0.008067312650382519, -0.04524209350347519, -0.059042371809482574, -0.012106281705200672, -0.07074058800935745, 0.12444032728672028, -0.05707458779215813, -0.008770721033215523, 0.0440092496573925, 0.031565111130476, -0.050379678606987, -0.013999979943037033, -0.02461360953748226, -0.013963744044303894, -0.153265118598938, -0.001787011045962572, 0.05799366533756256, -0.02358252927660942, -0.037012096494436264, -0.031784217804670334, -0.08009938895702362, 0.04412795603275299, -8.227231329475434e-33, 0.09128370881080627, 0.09031524509191513, -0.06093006581068039, -0.004467986989766359, -0.039210185408592224, 0.0034009565133601427, 0.0687640979886055, 0.036210570484399796, 0.01593228615820408, -0.013239937834441662, -0.013306439854204655, -0.018505671992897987, -0.10611550509929657, -0.07723046094179153, -0.046530645340681076, -0.016712114214897156, 0.05093902349472046, -0.023246727883815765, 0.07193931937217712, -0.007834292948246002, 0.0159918200224638, -0.05323680117726326, -0.05107324942946434, 0.07818184792995453, 0.04974011331796646, 0.028683051466941833, -0.018290769308805466, 0.06778997927904129, 0.019819770008325577, -0.03682756796479225, 0.025030892342329025, 0.016202693805098534, 0.009416643530130386, -0.05110163986682892, -0.07195379585027695, -0.010896177031099796, -0.043840307742357254, 0.09662578999996185, 0.06927913427352905, -0.011007214896380901, 0.1214788481593132, 0.00470568984746933, -0.08008323609828949, 0.02275995910167694, -0.06128528341650963, 0.060067299753427505, -0.05619996041059494, 0.0015947438078001142, -0.0628935769200325, 0.03402978554368019, 0.04484725371003151, 0.0032903035171329975, -0.01840388774871826, 0.024536652490496635, -0.05288395285606384, -0.04851067438721657, -0.0314827524125576, -0.026052920147776604, -0.1156088337302208, -0.04349804297089577, -0.09094167500734329, 0.01143337320536375, 0.09842094033956528, 0.025997089222073555, 0.12518435716629028, -0.05961832031607628, 0.0636458471417427, -0.04997451603412628, -0.06152943894267082, 0.010608037002384663, 0.021618325263261795, -0.08945299685001373, 0.003811585484072566, -0.023934051394462585, 0.04641549289226532, -0.0006740771350450814, -0.03654714673757553, 0.02113829180598259, 0.007986179552972317, 0.10433370620012283, -0.01642020046710968, 0.009822371415793896, 0.012170719914138317, 0.003025954822078347, -0.007479480002075434, 0.0762370377779007, 0.008472603745758533, 0.16632021963596344, -0.041130684316158295, 0.01768537051975727, -0.03350537642836571, 0.06365904211997986, 0.01737087033689022, 0.09019672125577927, 0.053342971950769424, -5.374819878056769e-8, -0.05143526941537857, -0.07792064547538757, -0.12103071808815002, 0.04446864873170853, -0.09478581696748734, 0.000678985146805644, 0.022230522707104683, -0.018330492079257965, -0.039428405463695526, -0.02172231115400791, 0.06569109857082367, 0.044992804527282715, -0.039402496069669724, -0.041794322431087494, -0.04091901332139969, 0.06423041224479675, -0.05154597759246826, -0.04327436164021492, -0.0581829659640789, -0.0063717663288116455, -0.042474497109651566, 0.030654115602374077, -0.030700061470270157, 0.0541643425822258, 0.010767802596092224, 0.027167728170752525, -0.05568045377731323, 0.10326247662305832, 0.010732246562838554, 0.018957030028104782, 0.008099297992885113, 0.03004521131515503, 0.019839540123939514, -0.01585664227604866, -0.02908843569457531, 0.015002851374447346, 0.023289401084184647, 0.010635780170559883, 0.07142039388418198, 0.10059193521738052, 0.04224257543683052, 0.002091440837830305, -0.03357292711734772, -0.03512321412563324, 0.029738634824752808, -0.00411453191190958, -0.06459386646747589, 0.027320345863699913, -0.03898695111274719, 0.012758245691657066, 0.03288234770298004, -0.013350777328014374, -0.049032311886548996, 0.01833490841090679, 0.009309304878115654, -0.01856158673763275, 0.05334051698446274, 0.021924667060375214, 0.016385681927204132, 0.05163724720478058, 0.06933305412530899, -0.03890274092555046, 0.0678805485367775, -0.021674204617738724 ]
0.016106
adapter to use the new chunker and renderer. 5. **Test:** add or update format tests and an outbound delivery test if the channel uses chunking. ## Common gotchas - Slack angle-bracket tokens (`<@U123>`, `<#C123>`, ``) must be preserved; escape raw HTML safely. - Telegram HTML requires escaping text outside tags to avoid broken markup. - Signal style ranges depend on UTF-16 offsets; do not use code point offsets. - Preserve trailing newlines for fenced code blocks so closing markers land on their own line. ``` ````~~***
https://github.com/openclaw/openclaw/blob/main//docs/concepts/markdown-formatting.md
main
opebclaw
[ -0.1031891331076622, 0.020438099279999733, 0.01954563520848751, -0.04444881156086922, -0.001341431518085301, -0.03494349494576454, -0.039874836802482605, -0.018551407381892204, -0.033551786094903946, 0.010069274343550205, -0.006467492785304785, -0.03820652887225151, 0.003493746742606163, 0.01855257712304592, 0.13131499290466309, 0.05942125618457794, 0.00962044857442379, -0.04297340661287308, 0.0115793626755476, -0.027883628383278847, 0.03210952877998352, 0.00011585730680963024, -0.0019010070245712996, 0.07318177819252014, 0.06105896830558777, 0.0251904409378767, -0.008521216921508312, 0.041370999068021774, 0.05382872000336647, -0.03833666071295738, 0.061108704656362534, -0.06787670403718948, -0.007205898407846689, 0.019176295027136803, 0.03233666718006134, 0.09454129636287689, 0.02615993097424507, 0.014924710616469383, 0.02340659312903881, 0.027069348841905594, -0.023970184847712517, -0.06920944154262543, -0.06691061705350876, 0.015926845371723175, 0.0025368586648255587, -0.04374352842569351, -0.001548027852550149, 0.03298649936914444, -0.022072594612836838, -0.029908375814557076, -0.03938242793083191, -0.028131971135735512, -0.022713366895914078, 0.06615439057350159, 0.0009678320493549109, -0.026552531868219376, -0.05006843060255051, 0.04342524707317352, 0.030132997781038284, 0.0044713011011481285, -0.014385386370122433, 0.023502957075834274, 0.04392277076840401, 0.02172771282494068, -0.02268531359732151, 0.030269073322415352, -0.02205190435051918, 0.11210935562849045, 0.011971035040915012, 0.02457307279109955, -0.05565449967980385, -0.05361079424619675, -0.07676994055509567, 0.011665801517665386, 0.0021740419324487448, 0.023122556507587433, 0.05058026313781738, 0.030989112332463264, -0.08712849766016006, -0.04975388944149017, -0.05389106646180153, -0.06668290495872498, -0.022690512239933014, 0.022685781121253967, 0.006871527060866356, 0.07150112837553024, 0.019353248178958893, -0.01379959937185049, -0.0028394588734954596, 0.013467996381223202, -0.004115805961191654, -0.03515199199318886, 0.06683284044265747, 0.06599192321300507, -0.030842183157801628, -0.026011256501078606, -0.008435883559286594, -0.053751058876514435, -0.06573107093572617, 0.05249045416712761, 0.03807472437620163, -0.02395370788872242, -0.032476380467414856, -0.04940111190080643, 0.03894846513867378, -0.03585970029234886, 0.007912930101156235, 0.07167083770036697, 0.043460335582494736, 0.012478971853852272, 0.006494353991001844, 0.04262901097536087, -0.010470729321241379, -0.052233364433050156, -0.0038217545952647924, -0.010302150622010231, -0.0036780000664293766, -0.03641350567340851, 0.08944874256849289, 0.035806216299533844, 0.07886908948421478, -0.05031146854162216, -0.12738555669784546, 0.07046423107385635, 0.026709506288170815, 0.0451502799987793, 0.07414516061544418, 9.361290239115205e-33, 0.006252197083085775, 0.05397860333323479, -0.11792673170566559, 0.05952503904700279, 0.00023352913558483124, 0.04213322326540947, -0.08804868161678314, 0.0047986204735934734, -0.06285956501960754, 0.011312698014080524, 0.017862379550933838, -0.1258172243833542, 0.012566802091896534, 0.07775242626667023, -0.015451204963028431, -0.08385565131902695, -0.01712886616587639, -0.013084238395094872, -0.021365219727158546, 0.02628982625901699, -0.11488789319992065, -0.04512012004852295, -0.025996025651693344, -0.02165677584707737, -0.00019632987095974386, 0.11786218732595444, 0.015906846150755882, -0.05535046383738518, -0.054743509739637375, -0.00181588064879179, -0.025363940745592117, -0.06368012726306915, 0.04469037055969238, -0.021507885307073593, 0.0363508015871048, 0.00027641543420031667, -0.03985925391316414, -0.006106685381382704, -0.07118184119462967, 0.019313286989927292, 0.002316045807674527, -0.020626626908779144, -0.049037445336580276, 0.006273726001381874, 0.04568484425544739, -0.05651893466711044, -0.03279610723257065, 0.023292958736419678, -0.0015125623904168606, -0.014467674307525158, 0.040403109043836594, 0.07858917862176895, 0.01715085096657276, -0.007434156723320484, 0.053705085068941116, -0.10623867809772491, 0.003324114717543125, -0.07533922046422958, 0.061581604182720184, 0.007172870449721813, -0.04798727482557297, 0.009724822826683521, 0.031510695815086365, -0.03438272327184677, -0.013694132678210735, 0.045850470662117004, 0.00417964905500412, -0.006499491631984711, -0.03386872261762619, 0.003773213131353259, -0.08057229220867157, 0.0658981055021286, 0.000745279947295785, 0.09236326813697815, -0.1149071529507637, -0.025158168748021126, -0.07771886885166168, -0.007650572806596756, 0.09604084491729736, -0.03193547949194908, 0.03035045601427555, -0.02347826398909092, 0.047807153314352036, -0.024979395791888237, 0.061698075383901596, -0.05246987193822861, 0.055901192128658295, -0.1492929309606552, -0.029650922864675522, 0.05876648426055908, -0.03368766978383064, 0.018783418461680412, -0.0328294113278389, -0.08169947564601898, 0.020873654633760452, -8.44351788192292e-33, 0.01600690186023712, 0.06038423255085945, -0.050621069967746735, 0.02958957478404045, -0.05665389820933342, -0.029781654477119446, 0.05920037254691124, 0.08367201685905457, 0.00722353532910347, 0.04882732406258583, -0.06022705137729645, -0.01616702787578106, -0.04146778583526611, -0.004950708243995905, 0.004797059576958418, 0.007689413148909807, -0.024029118940234184, -0.001888427184894681, 0.04861291125416756, -0.01592395082116127, 0.00038426651735790074, -0.05111563205718994, -0.05626702308654785, 0.08779510110616684, 0.08978722244501114, 0.050433654338121414, 0.016378970816731453, 0.03199459984898567, 0.05568674951791763, -0.11992528289556503, 0.014007627964019775, -0.060120418667793274, -0.004616191610693932, -0.06824510544538498, 0.046552617102861404, 0.02192765101790428, 0.057971078902482986, 0.1440662443637848, -0.00023975575459189713, -0.009950709529221058, 0.1283314824104309, 0.02480589784681797, -0.0818396508693695, 0.061664532870054245, -0.07761020958423615, -0.024996193125844002, -0.06950169056653976, 0.049209848046302795, -0.15326689183712006, 0.06859919428825378, 0.07157855480909348, -0.07103440910577774, 0.024227889254689217, 0.024384498596191406, -0.0666806772351265, -0.06229976564645767, -0.005337563809007406, 0.030379636213183403, -0.03586434945464134, -0.06537900865077972, -0.034386470913887024, -0.06000099703669548, 0.03956316411495209, -0.008324695751070976, 0.12840157747268677, -0.09619838744401932, 0.030929705128073692, -0.021933799609541893, -0.08341652154922485, 0.0020375456660985947, 0.10501822829246521, -0.03191610053181648, -0.029741762205958366, -0.0391949824988842, 0.09728964418172836, 0.012780658900737762, -0.01694471947848797, 0.01182814035564661, -0.00608747499063611, 0.05869361385703087, -0.015755556523799896, 0.010041318833827972, 0.04797925427556038, 0.01799268089234829, 0.050388678908348083, 0.07636883109807968, 0.012149102985858917, 0.07811056822538376, -0.055865947157144547, -0.04891641438007355, -0.030735505744814873, 0.08165562152862549, 0.02856764756143093, 0.10103356093168259, 0.07799617946147919, -5.4831922113862674e-8, -0.02339019626379013, -0.0672750398516655, -0.14016680419445038, -0.013036585412919521, -0.10223109275102615, 0.042169831693172455, -0.03883278742432594, -0.11008165776729584, -0.01161460392177105, -0.026540247723460197, 0.03957224264740944, 0.00008343515219166875, -0.06924095004796982, 0.01762460730969906, -0.02628692239522934, -0.03388318046927452, -0.07106159627437592, 0.015251477248966694, -0.03856548294425011, 0.036021701991558075, 0.019845930859446526, 0.08273039758205414, -0.03708929196000099, -0.008764107711613178, 0.009299423545598984, -0.006310209631919861, 0.00610153004527092, 0.1159733459353447, -0.009401482529938221, -0.046781718730926514, 0.021749911829829216, 0.006325452588498592, 0.007767708506435156, -0.04297143220901489, -0.009311524219810963, 0.04237097129225731, -0.035312388092279434, -0.01589367352426052, 0.06502445787191391, 0.11743996292352676, 0.02685072086751461, -0.04595694690942764, -0.05947251617908478, -0.041041336953639984, 0.00532432459294796, -0.06825921684503555, -0.01171370130032301, -0.023978320881724358, -0.018314668908715248, -0.007705064956098795, 0.02166324481368065, -0.015476329252123833, -0.028669992461800575, -0.011808712035417557, 0.01985991559922695, -0.05165928602218628, 0.07744141668081284, 0.008331362158060074, 0.04161616787314415, 0.04431883245706558, 0.048442721366882324, 0.042959947139024734, 0.02782774157822132, -0.02191964164376259 ]
0.082686
# Session Tools Goal: small, hard-to-misuse tool set so agents can list sessions, fetch history, and send to another session. ## Tool Names - `sessions\_list` - `sessions\_history` - `sessions\_send` - `sessions\_spawn` ## Key Model - Main direct chat bucket is always the literal key `"main"` (resolved to the current agent’s main key). - Group chats use `agent:::group:` or `agent:::channel:` (pass the full key). - Cron jobs use `cron:`. - Hooks use `hook:` unless explicitly set. - Node sessions use `node-` unless explicitly set. `global` and `unknown` are reserved values and are never listed. If `session.scope = "global"`, we alias it to `main` for all tools so callers never see `global`. ## sessions\_list List sessions as an array of rows. Parameters: - `kinds?: string[]` filter: any of `"main" | "group" | "cron" | "hook" | "node" | "other"` - `limit?: number` max rows (default: server default, clamp e.g. 200) - `activeMinutes?: number` only sessions updated within N minutes - `messageLimit?: number` 0 = no messages (default 0); >0 = include last N messages Behavior: - `messageLimit > 0` fetches `chat.history` per session and includes the last N messages. - Tool results are filtered out in list output; use `sessions\_history` for tool messages. - When running in a \*\*sandboxed\*\* agent session, session tools default to \*\*spawned-only visibility\*\* (see below). Row shape (JSON): - `key`: session key (string) - `kind`: `main | group | cron | hook | node | other` - `channel`: `whatsapp | telegram | discord | signal | imessage | webchat | internal | unknown` - `displayName` (group display label if available) - `updatedAt` (ms) - `sessionId` - `model`, `contextTokens`, `totalTokens` - `thinkingLevel`, `verboseLevel`, `systemSent`, `abortedLastRun` - `sendPolicy` (session override if set) - `lastChannel`, `lastTo` - `deliveryContext` (normalized `{ channel, to, accountId }` when available) - `transcriptPath` (best-effort path derived from store dir + sessionId) - `messages?` (only when `messageLimit > 0`) ## sessions\_history Fetch transcript for one session. Parameters: - `sessionKey` (required; accepts session key or `sessionId` from `sessions\_list`) - `limit?: number` max messages (server clamps) - `includeTools?: boolean` (default false) Behavior: - `includeTools=false` filters `role: "toolResult"` messages. - Returns messages array in the raw transcript format. - When given a `sessionId`, OpenClaw resolves it to the corresponding session key (missing ids error). ## sessions\_send Send a message into another session. Parameters: - `sessionKey` (required; accepts session key or `sessionId` from `sessions\_list`) - `message` (required) - `timeoutSeconds?: number` (default >0; 0 = fire-and-forget) Behavior: - `timeoutSeconds = 0`: enqueue and return `{ runId, status: "accepted" }`. - `timeoutSeconds > 0`: wait up to N seconds for completion, then return `{ runId, status: "ok", reply }`. - If wait times out: `{ runId, status: "timeout", error }`. Run continues; call `sessions\_history` later. - If the run fails: `{ runId, status: "error", error }`. - Announce delivery runs after the primary run completes and is best-effort; `status: "ok"` does not guarantee the announce was delivered. - Waits via gateway `agent.wait` (server-side) so reconnects don't drop the wait. - Agent-to-agent message context is injected for the primary run. - After the primary run completes, OpenClaw runs a \*\*reply-back loop\*\*: - Round 2+ alternates between requester and target agents. - Reply exactly `REPLY\_SKIP` to stop the ping‑pong. - Max turns is `session.agentToAgent.maxPingPongTurns` (0–5, default 5). - Once the loop ends, OpenClaw runs the \*\*agent‑to‑agent announce step\*\* (target agent only): - Reply exactly `ANNOUNCE\_SKIP` to stay silent. - Any other reply is sent to the target channel. - Announce step includes the original request + round‑1 reply + latest ping‑pong reply. ## Channel Field - For groups, `channel` is the channel recorded on the
https://github.com/openclaw/openclaw/blob/main//docs/concepts/session-tool.md
main
opebclaw
[ -0.05458036810159683, 0.02673329785466194, -0.04585045203566551, 0.031648747622966766, -0.021658165380358696, -0.03058413602411747, 0.08901402354240417, 0.003398350439965725, -0.019273247569799423, 0.06283790618181229, -0.03512084111571312, -0.06388052552938461, -0.01046472042798996, 0.04650570824742317, 0.014068745076656342, 0.01086487527936697, -0.010060470551252365, -0.07735338062047958, 0.014898421242833138, -0.11120903491973877, -0.005589833948761225, 0.09503430128097534, -0.012688333168625832, 0.0511217899620533, -0.049510203301906586, -0.08049134165048599, -0.03779146820306778, -0.02143947407603264, 0.03463756665587425, 0.02425342984497547, -0.0140184685587883, 0.05951974168419838, -0.015258130617439747, 0.04960731416940689, 0.04688660055398941, 0.10426458716392517, 0.059548359364271164, -0.020282452926039696, 0.012782786972820759, -0.021729810163378716, 0.06585504114627838, 0.04438401758670807, -0.05472608655691147, -0.07809432595968246, -0.03144214302301407, -0.0498335137963295, -0.04740709811449051, 0.008754613809287548, -0.023290054872632027, 0.031173916533589363, -0.015708724036812782, -0.05359197407960892, 0.00855470821261406, 0.10948074609041214, -0.010065515525639057, 0.07184621691703796, -0.06896042078733444, -0.00018194265430793166, 0.09454195946455002, -0.06316012889146805, -0.1098073348402977, -0.06442093104124069, -0.0009939924348145723, -0.03314700350165367, -0.06329692155122757, 0.02398514933884144, -0.059413596987724304, -0.013059932738542557, 0.03743783384561539, 0.03148496896028519, -0.010241479612886906, -0.042275991290807724, -0.0983576849102974, -0.10907969623804092, -0.016895748674869537, -0.016667503863573074, 0.004493583459407091, -0.03196031227707863, -0.12978455424308777, -0.03213924169540405, -0.10101362317800522, -0.08522815257310867, 0.014587086625397205, 0.0048884740099310875, -0.08695751428604126, -0.0007366049685515463, 0.004730432294309139, -0.047411106526851654, 0.0668095126748085, 0.008040840737521648, -0.0815315768122673, -0.033134616911411285, 0.03684866800904274, 0.030669843778014183, 0.029902296140789986, 0.06664685159921646, 0.02040783129632473, 0.04466743394732475, 0.020501410588622093, 0.06913723796606064, 0.01308551337569952, 0.06971926987171173, 0.0021047324407845736, -0.03365873917937279, 0.032318346202373505, 0.03587622195482254, -0.037023622542619705, -0.02342751808464527, -0.039089351892471313, -0.043856438249349594, -0.06602872163057327, 0.12665890157222748, 0.048287533223629, 0.007446922827512026, 0.08256791532039642, 0.0081302709877491, 0.02744358405470848, 0.037567801773548126, -0.0132153844460845, 0.06740264594554901, 0.1744510382413864, -0.033404022455215454, -0.006934280041605234, -0.0030149808153510094, 0.04711535573005676, 0.054704755544662476, 0.01500247698277235, 3.681549859123523e-33, 0.07000097632408142, -0.06183416768908501, -0.03735071420669556, 0.062209129333496094, 0.026115017011761665, 0.09432312101125717, 0.007899507880210876, 0.055439822375774384, -0.009649550542235374, -0.012144714593887329, -0.06250036507844925, 0.07177171111106873, -0.03594425320625305, -0.002854757709428668, -0.04420451819896698, 0.020937563851475716, -0.014404884539544582, -0.006794157437980175, 0.06481802463531494, 0.023389268666505814, -0.05354517698287964, 0.0064680445939302444, -0.06775496155023575, 0.05309014394879341, 0.03724076971411705, 0.000959933502599597, 0.022958513349294662, -0.04545007646083832, 0.036060530692338943, 0.009792122058570385, 0.016295194625854492, 0.09871168434619904, 0.02709084190428257, 0.05082792416214943, 0.008492272347211838, 0.031554244458675385, -0.05204390734434128, 0.03204089775681496, -0.0776119977235794, -0.0680876076221466, 0.03923947364091873, 0.01891625113785267, -0.05910908058285713, -0.10754664242267609, -0.01456355582922697, -0.1313408762216568, -0.025869470089673996, -0.022365350276231766, 0.061977509409189224, 0.02425914630293846, -0.04548564553260803, 0.06771022081375122, 0.028169026598334312, 0.01757604256272316, 0.005310928914695978, -0.09464449435472488, 0.016748538240790367, 0.03572125732898712, 0.049162641167640686, 0.04164072498679161, -0.014393586665391922, -0.003381619695574045, -0.01825571246445179, 0.07288143783807755, 0.04992199316620827, 0.0007897450122982264, -0.0055272579193115234, 0.04889720305800438, 0.050744831562042236, 0.0113117890432477, -0.011886882595717907, 0.11871998012065887, -0.030359474942088127, 0.028165092691779137, 0.015041835606098175, -0.11547226458787918, 0.050589513033628464, 0.006114416290074587, -0.004349067807197571, 0.02701619826257229, 0.04990333318710327, -0.021812574937939644, -0.059526361525058746, 0.024657832458615303, -0.06718632578849792, -0.06001465395092964, 0.0004526764387264848, -0.011404178105294704, -0.00907420925796032, -0.03619193285703659, -0.0717516839504242, -0.03483814001083374, -0.009687649086117744, 0.011815626174211502, -0.08847133815288544, -5.501783024904665e-33, 0.0403294637799263, -0.0016859734896570444, -0.05723026394844055, 0.03783806413412094, 0.00048720691120252013, -0.05138295516371727, 0.09777282923460007, -0.05825008824467659, 0.004524193704128265, -0.025983722880482674, -0.04938248172402382, 0.02429363690316677, 0.03165175020694733, 0.0014929622411727905, 0.0974801778793335, 0.01721980608999729, -0.061642736196517944, -0.14271055161952972, -0.029544703662395477, -0.04090948775410652, -0.04287859797477722, 0.04614843800663948, -0.023541593924164772, 0.04911108314990997, 0.023748083040118217, -0.03447714075446129, -0.021642299368977547, -0.004689802881330252, 0.01678839512169361, -0.005551912821829319, 0.006373602896928787, -0.021723225712776184, -0.05576309561729431, 0.08843503147363663, -0.03440389409661293, -0.08321087807416916, 0.04335654899477959, 0.11958114802837372, 0.002546540694311261, -0.00003392530561541207, 0.14538975059986115, 0.012106670066714287, -0.07389555126428604, -0.07152590155601501, -0.029353726655244827, 0.10848189890384674, -0.014431999996304512, 0.0947069376707077, -0.11469604820013046, 0.06150360777974129, -0.035427503287792206, -0.059123773127794266, -0.030704263597726822, -0.048882342875003815, 0.021319866180419922, -0.06314542144536972, 0.008560406975448132, -0.022642012685537338, 0.009214201010763645, -0.036878518760204315, 0.022746866568922997, -0.04764416441321373, 0.025345565751194954, 0.043301407247781754, -0.030602257698774338, -0.07821366935968399, -0.03894157335162163, 0.011337623000144958, 0.0546414777636528, 0.0323033481836319, 0.03427807241678238, -0.06977885216474533, -0.008211164735257626, -0.0051190052181482315, -0.009662372060120106, 0.04441232606768608, -0.06559451669454575, -0.11620438098907471, 0.025425007566809654, 0.06164715811610222, -0.08364538103342056, 0.052118830382823944, 0.03981863334774971, 0.03336377814412117, -0.01375146210193634, 0.024896424263715744, -0.020639685913920403, 0.12350822985172272, -0.019691385328769684, 0.04219866544008255, -0.014017320238053799, -0.0568230077624321, -0.02930436283349991, 0.005641441326588392, 0.03340074419975281, -4.878721426848642e-8, -0.01106262020766735, -0.01208928320556879, -0.024779891595244408, 0.08650799095630646, 0.04120977222919464, -0.04868186637759209, 0.038836244493722916, 0.06085991486907005, -0.014031249098479748, 0.04351208731532097, -0.004144274163991213, -0.07757619768381119, 0.030056336894631386, 0.00287623074837029, -0.004204260651022196, 0.020679472014307976, -0.02083377167582512, -0.03247486799955368, -0.02037668786942959, -0.03838774934411049, -0.03439537435770035, -0.05191725119948387, 0.020309923216700554, 0.05346110835671425, -0.04923229664564133, 0.010771640576422215, -0.04969160631299019, 0.08425546437501907, -0.05074121430516243, 0.020197661593556404, 0.027954936027526855, -0.019049061462283134, 0.01754043996334076, -0.00849183090031147, -0.04521637037396431, -0.02474949322640896, -0.08619657903909683, -0.02295881323516369, -0.010702553205192089, 0.021483685821294785, 0.00545191764831543, -0.0029196464456617832, -0.009198226034641266, -0.028736421838402748, -0.011732533574104309, -0.0349310003221035, -0.04111470282077789, 0.05264434590935707, 0.04414911940693855, 0.015376563183963299, -0.005892347544431686, 0.010016382671892643, 0.030871573835611343, 0.07857342064380646, 0.07595817744731903, -0.010387447662651539, 0.1071116104722023, -0.10306409746408463, 0.08006753027439117, -0.018561236560344696, -0.0021547868382185698, 0.02055017277598381, -0.07122740149497986, -0.022769464179873466 ]
0.063899
\*\*agent‑to‑agent announce step\*\* (target agent only): - Reply exactly `ANNOUNCE\_SKIP` to stay silent. - Any other reply is sent to the target channel. - Announce step includes the original request + round‑1 reply + latest ping‑pong reply. ## Channel Field - For groups, `channel` is the channel recorded on the session entry. - For direct chats, `channel` maps from `lastChannel`. - For cron/hook/node, `channel` is `internal`. - If missing, `channel` is `unknown`. ## Security / Send Policy Policy-based blocking by channel/chat type (not per session id). ```json { "session": { "sendPolicy": { "rules": [ { "match": { "channel": "discord", "chatType": "group" }, "action": "deny" } ], "default": "allow" } } } ``` Runtime override (per session entry): - `sendPolicy: "allow" | "deny"` (unset = inherit config) - Settable via `sessions.patch` or owner-only `/send on|off|inherit` (standalone message). Enforcement points: - `chat.send` / `agent` (gateway) - auto-reply delivery logic ## sessions\_spawn Spawn a sub-agent run in an isolated session and announce the result back to the requester chat channel. Parameters: - `task` (required) - `label?` (optional; used for logs/UI) - `agentId?` (optional; spawn under another agent id if allowed) - `model?` (optional; overrides the sub-agent model; invalid values error) - `runTimeoutSeconds?` (default 0; when set, aborts the sub-agent run after N seconds) - `cleanup?` (`delete|keep`, default `keep`) Allowlist: - `agents.list[].subagents.allowAgents`: list of agent ids allowed via `agentId` (`["\*"]` to allow any). Default: only the requester agent. Discovery: - Use `agents\_list` to discover which agent ids are allowed for `sessions\_spawn`. Behavior: - Starts a new `agent::subagent:` session with `deliver: false`. - Sub-agents default to the full tool set \*\*minus session tools\*\* (configurable via `tools.subagents.tools`). - Sub-agents are not allowed to call `sessions\_spawn` (no sub-agent → sub-agent spawning). - Always non-blocking: returns `{ status: "accepted", runId, childSessionKey }` immediately. - After completion, OpenClaw runs a sub-agent \*\*announce step\*\* and posts the result to the requester chat channel. - Reply exactly `ANNOUNCE\_SKIP` during the announce step to stay silent. - Announce replies are normalized to `Status`/`Result`/`Notes`; `Status` comes from runtime outcome (not model text). - Sub-agent sessions are auto-archived after `agents.defaults.subagents.archiveAfterMinutes` (default: 60). - Announce replies include a stats line (runtime, tokens, sessionKey/sessionId, transcript path, and optional cost). ## Sandbox Session Visibility Sandboxed sessions can use session tools, but by default they only see sessions they spawned via `sessions\_spawn`. Config: ```json5 { agents: { defaults: { sandbox: { // default: "spawned" sessionToolsVisibility: "spawned", // or "all" }, }, }, } ```
https://github.com/openclaw/openclaw/blob/main//docs/concepts/session-tool.md
main
opebclaw
[ -0.052132852375507355, 0.03203554451465607, 0.007240655831992626, -0.002470061182975769, 0.018325654789805412, -0.049746811389923096, 0.10407765209674835, -0.04865540936589241, 0.05140526592731476, 0.036088977009058, -0.0245609600096941, -0.026780573651194572, -0.05104507878422737, 0.0360422320663929, 0.0750625729560852, -0.02112998440861702, 0.0015683951787650585, -0.04258638247847557, -0.014420939609408379, -0.13836754858493805, 0.0685238167643547, 0.03384295478463173, 0.0132110845297575, 0.028930477797985077, -0.05011754855513573, -0.09538334608078003, 0.03215234726667404, 0.0429854616522789, -0.00849475059658289, 0.008640190586447716, 0.00869350228458643, 0.018976224586367607, -0.001481272978708148, 0.04126282036304474, -0.01342499814927578, 0.03745567426085472, 0.011765668168663979, 0.02091902494430542, 0.006922992877662182, 0.012111452408134937, 0.04283825680613518, -0.005637458059936762, -0.04633282124996185, -0.04459024593234062, 0.014989565126597881, -0.06005914881825447, -0.03656800463795662, 0.04882331192493439, -0.091064453125, 0.0863095074892044, -0.01724153943359852, -0.0003462635213509202, 0.051083847880363464, 0.1176222562789917, 0.01713843084871769, 0.059838682413101196, -0.06672337651252747, 0.10390952229499817, 0.07281471788883209, -0.0697549507021904, -0.040059253573417664, -0.08775252103805542, -0.029049091041088104, -0.010231697000563145, -0.09672925621271133, -0.004818955436348915, -0.04961412400007248, 0.02019762247800827, 0.02138729952275753, 0.03075992502272129, 0.040758851915597916, -0.04955901950597763, -0.037378471344709396, -0.07681606709957123, 0.03773918002843857, 0.02039874717593193, 0.0043852548114955425, 0.009565782733261585, -0.04452316090464592, 0.002882078057155013, -0.06637116521596909, -0.1305612325668335, -0.004786733537912369, 0.006529392208904028, -0.09648317843675613, 0.011020367965102196, 0.02370963618159294, -0.01502134371548891, 0.020731201395392418, -0.010296029038727283, -0.06585314124822617, -0.014203887432813644, 0.007987373508512974, 0.04553261026740074, -0.0035537085495889187, 0.09885759651660919, -0.059534311294555664, -0.026109833270311356, -0.041570570319890976, 0.09561996161937714, 0.02675117924809456, 0.003962553571909666, -0.016183432191610336, 0.030240874737501144, 0.039306897670030594, -0.03686346113681793, -0.004345593508332968, 0.02389354631304741, 0.030525190755724907, 0.04092215746641159, -0.084378182888031, 0.07041427493095398, 0.0690002366900444, 0.0182771235704422, 0.03569893166422844, 0.07662655413150787, 0.06513935327529907, 0.11232911795377731, 0.07304560393095016, -0.008155743591487408, 0.1679714173078537, -0.08187554776668549, 0.005102840252220631, 0.008868077769875526, 0.07246192544698715, 0.04571301117539406, 0.050445299595594406, 3.6135717554994395e-33, 0.05237700045108795, 0.02126215025782585, -0.03687306493520737, -0.03577328100800514, 0.02768542617559433, -0.002783482428640127, 0.027604389935731888, -0.0029288630466908216, -0.0022242001723498106, -0.02300707995891571, -0.05590539053082466, 0.009659943170845509, 0.017110727727413177, 0.011719560250639915, -0.0724593847990036, -0.025781260803341866, 0.02510986477136612, 0.034136202186346054, 0.061872273683547974, 0.026632161810994148, 0.01441415585577488, 0.013713358901441097, 0.002221131231635809, 0.0707257091999054, 0.03654921427369118, 0.019858403131365776, -0.012285793200135231, -0.04714203625917435, -0.012770872563123703, 0.017286943271756172, 0.04148726910352707, 0.04450413957238197, 0.0777779147028923, 0.05511286109685898, -0.0026094375643879175, -0.03808753937482834, -0.07335272431373596, -0.015740878880023956, 0.0033353453036397696, -0.07485436648130417, -0.008969669230282307, -0.048125408589839935, -0.10055340081453323, -0.0887727215886116, -0.04034465178847313, -0.11371570825576782, -0.05340888723731041, -0.0582621805369854, 0.02119920589029789, 0.0251228678971529, -0.010278078727424145, 0.09268034994602203, 0.017097920179367065, -0.03154905512928963, 0.05470931902527809, -0.11702749878168106, -0.008621441200375557, 0.06033948436379433, 0.03284943476319313, 0.011500782333314419, 0.04865909367799759, 0.003643978852778673, 0.04934830963611603, 0.0058263614773750305, 0.017212621867656708, 0.047427136451005936, -0.12037018686532974, 0.0230347141623497, 0.011876347474753857, -0.05653313174843788, -0.027105309069156647, 0.11163093894720078, -0.024790706112980843, 0.016857488080859184, -0.05652054026722908, -0.10065831243991852, -0.004224853124469519, 0.024379583075642586, 0.045817941427230835, -0.026690561324357986, 0.00403222069144249, -0.007059125695377588, -0.06280341744422913, 0.03463337942957878, -0.03762354701757431, -0.01898956671357155, 0.008463324047625065, -0.011539946310222149, -0.009565711952745914, 0.03442429006099701, -0.10344602167606354, 0.033183611929416656, -0.034051038324832916, 0.09457645565271378, -0.006885980721563101, -3.774678031725434e-33, -0.0052686771377921104, 0.013311825692653656, -0.04969533160328865, 0.02334052138030529, -0.03614772856235504, -0.052122585475444794, 0.05386338755488396, -0.001954224891960621, 0.09981173276901245, 0.00833607092499733, -0.03001466579735279, -0.023868229240179062, -0.006178501062095165, -0.007738939952105284, 0.0012225804384797812, -0.0027502330485731363, 0.04887741804122925, -0.04023376479744911, -0.001783188316039741, -0.010873453691601753, -0.02684592641890049, 0.02829495072364807, -0.07722795009613037, 0.05100386589765549, 0.010146091692149639, -0.07242149114608765, 0.057272400707006454, 0.03785112872719765, -0.023497959598898888, -0.04599236696958542, 0.009908132255077362, -0.008016372099518776, -0.04778991639614105, 0.03147216513752937, 0.021164074540138245, -0.032528601586818695, 0.04789595305919647, 0.17562644183635712, -0.04682436212897301, -0.02933758683502674, 0.14870017766952515, -0.060223568230867386, -0.09008465707302094, 0.007979698479175568, -0.006703723222017288, 0.0669679269194603, 0.03973051533102989, 0.053129829466342926, -0.13321876525878906, 0.048067010939121246, 0.013252959586679935, -0.03976966440677643, 0.08195238560438156, 0.003905056044459343, 0.009616800583899021, -0.009667772799730301, 0.026530582457780838, 0.0073717739433050156, 0.013168148696422577, -0.05009995773434639, -0.019207648932933807, -0.09620801359415054, 0.016588706523180008, 0.041038256138563156, 0.10880514979362488, -0.03329106792807579, -0.037076715379953384, 0.06880571693181992, 0.12498068064451218, -0.01348958257585764, 0.06620080769062042, -0.002684325911104679, -0.03894709423184395, 0.07452668994665146, 0.09676524996757507, 0.00019108614651486278, -0.04679109901189804, -0.11561904102563858, -0.05080496147274971, 0.07045748829841614, -0.09786033630371094, 0.0477687269449234, -0.04706187918782234, 0.034410495311021805, 0.05615565553307533, 0.07043766230344772, -0.021406032145023346, 0.10303009301424026, -0.01060104463249445, 0.02924194186925888, 0.04236947372555733, -0.032956644892692566, -0.05060867220163345, -0.026334771886467934, -0.01910172402858734, -4.96504810598708e-8, -0.031706418842077255, -0.08355291187763214, 0.006541282869875431, 0.0331028513610363, 0.008047728799283504, 0.014537339098751545, 0.08432742953300476, -0.06359344720840454, 0.012069852091372013, -0.04299914836883545, 0.0026551915798336267, 0.04069467633962631, 0.06823312491178513, -0.01804656721651554, 0.0006233103340491652, -0.015265428461134434, -0.0879414826631546, -0.0005776011967100203, -0.026407593861222267, -0.004763685632497072, -0.02975963056087494, -0.043466612696647644, -0.02719205431640148, 0.054100483655929565, -0.014103504829108715, -0.02275509387254715, 0.03254220262169838, 0.02199852280318737, -0.09901084005832672, -0.016726581379771233, -0.08242649585008621, -0.03775826469063759, 0.011017507873475552, -0.013688902370631695, -0.07133106142282486, 0.05880353972315788, -0.008569886907935143, 0.005705873016268015, 0.02497200109064579, 0.028604593127965927, -0.005727977491915226, -0.038432762026786804, -0.015297642908990383, -0.03684280812740326, -0.021176403388381004, 0.022239625453948975, -0.06364674121141434, -0.03252812847495079, 0.05229925364255905, -0.05539274960756302, -0.03256476670503616, 0.009167450480163097, 0.023923903703689575, 0.011453530751168728, 0.02110670693218708, 0.02275756001472473, 0.059456683695316315, -0.09372858703136444, 0.06485265493392944, 0.013745627366006374, 0.0327022559940815, 0.03915570303797722, -0.07015616446733475, -0.07254491001367569 ]
0.105934
# Command Queue (2026-01-16) We serialize inbound auto-reply runs (all channels) through a tiny in-process queue to prevent multiple agent runs from colliding, while still allowing safe parallelism across sessions. ## Why - Auto-reply runs can be expensive (LLM calls) and can collide when multiple inbound messages arrive close together. - Serializing avoids competing for shared resources (session files, logs, CLI stdin) and reduces the chance of upstream rate limits. ## How it works - A lane-aware FIFO queue drains each lane with a configurable concurrency cap (default 1 for unconfigured lanes; main defaults to 4, subagent to 8). - `runEmbeddedPiAgent` enqueues by \*\*session key\*\* (lane `session:`) to guarantee only one active run per session. - Each session run is then queued into a \*\*global lane\*\* (`main` by default) so overall parallelism is capped by `agents.defaults.maxConcurrent`. - When verbose logging is enabled, queued runs emit a short notice if they waited more than ~2s before starting. - Typing indicators still fire immediately on enqueue (when supported by the channel) so user experience is unchanged while we wait our turn. ## Queue modes (per channel) Inbound messages can steer the current run, wait for a followup turn, or do both: - `steer`: inject immediately into the current run (cancels pending tool calls after the next tool boundary). If not streaming, falls back to followup. - `followup`: enqueue for the next agent turn after the current run ends. - `collect`: coalesce all queued messages into a \*\*single\*\* followup turn (default). If messages target different channels/threads, they drain individually to preserve routing. - `steer-backlog` (aka `steer+backlog`): steer now \*\*and\*\* preserve the message for a followup turn. - `interrupt` (legacy): abort the active run for that session, then run the newest message. - `queue` (legacy alias): same as `steer`. Steer-backlog means you can get a followup response after the steered run, so streaming surfaces can look like duplicates. Prefer `collect`/`steer` if you want one response per inbound message. Send `/queue collect` as a standalone command (per-session) or set `messages.queue.byChannel.discord: "collect"`. Defaults (when unset in config): - All surfaces → `collect` Configure globally or per channel via `messages.queue`: ```json5 { messages: { queue: { mode: "collect", debounceMs: 1000, cap: 20, drop: "summarize", byChannel: { discord: "collect" }, }, }, } ``` ## Queue options Options apply to `followup`, `collect`, and `steer-backlog` (and to `steer` when it falls back to followup): - `debounceMs`: wait for quiet before starting a followup turn (prevents “continue, continue”). - `cap`: max queued messages per session. - `drop`: overflow policy (`old`, `new`, `summarize`). Summarize keeps a short bullet list of dropped messages and injects it as a synthetic followup prompt. Defaults: `debounceMs: 1000`, `cap: 20`, `drop: summarize`. ## Per-session overrides - Send `/queue ` as a standalone command to store the mode for the current session. - Options can be combined: `/queue collect debounce:2s cap:25 drop:summarize` - `/queue default` or `/queue reset` clears the session override. ## Scope and guarantees - Applies to auto-reply agent runs across all inbound channels that use the gateway reply pipeline (WhatsApp web, Telegram, Slack, Discord, Signal, iMessage, webchat, etc.). - Default lane (`main`) is process-wide for inbound + main heartbeats; set `agents.defaults.maxConcurrent` to allow multiple sessions in parallel. - Additional lanes may exist (e.g. `cron`, `subagent`) so background jobs can run in parallel without blocking inbound replies. - Per-session lanes guarantee that only one agent run touches a given session at a time. - No external dependencies or background worker threads; pure TypeScript + promises. ## Troubleshooting - If commands seem stuck, enable verbose logs and look for “queued for …ms” lines to confirm the
https://github.com/openclaw/openclaw/blob/main//docs/concepts/queue.md
main
opebclaw
[ -0.046516239643096924, -0.04851388558745384, -0.06493265926837921, -0.044298119843006134, -0.10358322411775589, -0.04507958143949509, 0.045204970985651016, -0.005792254116386175, 0.040358442813158035, 0.06446926295757294, -0.01015609223395586, -0.005247548688203096, -0.005258535034954548, -0.0325499102473259, -0.006315239239484072, -0.04785968363285065, 0.09636121988296509, -0.06412322074174881, -0.11031769961118698, -0.017233503982424736, 0.07197163254022598, -0.029123257845640182, 0.015136153437197208, 0.0026600619312375784, -0.08225403726100922, -0.04086123779416084, -0.04148871824145317, -0.039464112371206284, -0.016753211617469788, -0.07316676527261734, -0.0459531769156456, 0.05305126681923866, -0.032162364572286606, 0.04266001656651497, -0.004492642357945442, -0.027759885415434837, 0.02592718042433262, 0.0003219766076654196, 0.014014072716236115, -0.0650610625743866, 0.029947694391012192, -0.03762852028012276, -0.057733796536922455, 0.035333406180143356, 0.0172931719571352, -0.04032697156071663, -0.09272315353155136, 0.011517753824591637, -0.039348285645246506, -0.05036910995841026, -0.06258436292409897, 0.06263615936040878, 0.05123530328273773, 0.060031671077013016, 0.005144316237419844, 0.003977331332862377, 0.009523543529212475, 0.016437694430351257, 0.026921773329377174, 0.006266633048653603, -0.06966089457273483, -0.008301764726638794, -0.04634696617722511, 0.038560282438993454, -0.018854007124900818, -0.05036836490035057, 0.05328211933374405, -0.004453045316040516, 0.012934932485222816, 0.038505833595991135, -0.012081033550202847, -0.08473456650972366, -0.05899612233042717, 0.03292674571275711, 0.07156584411859512, 0.041473742574453354, -0.02059413306415081, -0.0022864644415676594, -0.06200588122010231, -0.09378168731927872, 0.0041763754561543465, -0.04477313160896301, 0.06169726327061653, 0.02027571201324463, 0.0002485266886651516, -0.06122925877571106, -0.03641700744628906, 0.00024470884818583727, 0.0637892484664917, 0.024271728470921516, 0.020525826141238213, 0.059539251029491425, 0.04332875832915306, 0.015377549454569817, 0.0029419809579849243, 0.09983329474925995, 0.0006000016583129764, -0.0030811100732535124, 0.009518362581729889, 0.04185924306511879, 0.05030902102589607, 0.010363297536969185, 0.03638063743710518, 0.04877003654837608, 0.010409149341285229, 0.0052613322623074055, 0.005638287868350744, -0.03841822221875191, -0.016957903280854225, -0.030936850234866142, 0.017104029655456543, 0.05852366238832474, 0.09015393257141113, 0.010867351666092873, 0.0008730258559808135, 0.07841023802757263, -0.005172260105609894, 0.02456257864832878, 0.10167784243822098, 0.0808790847659111, -0.00479626189917326, -0.05459727719426155, -0.04261639341711998, 0.020307153463363647, 0.10330955684185028, 0.021561715751886368, 0.06512870639562607, 7.48771020095787e-33, -0.01708679087460041, -0.0628691092133522, -0.04130085930228233, -0.06365704536437988, 0.01418636180460453, 0.017755473032593727, -0.004702326841652393, 0.04422901198267937, -0.07384943962097168, -0.04157594218850136, -0.06543873995542526, -0.013084042817354202, 0.012120564468204975, 0.0653134286403656, -0.04226214066147804, -0.029733482748270035, 0.02313004806637764, 0.04238926246762276, 0.00687120808288455, -0.020543700084090233, 0.07741105556488037, 0.0015850882045924664, 0.0030138976871967316, 0.008270952850580215, 0.03502755984663963, -0.004468825645744801, -0.0009214322199113667, -0.05284653231501579, 0.0914897471666336, 0.08597960323095322, -0.02294108271598816, 0.061096251010894775, -0.020848041400313377, 0.06649792939424515, -0.03386710211634636, 0.08143437653779984, -0.0943647250533104, -0.03474588319659233, -0.026704028248786926, -0.035754479467868805, -0.04682612791657448, 0.011051906272768974, -0.06904062628746033, -0.07954052090644836, -0.13933664560317993, -0.12957075238227844, -0.07931975275278091, 0.007975351996719837, -0.036783475428819656, 0.03492390736937523, 0.06200842186808586, 0.038876455277204514, -0.04154134914278984, 0.012020573019981384, 0.046412721276283264, 0.0309585090726614, 0.01218484528362751, 0.05278690531849861, -0.011249971576035023, 0.08428667485713959, -0.0010645976290106773, -0.07143858820199966, -0.03788767755031586, 0.057025182992219925, 0.09985630214214325, -0.01946369931101799, -0.006879686377942562, 0.018923107534646988, 0.03771388530731201, 0.018039599061012268, -0.05302465707063675, 0.00970979779958725, 0.020739072933793068, -0.018901335075497627, 0.010589705780148506, 0.025078492239117622, 0.015253446064889431, -0.04399924725294113, -0.051125820726156235, 0.000957031617872417, -0.09371712803840637, 0.09147730469703674, -0.059393707662820816, 0.016183165833353996, 0.0219580065459013, -0.03931483253836632, 0.0435635931789875, -0.018238574266433716, -0.02827593684196472, 0.03876621648669243, -0.0006065825582481921, -0.06189184635877609, 0.008775556460022926, 0.10311787575483322, -0.02542823553085327, -8.253102490769094e-33, -0.0004964719992130995, 0.00033192726550623775, -0.1015092208981514, 0.0930299311876297, -0.059458862990140915, -0.024025393649935722, -0.017170988023281097, -0.03233809769153595, -0.04212775453925133, -0.08322104066610336, -0.0777430534362793, 0.039776839315891266, 0.07063053548336029, 0.026610951870679855, 0.019302908331155777, -0.09599988162517548, 0.1015109270811081, -0.01581854373216629, 0.0073637645691633224, -0.00787013117223978, 0.017887914553284645, -0.022223826497793198, -0.010968707501888275, 0.0531700924038887, -0.0061159092001616955, -0.03935497999191284, -0.057914841920137405, -0.001302751014009118, -0.0394618883728981, -0.005185341462492943, 0.013551343232393265, -0.01666015200316906, -0.01995685324072838, -0.018756920471787453, -0.015634704381227493, 0.038553234189748764, 0.04070001840591431, 0.0564892552793026, -0.009779238142073154, 0.06099389120936394, 0.13471487164497375, -0.04669720679521561, -0.05357029289007187, -0.056654684245586395, 0.0013395310379564762, 0.02432962879538536, -0.06934648752212524, -0.033913467079401016, -0.04517155885696411, 0.027866164222359657, -0.008267302997410297, 0.007845301181077957, 0.049888018518686295, 0.07728804647922516, -0.0011815461330115795, -0.04518355056643486, 0.1045871302485466, 0.0348748080432415, -0.008813995867967606, 0.008687632158398628, 0.03269767388701439, 0.01158751081675291, -0.01051352545619011, -0.0012899814173579216, 0.09027877449989319, 0.011851279065012932, -0.017997974529862404, -0.10476880520582199, 0.02055056393146515, 0.003052371321246028, 0.07335752248764038, 0.04281029850244522, -0.07327272742986679, 0.07749100774526596, 0.026003440842032433, 0.006736213807016611, -0.02474028989672661, -0.16703559458255768, -0.06664694100618362, 0.020207401365041733, -0.09515918791294098, 0.06316790729761124, -0.021982794627547264, 0.08894284814596176, -0.10872699320316315, -0.04879365116357803, 0.056343547999858856, 0.059544436633586884, 0.052609410136938095, 0.009858191013336182, 0.07340214401483536, 0.01739644818007946, -0.10377486795186996, 0.012325454503297806, -0.06604211032390594, -5.765737043361696e-8, 0.007962563075125217, -0.037124138325452805, -0.044338811188936234, 0.13972720503807068, 0.04137255623936653, -0.010369175113737583, 0.009839532896876335, 0.04224339872598648, -0.02044197916984558, 0.019876303151249886, 0.10424963384866714, -0.03322666883468628, 0.03787113353610039, -0.02777867764234543, 0.09794573485851288, 0.048623498529195786, 0.021803511306643486, -0.08563157171010971, -0.07194757461547852, -0.057278916239738464, 0.002848054049536586, -0.004111497662961483, -0.0747692883014679, 0.03699692338705063, -0.06944623589515686, -0.00687229773029685, 0.08016928285360336, 0.04418889805674553, -0.04157594218850136, -0.03765939548611641, -0.04010434076189995, -0.006521032657474279, 0.012458272278308868, 0.01419927179813385, -0.0837336853146553, 0.05063525214791298, -0.012664311565458775, -0.019965652376413345, 0.06246315315365791, -0.04531874880194664, 0.04574389010667801, -0.03305180370807648, -0.05485009402036667, -0.0034145715180784464, 0.0840611606836319, 0.0524681955575943, -0.12632879614830017, 0.038752198219299316, 0.011965364217758179, -0.006808367557823658, -0.04701250046491623, 0.01617005653679371, 0.06385853886604309, 0.08107900619506836, 0.012011220678687096, 0.0012514656409621239, 0.03905632719397545, -0.06848353147506714, 0.12262816727161407, 0.044832441955804825, 0.021929742768406868, 0.010615039616823196, -0.015821563079953194, -0.07730463892221451 ]
0.172262
inbound replies. - Per-session lanes guarantee that only one agent run touches a given session at a time. - No external dependencies or background worker threads; pure TypeScript + promises. ## Troubleshooting - If commands seem stuck, enable verbose logs and look for “queued for …ms” lines to confirm the queue is draining. - If you need queue depth, enable verbose logs and watch for queue timing lines.
https://github.com/openclaw/openclaw/blob/main//docs/concepts/queue.md
main
opebclaw
[ -0.04188026115298271, -0.05372555926442146, -0.024338075891137123, 0.03158187493681908, -0.018976736813783646, -0.05240830406546593, 0.03237620368599892, -0.03546309098601341, 0.03767430782318115, 0.05175169184803963, -0.08226443827152252, -0.00730778556317091, -0.1073305755853653, 0.031040212139487267, 0.058571621775627136, -0.002618772443383932, 0.08689078688621521, -0.12552565336227417, -0.007469539996236563, -0.009047978557646275, 0.011779873631894588, -0.0406617671251297, 0.015551179647445679, -0.04022171348333359, -0.0977494865655899, -0.02003399096429348, -0.03611518070101738, -0.07949771732091904, 0.028115347027778625, -0.07704585790634155, -0.042839378118515015, 0.05345294624567032, -0.09290939569473267, -0.01929459162056446, 0.05960197001695633, 0.07096368074417114, -0.005281779915094376, 0.04320624843239784, 0.04028346389532089, 0.01571429707109928, 0.08885795623064041, 0.03666778653860092, -0.04774675518274307, 0.04307914897799492, 0.019169608131051064, -0.06210312247276306, -0.09095900505781174, -0.02642630971968174, -0.03232650086283684, -0.021253274753689766, -0.014304528944194317, 0.0328807458281517, 0.02757568471133709, 0.03945101425051689, 0.003955057356506586, -0.025188103318214417, -0.03130606189370155, 0.03824689984321594, 0.03065437637269497, -0.009065789170563221, -0.011330493725836277, -0.03774292394518852, 0.044646427035331726, 0.008565553463995457, 0.016741441562771797, 0.05517895892262459, 0.012933426536619663, 0.004324400331825018, 0.017948998138308525, 0.029276574030518532, -0.018781576305627823, -0.03745343163609505, -0.07230357080698013, -0.03791530057787895, 0.00924469344317913, -0.07096685469150543, 0.016748471185564995, -0.05021331459283829, -0.007137903477996588, -0.04765133187174797, -0.0742986723780632, -0.1037810891866684, 0.01173078641295433, 0.11665178090333939, -0.039024725556373596, -0.006015579681843519, 0.05544744431972504, -0.00259250751696527, 0.06796745955944061, 0.033600062131881714, -0.02457507513463497, 0.07529627531766891, 0.013216930441558361, 0.001752526848576963, 0.0017400832148268819, 0.10488001257181168, -0.055360425263643265, 0.023561038076877594, -0.049393825232982635, 0.03598082438111305, -0.013946016319096088, 0.03955692797899246, 0.061548445373773575, 0.03349408134818077, -0.05523264408111572, 0.05301275849342346, 0.04206987842917442, -0.07391630858182907, -0.051544491201639175, -0.022555334493517876, 0.0095793092623353, 0.02310316637158394, 0.07981007546186447, 0.09119967371225357, 0.02058967389166355, 0.02395431511104107, 0.02112027071416378, -0.03342520445585251, 0.04540523514151573, 0.08923133462667465, 0.04631290212273598, 0.012282216921448708, -0.042829591780900955, -0.024149512872099876, 0.05514876917004585, 0.08090346306562424, 0.1495489627122879, 3.2798775619757934e-33, -0.030271990224719048, -0.08614751696586609, -0.008776713162660599, 0.004958907142281532, 0.04285362735390663, 0.058635126799345016, 0.038040224462747574, 0.03096221387386322, -0.04121864214539528, 0.02408868633210659, -0.0060474080964922905, -0.009467270225286484, -0.04986942932009697, -0.06213274598121643, -0.03946724906563759, -0.026098104193806648, 0.04572325944900513, 0.03053421527147293, -0.048933397978544235, 0.048327166587114334, 0.059488918632268906, 0.017079247161746025, -0.059289995580911636, 0.02343597263097763, 0.01206898782402277, -0.01005795132368803, -0.010847843252122402, 0.0313553549349308, 0.091164730489254, 0.013130569830536842, 0.013928763568401337, 0.09669876843690872, -0.051225870847702026, 0.04523850604891777, -0.05491555854678154, 0.031148850917816162, -0.03901707008481026, -0.005031714681535959, -0.010248329490423203, -0.06410577148199081, -0.14752423763275146, 0.028452932834625244, -0.04042481631040573, -0.03036355786025524, -0.11728213727474213, -0.1319427490234375, -0.08811258524656296, 0.018981924280524254, 0.053115058690309525, 0.11669217050075531, -0.03634033724665642, 0.07102274149656296, 0.006951316259801388, 0.027683908119797707, 0.04885716363787651, 0.011176356114447117, 0.02785015106201172, 0.1012682169675827, -0.004991449415683746, 0.04361448809504509, 0.07908666133880615, -0.10788841545581818, -0.11132806539535522, -0.041694238781929016, 0.05938732996582985, 0.027803396806120872, -0.09452901035547256, 0.04878430813550949, 0.033462315797805786, 0.001837625284679234, -0.03483254835009575, 0.0389196053147316, 0.05471489578485489, 0.05196451023221016, 0.037394192069768906, -0.011333304457366467, -0.06246570497751236, -0.019269008189439774, -0.01900669001042843, 0.020495936274528503, 0.005647266283631325, -0.02683989517390728, -0.019246108829975128, 0.029720589518547058, 0.04917670413851738, -0.006165100261569023, -0.02414388582110405, -0.05814369022846222, 0.01647922955453396, 0.09450392425060272, -0.05806587636470795, 0.00961846113204956, -0.01905612088739872, 0.041578780859708786, -0.04252825677394867, -4.2817458870518595e-33, -0.04816465824842453, 0.028674516826868057, -0.0773463174700737, 0.11034663021564484, 0.016574781388044357, 0.018880140036344528, -0.03733302652835846, 0.016230296343564987, 0.0431576631963253, -0.006849280558526516, -0.03031775914132595, 0.06602033227682114, 0.012397115118801594, 0.05136938765645027, -0.004962452221661806, 0.007529596332460642, 0.047780659049749374, -0.05571947619318962, 0.04422365128993988, -0.0005196527927182615, 0.02152925170958042, -0.004777238238602877, -0.036251433193683624, 0.08524003624916077, -0.04970324784517288, 0.05644642934203148, 0.03670092672109604, 0.008398524485528469, -0.06982401013374329, -0.008962167426943779, 0.0019742108415812254, -0.029249191284179688, -0.055065326392650604, 0.03833187371492386, 0.022781196981668472, -0.026293328031897545, 0.0034472686238586903, 0.11351215839385986, -0.03961148113012314, -0.003966399934142828, 0.08542126417160034, -0.06763145327568054, -0.021515365689992905, -0.03181229159235954, -0.00944533385336399, -0.011168189346790314, -0.04793444648385048, -0.0493708960711956, -0.06240423023700714, 0.06577877700328827, -0.06418301910161972, -0.003178435144945979, 0.004129719454795122, 0.029096154496073723, -0.04043755680322647, -0.059919096529483795, 0.053903982043266296, -0.040014926344156265, 0.006407048553228378, -0.01848030835390091, 0.019059836864471436, 0.014499175362288952, 0.03620900213718414, 0.018035907298326492, 0.029834190383553505, -0.0581984706223011, -0.059581656008958817, -0.08017255365848541, 0.11754364520311356, 0.06156346946954727, 0.027073193341493607, 0.0354151725769043, -0.053859759122133255, 0.028521746397018433, 0.02806534431874752, 0.04108703136444092, -0.03276803717017174, -0.19965849816799164, 0.04599160701036453, 0.013956193812191486, -0.025775032117962837, 0.09084190428256989, 0.014856483787298203, -0.0005979147390462458, -0.01816263422369957, 0.05734606832265854, 0.01574394665658474, 0.021308718249201775, 0.038499172776937485, 0.0726378783583641, 0.02932376228272915, -0.008533920161426067, -0.07704120874404907, 0.015137715265154839, -0.010309699922800064, -4.698194899788177e-8, 0.00429975101724267, -0.06240641698241234, 0.009985503740608692, 0.04464050382375717, 0.0009518735460005701, -0.050845760852098465, 0.001156673184596002, 0.0008227972430177033, -0.05357290431857109, 0.05004953593015671, 0.03935439884662628, 0.001973989885300398, 0.04028385877609253, 0.024107223376631737, 0.10149352252483368, 0.010451355017721653, 0.009272705763578415, -0.03318611532449722, -0.08899762481451035, -0.1124182790517807, -0.06126188486814499, -0.04343767836689949, -0.01726541854441166, 0.02757975086569786, -0.07497069984674454, 0.012526679784059525, 0.032294366508722305, 0.015868788585066795, -0.027748700231313705, -0.05179494991898537, -0.05527329072356224, 0.015104571357369423, 0.028301145881414413, -0.040047574788331985, -0.03312411904335022, 0.02928760088980198, 0.02000553347170353, -0.0587792731821537, 0.08023563772439957, -0.030786607414484024, 0.014774568378925323, 0.03480417653918266, -0.004418352618813515, -0.0231633298099041, 0.10650325566530228, 0.04734918102622032, -0.10978466272354126, 0.09056554734706879, 0.03307214751839638, -0.04198629409074783, -0.04069708660244942, -0.0269796010106802, -0.10831993818283081, 0.06832621991634369, -0.021366216242313385, -0.009138436987996101, 0.05798075720667839, -0.05647609382867813, 0.040287189185619354, -0.008783875033259392, -0.011282901279628277, -0.02804461494088173, -0.03362375497817993, -0.08821270614862442 ]
0.078789
## Highlights WhatsApp, Telegram, Discord, and iMessage with a single Gateway. Add Mattermost and more with extensions. Multi-agent routing with isolated sessions. Images, audio, and documents in and out. Web Control UI and macOS companion app. iOS and Android nodes with Canvas support. ## Full list - WhatsApp integration via WhatsApp Web (Baileys) - Telegram bot support (grammY) - Discord bot support (channels.discord.js) - Mattermost bot support (plugin) - iMessage integration via local imsg CLI (macOS) - Agent bridge for Pi in RPC mode with tool streaming - Streaming and chunking for long responses - Multi-agent routing for isolated sessions per workspace or sender - Subscription auth for Anthropic and OpenAI via OAuth - Sessions: direct chats collapse into shared `main`; groups are isolated - Group chat support with mention based activation - Media support for images, audio, and documents - Optional voice note transcription hook - WebChat and macOS menu bar app - iOS node with pairing and Canvas surface - Android node with pairing, Canvas, chat, and camera Legacy Claude, Codex, Gemini, and Opencode paths have been removed. Pi is the only coding agent path.
https://github.com/openclaw/openclaw/blob/main//docs/concepts/features.md
main
opebclaw
[ -0.05689702928066254, -0.04868466779589653, 0.02826215699315071, -0.03972471505403519, 0.06448648124933243, -0.06217474862933159, -0.004464621655642986, 0.03881975635886192, -0.0025156689807772636, 0.06786975264549255, 0.04155704006552696, -0.030323978513479233, 0.009764498099684715, 0.08686580508947372, 0.16409166157245636, -0.007365686818957329, 0.054549943655729294, -0.09888014197349548, -0.006805709563195705, 0.00035984604619443417, -0.0028865188360214233, -0.00502222403883934, 0.0463501401245594, 0.015364122577011585, -0.005921447649598122, -0.025575654581189156, -0.012963900342583656, -0.020049788057804108, 0.0022011830005794764, 0.006717135664075613, 0.03065914288163185, -0.011500752530992031, 0.014183161780238152, 0.051479633897542953, -0.06577959656715393, -0.007671413943171501, 0.06584116071462631, 0.033465396612882614, -0.0412258580327034, -0.0017269692616537213, -0.05693816393613815, 0.011121618561446667, -0.013809528201818466, -0.004059809260070324, 0.0770910307765007, -0.055928297340869904, -0.10140354931354523, -0.0112198106944561, -0.01598864234983921, 0.043745946139097214, 0.03303835541009903, -0.04895704984664917, 0.03116774745285511, 0.17934559285640717, -0.019343964755535126, 0.04092760011553764, -0.10989643633365631, 0.06443572044372559, 0.05193931609392166, 0.003997246269136667, -0.03391774371266365, -0.027745841071009636, 0.04251786693930626, 0.04231581836938858, -0.06801945716142654, 0.03719284385442734, -0.04274126514792442, 0.03807239234447479, 0.01663663610816002, -0.07528965920209885, -0.036742791533470154, 0.0004142308025620878, 0.060199107974767685, -0.0163569375872612, -0.022745484486222267, -0.00363565469160676, 0.04999104514718056, 0.008278119377791882, -0.08020017296075821, -0.03304336592555046, 0.018937183544039726, 0.05000483989715576, -0.06785807013511658, 0.03282737731933594, -0.027026621624827385, -0.00415513152256608, -0.03286593779921532, 0.02784525603055954, -0.05777426064014435, 0.03555025905370712, -0.024947799742221832, 0.02027878165245056, -0.0070082275196909904, 0.006316784769296646, 0.022611670196056366, 0.011515526100993156, -0.006169094704091549, 0.01601848192512989, -0.06375983357429504, 0.03296009078621864, -0.04300567880272865, -0.03441028669476509, 0.0022614141926169395, -0.036464400589466095, 0.04359491541981697, -0.012609397992491722, 0.011236242018640041, -0.03664692863821983, 0.15246517956256866, 0.034822359681129456, -0.08634302020072937, -0.0694735124707222, -0.00210266443900764, -0.00398350041359663, 0.05200464650988579, 0.0218349639326334, 0.03933647274971008, 0.03878157585859299, 0.10357571393251419, 0.011669617146253586, 0.07592903077602386, -0.02603314258158207, 0.025864237919449806, 0.01413586363196373, 0.05086218938231468, 0.03689465671777725, 0.022921457886695862, 5.030359097031049e-33, 0.011300519108772278, 0.019546035677194595, -0.04774804040789604, 0.03633035346865654, 0.03717464953660965, 0.012792286463081837, -0.009539367631077766, 0.00792589969933033, -0.0631616860628128, -0.07215684652328491, -0.07066953182220459, 0.06038590520620346, -0.03952156379818916, 0.031109105795621872, 0.011931004002690315, -0.06896641850471497, -0.02802892215549946, 0.02316872775554657, 0.13303036987781525, 0.001822986057959497, -0.039694927632808685, -0.00035334937274456024, 0.0017791049322113395, 0.07577843964099884, 0.08198435604572296, 0.09743862599134445, 0.06261473149061203, -0.10608980804681778, 0.051831282675266266, -0.003536287462338805, -0.04313290864229202, 0.020369285717606544, -0.016929486766457558, 0.01203211210668087, -0.038860566914081573, -0.017916718497872353, -0.1023307517170906, -0.06800223141908646, -0.02984107844531536, -0.0043767886236310005, -0.10907139629125595, -0.03666341304779053, -0.06122102960944176, -0.10922148078680038, 0.012550962157547474, -0.05456174165010452, -0.038045573979616165, 0.028292428702116013, -0.012031646445393562, 0.0433911457657814, -0.09422677755355835, 0.01110920775681734, -0.014104886911809444, 0.022188056260347366, -0.021577557548880577, -0.08760275691747665, -0.02698064036667347, -0.01834222860634327, -0.027298152446746826, -0.034808382391929626, -0.014725744724273682, -0.003632909618318081, -0.017486587166786194, -0.009724301286041737, 0.0009244484244845808, 0.024826783686876297, -0.05233694612979889, -0.03401472792029381, -0.013063821010291576, 0.04063943400979042, -0.06537969410419464, 0.08351052552461624, -0.005322049837559462, 0.05777807533740997, -0.13036373257637024, 0.028595536947250366, -0.04757402837276459, 0.019822778180241585, 0.025913724675774574, 0.05378365516662598, -0.05307995527982712, 0.00895339623093605, 0.025242643430829048, 0.03304966166615486, 0.028217250481247902, 0.025249788537621498, 0.037791911512613297, -0.05996862053871155, -0.06448107957839966, 0.08637899905443192, -0.10097832977771759, 0.0539001040160656, 0.04142599552869797, 0.04942505434155464, -0.028432806953787804, -3.739587321301481e-33, -0.021787773817777634, 0.011773739941418171, -0.038768090307712555, 0.026603111997246742, 0.04253486543893814, -0.028422672301530838, 0.06229868158698082, -0.008409363217651844, 0.08269429951906204, -0.005784644279628992, -0.028827961534261703, -0.014004014432430267, 0.056956108659505844, -0.06679977476596832, -0.012971770018339157, 0.032637495547533035, -0.01831066980957985, -0.04781271517276764, -0.005587921477854252, -0.01831975392997265, -0.033403415232896805, 0.0027397857047617435, -0.022305233404040337, -0.013513357378542423, 0.05132168158888817, 0.004625371657311916, 0.036672063171863556, 0.003016840200871229, 0.024767573922872543, -0.04624693840742111, 0.036206990480422974, -0.04241796210408211, -0.011034557595849037, -0.041138023138046265, 0.08917471021413803, 0.028977788984775543, -0.016488822177052498, 0.10634952038526535, -0.010646205395460129, -0.10136664658784866, 0.1233052983880043, -0.045009441673755646, -0.07000547647476196, 0.0054926397278904915, 0.013616695068776608, 0.08971595764160156, -0.14222590625286102, 0.0846928283572197, -0.13634458184242249, 0.019442008808255196, 0.0407605804502964, -0.0789317935705185, 0.008849585428833961, -0.011874937452375889, -0.034385111182928085, 0.021871676668524742, 0.03959197178483009, 0.05590919405221939, -0.0877942368388176, -0.07224839925765991, 0.06345225125551224, -0.10382604598999023, 0.024776378646492958, 0.04077107459306717, 0.004662959836423397, -0.03581887111067772, -0.02092403545975685, 0.017101537436246872, -0.06140528619289398, 0.016507437452673912, 0.049113743007183075, -0.11806749552488327, 0.016363848000764847, -0.014251702465116978, 0.09406529366970062, 0.052332863211631775, -0.024765852838754654, -0.15205371379852295, 0.017269648611545563, -0.004912402480840683, -0.03691228851675987, 0.08662412315607071, 0.07033970206975937, 0.015424449928104877, 0.07007148861885071, 0.07714502513408661, 0.01674063317477703, 0.050472959876060486, 0.02545393444597721, 0.011855286546051502, -0.05917384847998619, 0.0752386599779129, 0.004009700380265713, -0.004733460023999214, 0.00658055255189538, -5.0041872867723214e-8, -0.019784850999712944, -0.09562704712152481, -0.05281703919172287, -0.008683228865265846, -0.01665663905441761, 0.0014184386236593127, 0.0535762645304203, -0.05041581392288208, 0.09298060834407806, 0.08181274682283401, 0.016941456124186516, -0.06222955510020256, -0.07601273059844971, 0.021439189091324806, 0.016578318551182747, -0.008310974575579166, -0.033612336963415146, 0.00876541156321764, 0.002022530185058713, -0.08593039214611053, -0.036078035831451416, -0.031685441732406616, -0.07316756993532181, 0.038229189813137054, -0.004562112502753735, 0.0005188902723602951, 0.032229237258434296, 0.03956901654601097, -0.04950970411300659, -0.009959443472325802, -0.032629430294036865, -0.0705404207110405, 0.01508999988436699, -0.007878878153860569, 0.011161650530993938, 0.06407195329666138, -0.07523581385612488, -0.034386247396469116, -0.009169056080281734, 0.0658852830529213, 0.028390949591994286, -0.01730133406817913, 0.03339012339711189, -0.05491434410214424, 0.030341587960720062, -0.012237579561769962, -0.04558128863573074, -0.042614568024873734, 0.008847522549331188, 0.053599823266267776, -0.018589790910482407, -0.024118077009916306, 0.06758010387420654, 0.01596398651599884, 0.06735651940107346, -0.0034374648239463568, 0.1256532520055771, -0.05152114853262901, 0.08973583579063416, 0.04423251003026962, 0.040202170610427856, 0.04355463758111, 0.026508960872888565, 0.031310055404901505 ]
0.160278
# Session Management OpenClaw treats \*\*one direct-chat session per agent\*\* as primary. Direct chats collapse to `agent::` (default `main`), while group/channel chats get their own keys. `session.mainKey` is honored. Use `session.dmScope` to control how \*\*direct messages\*\* are grouped: - `main` (default): all DMs share the main session for continuity. - `per-peer`: isolate by sender id across channels. - `per-channel-peer`: isolate by channel + sender (recommended for multi-user inboxes). - `per-account-channel-peer`: isolate by account + channel + sender (recommended for multi-account inboxes). Use `session.identityLinks` to map provider-prefixed peer ids to a canonical identity so the same person shares a DM session across channels when using `per-peer`, `per-channel-peer`, or `per-account-channel-peer`. ### Secure DM mode (recommended) If your agent can receive DMs from \*\*multiple people\*\* (pairing approvals for more than one sender, a DM allowlist with multiple entries, or `dmPolicy: "open"`), enable \*\*secure DM mode\*\* to avoid cross-user context leakage: ```json5 // ~/.openclaw/openclaw.json { session: { // Secure DM mode: isolate DM context per channel + sender. dmScope: "per-channel-peer", }, } ``` Notes: - Default is `dmScope: "main"` for continuity (all DMs share the main session). - For multi-account inboxes on the same channel, prefer `per-account-channel-peer`. - If the same person contacts you on multiple channels, use `session.identityLinks` to collapse their DM sessions into one canonical identity. ## Gateway is the source of truth All session state is \*\*owned by the gateway\*\* (the “master” OpenClaw). UI clients (macOS app, WebChat, etc.) must query the gateway for session lists and token counts instead of reading local files. - In \*\*remote mode\*\*, the session store you care about lives on the remote gateway host, not your Mac. - Token counts shown in UIs come from the gateway’s store fields (`inputTokens`, `outputTokens`, `totalTokens`, `contextTokens`). Clients do not parse JSONL transcripts to “fix up” totals. ## Where state lives - On the \*\*gateway host\*\*: - Store file: `~/.openclaw/agents//sessions/sessions.json` (per agent). - Transcripts: `~/.openclaw/agents//sessions/.jsonl` (Telegram topic sessions use `.../-topic-.jsonl`). - The store is a map `sessionKey -> { sessionId, updatedAt, ... }`. Deleting entries is safe; they are recreated on demand. - Group entries may include `displayName`, `channel`, `subject`, `room`, and `space` to label sessions in UIs. - Session entries include `origin` metadata (label + routing hints) so UIs can explain where a session came from. - OpenClaw does \*\*not\*\* read legacy Pi/Tau session folders. ## Session pruning OpenClaw trims \*\*old tool results\*\* from the in-memory context right before LLM calls by default. This does \*\*not\*\* rewrite JSONL history. See [/concepts/session-pruning](/concepts/session-pruning). ## Pre-compaction memory flush When a session nears auto-compaction, OpenClaw can run a \*\*silent memory flush\*\* turn that reminds the model to write durable notes to disk. This only runs when the workspace is writable. See [Memory](/concepts/memory) and [Compaction](/concepts/compaction). ## Mapping transports → session keys - Direct chats follow `session.dmScope` (default `main`). - `main`: `agent::` (continuity across devices/channels). - Multiple phone numbers and channels can map to the same agent main key; they act as transports into one conversation. - `per-peer`: `agent::dm:`. - `per-channel-peer`: `agent:::dm:`. - `per-account-channel-peer`: `agent::::dm:` (accountId defaults to `default`). - If `session.identityLinks` matches a provider-prefixed peer id (for example `telegram:123`), the canonical key replaces `` so the same person shares a session across channels. - Group chats isolate state: `agent:::group:` (rooms/channels use `agent:::channel:`). - Telegram forum topics append `:topic:` to the group id for isolation. - Legacy `group:` keys are still recognized for migration. - Inbound contexts may still use `group:`; the channel is inferred from `Provider` and normalized to the canonical `agent:::group:` form. - Other sources: - Cron jobs: `cron:` - Webhooks: `hook:` (unless explicitly set by the hook) - Node runs: `node-`
https://github.com/openclaw/openclaw/blob/main//docs/concepts/session.md
main
opebclaw
[ -0.015107673592865467, -0.06035982444882393, -0.053169701248407364, 0.023119991645216942, -0.031057875603437424, -0.10282140970230103, 0.10587683320045471, -0.0012724230764433742, 0.015038037672638893, 0.03712598234415054, 0.02318589948117733, -0.019976967945694923, 0.037666141986846924, 0.029079042375087738, 0.10527381300926208, 0.08801644295454025, 0.02011130191385746, -0.041011348366737366, -0.014662782661616802, 0.01962260529398918, 0.026227759197354317, -0.00321549572981894, -0.01170662883669138, -0.046740397810935974, -0.033680107444524765, -0.10838516056537628, -0.000359793339157477, 0.041628580540418625, 0.015251283533871174, -0.053144678473472595, 0.09548287093639374, 0.04871197044849396, -0.030302956700325012, 0.008790134452283382, 0.03343107923865318, 0.025287354364991188, 0.004764861892908812, 0.023977063596248627, -0.06713200360536575, 0.010282491333782673, 0.034713760018348694, 0.04070564731955528, -0.04235617071390152, -0.004163490142673254, -0.07760466635227203, -0.0036605405621230602, -0.0845029354095459, 0.019720369949936867, -0.049831539392471313, 0.0192648284137249, -0.03835754841566086, -0.014629019424319267, 0.018481245264410973, 0.09573569148778915, -0.0049194456078112125, 0.026367954909801483, -0.061855338513851166, 0.013854790478944778, 0.03169192746281624, -0.0347893051803112, -0.006270974408835173, 0.016971683129668236, -0.03053666464984417, -0.00024387065786868334, -0.02056162618100643, 0.043367624282836914, 0.043997474014759064, 0.032893262803554535, 0.005690311081707478, -0.034803129732608795, -0.03422880545258522, -0.05151284858584404, -0.0051482971757650375, -0.06977030634880066, 0.04315405339002609, -0.06503597646951675, -0.003615183522924781, 0.010414861142635345, -0.032706305384635925, -0.06096256896853447, -0.06309562176465988, 0.03183657303452492, -0.002715935930609703, -0.04138060286641121, -0.021028636023402214, 0.09010901302099228, -0.06375754624605179, 0.01607249677181244, -0.06339186429977417, 0.06718983501195908, -0.07445743680000305, -0.020899822935461998, 0.03329549729824066, 0.02079710178077221, 0.039680365473032, -0.0005398066132329404, -0.044059328734874725, 0.06855108588933945, 0.023733817040920258, 0.09266119450330734, 0.013023234903812408, 0.015419482253491879, -0.021729877218604088, 0.016552310436964035, -0.09164309501647949, -0.017673786729574203, 0.05035846307873726, -0.03372856602072716, -0.005349296145141125, 0.012197064235806465, -0.010026074014604092, 0.025444425642490387, 0.05028034374117851, -0.003395745763555169, 0.0016736051766201854, 0.04129909723997116, 0.045012153685092926, 0.05217639356851578, 0.11434665322303772, 0.033541951328516006, 0.024323269724845886, -0.08286430686712265, 0.10758591443300247, 0.042054932564496994, 0.037674352526664734, 0.10023212432861328, 0.051457248628139496, 5.1400771683429086e-33, 0.04150298610329628, -0.034571386873722076, -0.07086867094039917, 0.04683121666312218, 0.07391989976167679, 0.08639958500862122, 0.028823398053646088, -0.007683999370783567, -0.10002992302179337, 0.022354483604431152, -0.06835762411355972, 0.03660789877176285, -0.013966284692287445, -0.04162202402949333, -0.017672406509518623, 0.006121092941612005, -0.029119592159986496, 0.07482568919658661, 0.08682157844305038, -0.012629656121134758, -0.03166332095861435, 0.05692126229405403, -0.018857520073652267, 0.026789987459778786, 0.018459603190422058, 0.07926977425813675, -0.011710001155734062, -0.0575423389673233, 0.060995426028966904, 0.035442907363176346, 0.07588962465524673, 0.020049937069416046, 0.006527001038193703, 0.08631812036037445, -0.004011449404060841, 0.042526841163635254, -0.11397412419319153, -0.0009645161335356534, -0.03261825442314148, -0.0769270658493042, -0.017892243340611458, -0.05192602425813675, 0.0001599857787368819, -0.07445331662893295, -0.10667445510625839, -0.07310336828231812, -0.062991201877594, 0.053220320492982864, 0.00004978154902346432, 0.0306834913790226, -0.01995636522769928, 0.005108238197863102, -0.03199508413672447, -0.017241228371858597, 0.0031422628089785576, -0.054210204631090164, -0.07926376163959503, 0.023924438282847404, 0.026572585105895996, 0.03885148838162422, -0.07934179157018661, 0.029242398217320442, -0.036906953901052475, 0.001179928658530116, 0.014147340320050716, -0.0003567705862224102, -0.029743684455752373, 0.023479416966438293, 0.005661985836923122, -0.07024922221899033, -0.08032134920358658, 0.030580226331949234, -0.01931925117969513, 0.006748761050403118, -0.08319962024688721, -0.04400888830423355, 0.026511497795581818, 0.08724295347929001, 0.03377795219421387, 0.04640435054898262, -0.026209596544504166, 0.07869673520326614, -0.031996048986911774, 0.03080557845532894, -0.07695223391056061, 0.02523288130760193, -0.0053146895952522755, -0.062051888555288315, -0.024038540199398994, 0.09855368733406067, -0.031077958643436432, -0.02147260494530201, 0.006062170956283808, 0.07776094228029251, 0.005887901876121759, -6.062304281782826e-33, -0.05447808653116226, 0.07496269047260284, -0.04979249835014343, -0.015822794288396835, 0.00838303379714489, 0.00013651222980115563, 0.06620122492313385, -0.06600622832775116, -0.02312777191400528, -0.014507446438074112, -0.02263895608484745, 0.03278090059757233, 0.05931523069739342, -0.011450977064669132, 0.022686269134283066, -0.02611047960817814, -0.0041133626364171505, 0.0012763948179781437, -0.03756162151694298, -0.008707300759851933, -0.009114053100347519, 0.06436465680599213, -0.06184832379221916, 0.06208959221839905, 0.0472244918346405, -0.021644387394189835, 0.008868848904967308, 0.03979542851448059, 0.045809242874383926, 0.005606905557215214, 0.11366268247365952, 0.055082812905311584, -0.04658661410212517, -0.05405930057168007, -0.07820931822061539, -0.0008539773989468813, -0.07836709916591644, 0.08669343590736389, -0.03638191148638725, 0.019103340804576874, 0.05563243851065636, -0.03372780233621597, -0.1198151633143425, -0.04434237629175186, 0.005746072623878717, 0.12057745456695557, -0.036111846566200256, -0.0443650521337986, -0.1495559811592102, 0.08650246262550354, -0.027599437162280083, -0.03949221596121788, 0.06584683060646057, -0.09177523106336594, -0.02142438106238842, 0.017827937379479408, 0.08398126810789108, 0.009923046454787254, 0.009468337520956993, -0.08985909074544907, 0.06668651849031448, -0.06112188473343849, -0.0051386370323598385, 0.10206838697195053, -0.028644317761063576, -0.056723326444625854, 0.012686461210250854, 0.07703214883804321, -0.04565493017435074, -0.03691273182630539, -0.0069133988581597805, -0.10620246827602386, -0.024026377126574516, -0.028737448155879974, 0.0395270474255085, -0.0032358777243644, -0.09806029498577118, -0.10818389058113098, -0.009091242216527462, 0.07533765584230423, -0.08878299593925476, 0.043128229677677155, 0.03797402232885361, 0.0349915437400341, -0.00349717796780169, -0.013183355331420898, 0.0938676968216896, 0.11845306307077408, 0.00260622869245708, 0.016971252858638763, -0.04534395411610603, 0.00208807410672307, -0.05096346139907837, -0.04114972800016403, 0.04992559552192688, -5.352532284064182e-8, -0.04214769974350929, -0.0775056779384613, -0.018016964197158813, 0.052054814994335175, -0.0701889917254448, -0.06192396208643913, -0.015258370898663998, 0.046940360218286514, -0.029380720108747482, 0.05706222355365753, 0.08100419491529465, 0.004081110004335642, -0.042134031653404236, -0.04723269119858742, 0.020471055060625076, 0.011920223943889141, -0.023181766271591187, -0.06050780043005943, -0.027616016566753387, -0.056332431733608246, -0.01257263496518135, -0.041350215673446655, 0.05563386529684067, 0.08342863619327545, -0.05468667298555374, -0.013147363439202309, 0.036922357976436615, 0.05151236057281494, -0.03449919447302818, 0.023739084601402283, -0.058235861361026764, -0.017067953944206238, -0.016588250175118446, 0.03968866914510727, -0.11696840822696686, 0.06745409220457077, -0.05850015953183174, 0.034272126853466034, 0.02474001608788967, 0.0733683705329895, 0.018273795023560524, -0.08046617358922958, 0.0038875907193869352, 0.01567930541932583, -0.04120152071118355, 0.07382674515247345, -0.0877850353717804, -0.016347743570804596, 0.019253402948379517, -0.011179255321621895, -0.03572534769773483, 0.041971344500780106, -0.00013343332102522254, 0.08112172037363052, 0.010185061022639275, 0.02718510851264, 0.029765333980321884, 0.0066312034614384174, 0.05421307682991028, -0.005619449075311422, -0.04905833676457405, 0.09168951213359833, -0.07838806509971619, -0.09605097025632858 ]
0.070323
isolation. - Legacy `group:` keys are still recognized for migration. - Inbound contexts may still use `group:`; the channel is inferred from `Provider` and normalized to the canonical `agent:::group:` form. - Other sources: - Cron jobs: `cron:` - Webhooks: `hook:` (unless explicitly set by the hook) - Node runs: `node-` ## Lifecycle - Reset policy: sessions are reused until they expire, and expiry is evaluated on the next inbound message. - Daily reset: defaults to \*\*4:00 AM local time on the gateway host\*\*. A session is stale once its last update is earlier than the most recent daily reset time. - Idle reset (optional): `idleMinutes` adds a sliding idle window. When both daily and idle resets are configured, \*\*whichever expires first\*\* forces a new session. - Legacy idle-only: if you set `session.idleMinutes` without any `session.reset`/`resetByType` config, OpenClaw stays in idle-only mode for backward compatibility. - Per-type overrides (optional): `resetByType` lets you override the policy for `dm`, `group`, and `thread` sessions (thread = Slack/Discord threads, Telegram topics, Matrix threads when provided by the connector). - Per-channel overrides (optional): `resetByChannel` overrides the reset policy for a channel (applies to all session types for that channel and takes precedence over `reset`/`resetByType`). - Reset triggers: exact `/new` or `/reset` (plus any extras in `resetTriggers`) start a fresh session id and pass the remainder of the message through. `/new ` accepts a model alias, `provider/model`, or provider name (fuzzy match) to set the new session model. If `/new` or `/reset` is sent alone, OpenClaw runs a short “hello” greeting turn to confirm the reset. - Manual reset: delete specific keys from the store or remove the JSONL transcript; the next message recreates them. - Isolated cron jobs always mint a fresh `sessionId` per run (no idle reuse). ## Send policy (optional) Block delivery for specific session types without listing individual ids. ```json5 { session: { sendPolicy: { rules: [ { action: "deny", match: { channel: "discord", chatType: "group" } }, { action: "deny", match: { keyPrefix: "cron:" } }, ], default: "allow", }, }, } ``` Runtime override (owner only): - `/send on` → allow for this session - `/send off` → deny for this session - `/send inherit` → clear override and use config rules Send these as standalone messages so they register. ## Configuration (optional rename example) ```json5 // ~/.openclaw/openclaw.json { session: { scope: "per-sender", // keep group keys separate dmScope: "main", // DM continuity (set per-channel-peer/per-account-channel-peer for shared inboxes) identityLinks: { alice: ["telegram:123456789", "discord:987654321012345678"], }, reset: { // Defaults: mode=daily, atHour=4 (gateway host local time). // If you also set idleMinutes, whichever expires first wins. mode: "daily", atHour: 4, idleMinutes: 120, }, resetByType: { thread: { mode: "daily", atHour: 4 }, dm: { mode: "idle", idleMinutes: 240 }, group: { mode: "idle", idleMinutes: 120 }, }, resetByChannel: { discord: { mode: "idle", idleMinutes: 10080 }, }, resetTriggers: ["/new", "/reset"], store: "~/.openclaw/agents/{agentId}/sessions/sessions.json", mainKey: "main", }, } ``` ## Inspecting - `openclaw status` — shows store path and recent sessions. - `openclaw sessions --json` — dumps every entry (filter with `--active `). - `openclaw gateway call sessions.list --params '{}'` — fetch sessions from the running gateway (use `--url`/`--token` for remote gateway access). - Send `/status` as a standalone message in chat to see whether the agent is reachable, how much of the session context is used, current thinking/verbose toggles, and when your WhatsApp web creds were last refreshed (helps spot relink needs). - Send `/context list` or `/context detail` to see what’s in the system prompt and injected workspace files (and the biggest context contributors). - Send `/stop` as a standalone message to abort
https://github.com/openclaw/openclaw/blob/main//docs/concepts/session.md
main
opebclaw
[ -0.09434538334608078, -0.016932260245084763, -0.06366483122110367, 0.06353851407766342, 0.07757102698087692, -0.08381055295467377, 0.024660471826791763, -0.044062793254852295, 0.010929071344435215, -0.0272297915071249, 0.04756796360015869, 0.023921774700284004, -0.024606704711914062, -0.024628503248095512, 0.06164892390370369, 0.0647166520357132, -0.036373320966959, -0.07965993881225586, -0.05013632774353027, -0.016832862049341202, -0.05183541402220726, 0.0007505900575779378, -0.02165372297167778, -0.0078018284402787685, -0.06273259967565536, -0.06274280697107315, -0.016931448131799698, -0.020888186991214752, 0.036230895668268204, 0.008315798826515675, -0.058600738644599915, 0.08147921413183212, -0.08865766227245331, 0.023902133107185364, 0.03436249494552612, 0.1303020864725113, 0.0795711800456047, 0.013244492001831532, -0.01918593980371952, 0.0032747131772339344, 0.09933249652385712, -0.0007201987318694592, -0.03694003075361252, -0.06820855289697647, -0.01849609613418579, -0.028063874691724777, -0.07935614138841629, -0.07612432539463043, -0.05212482064962387, 0.04759609326720238, 0.05217732489109039, -0.022269031032919884, -0.01107978355139494, 0.06352309137582779, 0.028502395376563072, 0.10202593356370926, 0.029402095824480057, 0.010619360953569412, 0.03585232421755791, -0.04452570527791977, 0.005761574953794479, -0.024702701717615128, -0.013812616467475891, 0.04614276811480522, -0.0725507065653801, -0.0013980059884488583, 0.010420634411275387, -0.06711231172084808, 0.026758456602692604, -0.006824019365012646, -0.10122483968734741, -0.005440554115921259, -0.11001098901033401, -0.07488421350717545, -0.0029324530623853207, -0.01779305189847946, 0.02801477164030075, -0.047825466841459274, -0.04113695025444031, -0.05439990013837814, 0.0018657828914001584, -0.029918137937784195, -0.051343291997909546, -0.009514765813946724, -0.030581671744585037, 0.03819626197218895, -0.015644052997231483, 0.03856801986694336, 0.06066080927848816, 0.08374759554862976, -0.004468628671020269, -0.0069188582710921764, 0.035115793347358704, -0.022628270089626312, -0.029011977836489677, 0.009546404704451561, 0.021477611735463142, 0.10799521207809448, -0.014591565355658531, 0.07042822986841202, 0.0016115250764414668, 0.03637628257274628, -0.0014781494392082095, 0.01174074411392212, -0.02552412822842598, -0.019312316551804543, 0.006738258525729179, 0.046367097645998, 0.020673535764217377, 0.021881528198719025, -0.021167341619729996, -0.00583201227709651, 0.1046965941786766, -0.005489859264343977, -0.030565928667783737, 0.06637891381978989, -0.043410658836364746, 0.00369661720469594, 0.037698112428188324, 0.09981219470500946, 0.05432170256972313, 0.01297254953533411, 0.04583432525396347, -0.048737552016973495, 0.03978947177529335, 0.09830576926469803, 0.06460011750459671, 5.414344244960734e-33, 0.0014089943142607808, -0.05725490674376488, -0.06009961664676666, 0.007122711278498173, 0.057309288531541824, -0.03298334777355194, -0.029012594372034073, 0.04733666032552719, -0.0378417894244194, -0.034539178013801575, -0.0032033678144216537, 0.04228120297193527, -0.025997471064329147, -0.01932547241449356, -0.021830543875694275, 0.013683944009244442, -0.01909841038286686, 0.03354218974709511, 0.12660148739814758, -0.022957798093557358, 0.01930096559226513, -0.02684232033789158, -0.02909250743687153, 0.030439937487244606, 0.02494620345532894, -0.0191070307046175, 0.025729749351739883, 0.00009249820141121745, -0.029746048152446747, 0.023247743025422096, 0.03748035803437233, 0.08676059544086456, -0.02239004522562027, 0.05917574465274811, -0.08633781224489212, 0.06183736026287079, -0.054450731724500656, -0.036839742213487625, 0.003050832776352763, -0.05859828367829323, -0.038555193692445755, 0.038910407572984695, -0.05320192500948906, -0.04951018467545509, 0.03195358067750931, -0.11367678642272949, 0.0297546349465847, 0.04789096117019653, 0.03293688967823982, 0.05034899339079857, -0.06793169677257538, 0.01919150911271572, -0.0009678024216555059, -0.03547604754567146, -0.06905762106180191, -0.02676444873213768, -0.008255690336227417, 0.005057870410382748, -0.025432251393795013, 0.004439075011759996, 0.08583549410104752, 0.0012107512447983027, 0.0006519086891785264, 0.0059663220308721066, 0.07725406438112259, 0.09656283259391785, -0.01483494695276022, 0.012769939377903938, -0.05948439612984657, -0.012093976140022278, 0.004493057727813721, 0.0029573324136435986, -0.028366941958665848, 0.012816518545150757, -0.02899101935327053, -0.06833850592374802, 0.0419355072081089, 0.008283792063593864, -0.048254527151584625, 0.03371840715408325, 0.10461439192295074, 0.05960731953382492, -0.0306564848870039, 0.03440529480576515, -0.02105085551738739, -0.030995002016425133, 0.014199397526681423, -0.006293987389653921, -0.03532381355762482, 0.07352367788553238, 0.00001650681224418804, -0.05312693119049072, 0.012975679710507393, 0.06840928643941879, -0.03984996676445007, -6.20089873916462e-33, 0.03398635983467102, 0.01229268591850996, -0.06885045766830444, 0.02787800133228302, -0.0054410845041275024, 0.030376726761460304, 0.013460748828947544, 0.04214010760188103, -0.015616894699633121, -0.03538190945982933, -0.016720958054065704, 0.09365798532962799, 0.04067742079496384, -0.03165338188409805, 0.021295886486768723, -0.0397847518324852, -0.053203780204057693, -0.05353773757815361, -0.020515505224466324, 0.058794599026441574, 0.04234293848276138, 0.0016530059510841966, -0.09132670611143112, 0.016172336414456367, 0.10343508422374725, 0.027654850855469704, -0.09525392204523087, 0.05522771552205086, -0.06852326542139053, -0.04452596604824066, 0.04165882244706154, -0.05569090694189072, -0.013781676068902016, 0.028596030548214912, 0.006346120499074459, -0.023624956607818604, -0.06528425216674805, 0.06578203290700912, 0.002677764743566513, 0.03912460058927536, 0.07521698623895645, 0.019376302137970924, -0.02598389983177185, -0.014407929033041, -0.02938605658710003, 0.1623476892709732, -0.09261509031057358, -0.03193066269159317, -0.11508674174547195, 0.01335256639868021, -0.014729436486959457, 0.04486916586756706, 0.03548724949359894, 0.030133722350001335, 0.03736738860607147, 0.0734577402472496, 0.00826264638453722, -0.02318774163722992, -0.044118959456682205, -0.09994055330753326, 0.08026400953531265, -0.0643787533044815, -0.036431849002838135, 0.10648366063833237, -0.04455418884754181, -0.049742262810468674, -0.020907310768961906, 0.023809032514691353, -0.03184102103114128, -0.032709673047065735, 0.045264579355716705, -0.03204337880015373, -0.0820917934179306, -0.03885185718536377, -0.055006805807352066, -0.005683514289557934, 0.05367942899465561, -0.1617586463689804, -0.08688832819461823, 0.009727626107633114, -0.15575140714645386, -0.0055611468851566315, -0.01979709044098854, 0.003861611010506749, -0.047316983342170715, -0.00037744949804618955, -0.046424996107816696, 0.06479983776807785, 0.05294061452150345, 0.07331579178571701, -0.05368952825665474, -0.053029827773571014, -0.13048525154590607, -0.00849658902734518, -0.03318263590335846, -5.827313032114034e-8, -0.015650976449251175, 0.012713096104562283, 0.04153088480234146, 0.10164142400026321, 0.04811001196503639, -0.08899163454771042, 0.11871329694986343, 0.005112017039209604, -0.025010693818330765, 0.08334234356880188, 0.04844151437282562, 0.015286083333194256, 0.04130936414003372, -0.059077952057123184, 0.005860404577106237, 0.0773368775844574, -0.015009255148470402, -0.05039357766509056, -0.0025962672661989927, -0.06172357499599457, -0.06624727696180344, -0.08062760531902313, 0.05763193219900131, 0.03992215543985367, -0.051320791244506836, 0.0411481074988842, 0.03705209121108055, 0.050026241689920425, 0.036599356681108475, 0.04183266684412956, -0.07012587040662766, -0.005566894076764584, 0.041097164154052734, 0.02089676260948181, -0.09537282586097717, 0.03450968489050865, -0.14096182584762573, 0.006673834752291441, -0.0242424625903368, 0.026825010776519775, 0.0469425693154335, -0.0019199104281142354, -0.045097094029188156, -0.01638016477227211, -0.04044400155544281, 0.016083814203739166, -0.039373692125082016, 0.03054828569293022, 0.01068069040775299, 0.031895168125629425, -0.017680853605270386, 0.023659374564886093, -0.0017952820053324103, 0.0710749626159668, 0.062323782593011856, 0.008357343263924122, 0.07489344477653503, -0.05848294124007225, 0.06421960890293121, 0.022034326568245888, -0.007938936352729797, 0.019247878342866898, -0.0422479622066021, -0.08003599941730499 ]
0.115392
is used, current thinking/verbose toggles, and when your WhatsApp web creds were last refreshed (helps spot relink needs). - Send `/context list` or `/context detail` to see what’s in the system prompt and injected workspace files (and the biggest context contributors). - Send `/stop` as a standalone message to abort the current run, clear queued followups for that session, and stop any sub-agent runs spawned from it (the reply includes the stopped count). - Send `/compact` (optional instructions) as a standalone message to summarize older context and free up window space. See [/concepts/compaction](/concepts/compaction). - JSONL transcripts can be opened directly to review full turns. ## Tips - Keep the primary key dedicated to 1:1 traffic; let groups keep their own keys. - When automating cleanup, delete individual keys instead of the whole store to preserve context elsewhere. ## Session origin metadata Each session entry records where it came from (best-effort) in `origin`: - `label`: human label (resolved from conversation label + group subject/channel) - `provider`: normalized channel id (including extensions) - `from`/`to`: raw routing ids from the inbound envelope - `accountId`: provider account id (when multi-account) - `threadId`: thread/topic id when the channel supports it The origin fields are populated for direct messages, channels, and groups. If a connector only updates delivery routing (for example, to keep a DM main session fresh), it should still provide inbound context so the session keeps its explainer metadata. Extensions can do this by sending `ConversationLabel`, `GroupSubject`, `GroupChannel`, `GroupSpace`, and `SenderName` in the inbound context and calling `recordSessionMetaFromInbound` (or passing the same context to `updateLastRoute`).
https://github.com/openclaw/openclaw/blob/main//docs/concepts/session.md
main
opebclaw
[ -0.060120224952697754, 0.03149251267313957, 0.012121928855776787, -0.007135417778044939, 0.04984812065958977, -0.029775377362966537, 0.054926369339227676, -0.0019919821061193943, 0.041623082011938095, 0.060311831533908844, -0.011010491289198399, 0.02790595032274723, -0.022235440090298653, 0.04403284937143326, 0.0448128767311573, 0.003471654374152422, 0.017716245725750923, -0.1073523536324501, -0.08029168844223022, 0.01566687785089016, 0.07108916342258453, 0.03892068192362785, 0.05651490017771721, 0.043544117361307144, -0.05739319697022438, 0.05428329482674599, -0.04021671041846275, 0.0035285335034132004, 0.05581940338015556, 0.06552255153656006, -0.04176042228937149, 0.06042199581861496, 0.024505674839019775, 0.039015743881464005, -0.0604361966252327, 0.05353350564837456, 0.0926830917596817, 0.0405445471405983, 0.05587569251656532, 0.01913483813405037, -0.027624808251857758, 0.015036283992230892, -0.10651134699583054, 0.016864104196429253, 0.043738123029470444, -0.04285963624715805, -0.08678142726421356, -0.034119389951229095, -0.06438922137022018, 0.038054272532463074, 0.01760248653590679, 0.029181109741330147, 0.013348575681447983, 0.06110529229044914, -0.01411988865584135, 0.02699023298919201, -0.04946032539010048, 0.08841361105442047, 0.01760994829237461, -0.0000019018324337594095, -0.03985598683357239, -0.051950644701719284, -0.02332092449069023, 0.020669465884566307, -0.03725264221429825, 0.03449804708361626, -0.06061886250972748, -0.05681128054857254, 0.03892936930060387, -0.01709003373980522, -0.08758614957332611, -0.01645347848534584, -0.004932885989546776, 0.01316133514046669, -0.02987935021519661, -0.023722432553768158, 0.0016256861854344606, -0.015647104009985924, -0.12250873446464539, -0.06252241879701614, 0.08270832151174545, -0.02726886235177517, -0.031541287899017334, 0.07035855203866959, -0.022401541471481323, 0.00316421315073967, 0.005578850861638784, -0.036312442272901535, 0.0490269660949707, -0.032614488154649734, -0.024158520624041557, -0.08501525223255157, 0.006736475042998791, 0.03210066258907318, 0.02644333615899086, 0.04647057130932808, -0.029221534729003906, 0.02726159431040287, 0.014170010574162006, 0.0533389076590538, 0.07547964155673981, -0.0154249407351017, 0.002213174244388938, -0.08199454843997955, -0.02317558228969574, 0.02671126089990139, -0.024246565997600555, 0.10049895197153091, 0.0541512668132782, 0.017390593886375427, -0.09232538193464279, 0.03864993527531624, -0.06131637841463089, 0.015713157132267952, 0.033196114003658295, 0.004756722133606672, 0.004013218451291323, 0.007959439419209957, 0.03536566346883774, 0.04185066744685173, 0.14352566003799438, -0.06992228329181671, -0.00043026322964578867, 0.02952723391354084, -0.0361187681555748, -0.003003865946084261, 0.08193036913871765, 3.539381531573245e-33, 0.014420520514249802, 0.045760784298181534, -0.01876140385866165, 0.127079039812088, 0.02759009227156639, 0.008031624369323254, -0.010712680406868458, 0.03989318385720253, 0.005921607371419668, -0.0065507483668625355, 0.05441076308488846, 0.1143786683678627, -0.013459965586662292, -0.010086273774504662, -0.033062227070331573, -0.02013799175620079, -0.03979438915848732, 0.039612431079149246, 0.06337796151638031, -0.03631715849041939, -0.030643031001091003, -0.026121502742171288, -0.04687587916851044, 0.017411736771464348, 0.08497052639722824, 0.005850881338119507, 0.016457028687000275, 0.031000521034002304, -0.016216302290558815, -0.009398444555699825, -0.031680647283792496, 0.006403622683137655, -0.027483070269227028, 0.03241489827632904, 0.035564761608839035, 0.017992954701185226, -0.06815129518508911, -0.0296401958912611, -0.01938670128583908, -0.031365979462862015, -0.014553103595972061, 0.0038736709393560886, -0.10682296752929688, -0.004606404807418585, 0.028004860505461693, -0.12402480095624924, -0.03328169882297516, 0.02919836901128292, -0.04580162838101387, 0.07266247272491455, -0.007010807748883963, 0.028609169647097588, -0.00005364523167372681, 0.0387941338121891, -0.059924542903900146, -0.006708845961838961, 0.038096390664577484, -0.06639602035284042, -0.006514022126793861, 0.05432258918881416, 0.030475357547402382, -0.06351227313280106, -0.05303087830543518, 0.042921070009469986, 0.027911800891160965, -0.02283322811126709, -0.11320395022630692, 0.0009603217476978898, -0.06069876253604889, -0.014538568444550037, -0.04742735996842384, 0.0939415842294693, 0.05112944543361664, 0.07143697887659073, -0.0634240061044693, -0.03666643425822258, -0.0421411357820034, 0.13658790290355682, -0.0519961453974247, 0.011999843642115593, 0.12705178558826447, 0.01054529007524252, -0.05126737803220749, -0.01724102534353733, -0.008915119804441929, -0.03275344520807266, 0.045725468546152115, -0.11342834681272507, -0.12216207385063171, 0.03579774871468544, -0.04429741948843002, 0.03265756741166115, 0.044952791184186935, 0.050945207476615906, -0.01817903108894825, -4.7425903657680754e-33, 0.04855857044458389, -0.003373589599505067, -0.06441047787666321, 0.039523933082818985, -0.03439027816057205, -0.06651140749454498, 0.03151823580265045, 0.07282277196645737, 0.02770221047103405, -0.04709819331765175, -0.036075491458177567, -0.01252933032810688, 0.06959321349859238, -0.004293240141123533, -0.03250894695520401, 0.045325346291065216, 0.07898526638746262, -0.07564738392829895, -0.05566824600100517, -0.008664715103805065, 0.09624207019805908, -0.025940537452697754, -0.008456704206764698, 0.026845315471291542, -0.014849599450826645, -0.027109013870358467, 0.023406455293297768, -0.00912526436150074, -0.008554697968065739, -0.005137944128364325, 0.017612526193261147, -0.08996548503637314, 0.031785983592271805, 0.0038593485951423645, -0.0005072483909316361, -0.05290219560265541, -0.008534325286746025, 0.06075802817940712, 0.015776842832565308, -0.007497509475797415, 0.13657815754413605, -0.005223478190600872, -0.07638788968324661, -0.016171850264072418, 0.004236684646457434, 0.0694337710738182, -0.11677376925945282, 0.04406498000025749, -0.11703485995531082, 0.010728641413152218, 0.003696755040436983, -0.04725642502307892, -0.023924535140395164, -0.05818169191479683, -0.0262433011084795, -0.007519418373703957, 0.06612581759691238, -0.040476761758327484, -0.022159812971949577, -0.11643598973751068, 0.04978131502866745, -0.021766144782304764, -0.006220178212970495, 0.0020271162502467632, 0.044950976967811584, -0.10837183892726898, 0.007351284846663475, -0.04097052663564682, -0.009993158280849457, 0.0075458926148712635, -0.01767975464463234, -0.07373262941837311, -0.08603877574205399, -0.020649511367082596, 0.061596013605594635, -0.016986409202218056, -0.006428674794733524, -0.2333475798368454, 0.013009455986320972, 0.025919366627931595, -0.006120752543210983, -0.01702716387808323, 0.021505391225218773, 0.00869302824139595, 0.002402998972684145, 0.10560552030801773, -0.027789628133177757, 0.0671548992395401, -0.03079172782599926, 0.029472023248672485, -0.030296659097075462, -0.007728408556431532, -0.009864792227745056, 0.01705908589065075, 0.007446654606610537, -6.442928679462057e-8, -0.09391865879297256, -0.02361433207988739, -0.01123060006648302, 0.04571358487010002, 0.03129533678293228, -0.01280998531728983, 0.023648837581276894, 0.07200603932142258, 0.08092039078474045, -0.04390716180205345, -0.0119688231498003, -0.012072059325873852, -0.06677328050136566, 0.027633028104901314, 0.005850686226040125, 0.027713673189282417, -0.006880059372633696, -0.02178316004574299, -0.024105902761220932, -0.031743355095386505, 0.01437976211309433, -0.025574976578354836, -0.017199542373418808, 0.030116336420178413, 0.0776437520980835, -0.04295185208320618, 0.10217775404453278, 0.13475607335567474, -0.05375799909234047, -0.09074762463569641, -0.09769730269908905, -0.051151953637599945, -0.03508443757891655, 0.008355948142707348, -0.08681323379278183, 0.052306048572063446, -0.04740042984485626, -0.068354032933712, 0.010253889486193657, 0.012425840832293034, 0.07723445445299149, 0.05978034436702728, -0.028710944578051567, 0.020433947443962097, -0.009927977807819843, 0.033118121325969696, -0.014633595943450928, 0.025698116049170494, -0.02377818152308464, -0.05523965135216713, -0.009108132682740688, -0.04698605462908745, -0.010416756384074688, 0.04069720208644867, -0.020481139421463013, 0.002342771738767624, 0.06403505057096481, -0.00388274434953928, 0.07434551417827606, 0.028245847672224045, -0.007751700468361378, 0.11114805936813354, -0.061936717480421066, -0.00047364228521473706 ]
0.113085
# System Prompt OpenClaw builds a custom system prompt for every agent run. The prompt is \*\*OpenClaw-owned\*\* and does not use the p-coding-agent default prompt. The prompt is assembled by OpenClaw and injected into each agent run. ## Structure The prompt is intentionally compact and uses fixed sections: - \*\*Tooling\*\*: current tool list + short descriptions. - \*\*Safety\*\*: short guardrail reminder to avoid power-seeking behavior or bypassing oversight. - \*\*Skills\*\* (when available): tells the model how to load skill instructions on demand. - \*\*OpenClaw Self-Update\*\*: how to run `config.apply` and `update.run`. - \*\*Workspace\*\*: working directory (`agents.defaults.workspace`). - \*\*Documentation\*\*: local path to OpenClaw docs (repo or npm package) and when to read them. - \*\*Workspace Files (injected)\*\*: indicates bootstrap files are included below. - \*\*Sandbox\*\* (when enabled): indicates sandboxed runtime, sandbox paths, and whether elevated exec is available. - \*\*Current Date & Time\*\*: user-local time, timezone, and time format. - \*\*Reply Tags\*\*: optional reply tag syntax for supported providers. - \*\*Heartbeats\*\*: heartbeat prompt and ack behavior. - \*\*Runtime\*\*: host, OS, node, model, repo root (when detected), thinking level (one line). - \*\*Reasoning\*\*: current visibility level + /reasoning toggle hint. Safety guardrails in the system prompt are advisory. They guide model behavior but do not enforce policy. Use tool policy, exec approvals, sandboxing, and channel allowlists for hard enforcement; operators can disable these by design. ## Prompt modes OpenClaw can render smaller system prompts for sub-agents. The runtime sets a `promptMode` for each run (not a user-facing config): - `full` (default): includes all sections above. - `minimal`: used for sub-agents; omits \*\*Skills\*\*, \*\*Memory Recall\*\*, \*\*OpenClaw Self-Update\*\*, \*\*Model Aliases\*\*, \*\*User Identity\*\*, \*\*Reply Tags\*\*, \*\*Messaging\*\*, \*\*Silent Replies\*\*, and \*\*Heartbeats\*\*. Tooling, \*\*Safety\*\*, Workspace, Sandbox, Current Date & Time (when known), Runtime, and injected context stay available. - `none`: returns only the base identity line. When `promptMode=minimal`, extra injected prompts are labeled \*\*Subagent Context\*\* instead of \*\*Group Chat Context\*\*. ## Workspace bootstrap injection Bootstrap files are trimmed and appended under \*\*Project Context\*\* so the model sees identity and profile context without needing explicit reads: - `AGENTS.md` - `SOUL.md` - `TOOLS.md` - `IDENTITY.md` - `USER.md` - `HEARTBEAT.md` - `BOOTSTRAP.md` (only on brand-new workspaces) Large files are truncated with a marker. The max per-file size is controlled by `agents.defaults.bootstrapMaxChars` (default: 20000). Missing files inject a short missing-file marker. Internal hooks can intercept this step via `agent:bootstrap` to mutate or replace the injected bootstrap files (for example swapping `SOUL.md` for an alternate persona). To inspect how much each injected file contributes (raw vs injected, truncation, plus tool schema overhead), use `/context list` or `/context detail`. See [Context](/concepts/context). ## Time handling The system prompt includes a dedicated \*\*Current Date & Time\*\* section when the user timezone is known. To keep the prompt cache-stable, it now only includes the \*\*time zone\*\* (no dynamic clock or time format). Use `session\_status` when the agent needs the current time; the status card includes a timestamp line. Configure with: - `agents.defaults.userTimezone` - `agents.defaults.timeFormat` (`auto` | `12` | `24`) See [Date & Time](/date-time) for full behavior details. ## Skills When eligible skills exist, OpenClaw injects a compact \*\*available skills list\*\* (`formatSkillsForPrompt`) that includes the \*\*file path\*\* for each skill. The prompt instructs the model to use `read` to load the SKILL.md at the listed location (workspace, managed, or bundled). If no skills are eligible, the Skills section is omitted. ``` ... ... ... ``` This keeps the base prompt small while still enabling targeted skill usage. ## Documentation When available, the system prompt includes a \*\*Documentation\*\* section that points to the local OpenClaw docs directory (either `docs/` in the repo workspace or the bundled npm package
https://github.com/openclaw/openclaw/blob/main//docs/concepts/system-prompt.md
main
opebclaw
[ -0.006138477474451065, -0.006984990555793047, -0.08940403163433075, 0.04148362576961517, 0.019699793308973312, -0.043569695204496384, -0.00956397969275713, -0.011275921948254108, -0.03292009234428406, 0.01950230821967125, 0.016057435423135757, -0.024217823520302773, 0.04875919595360756, -0.014820731244981289, 0.06261471658945084, 0.0837489664554596, 0.039136480540037155, -0.05572719871997833, 0.015594542026519775, 0.014459245838224888, 0.022811589762568474, 0.02889586053788662, 0.03809525445103645, -0.01252321433275938, -0.12379550188779831, -0.007415063213557005, -0.0033875401131808758, -0.03336583077907562, -0.04650799185037613, -0.029786739498376846, 0.032677944749593735, 0.03985095024108887, 0.08035538345575333, 0.04524232819676399, 0.106355220079422, 0.04369572177529335, 0.018904419615864754, 0.028361698612570763, -0.06991083174943924, 0.009691484272480011, 0.004029161296784878, -0.010401014238595963, -0.018964005634188652, -0.024846186861395836, -0.08561224490404129, -0.06033308058977127, -0.003840155666694045, -0.09829496592283249, 0.003148829098790884, -0.018806926906108856, -0.09793323278427124, -0.12356667220592499, 0.02646566554903984, -0.09149308502674103, -0.0023165037855505943, -0.017323045060038567, 0.09713942557573318, -0.02390613965690136, 0.008077708072960377, -0.06644126772880554, 0.0006274435436353087, 0.02451368421316147, -0.11522842198610306, 0.08267366886138916, -0.03936511650681496, 0.04203356057405472, -0.08092745393514633, -0.038784533739089966, -0.026956239715218544, -0.0671328753232956, -0.05403195321559906, 0.020257985219359398, -0.012020052410662174, -0.0395541787147522, 0.01886018179357052, -0.028032857924699783, -0.025000276044011116, 0.06694213300943375, -0.03399282693862915, -0.10883577167987823, -0.0139897670596838, -0.01657034642994404, -0.053780294954776764, 0.032613836228847504, -0.005740400869399309, 0.12784364819526672, 0.034718845039606094, 0.05376705154776573, 0.06143501028418541, 0.005726585164666176, 0.03993621841073036, -0.13204741477966309, 0.034411702305078506, 0.006070644594728947, -0.008621995337307453, 0.040224093943834305, -0.005158207379281521, -0.049525436013936996, -0.07025006413459778, 0.05351635441184044, -0.04181387647986412, -0.08664436638355255, 0.030004335567355156, -0.01654873602092266, -0.07583872228860855, 0.08053578436374664, 0.039613720029592514, 0.08831775933504105, -0.020973574370145798, -0.055066488683223724, 0.004879700485616922, -0.030040619894862175, 0.053715337067842484, -0.049247391521930695, 0.055471066385507584, 0.027931760996580124, -0.07046932727098465, 0.020279040560126305, 0.021506905555725098, 0.041758835315704346, 0.1271703839302063, -0.023905832320451736, 0.010676027275621891, -0.0019417027942836285, 0.1381012201309204, 0.046341415494680405, 0.04428499564528465, 4.359484634549599e-33, 0.07633951306343079, 0.017564157024025917, -0.04378235340118408, 0.07764100283384323, 0.10882516205310822, 0.026975421234965324, 0.0658416748046875, -0.005052222404628992, -0.05123971402645111, 0.03687360882759094, 0.04248218610882759, 0.026047667488455772, -0.04592696577310562, 0.014236505143344402, 0.003116746200248599, -0.006983473896980286, -0.03566396236419678, 0.07335839420557022, 0.029292473569512367, 0.015307357534766197, 0.05110910162329674, 0.02225389890372753, -0.0397205613553524, 0.06433658301830292, 0.03384411707520485, 0.05958103761076927, -0.03782493248581886, -0.02880077436566353, 0.04154680669307709, 0.02656855434179306, 0.029915405437350273, 0.04398098960518837, -0.03675660863518715, 0.07294631004333496, -0.09755394607782364, 0.07684895396232605, -0.06784192472696304, -0.07640545815229416, 0.022814910858869553, -0.02799014374613762, 0.022671585902571678, -0.04379155859351158, 0.03479010984301567, -0.02933657541871071, 0.012747911736369133, -0.1669529676437378, -0.04807784780859947, 0.06434762477874756, 0.02037177048623562, 0.06586811691522598, 0.019041921943426132, 0.055018551647663116, 0.08082696795463562, -0.008492904715240002, -0.021661395207047462, -0.01827402040362358, 0.014029799029231071, -0.01660633087158203, 0.008387567475438118, 0.016962941735982895, 0.016885410994291306, 0.03887563571333885, -0.013366427272558212, 0.010060932487249374, -0.0006852048099972308, -0.03357800468802452, 0.07632042467594147, 0.029918968677520752, 0.06232864782214165, 0.0348329097032547, -0.12132827937602997, -0.00679805688560009, -0.011858196929097176, 0.009032421745359898, -0.0745406299829483, -0.07359953224658966, 0.025931749492883682, -0.06925985962152481, 0.04000699892640114, -0.0362015962600708, 0.016286686062812805, -0.017141567543148994, -0.03192100673913956, 0.027083292603492737, 0.03512457013130188, 0.0013273657532408834, -0.016262076795101166, -0.045954275876283646, -0.010800587013363838, 0.07349925488233566, 0.02588697150349617, -0.056948333978652954, -0.13606393337249756, 0.10219656676054001, 0.022019172087311745, -6.967115344389358e-33, 0.03930211812257767, -0.03517396003007889, -0.07476833462715149, 0.025446994230151176, -0.05466693267226219, -0.01468763779848814, -0.02189609780907631, -0.06611546128988266, -0.042959894984960556, -0.0708129033446312, -0.008278514258563519, 0.06890703737735748, 0.003463281085714698, -0.052593644708395004, 0.07118701934814453, -0.04433377832174301, -0.04525431618094444, -0.03630475699901581, 0.013010167516767979, -0.03962311893701553, 0.014380630105733871, 0.046005506068468094, -0.05132663622498512, -0.006961713079363108, 0.06709214299917221, -0.046249378472566605, -0.008364089764654636, 0.059457678347826004, 0.08187513053417206, -0.003329399973154068, 0.025150302797555923, 0.04275365173816681, -0.0552481934428215, 0.01561448909342289, -0.04894338548183441, 0.0364702083170414, -0.025305332615971565, -0.020565534010529518, 0.012667916715145111, 0.09004124999046326, 0.06443704664707184, -0.07005782425403595, -0.035001836717128754, -0.026845760643482208, -0.05170683190226555, 0.0383501872420311, -0.02477305382490158, -0.06713581830263138, -0.04472548887133598, -0.007887663319706917, 0.0048853447660803795, -0.0006164861842989922, 0.010887249372899532, -0.02825120836496353, -0.010273486375808716, 0.027593137696385384, 0.02430032379925251, -0.06297164410352707, 0.021576818078756332, -0.07910270243883133, -0.0007240082486532629, 0.03167885169386864, -0.022211983799934387, 0.05995103344321251, -0.04447536915540695, -0.053968243300914764, -0.03328302875161171, 0.04747462645173073, -0.05935012921690941, -0.04272328317165375, -0.0235312320291996, -0.05891704559326172, -0.027303243055939674, -0.06851662695407867, 0.029172785580158234, 0.021362043917179108, -0.049077533185482025, -0.08023162186145782, -0.06971940398216248, 0.041547782719135284, -0.003711144207045436, -0.00003638622729340568, 0.014433476142585278, 0.022712282836437225, -0.07524905353784561, 0.04296661168336868, -0.004581440705806017, 0.14041461050510406, 0.014928718097507954, 0.055747319012880325, -0.05731360614299774, 0.03609732910990715, 0.06986159831285477, -0.006663573905825615, -0.03991003707051277, -5.962330362763169e-8, -0.07954459637403488, 0.007241600193083286, -0.002106503816321492, -0.015170728787779808, 0.029636766761541367, -0.03422217443585396, 0.011426701210439205, 0.030770549550652504, -0.06449050456285477, 0.01929946057498455, 0.11935942620038986, 0.001107479096390307, -0.014151254668831825, -0.007315740454941988, 0.004188522696495056, 0.0950491726398468, -0.03504998981952667, 0.005517265759408474, -0.03708032891154289, -0.11654876917600632, 0.03989943861961365, -0.032759636640548706, -0.010524163022637367, 0.01957140862941742, -0.06152888014912605, -0.01778438128530979, -0.08879490196704865, 0.029678773134946823, -0.05942939221858978, 0.08018787950277328, -0.0023006380070000887, -0.04180140793323517, 0.03429122641682625, 0.0006647370173595846, -0.01760968565940857, 0.08317691087722778, -0.000250189914368093, 0.00208306428976357, 0.061343058943748474, -0.03866933286190033, 0.013399355113506317, 0.006071284878998995, -0.051312267780303955, -0.04043376445770264, -0.07652173936367035, 0.0242318008095026, -0.047979723662137985, -0.04987592250108719, 0.0123157212510705, -0.08721301704645157, -0.0857427641749382, 0.014718761667609215, -0.05569171905517578, 0.08833184093236923, 0.006276291329413652, 0.1300065666437149, 0.05084214359521866, -0.04913296923041344, 0.016923457384109497, 0.0349484421312809, -0.03999336063861847, 0.04459607973694801, 0.056389547884464264, -0.017665471881628036 ]
0.124005
section is omitted. ``` ... ... ... ``` This keeps the base prompt small while still enabling targeted skill usage. ## Documentation When available, the system prompt includes a \*\*Documentation\*\* section that points to the local OpenClaw docs directory (either `docs/` in the repo workspace or the bundled npm package docs) and also notes the public mirror, source repo, community Discord, and ClawHub (https://clawhub.com) for skills discovery. The prompt instructs the model to consult local docs first for OpenClaw behavior, commands, configuration, or architecture, and to run `openclaw status` itself when possible (asking the user only when it lacks access).
https://github.com/openclaw/openclaw/blob/main//docs/concepts/system-prompt.md
main
opebclaw
[ -0.0022466848604381084, 0.02737252041697502, -0.0374993272125721, 0.06056595966219902, 0.04886868968605995, -0.08844122290611267, -0.04271445795893669, -0.00702266488224268, -0.06327050179243088, -0.011869595386087894, 0.0046590655110776424, -0.017029311507940292, 0.0421333946287632, -0.022946828976273537, 0.03278062120079994, 0.08861002326011658, 0.03505021706223488, -0.09103769809007645, 0.024183891713619232, 0.011470765806734562, -0.013615398667752743, 0.07165698707103729, 0.06364372372627258, -0.025239577516913414, -0.06190401688218117, -0.025228865444660187, -0.05530950427055359, -0.011328596621751785, 0.002169623738154769, 0.00333716650493443, 0.05844413489103317, 0.0688989982008934, 0.10772252082824707, 0.0365857370197773, 0.09076786041259766, 0.021227607503533363, 0.09482264518737793, -0.007295270450413227, -0.11119434237480164, 0.00351825263351202, 0.0031227723229676485, 0.026909220963716507, -0.014956544153392315, -0.005949972663074732, -0.09002508968114853, -0.04075581207871437, 0.014617061242461205, -0.12397580593824387, -0.013986408710479736, 0.012599228881299496, -0.06323128938674927, -0.1476878672838211, 0.01570114493370056, -0.09587905555963516, 0.01659436523914337, 0.03746636584401131, 0.04567123204469681, -0.013219505548477173, 0.01307675614953041, -0.043591078370809555, 0.024857956916093826, 0.006824721582233906, -0.11471214145421982, 0.050944309681653976, -0.005526443012058735, 0.029649365693330765, -0.051568757742643356, -0.05670468136668205, -0.06329617649316788, -0.05111256614327431, 0.0009774192003533244, 0.0677301287651062, 0.007197733037173748, 0.02050829865038395, 0.06816645711660385, -0.04686910659074783, 0.015282059088349342, 0.03801659867167473, -0.008118273690342903, -0.05781508609652519, -0.06326700001955032, -0.014224427752196789, -0.04738498479127884, -0.0053056273609399796, -0.02497771382331848, 0.1531577855348587, 0.007703917566686869, 0.02903195284307003, 0.046730898320674896, 0.021563351154327393, 0.058454252779483795, -0.1957630217075348, -0.04111509397625923, 0.0026372396387159824, -0.04899829253554344, 0.008586929179728031, 0.009917125105857849, -0.028689568862318993, -0.080048568546772, 0.020390760153532028, -0.03143509849905968, -0.06878967583179474, 0.06754223257303238, -0.02023887075483799, -0.08342476934194565, 0.10613871365785599, -0.006418799981474876, 0.12318829447031021, 0.007766943424940109, -0.013912593945860863, 0.04108109325170517, -0.02284826897084713, 0.048048216849565506, -0.020687397569417953, -0.014886324293911457, 0.04503757506608963, -0.04869147762656212, -0.047107622027397156, 0.01799965091049671, 0.028565101325511932, 0.0911789983510971, 0.03952447697520256, 0.03877970203757286, -0.004643910564482212, 0.06297309696674347, -0.0010902556823566556, 0.00869766529649496, -6.248108796345551e-34, 0.10932908952236176, 0.03194108605384827, -0.03721258416771889, 0.03501205891370773, 0.08941040188074112, 0.022714801132678986, 0.056175004690885544, 0.016882725059986115, -0.04382321611046791, 0.0035292417742311954, 0.045890893787145615, 0.021818244829773903, -0.004288634285330772, -0.040482498705387115, 0.024655481800436974, 0.044129353016614914, -0.012245595455169678, 0.06846579909324646, 0.010029069148004055, -0.0036221963819116354, 0.046972718089818954, 0.0022151421289891005, -0.06189149245619774, 0.0728527158498764, 0.020881859585642815, 0.046473581343889236, 0.01578083448112011, -0.0005458691157400608, 0.019080322235822678, 0.037299077957868576, 0.028333555907011032, 0.019218897446990013, -0.036272093653678894, 0.024964652955532074, 0.024371417239308357, 0.1036464124917984, -0.04169643297791481, -0.05498630553483963, 0.010186372324824333, -0.054470159113407135, -0.0018012921791523695, -0.024345995858311653, -0.014445639215409756, 0.00815823394805193, 0.0025426591746509075, -0.1388521045446396, 0.01225575152784586, 0.048246100544929504, 0.009782571345567703, 0.10780976712703705, 0.0018072390230372548, 0.03506956994533539, 0.09340773522853851, -0.04596909135580063, -0.01206386461853981, 0.0013218867825344205, 0.02864391729235649, -0.015597790479660034, -0.019046256318688393, -0.028036730363965034, 0.03382790461182594, 0.04975936934351921, -0.010328659787774086, 0.019645661115646362, -0.09399577975273132, -0.016208693385124207, 0.035313088446855545, 0.008760558441281319, 0.0790754035115242, 0.027529828250408173, -0.05183769389986992, 0.003669960191473365, -0.021595463156700134, 0.033229630440473557, -0.09111930429935455, -0.04453962668776512, 0.020464036613702774, -0.01992359757423401, 0.07178469002246857, -0.0028013710398226976, 0.04746628180146217, -0.04495982825756073, -0.050698619335889816, 0.014577887952327728, 0.08052043616771698, 0.03270401433110237, 0.05360359698534012, -0.02747044712305069, -0.019338956102728844, 0.06650839000940323, 0.06229312717914581, -0.0031726346351206303, -0.12655986845493317, 0.07053426653146744, 0.02133617363870144, -1.391235216751602e-33, 0.02914918214082718, -0.05802609398961067, -0.043125469237565994, -0.010484092868864536, -0.07655512541532516, 0.005773218348622322, 0.03943565487861633, -0.051983777433633804, -0.04317203164100647, -0.0924518033862114, -0.006825949996709824, 0.07022223621606827, -0.019941307604312897, -0.04052354767918587, 0.0457921102643013, -0.04828533157706261, -0.08994565159082413, 0.001824384555220604, 0.025644546374678612, -0.0030761908274143934, -0.03951656445860863, 0.013475161045789719, -0.07231186330318451, 0.010840462520718575, 0.047711752355098724, -0.04359649121761322, -0.04668809846043587, -0.005858412943780422, 0.04207038879394531, -0.0009883996099233627, 0.03957967460155487, 0.021631652489304543, -0.05647680535912514, 0.0022148967254906893, -0.05573105439543724, 0.02290530316531658, -0.09283702075481415, -0.021515611559152603, 0.032316308468580246, 0.04610888659954071, 0.03295036405324936, -0.03354628384113312, -0.06681471318006516, -0.014880864880979061, -0.09680963307619095, 0.04595658555626869, 0.021897638216614723, -0.035694874823093414, -0.0893741026520729, -0.005310375243425369, 0.027808133512735367, 0.028984684497117996, 0.07981377840042114, -0.015083884820342064, -0.0007988467696122825, 0.0795542299747467, 0.0009508926304988563, -0.058626145124435425, 0.01005973108112812, -0.0662943571805954, 0.035865508019924164, 0.06445328146219254, -0.0744667500257492, 0.06772877275943756, -0.033938758075237274, -0.05002793297171593, 0.006124543957412243, 0.07965230941772461, -0.0802718847990036, -0.031994614750146866, -0.06588669866323471, -0.028709225356578827, 0.02315850742161274, -0.11655423045158386, -0.016646526753902435, 0.04039105400443077, -0.0360778272151947, -0.05162603408098221, -0.08705512434244156, 0.042749423533678055, -0.01827286370098591, -0.0009431144571863115, 0.02060600183904171, 0.03719281405210495, 0.004609817638993263, 0.012637128122150898, 0.017934560775756836, 0.09302544593811035, -0.01301796268671751, 0.05453086271882057, -0.059295590966939926, 0.03972489759325981, -0.003098682966083288, 0.0011737804161384702, -0.043276041746139526, -4.995364477622388e-8, -0.08852735161781311, 0.03096504509449005, -0.059540100395679474, -0.015561520121991634, 0.06932426244020462, -0.013478957116603851, -0.005784136708825827, 0.05981306731700897, -0.07465235888957977, 0.10768981277942657, 0.07349123060703278, 0.005406303331255913, -0.059281125664711, -0.035769980400800705, 0.03513045236468315, 0.06721234321594238, 0.032635387033224106, -0.017835941165685654, -0.048680394887924194, -0.06295450031757355, 0.019057372584939003, -0.03403995931148529, 0.004825253505259752, 0.03007250837981701, -0.06970641762018204, -0.031299129128456116, -0.05492351949214935, 0.07047253847122192, -0.05757806450128555, -0.007135774940252304, -0.03207917883992195, -0.035626836121082306, -0.0010972482850775123, -0.005983937531709671, 0.028069527819752693, 0.07920292019844055, -0.01106826402246952, 0.032753992825746536, 0.015889262780547142, -0.0267168041318655, -0.0029147572349756956, 0.0008146365289576352, -0.0185416117310524, 0.008282214403152466, -0.12364345788955688, 0.06401588767766953, -0.001716548576951027, -0.001608679536730051, -0.01660432666540146, -0.07284804433584213, -0.03044392168521881, -0.03451256453990936, -0.02208447828888893, 0.06071488931775093, 0.008373862132430077, 0.1738320142030716, 0.0642634853720665, -0.037452470511198044, -0.06301142275333405, 0.015819363296031952, 0.01691027730703354, 0.06238771602511406, 0.020181460306048393, 0.027133703231811523 ]
0.057181
# Groups OpenClaw treats group chats consistently across surfaces: WhatsApp, Telegram, Discord, Slack, Signal, iMessage, Microsoft Teams. ## Beginner intro (2 minutes) OpenClaw “lives” on your own messaging accounts. There is no separate WhatsApp bot user. If \*\*you\*\* are in a group, OpenClaw can see that group and respond there. Default behavior: - Groups are restricted (`groupPolicy: "allowlist"`). - Replies require a mention unless you explicitly disable mention gating. Translation: allowlisted senders can trigger OpenClaw by mentioning it. > TL;DR > > - \*\*DM access\*\* is controlled by `\*.allowFrom`. > - \*\*Group access\*\* is controlled by `\*.groupPolicy` + allowlists (`\*.groups`, `\*.groupAllowFrom`). > - \*\*Reply triggering\*\* is controlled by mention gating (`requireMention`, `/activation`). Quick flow (what happens to a group message): ``` groupPolicy? disabled -> drop groupPolicy? allowlist -> group allowed? no -> drop requireMention? yes -> mentioned? no -> store for context only otherwise -> reply ``` ![Group message flow](/images/groups-flow.svg) If you want... | Goal | What to set | |------|-------------| | Allow all groups but only reply on @mentions | `groups: { "\*": { requireMention: true } }` | | Disable all group replies | `groupPolicy: "disabled"` | | Only specific groups | `groups: { "": { ... } }` (no `"\*"` key) | | Only you can trigger in groups | `groupPolicy: "allowlist"`, `groupAllowFrom: ["+1555..."]` | ## Session keys - Group sessions use `agent:::group:` session keys (rooms/channels use `agent:::channel:`). - Telegram forum topics add `:topic:` to the group id so each topic has its own session. - Direct chats use the main session (or per-sender if configured). - Heartbeats are skipped for group sessions. ## Pattern: personal DMs + public groups (single agent) Yes — this works well if your “personal” traffic is \*\*DMs\*\* and your “public” traffic is \*\*groups\*\*. Why: in single-agent mode, DMs typically land in the \*\*main\*\* session key (`agent:main:main`), while groups always use \*\*non-main\*\* session keys (`agent:main::group:`). If you enable sandboxing with `mode: "non-main"`, those group sessions run in Docker while your main DM session stays on-host. This gives you one agent “brain” (shared workspace + memory), but two execution postures: - \*\*DMs\*\*: full tools (host) - \*\*Groups\*\*: sandbox + restricted tools (Docker) > If you need truly separate workspaces/personas (“personal” and “public” must never mix), use a second agent + bindings. See [Multi-Agent Routing](/concepts/multi-agent). Example (DMs on host, groups sandboxed + messaging-only tools): ```json5 { agents: { defaults: { sandbox: { mode: "non-main", // groups/channels are non-main -> sandboxed scope: "session", // strongest isolation (one container per group/channel) workspaceAccess: "none", }, }, }, tools: { sandbox: { tools: { // If allow is non-empty, everything else is blocked (deny still wins). allow: ["group:messaging", "group:sessions"], deny: ["group:runtime", "group:fs", "group:ui", "nodes", "cron", "gateway"], }, }, }, } ``` Want “groups can only see folder X” instead of “no host access”? Keep `workspaceAccess: "none"` and mount only allowlisted paths into the sandbox: ```json5 { agents: { defaults: { sandbox: { mode: "non-main", scope: "session", workspaceAccess: "none", docker: { binds: [ // hostPath:containerPath:mode "~/FriendsShared:/data:ro", ], }, }, }, }, } ``` Related: - Configuration keys and defaults: [Gateway configuration](/gateway/configuration#agentsdefaultssandbox) - Debugging why a tool is blocked: [Sandbox vs Tool Policy vs Elevated](/gateway/sandbox-vs-tool-policy-vs-elevated) - Bind mounts details: [Sandboxing](/gateway/sandboxing#custom-bind-mounts) ## Display labels - UI labels use `displayName` when available, formatted as `:`. - `#room` is reserved for rooms/channels; group chats use `g-` (lowercase, spaces -> `-`, keep `#@+.\_-`). ## Group policy Control how group/room messages are handled per channel: ```json5 { channels: { whatsapp: { groupPolicy: "disabled", // "open" | "disabled" | "allowlist" groupAllowFrom: ["+15551234567"], }, telegram: { groupPolicy: "disabled", groupAllowFrom: ["123456789", "@username"], }, signal: { groupPolicy: "disabled", groupAllowFrom:
https://github.com/openclaw/openclaw/blob/main//docs/concepts/groups.md
main
opebclaw
[ -0.09113698452711105, -0.04864346608519554, -0.0008001552196219563, 0.06957617402076721, 0.039414726197719574, -0.1046954095363617, 0.03742660954594612, -0.0510735809803009, 0.05436762794852257, 0.009101013652980328, 0.04059239849448204, -0.06838351488113403, -0.001633316627703607, 0.037719178944826126, 0.10000552982091904, 0.02935273014008999, 0.04337006434798241, -0.1544433832168579, -0.07199425995349884, -0.02172010950744152, 0.046177685260772705, 0.019252963364124298, 0.0284835584461689, 0.005699985194951296, -0.040964268147945404, -0.05311935395002365, -0.07202085107564926, -0.031486522406339645, 0.019835177809000015, 0.027241190895438194, 0.012841697782278061, 0.03247205913066864, 0.03764515742659569, 0.09186198562383652, 0.010666370391845703, 0.07772377133369446, 0.03682131692767143, 0.0470394529402256, -0.034743499010801315, 0.013345826417207718, -0.08894038945436478, 0.030490942299365997, -0.024898147210478783, -0.03921428695321083, -0.0015191183192655444, 0.005823338869959116, -0.005977126304060221, -0.004759612027555704, -0.09559556841850281, 0.06026369705796242, -0.02553662285208702, -0.0045203217305243015, 0.019514089450240135, 0.0036316928453743458, 0.005095461383461952, -0.017536502331495285, -0.007255998440086842, 0.014058229513466358, 0.028277823701500893, -0.10205547511577606, -0.010114864446222782, -0.09937966614961624, -0.024027466773986816, 0.033691905438899994, -0.11849431693553925, 0.04123019054532051, -0.04249948263168335, -0.036196302622556686, -0.04672854021191597, -0.0072452048771083355, 0.07804150134325027, 0.01081822719424963, 0.013674176298081875, 0.03685605525970459, 0.08834178000688553, -0.009975636377930641, 0.012430046685039997, 0.027181211858987808, -0.05094260722398758, -0.08070264756679535, 0.032527923583984375, -0.018813109025359154, -0.04026998206973076, 0.01703859493136406, -0.009299546480178833, 0.07818793505430222, -0.008581103757023811, 0.0470697283744812, -0.026330597698688507, 0.06932764500379562, 0.007996691390872002, -0.03974813222885132, 0.03824089467525482, 0.03383138030767441, 0.03167083114385605, -0.029741019010543823, -0.006019227672368288, -0.007548787165433168, -0.035870302468538284, 0.0417470745742321, 0.0566168874502182, -0.038516268134117126, -0.05259827896952629, -0.062648706138134, -0.029988836497068405, 0.01486756931990385, 0.025470342487096786, 0.02625386230647564, -0.010960477404296398, -0.02959674783051014, -0.02761683613061905, -0.0016045174561440945, 0.09686236828565598, -0.04636489599943161, -0.03810708597302437, -0.06225219741463661, 0.0058081140741705894, -0.026324760168790817, 0.023508913815021515, 0.025721350684762, 0.09780643880367279, -0.01875137723982334, 0.06461217254400253, 0.01718023046851158, 0.10306313633918762, 0.0716467797756195, -0.0023029393050819635, 4.7490919515540766e-33, 0.017419153824448586, -0.05223960801959038, -0.07601049542427063, 0.02158571407198906, 0.009283424355089664, 0.04509354382753372, -0.03660500422120094, 0.060154564678668976, -0.057686351239681244, -0.027900632470846176, -0.04030750319361687, 0.01813122257590294, 0.01475251093506813, -0.003559855744242668, 0.0016988463466987014, 0.07019282877445221, -0.03001435659825802, 0.013190941885113716, 0.018729401752352715, -0.021001039072871208, -0.02405993640422821, -0.026830697432160378, -0.0618031807243824, 0.07316114753484726, -0.04807806760072708, 0.10147571563720703, -0.01644226908683777, -0.06202268227934837, 0.019174940884113312, 0.04366034269332886, -0.0160807054489851, 0.011269780807197094, -0.05169523507356644, 0.04402516037225723, 0.0009472644305787981, 0.053687483072280884, -0.039192553609609604, -0.026622040197253227, 0.00832804199308157, -0.014536264352500439, -0.029050447046756744, 0.008167488500475883, -0.08032583445310593, -0.04567362740635872, 0.02103978954255581, -0.05915871635079384, -0.06618691980838776, 0.0634014755487442, -0.04126141592860222, 0.04326685145497322, -0.007789068855345249, 0.05039261654019356, -0.013983028009533882, -0.0036035620141774416, -0.0015577215235680342, -0.06431654095649719, -0.01823601685464382, 0.007532558403909206, 0.025306085124611855, 0.030640186741948128, 0.00655688950791955, 0.046124354004859924, -0.02199583314359188, 0.017213495448231697, 0.00921234767884016, -0.016385061666369438, 0.03171265125274658, 0.06740593910217285, -0.033409055322408676, -0.0025769532658159733, 0.01798395998775959, 0.052520912140607834, 0.0061750030145049095, 0.08739464730024338, -0.11467409133911133, -0.05732623115181923, -0.003951130900532007, 0.07826908677816391, 0.0345742404460907, -0.018196646124124527, 0.06097202003002167, -0.048825521022081375, -0.013867098838090897, -0.026427198201417923, -0.09930521994829178, 0.01618301495909691, 0.03862323984503746, -0.08570955693721771, -0.05985909700393677, 0.13614866137504578, -0.07156725972890854, 0.002817711792886257, -0.006960321217775345, 0.09432083368301392, -0.03531308472156525, -6.253061300982359e-33, 0.01151873916387558, 0.11361604928970337, -0.03536169230937958, -0.06118560954928398, 0.03813176974654198, -0.021322989836335182, 0.0382239855825901, -0.00870189443230629, 0.07065849006175995, -0.015486465767025948, -0.06284704804420471, 0.01218623761087656, 0.019958076998591423, 0.013340650126338005, 0.05171266570687294, -0.04014936834573746, 0.024441903457045555, -0.023049620911478996, -0.043148934841156006, -0.022878793999552727, -0.005486349109560251, -0.042728208005428314, -0.002370326081290841, 0.07672054320573807, 0.06656508892774582, -0.027410028502345085, -0.020519858226180077, 0.02224723808467388, 0.06737314164638519, -0.011470711790025234, 0.06711174547672272, 0.054324086755514145, -0.046561937779188156, -0.009044253267347813, 0.0034014577977359295, -0.011762598529458046, -0.043824099004268646, 0.07271367311477661, -0.020298343151807785, -0.014620838686823845, 0.10272250324487686, 0.024066010490059853, -0.09992030262947083, -0.03348833695054054, -0.010426673106849194, 0.09005606174468994, -0.0035677433479577303, -0.1025518923997879, -0.12282735109329224, 0.054458942264318466, 0.004781889729201794, -0.05272270739078522, 0.13608424365520477, -0.026465721428394318, 0.016177058219909668, 0.041074298322200775, 0.09297788888216019, -0.11053367704153061, -0.016562609001994133, -0.0970703735947609, 0.030886707827448845, -0.048185914754867554, -0.014728088863193989, 0.033471256494522095, 0.056765537708997726, -0.04682552069425583, 0.0296354778110981, 0.021477745845913887, 0.030938565731048584, -0.03759944066405296, 0.046778030693531036, -0.14804475009441376, -0.062177158892154694, -0.09516157954931259, 0.040165942162275314, 0.03773500397801399, -0.05499037355184555, -0.10496312379837036, -0.04234430566430092, 0.07212746888399124, -0.038786645978689194, -0.013183013536036015, 0.08023805171251297, 0.07086466997861862, -0.018895640969276428, -0.00960768386721611, 0.014082720503211021, 0.10909527540206909, 0.0022360815200954676, 0.11010922491550446, -0.0463826023042202, -0.007527623791247606, 0.043411146849393845, -0.017293468117713928, 0.007159824948757887, -5.2974403530470227e-8, -0.09225433319807053, -0.0800851583480835, -0.012117217294871807, 0.05365762114524841, -0.003950733225792646, 0.0015774371568113565, -0.017815465107560158, 0.022711681202054024, -0.003666982753202319, 0.01773335412144661, 0.035433392971754074, 0.01986100897192955, -0.04015041142702103, -0.026384787634015083, 0.036384351551532745, 0.05353447049856186, -0.0659836083650589, -0.08712296932935715, -0.015691837295889854, -0.05678114667534828, 0.0075673372484743595, -0.0657290667295456, -0.0041077411733567715, 0.01968672312796116, -0.11635839939117432, -0.06538160145282745, -0.06862257421016693, 0.024926716461777687, -0.08925633877515793, -0.017585385590791702, -0.08015989512205124, -0.04866369441151619, -0.023039670661091805, 0.03989474102854729, -0.035850513726472855, 0.030390657484531403, -0.040201351046562195, 0.009998446330428123, 0.07045203447341919, 0.05120134353637695, 0.07698311656713486, 0.022131675854325294, -0.03029490076005459, 0.003217814490199089, -0.06519926339387894, 0.010567215271294117, -0.02747567556798458, -0.11950519680976868, 0.0048618195578455925, 0.0069014569744467735, 0.01504858210682869, -0.020975949242711067, -0.018084757030010223, 0.11235196143388748, -0.037034228444099426, 0.04625152423977852, 0.09339872747659683, -0.011124884709715843, 0.06589049100875854, -0.006568435579538345, 0.0021125536877661943, 0.12131839990615845, -0.012957471422851086, -0.003088486846536398 ]
0.041375
chats use `g-` (lowercase, spaces -> `-`, keep `#@+.\_-`). ## Group policy Control how group/room messages are handled per channel: ```json5 { channels: { whatsapp: { groupPolicy: "disabled", // "open" | "disabled" | "allowlist" groupAllowFrom: ["+15551234567"], }, telegram: { groupPolicy: "disabled", groupAllowFrom: ["123456789", "@username"], }, signal: { groupPolicy: "disabled", groupAllowFrom: ["+15551234567"], }, imessage: { groupPolicy: "disabled", groupAllowFrom: ["chat\_id:123"], }, msteams: { groupPolicy: "disabled", groupAllowFrom: ["user@org.com"], }, discord: { groupPolicy: "allowlist", guilds: { GUILD\_ID: { channels: { help: { allow: true } } }, }, }, slack: { groupPolicy: "allowlist", channels: { "#general": { allow: true } }, }, matrix: { groupPolicy: "allowlist", groupAllowFrom: ["@owner:example.org"], groups: { "!roomId:example.org": { allow: true }, "#alias:example.org": { allow: true }, }, }, }, } ``` | Policy | Behavior | | ------------- | ------------------------------------------------------------ | | `"open"` | Groups bypass allowlists; mention-gating still applies. | | `"disabled"` | Block all group messages entirely. | | `"allowlist"` | Only allow groups/rooms that match the configured allowlist. | Notes: - `groupPolicy` is separate from mention-gating (which requires @mentions). - WhatsApp/Telegram/Signal/iMessage/Microsoft Teams: use `groupAllowFrom` (fallback: explicit `allowFrom`). - Discord: allowlist uses `channels.discord.guilds..channels`. - Slack: allowlist uses `channels.slack.channels`. - Matrix: allowlist uses `channels.matrix.groups` (room IDs, aliases, or names). Use `channels.matrix.groupAllowFrom` to restrict senders; per-room `users` allowlists are also supported. - Group DMs are controlled separately (`channels.discord.dm.\*`, `channels.slack.dm.\*`). - Telegram allowlist can match user IDs (`"123456789"`, `"telegram:123456789"`, `"tg:123456789"`) or usernames (`"@alice"` or `"alice"`); prefixes are case-insensitive. - Default is `groupPolicy: "allowlist"`; if your group allowlist is empty, group messages are blocked. Quick mental model (evaluation order for group messages): 1. `groupPolicy` (open/disabled/allowlist) 2. group allowlists (`\*.groups`, `\*.groupAllowFrom`, channel-specific allowlist) 3. mention gating (`requireMention`, `/activation`) ## Mention gating (default) Group messages require a mention unless overridden per group. Defaults live per subsystem under `\*.groups."\*"`. Replying to a bot message counts as an implicit mention (when the channel supports reply metadata). This applies to Telegram, WhatsApp, Slack, Discord, and Microsoft Teams. ```json5 { channels: { whatsapp: { groups: { "\*": { requireMention: true }, "123@g.us": { requireMention: false }, }, }, telegram: { groups: { "\*": { requireMention: true }, "123456789": { requireMention: false }, }, }, imessage: { groups: { "\*": { requireMention: true }, "123": { requireMention: false }, }, }, }, agents: { list: [ { id: "main", groupChat: { mentionPatterns: ["@openclaw", "openclaw", "\\+15555550123"], historyLimit: 50, }, }, ], }, } ``` Notes: - `mentionPatterns` are case-insensitive regexes. - Surfaces that provide explicit mentions still pass; patterns are a fallback. - Per-agent override: `agents.list[].groupChat.mentionPatterns` (useful when multiple agents share a group). - Mention gating is only enforced when mention detection is possible (native mentions or `mentionPatterns` are configured). - Discord defaults live in `channels.discord.guilds."\*"` (overridable per guild/channel). - Group history context is wrapped uniformly across channels and is \*\*pending-only\*\* (messages skipped due to mention gating); use `messages.groupChat.historyLimit` for the global default and `channels..historyLimit` (or `channels..accounts.\*.historyLimit`) for overrides. Set `0` to disable. ## Group/channel tool restrictions (optional) Some channel configs support restricting which tools are available \*\*inside a specific group/room/channel\*\*. - `tools`: allow/deny tools for the whole group. - `toolsBySender`: per-sender overrides within the group (keys are sender IDs/usernames/emails/phone numbers depending on the channel). Use `"\*"` as a wildcard. Resolution order (most specific wins): 1. group/channel `toolsBySender` match 2. group/channel `tools` 3. default (`"\*"`) `toolsBySender` match 4. default (`"\*"`) `tools` Example (Telegram): ```json5 { channels: { telegram: { groups: { "\*": { tools: { deny: ["exec"] } }, "-1001234567890": { tools: { deny: ["exec", "read", "write"] }, toolsBySender: { "123456789": { alsoAllow: ["exec"] }, }, }, }, }, }, } ``` Notes: - Group/channel tool restrictions are applied in
https://github.com/openclaw/openclaw/blob/main//docs/concepts/groups.md
main
opebclaw
[ -0.051643434911966324, 0.019227972254157066, 0.02002379111945629, 0.03443797305226326, -0.016295375302433968, -0.022436173632740974, 0.05108052119612694, -0.07695295661687851, 0.013075280003249645, 0.017567159608006477, -0.00822778046131134, -0.014137606136500835, -0.025797422975301743, 0.10709671676158905, 0.0819958746433258, 0.007863041944801807, -0.0357360914349556, -0.11326470971107483, -0.05561753734946251, -0.07053554058074951, 0.06904013454914093, 0.0760415643453598, 0.0033262877259403467, -0.008604052476584911, 0.03619883581995964, -0.067763552069664, -0.04617329686880112, 0.019723333418369293, 0.019041216000914574, 0.039740368723869324, 0.021140584722161293, 0.0011534669902175665, 0.013019458390772343, 0.05297459289431572, -0.020128000527620316, 0.053548626601696014, 0.03597982972860336, -0.0019515784224495292, 0.05981350690126419, 0.027135685086250305, -0.03469265252351761, 0.01122816652059555, -0.06585279107093811, -0.03557806462049484, 0.01373502891510725, -0.060052014887332916, -0.04793613776564598, 0.0046452428214251995, -0.0444442518055439, 0.07500874251127243, 0.03757528215646744, -0.001670018769800663, -0.02107059583067894, 0.10659746080636978, 0.019456077367067337, 0.03651507571339607, -0.1295219212770462, 0.09306495636701584, 0.06905046850442886, -0.088285431265831, -0.006908940616995096, -0.09522596746683121, 0.007471482269465923, -0.05553727224469185, -0.11406488716602325, 0.0389217883348465, -0.025739075616002083, 0.023278187960386276, 0.006941416300833225, 0.026147235184907913, 0.049651626497507095, -0.030492112040519714, -0.016584094613790512, -0.0029602928552776575, 0.011168045923113823, 0.04791310429573059, -0.024760011583566666, 0.007255712058395147, -0.026179179549217224, -0.02672741748392582, 0.00917151290923357, -0.06859038025140762, -0.03299684450030327, 0.023078223690390587, -0.057570647448301315, 0.027947353199124336, -0.052725572139024734, -0.03504062071442604, -0.03666243702173233, -0.011656131595373154, -0.04916846752166748, 0.011379772797226906, 0.00436045927926898, 0.036495670676231384, 0.044677186757326126, 0.01874561235308647, -0.07209156453609467, -0.025954602286219597, -0.04213280230760574, 0.05919773876667023, 0.015154452063143253, -0.04233518987894058, 0.0198457520455122, -0.009497562423348427, 0.04868711158633232, -0.020814796909689903, 0.021769389510154724, 0.015992984175682068, -0.0021337631624192, -0.010674215853214264, -0.08817636221647263, 0.1297631710767746, 0.007775259204208851, 0.019109129905700684, -0.01767432875931263, -0.01288823876529932, 0.08181112259626389, 0.023831849917769432, 0.059253860265016556, 0.015243439003825188, 0.17986871302127838, -0.08338194340467453, 0.04123631864786148, 0.05749557167291641, -0.005731565877795219, 0.08001803606748581, 0.008202199824154377, 7.1938652659271e-33, 0.05372955650091171, -0.021292470395565033, -0.05742453783750534, 0.010898960754275322, 0.016687626019120216, 0.026537403464317322, -0.06957602500915527, 0.041334230452775955, -0.015298875980079174, -0.02572343870997429, -0.0783415213227272, 0.03508329391479492, 0.029327651485800743, -0.03132093697786331, -0.0027890207711607218, -0.013388696126639843, 0.047795336693525314, 0.017799928784370422, 0.049032602459192276, -0.004951789043843746, -0.07097569853067398, 0.08392180502414703, -0.0166183952242136, 0.05477337911725044, -0.015235261991620064, 0.08426659554243088, 0.023275775834918022, -0.07402326911687851, 0.020259784534573555, 0.0025495742447674274, -0.009531023912131786, 0.011867256835103035, -0.004582162480801344, 0.019374879077076912, 0.05483878031373024, -0.0032191502396017313, -0.03896297141909599, -0.0005533042130991817, -0.028487559407949448, -0.04658517614006996, 0.009349044412374496, -0.047743771225214005, -0.06533525139093399, -0.05034735053777695, -0.023264233022928238, -0.01757027767598629, -0.04684112221002579, -0.0782664567232132, -0.020756931975483894, 0.013973652385175228, -0.028762515634298325, 0.056520089507102966, -0.08813747763633728, -0.004641417879611254, 0.020906558260321617, -0.10011955350637436, -0.03895209729671478, 0.06028160825371742, 0.02109878696501255, -0.03165219724178314, 0.00937389861792326, 0.035643402487039566, 0.05377567559480667, 0.0012287716381251812, 0.06142450496554375, -0.0008215187699533999, -0.0969298705458641, 0.026543013751506805, -0.05619737505912781, -0.006079270504415035, -0.00808073952794075, 0.10121539980173111, 0.016351979225873947, 0.07290160655975342, -0.13196074962615967, -0.07198014110326767, -0.010189254768192768, 0.13228146731853485, -0.01896759867668152, 0.005913033615797758, -0.004870243836194277, -0.031972017139196396, -0.08306540548801422, -0.035721808671951294, -0.025358596816658974, 0.025678565725684166, 0.06246785819530487, -0.09381996840238571, -0.03924432396888733, 0.022649433463811874, -0.0860431045293808, 0.08601211756467819, 0.05185438692569733, 0.027584243565797806, -0.08786948770284653, -7.128867040482351e-33, 0.044415853917598724, 0.04291139915585518, 0.01890178769826889, -0.02576531656086445, 0.007931950502097607, -0.042807068675756454, 0.0839058980345726, -0.033081941306591034, 0.02060837671160698, 0.06786888837814331, -0.013489414937794209, -0.0335262268781662, 0.012050790712237358, -0.01592363975942135, 0.03953051567077637, 0.007273188326507807, -0.001353803207166493, -0.03403041139245033, 0.014136180281639099, -0.018048014491796494, 0.01978355273604393, 0.013426716439425945, -0.01724783331155777, 0.12713421881198883, -0.0017614433309063315, -0.05252647027373314, 0.00945014227181673, -0.02147442288696766, -0.005540660582482815, -0.05472273379564285, 0.012815870344638824, -0.006818100810050964, -0.05439799651503563, -0.027743024751544, 0.07928090542554855, -0.033434078097343445, 0.016183719038963318, 0.17231132090091705, -0.0395687036216259, -0.022701727226376534, 0.09901301562786102, 0.036214400082826614, -0.12256892770528793, 0.037638090550899506, 0.028944410383701324, 0.07669267803430557, 0.04603130370378494, -0.007454803213477135, -0.11538887768983841, 0.057702723890542984, 0.0918942242860794, -0.09475365281105042, 0.06282901018857956, -0.013373308815062046, 0.007195639424026012, -0.01967037096619606, 0.09582199901342392, -0.09754779934883118, 0.003217047778889537, -0.0008460222161374986, 0.023587901145219803, -0.1520131528377533, 0.004906794521957636, -0.0042930543422698975, 0.10259272158145905, -0.03173469379544258, -0.014466480351984501, 0.004011940211057663, 0.012053249403834343, -0.004138834308832884, 0.04679955914616585, -0.11518245190382004, -0.03349338471889496, 0.003656275337561965, 0.0466705784201622, -0.0025670467875897884, -0.025131134316325188, -0.09981260448694229, -0.019159233197569847, 0.039580464363098145, -0.036014556884765625, 0.027385100722312927, 0.01463185716420412, 0.04871402680873871, -0.015613519586622715, 0.029570600017905235, 0.014671871438622475, 0.15071982145309448, -0.03996507450938225, 0.04134618118405342, -0.03260236978530884, 0.0015697928611189127, 0.036070309579372406, -0.007930765859782696, 0.019730297848582268, -4.9007955027491334e-8, -0.09459710121154785, -0.07294222712516785, -0.04034009203314781, -0.03630707412958145, -0.016644660383462906, 0.01512040663510561, -0.031099580228328705, -0.06015091761946678, 0.08495278656482697, -0.03342035040259361, -0.008602529764175415, 0.03718049079179764, -0.021009081974625587, -0.04686914384365082, -0.027740655466914177, -0.02811160683631897, -0.14368541538715363, 0.007920663803815842, 0.029534542933106422, 0.0657435953617096, 0.05577213317155838, -0.0061233495362102985, -0.04557626321911812, 0.035832736641168594, -0.006681326776742935, -0.033238764852285385, 0.01953551359474659, 0.02954559586942196, -0.10185114294290543, 0.017382876947522163, -0.04190677031874657, -0.036343615502119064, 0.021894847974181175, 0.012225599028170109, -0.0760238841176033, -0.04328499361872673, -0.000958434771746397, -0.015430357307195663, 0.041998203843832016, 0.012343363836407661, 0.06350240856409073, -0.03147067129611969, -0.05098738521337509, 0.010687381960451603, -0.0074507370591163635, -0.025472845882177353, 0.04155291989445686, -0.02295297011733055, 0.01881427690386772, 0.03427795320749283, -0.00030871416674926877, 0.016559237614274025, 0.03760245069861412, 0.04525618255138397, -0.03532169759273529, -0.09197536110877991, 0.10291026532649994, 0.014872836880385876, 0.03510032594203949, -0.007572593167424202, 0.017450634390115738, 0.08330632746219635, -0.03938250243663788, -0.027502743527293205 ]
0.045805
`tools` Example (Telegram): ```json5 { channels: { telegram: { groups: { "\*": { tools: { deny: ["exec"] } }, "-1001234567890": { tools: { deny: ["exec", "read", "write"] }, toolsBySender: { "123456789": { alsoAllow: ["exec"] }, }, }, }, }, }, } ``` Notes: - Group/channel tool restrictions are applied in addition to global/agent tool policy (deny still wins). - Some channels use different nesting for rooms/channels (e.g., Discord `guilds.\*.channels.\*`, Slack `channels.\*`, MS Teams `teams.\*.channels.\*`). ## Group allowlists When `channels.whatsapp.groups`, `channels.telegram.groups`, or `channels.imessage.groups` is configured, the keys act as a group allowlist. Use `"\*"` to allow all groups while still setting default mention behavior. Common intents (copy/paste): 1. Disable all group replies ```json5 { channels: { whatsapp: { groupPolicy: "disabled" } }, } ``` 2. Allow only specific groups (WhatsApp) ```json5 { channels: { whatsapp: { groups: { "123@g.us": { requireMention: true }, "456@g.us": { requireMention: false }, }, }, }, } ``` 3. Allow all groups but require mention (explicit) ```json5 { channels: { whatsapp: { groups: { "\*": { requireMention: true } }, }, }, } ``` 4. Only the owner can trigger in groups (WhatsApp) ```json5 { channels: { whatsapp: { groupPolicy: "allowlist", groupAllowFrom: ["+15551234567"], groups: { "\*": { requireMention: true } }, }, }, } ``` ## Activation (owner-only) Group owners can toggle per-group activation: - `/activation mention` - `/activation always` Owner is determined by `channels.whatsapp.allowFrom` (or the bot’s self E.164 when unset). Send the command as a standalone message. Other surfaces currently ignore `/activation`. ## Context fields Group inbound payloads set: - `ChatType=group` - `GroupSubject` (if known) - `GroupMembers` (if known) - `WasMentioned` (mention gating result) - Telegram forum topics also include `MessageThreadId` and `IsForum`. The agent system prompt includes a group intro on the first turn of a new group session. It reminds the model to respond like a human, avoid Markdown tables, and avoid typing literal `\n` sequences. ## iMessage specifics - Prefer `chat\_id:` when routing or allowlisting. - List chats: `imsg chats --limit 20`. - Group replies always go back to the same `chat\_id`. ## WhatsApp specifics See [Group messages](/concepts/group-messages) for WhatsApp-only behavior (history injection, mention handling details).
https://github.com/openclaw/openclaw/blob/main//docs/concepts/groups.md
main
opebclaw
[ -0.065160371363163, 0.03401833027601242, -0.0046686213463544846, 0.01565784215927124, 0.002171378815546632, -0.0863981544971466, 0.040786534547805786, -0.05709429830312729, 0.028165927156805992, 0.05322616174817085, 0.047276437282562256, -0.04183604568243027, 0.045750610530376434, 0.09302234649658203, 0.09204591810703278, 0.033063020557165146, -0.00311730126850307, -0.10859449207782745, -0.054420873522758484, -0.09211932122707367, 0.08123612403869629, 0.06036495789885521, 0.02485150471329689, -0.019492575898766518, -0.023006265982985497, -0.08496028929948807, -0.09019168466329575, 0.0047424607910215855, 0.029358280822634697, 0.007353788707405329, -0.0017343397485092282, -0.01194289606064558, -0.05599600449204445, 0.04412280023097992, 0.03103088028728962, 0.09511963278055191, 0.04404931142926216, -0.007744841743260622, 0.04154474288225174, 0.01311423908919096, -0.032452862709760666, 0.007990002632141113, -0.0964270532131195, -0.06074129045009613, -0.0014640528243035078, -0.045804306864738464, -0.0032493132166564465, -0.03037586808204651, -0.07941151410341263, 0.030987178906798363, -0.010338038206100464, 0.0073767295107245445, -0.025586627423763275, 0.08641006052494049, 0.05077454075217247, -0.00485291238874197, -0.10963552445173264, 0.06345809251070023, 0.07159382104873657, -0.062113068997859955, 0.025044653564691544, -0.047072019428014755, -0.051955562084913254, -0.03694023936986923, -0.12500125169754028, 0.014524864964187145, -0.01056906208395958, 0.05533383786678314, -0.002223892603069544, -0.017632165923714638, 0.06249614432454109, -0.05368153750896454, -0.011137617751955986, -0.01864314265549183, 0.07917911559343338, 0.01193868275731802, 0.012644970789551735, 0.02633439563214779, -0.04676858335733414, -0.09941528737545013, -0.025162918493151665, -0.05116600543260574, -0.005801571533083916, 0.012399733066558838, -0.04606118053197861, 0.0833321064710617, 0.022968122735619545, -0.026350045576691628, 0.0502164252102375, 0.06005268543958664, 0.011587393470108509, -0.03470495715737343, 0.020330945029854774, 0.06640549004077911, 0.11368951201438904, -0.004125178791582584, -0.03132753074169159, 0.01483246497809887, -0.06418266147375107, 0.055510252714157104, 0.021128378808498383, -0.08189914375543594, -0.008874841034412384, -0.046162113547325134, 0.06870247423648834, -0.0005186377675272524, 0.0038554356433451176, -0.036031436175107956, 0.013153977692127228, 0.0006231964798644185, -0.061937086284160614, 0.08269210904836655, 0.013236239552497864, -0.016099561005830765, 0.0009659805800765753, 0.016996266320347786, 0.06954383850097656, 0.06087116524577141, 0.019122006371617317, 0.03808441013097763, 0.13751335442066193, -0.02065824717283249, 0.040754709392786026, 0.0351264551281929, 0.04582589864730835, 0.13151055574417114, -0.008961093612015247, 1.2138045382350513e-33, 0.07231869548559189, -0.03941076621413231, -0.09456633776426315, 0.006673412397503853, -0.010903698392212391, 0.04907817766070366, -0.033719636499881744, 0.07427255809307098, -0.07502395659685135, 0.030798133462667465, -0.06273911148309708, 0.005289724562317133, -0.004308124538511038, 0.0013217170489951968, 0.0630163922905922, 0.0037207144778221846, 0.053793132305145264, 0.008049871772527695, 0.0364728644490242, 0.01922096684575081, -0.042476586997509, 0.004590584896504879, -0.06499645113945007, 0.06698735803365707, -0.04892410710453987, 0.09276001900434494, -0.005587604828178883, -0.05099167302250862, 0.05657052621245384, 0.03219357877969742, -0.027815982699394226, -0.00023380031052511185, 0.037130050361156464, 0.07478920370340347, 0.022030211985111237, 0.04482877627015114, -0.0038505466654896736, -0.011769854463636875, -0.010532229207456112, -0.0728135034441948, -0.025336669757962227, -0.006885035894811153, -0.08365826308727264, -0.08994709700345993, 0.014172971248626709, -0.09115458279848099, -0.07252321392297745, -0.030201314017176628, 0.041075170040130615, 0.05120956525206566, -0.029755504801869392, 0.06204831600189209, 0.045899298042058945, 0.01968824863433838, 0.07871643453836441, -0.10467242449522018, -0.029456548392772675, 0.053353119641542435, 0.032680295407772064, -0.0024975407868623734, -0.031617674976587296, 0.018197372555732727, 0.04046710953116417, 0.0339537188410759, 0.05391488969326019, -0.001918449648655951, -0.019884634763002396, 0.060040995478630066, 0.00698444526642561, -0.036195944994688034, -0.09435062855482101, 0.030910346657037735, -0.006463758181780577, 0.061008114367723465, -0.10871031135320663, -0.11310240626335144, 0.010868050158023834, 0.0883941724896431, 0.010231485590338707, -0.017219875007867813, -0.002662476385012269, 0.01599719189107418, -0.017281826585531235, -0.030221516266465187, -0.04546143487095833, 0.030936559662222862, 0.008968520909547806, -0.06747423857450485, 0.02586648054420948, 0.011970787309110165, -0.078731007874012, 0.05157067999243736, -0.032116323709487915, 0.07262865453958511, -0.08323703706264496, -2.726373271688072e-33, 0.05981622263789177, -0.01349142286926508, -0.04173605516552925, -0.03809988498687744, 0.005379081703722477, -0.03968550264835358, 0.035943564027547836, -0.08162063360214233, 0.03974354267120361, -0.021439213305711746, 0.010299012064933777, -0.033766888082027435, 0.03209385275840759, -0.07218995690345764, 0.04431373253464699, -0.056567687541246414, -0.033170245587825775, -0.040022753179073334, 0.010898863896727562, -0.030332081019878387, -0.030124187469482422, 0.02821231260895729, -0.02226022444665432, 0.11957629024982452, 0.003732311772182584, -0.04698235169053078, -0.05066627636551857, -0.004505181219428778, 0.026466861367225647, -0.0786668136715889, 0.030543148517608643, -0.008643231354653835, -0.07734528183937073, -0.031027501448988914, 0.01776677742600441, -0.05162452161312103, 0.009302257560193539, 0.17408964037895203, -0.01592039316892624, -0.021345248445868492, 0.12327958643436432, 0.014951878227293491, -0.06066044792532921, 0.02786025032401085, -0.060902249068021774, 0.08090958744287491, 0.06858140230178833, -0.043736279010772705, -0.11207808554172516, 0.04533281922340393, 0.1162148267030716, -0.05501631274819374, 0.07078255712985992, -0.03484687581658363, -0.013480979949235916, 0.00011757376341847703, 0.08072911202907562, -0.09154780209064484, -0.0056551857851445675, -0.021185778081417084, 0.08712737262248993, -0.08773163706064224, 0.0076220277696847916, 0.0581529401242733, 0.049492187798023224, -0.038292475044727325, -0.050327133387327194, 0.03463314101099968, 0.00590194808319211, 0.0032312970142811537, 0.04852765426039696, -0.08172865957021713, -0.015921611338853836, -0.03565874695777893, 0.0788610503077507, -0.008758087642490864, -0.08604154735803604, -0.10278187692165375, -0.029458394274115562, 0.03236233443021774, -0.015282864682376385, 0.04776252433657646, 0.01371632982045412, 0.05627955496311188, -0.043820060789585114, 0.02715708315372467, -0.005621868651360273, 0.10240785777568817, -0.025080638006329536, 0.016856059432029724, -0.01185010839253664, -0.0517028272151947, -0.009653924964368343, 0.040873292833566666, 0.015658937394618988, -4.738701520068389e-8, -0.03338460996747017, -0.019461724907159805, -0.0887790396809578, -0.0005269555258564651, -0.031122718006372452, 0.008169295266270638, 0.0013698203256353736, -0.001940128393471241, 0.06534799933433533, 0.009720924310386181, 0.06512332707643509, 0.018601328134536743, -0.05456983298063278, -0.059833601117134094, -0.025302967056632042, -0.05548565462231636, -0.12403855472803116, -0.0007236989913508296, -0.0035971584729850292, -0.019813258200883865, 0.042374081909656525, -0.0389256551861763, -0.06357388198375702, 0.03475591912865639, -0.013290542177855968, -0.023272261023521423, -0.029243098571896553, 0.056232698261737823, -0.05914850905537605, 0.025643402710556984, -0.03712976723909378, -0.04797155782580376, 0.028718704357743263, 0.0029913417529314756, -0.08298556506633759, 0.04855272173881531, -0.03507547825574875, 0.013963469304144382, 0.0017689642263576388, 0.0710335522890091, 0.034697026014328, -0.05148650333285332, -0.023290734738111496, -0.013928030617535114, -0.04871979355812073, -0.023038137704133987, 0.009357347153127193, -0.012837008573114872, 0.05051995441317558, 0.006453327368944883, -0.027970481663942337, 0.03640283644199371, 0.02338426373898983, 0.08785935491323471, -0.019633159041404724, 0.006909331306815147, 0.09248915314674377, -0.04560505971312523, 0.046446602791547775, 0.0026727383956313133, 0.010666163638234138, 0.02145792730152607, -0.008108435198664665, 0.014775384217500687 ]
0.124903
# Presence OpenClaw “presence” is a lightweight, best‑effort view of: - the \*\*Gateway\*\* itself, and - \*\*clients connected to the Gateway\*\* (mac app, WebChat, CLI, etc.) Presence is used primarily to render the macOS app’s \*\*Instances\*\* tab and to provide quick operator visibility. ## Presence fields (what shows up) Presence entries are structured objects with fields like: - `instanceId` (optional but strongly recommended): stable client identity (usually `connect.client.instanceId`) - `host`: human‑friendly host name - `ip`: best‑effort IP address - `version`: client version string - `deviceFamily` / `modelIdentifier`: hardware hints - `mode`: `ui`, `webchat`, `cli`, `backend`, `probe`, `test`, `node`, ... - `lastInputSeconds`: “seconds since last user input” (if known) - `reason`: `self`, `connect`, `node-connected`, `periodic`, ... - `ts`: last update timestamp (ms since epoch) ## Producers (where presence comes from) Presence entries are produced by multiple sources and \*\*merged\*\*. ### 1) Gateway self entry The Gateway always seeds a “self” entry at startup so UIs show the gateway host even before any clients connect. ### 2) WebSocket connect Every WS client begins with a `connect` request. On successful handshake the Gateway upserts a presence entry for that connection. #### Why one‑off CLI commands don’t show up The CLI often connects for short, one‑off commands. To avoid spamming the Instances list, `client.mode === "cli"` is \*\*not\*\* turned into a presence entry. ### 3) `system-event` beacons Clients can send richer periodic beacons via the `system-event` method. The mac app uses this to report host name, IP, and `lastInputSeconds`. ### 4) Node connects (role: node) When a node connects over the Gateway WebSocket with `role: node`, the Gateway upserts a presence entry for that node (same flow as other WS clients). ## Merge + dedupe rules (why `instanceId` matters) Presence entries are stored in a single in‑memory map: - Entries are keyed by a \*\*presence key\*\*. - The best key is a stable `instanceId` (from `connect.client.instanceId`) that survives restarts. - Keys are case‑insensitive. If a client reconnects without a stable `instanceId`, it may show up as a \*\*duplicate\*\* row. ## TTL and bounded size Presence is intentionally ephemeral: - \*\*TTL:\*\* entries older than 5 minutes are pruned - \*\*Max entries:\*\* 200 (oldest dropped first) This keeps the list fresh and avoids unbounded memory growth. ## Remote/tunnel caveat (loopback IPs) When a client connects over an SSH tunnel / local port forward, the Gateway may see the remote address as `127.0.0.1`. To avoid overwriting a good client‑reported IP, loopback remote addresses are ignored. ## Consumers ### macOS Instances tab The macOS app renders the output of `system-presence` and applies a small status indicator (Active/Idle/Stale) based on the age of the last update. ## Debugging tips - To see the raw list, call `system-presence` against the Gateway. - If you see duplicates: - confirm clients send a stable `client.instanceId` in the handshake - confirm periodic beacons use the same `instanceId` - check whether the connection‑derived entry is missing `instanceId` (duplicates are expected)
https://github.com/openclaw/openclaw/blob/main//docs/concepts/presence.md
main
opebclaw
[ -0.04566540941596031, -0.012676991522312164, -0.04537684842944145, 0.0100780688226223, 0.046542976051568985, -0.11484739184379578, 0.032577693462371826, -0.011828577145934105, 0.043484967201948166, 0.0013664272846654058, 0.08166968077421188, -0.042468827217817307, -0.0018538400763645768, -0.04033371061086655, 0.10066045820713043, 0.04664536193013191, 0.08583685755729675, -0.12506148219108582, 0.0323970764875412, -0.014961553737521172, -0.02795226126909256, 0.05154002457857132, -0.06956040859222412, -0.04407323896884918, -0.05626628175377846, -0.040358129888772964, 0.0037252686452120543, 0.010733268223702908, 0.02189023606479168, -0.05174875259399414, 0.015799468383193016, 0.02725357376039028, -0.020217997953295708, 0.06571312993764877, 0.05567152053117752, 0.0452309288084507, 0.12065588682889938, -0.05558393523097038, -0.14751948416233063, -0.048470355570316315, -0.005952165927737951, -0.05252283066511154, 0.07346576452255249, -0.006054071243852377, -0.00044026877731084824, -0.08135275542736053, -0.05158211663365364, -0.03597095608711243, 0.03971502557396889, -0.018435517325997353, -0.0890640839934349, -0.029549773782491684, -0.02262629196047783, 0.08190903067588806, 0.012454398907721043, 0.07739774137735367, -0.06091795489192009, -0.012750422582030296, 0.01641705632209778, 0.0244197566062212, 0.04933903366327286, 0.04025939106941223, 0.05161944404244423, 0.05160805583000183, -0.06251370906829834, -0.00858706422150135, -0.02011457085609436, -0.06821300834417343, 0.050562720745801926, -0.03648786619305611, -0.03868773952126503, 0.05420972406864166, -0.16039568185806274, -0.02026628889143467, -0.028917185962200165, -0.02576536126434803, 0.014776821248233318, -0.033692438155412674, -0.0010441815247759223, -0.02987918071448803, 0.012566817924380302, 0.015377752482891083, -0.06749186664819717, 0.07922513782978058, -0.05395805463194847, 0.056672435253858566, -0.023323766887187958, 0.005461081862449646, -0.037154197692871094, 0.04202033951878548, -0.004908823873847723, -0.06389210373163223, -0.045554760843515396, -0.027754206210374832, -0.028093095868825912, -0.03138567879796028, 0.02353399619460106, 0.038537174463272095, -0.06637198477983475, 0.07532144337892532, -0.007543201092630625, 0.012752406299114227, 0.0574280209839344, 0.020156461745500565, -0.024551549926400185, 0.020318178460001945, -0.021461952477693558, 0.0500948391854763, 0.09700559824705124, 0.03553245589137077, -0.03747006133198738, -0.06508221477270126, -0.06886829435825348, -0.038048189133405685, 0.012945261783897877, 0.051249679177999496, 0.047478288412094116, 0.00947739090770483, 0.0567498579621315, 0.041400134563446045, 0.09676317125558853, 0.025369945913553238, 0.06953199952840805, -0.0750267431139946, 0.05014066770672798, -0.04349705949425697, 0.07356324046850204, 2.1738330704390174e-33, 0.01772601529955864, -0.028007030487060547, -0.03803865984082222, -0.001861327444203198, 0.10699447244405746, 0.010720787569880486, 0.043600182980298996, 0.04827788844704628, -0.08297661691904068, 0.029133092612028122, -0.008292261511087418, 0.04134363308548927, 0.012373005971312523, -0.002073043491691351, 0.046071361750364304, -0.015179392881691456, 0.02315688505768776, 0.0178268663585186, 0.07625467330217361, 0.022376716136932373, -0.0034146474208682775, -0.09678146243095398, -0.030452793464064598, 0.06096170097589493, 0.030556313693523407, 0.08659730106592178, 0.0018701039953157306, 0.011821821331977844, -0.01332639530301094, 0.010169644840061665, 0.06119973212480545, 0.025303851813077927, -0.09778668731451035, -0.02253018133342266, -0.012577652931213379, 0.0024557458236813545, -0.05741538852453232, -0.08337493985891342, 0.004179888404905796, -0.0160392913967371, -0.08177905529737473, -0.013656042516231537, -0.10425899922847748, -0.0687451884150505, -0.05179568752646446, -0.07533229887485504, -0.03403938189148903, 0.008362345397472382, 0.02269889973104, 0.07686589658260345, -0.07479559630155563, -0.014150483533740044, 0.028279459103941917, 0.0036313871387392282, -0.024796539917588234, -0.005137074738740921, -0.010020540095865726, 0.06814336031675339, 0.02614476904273033, 0.013524488545954227, -0.008292386308312416, 0.01745046116411686, -0.01647160016000271, 0.002707330510020256, 0.023949753493070602, 0.001730515738017857, 0.008676261641085148, -0.04737542197108269, 0.0033890476915985346, 0.05354544520378113, -0.03041003830730915, 0.012771490029990673, -0.01084431353956461, 0.041546132415533066, -0.0883667916059494, -0.0856136754155159, -0.08425656706094742, -0.038526855409145355, -0.01376443263143301, 0.0697859525680542, 0.029686467722058296, 0.0017177214613184333, -0.05341782793402672, 0.06310617178678513, -0.03856243938207626, 0.011143693700432777, 0.06419199705123901, -0.03947688266634941, -0.07030883431434631, 0.0856378823518753, 0.002700814511626959, -0.012881806120276451, 0.014022460207343102, -0.033233366906642914, -0.0986655056476593, -4.89181900626298e-33, -0.007475290913134813, -0.03931979089975357, -0.06051093339920044, -0.03329326957464218, -0.01945948228240013, -0.05891994759440422, 0.09012873470783234, 0.06679004430770874, -0.04508372023701668, -0.0211794413626194, 0.00802071113139391, 0.06077859550714493, 0.025840168818831444, -0.046435847878456116, 0.014991365373134613, 0.044815413653850555, -0.08625014126300812, -0.129264235496521, -0.03141312673687935, 0.027530010789632797, -0.061241328716278076, 0.04145875573158264, -0.0010306244948878884, -0.03215152397751808, 0.016260776668787003, -0.03623097762465477, 0.06497512757778168, -0.0025200005620718002, -0.07963555306196213, -0.08492322266101837, 0.06322591751813889, 0.054972950369119644, -0.06437854468822479, -0.01437672320753336, 0.0009789438918232918, 0.029693014919757843, 0.008155730552971363, 0.10944359749555588, 0.010831112042069435, -0.02107362635433674, 0.11098037660121918, 0.03998889401555061, -0.08019359409809113, 0.010367336682975292, -0.08314546942710876, 0.14247183501720428, -0.06905519217252731, 0.009326443076133728, -0.08679578453302383, -0.005660933442413807, 0.026933738961815834, -0.002859720727428794, -0.003107475582510233, 0.06450162827968597, -0.030868656933307648, 0.05329109728336334, -0.003782121930271387, 0.009555649012327194, 0.01978600025177002, -0.09562000632286072, 0.0364655964076519, -0.10077584534883499, -0.03765600919723511, 0.0653550997376442, 0.04422692582011223, -0.0602044053375721, -0.04294830188155174, 0.045375172048807144, -0.062113795429468155, -0.07323043048381805, -0.010107682086527348, -0.02534657157957554, -0.012400043196976185, 0.019256558269262314, 0.026894086971879005, -0.00046566437231376767, 0.04019910842180252, -0.07320678234100342, 0.022368839010596275, 0.06364381313323975, -0.0334140881896019, 0.03463007137179375, 0.016905399039387703, -0.045541875064373016, 0.028100108727812767, -0.005777062848210335, 0.006130591034889221, 0.13785836100578308, -0.018204262480139732, 0.07825981825590134, -0.08799948543310165, 0.07331753522157669, -0.14053046703338623, -0.02762684039771557, -0.07172024250030518, -5.183001050568237e-8, -0.08725573122501373, -0.059576164931058884, -0.0013155705528333783, -0.015385173261165619, -0.009021258912980556, 0.018119916319847107, 0.05788357928395271, -0.028203783556818962, -0.007108482997864485, 0.06875336170196533, 0.003813152201473713, -0.00854337215423584, -0.05849261209368706, 0.0004479259660001844, 0.045854225754737854, 0.07164781540632248, -0.013518474996089935, -0.0026874090544879436, -0.004998740274459124, 0.014515808783471584, 0.0044669294729828835, -0.012923849746584892, -0.009119086898863316, -0.0026319827884435654, 0.002220096765086055, 0.030315253883600235, 0.023473208770155907, 0.011783004738390446, -0.06622741371393204, 0.04157225042581558, -0.024138113483786583, 0.01336874533444643, 0.041887275874614716, -0.030300408601760864, -0.03722156584262848, 0.07412738353013992, -0.07836489379405975, -0.018907248973846436, -0.03639356791973114, -0.024152817204594612, -0.001836564508266747, -0.01668805629014969, -0.05506987124681473, -0.019860021770000458, 0.03419433906674385, 0.022263579070568085, 0.02860727347433567, -0.02442063018679619, 0.0005310507258400321, -0.023549620062112808, -0.03478546813130379, -0.08942150324583054, 0.023680560290813446, 0.046087779104709625, -0.013767835684120655, 0.06230141595005989, 0.11690794676542282, -0.04846811667084694, 0.0620575025677681, 0.0723075121641159, 0.06833168119192123, 0.09104198962450027, 0.02242758683860302, 0.015509695746004581 ]
0.205133
# Diagnostics Flags Diagnostics flags let you enable targeted debug logs without turning on verbose logging everywhere. Flags are opt-in and have no effect unless a subsystem checks them. ## How it works - Flags are strings (case-insensitive). - You can enable flags in config or via an env override. - Wildcards are supported: - `telegram.\*` matches `telegram.http` - `\*` enables all flags ## Enable via config ```json { "diagnostics": { "flags": ["telegram.http"] } } ``` Multiple flags: ```json { "diagnostics": { "flags": ["telegram.http", "gateway.\*"] } } ``` Restart the gateway after changing flags. ## Env override (one-off) ```bash OPENCLAW\_DIAGNOSTICS=telegram.http,telegram.payload ``` Disable all flags: ```bash OPENCLAW\_DIAGNOSTICS=0 ``` ## Where logs go Flags emit logs into the standard diagnostics log file. By default: ``` /tmp/openclaw/openclaw-YYYY-MM-DD.log ``` If you set `logging.file`, use that path instead. Logs are JSONL (one JSON object per line). Redaction still applies based on `logging.redactSensitive`. ## Extract logs Pick the latest log file: ```bash ls -t /tmp/openclaw/openclaw-\*.log | head -n 1 ``` Filter for Telegram HTTP diagnostics: ```bash rg "telegram http error" /tmp/openclaw/openclaw-\*.log ``` Or tail while reproducing: ```bash tail -f /tmp/openclaw/openclaw-$(date +%F).log | rg "telegram http error" ``` For remote gateways, you can also use `openclaw logs --follow` (see [/cli/logs](/cli/logs)). ## Notes - If `logging.level` is set higher than `warn`, these logs may be suppressed. Default `info` is fine. - Flags are safe to leave enabled; they only affect log volume for the specific subsystem. - Use [/logging](/logging) to change log destinations, levels, and redaction.
https://github.com/openclaw/openclaw/blob/main//docs/diagnostics/flags.md
main
opebclaw
[ 0.04191427677869797, 0.046937957406044006, -0.03083394281566143, 0.025050191208720207, 0.05428541451692581, -0.131723552942276, 0.02534564957022667, -0.008250739425420761, -0.002081440994516015, 0.041488055139780045, 0.005113061051815748, -0.02468765713274479, -0.010066702030599117, 0.08612973242998123, 0.06728070974349976, 0.07302114367485046, 0.005698373541235924, -0.09580941498279572, -0.011098579503595829, -0.01964208111166954, 0.015526092611253262, 0.0853578969836235, -0.0036048463080078363, 0.012691197916865349, -0.06958445906639099, -0.027782650664448738, -0.058782611042261124, -0.014916702173650265, -0.04914822056889534, -0.03592213615775108, 0.04055719077587128, 0.019220396876335144, -0.1457737684249878, 0.030671099200844765, 0.05140011012554169, 0.049140870571136475, 0.038922518491744995, -0.01347004622220993, 0.04431600123643875, 0.010586114600300789, 0.043659236282110214, -0.013930725865066051, -0.0718703493475914, -0.06824979186058044, -0.04815997555851936, -0.058588847517967224, -0.023434894159436226, -0.025842636823654175, -0.038427382707595825, -0.01731916517019272, 0.014235530979931355, 0.007649437058717012, -0.0014142642030492425, 0.005360357463359833, 0.06497877091169357, 0.009442411363124847, -0.07281181216239929, 0.019475078210234642, 0.007749419659376144, -0.04366804659366608, -0.06176615506410599, 0.002321977633982897, -0.04336915165185928, -0.04616770148277283, -0.06962745636701584, 0.00651150569319725, -0.00868033803999424, 0.041951343417167664, 0.03856639564037323, 0.08119366317987442, 0.01419590599834919, 0.029348712414503098, -0.05014786124229431, -0.04682847484946251, 0.008842595852911472, 0.02985556051135063, 0.04269010201096535, 0.023602794855833054, -0.12297969311475754, -0.0951557382941246, -0.03059844858944416, -0.02322407066822052, 0.014788870699703693, 0.004048989620059729, 0.009042187593877316, 0.07004517316818237, -0.008950981311500072, 0.01185346208512783, 0.0702349990606308, 0.0426594614982605, 0.04035777598619461, -0.1159590408205986, -0.01788676157593727, 0.017079763114452362, 0.044934991747140884, -0.03307562321424484, -0.021750612184405327, 0.00909398589283228, 0.021539244800806046, 0.07249435782432556, 0.035233963280916214, -0.05469813570380211, 0.04934263229370117, 0.020183924585580826, 0.08081791549921036, 0.033754728734493256, 0.014252142049372196, 0.06534741818904877, 0.04306291788816452, 0.011235351674258709, 0.010680574923753738, 0.07434874773025513, 0.10599958896636963, -0.020033786073327065, 0.02202148549258709, 0.03383275121450424, 0.055179160088300705, 0.010580755770206451, 0.00024342526739928871, 0.059279900044202805, 0.1776171177625656, -0.05599769204854965, -0.00932623166590929, 0.030130457133054733, 0.08647897839546204, 0.11900109052658081, 0.04022035002708435, 4.567497910819203e-33, 0.10429371148347855, 0.03673311322927475, -0.09477982670068741, 0.015887325629591942, -0.00462748110294342, 0.06913542002439499, -0.044030193239450455, 0.014375630766153336, -0.06047471985220909, 0.07486526668071747, -0.08226252347230911, 0.03696569800376892, -0.012834996916353703, 0.011763380840420723, -0.006725329905748367, 0.0071683600544929504, 0.021346624940633774, -0.02718581072986126, -0.015066652558743954, -0.00579187972471118, -0.019285431131720543, -0.05618458613753319, -0.05673088878393173, 0.00706397695466876, -0.060761887580156326, 0.08416803926229477, 0.04214324429631233, -0.04467660188674927, -0.0432019867002964, 0.009592695161700249, 0.017737573012709618, 0.002011658623814583, 0.023857690393924713, 0.07820490002632141, 0.07096309959888458, 0.02191872149705887, -0.06971519440412521, 0.04120093956589699, -0.035197362303733826, -0.0014435327611863613, 0.009020719677209854, 0.0035648897755891085, -0.11916006356477737, -0.041144102811813354, 0.037214454263448715, -0.08929486572742462, -0.09905783832073212, -0.04703371599316597, 0.024830041453242302, -0.05003158003091812, 0.04117041453719139, 0.020451834425330162, 0.051349323242902756, -0.030085287988185883, 0.018202170729637146, -0.05806214362382889, -0.0013046689564362168, -0.12863405048847198, 0.00556640001013875, -0.011325608938932419, 0.010062205605208874, -0.05858765169978142, -0.02132260985672474, -0.04141756519675255, 0.06953560560941696, 0.01994270831346512, 0.00331508694216609, 0.1095300242304802, -0.008400777354836464, 0.020047273486852646, -0.06840294599533081, 0.004629115574061871, 0.007304242346435785, 0.0941639319062233, -0.062468983232975006, -0.0324200801551342, -0.002327583497390151, 0.02421395853161812, 0.021143076941370964, 0.02499307319521904, 0.016919786110520363, 0.03151316195726395, 0.01510817464441061, -0.009559008292853832, 0.04263843968510628, -0.025841116905212402, 0.00888383761048317, -0.06214112788438797, -0.0337969996035099, 0.05170357972383499, -0.05274687707424164, 0.1105378121137619, -0.038433488458395004, -0.04482828825712204, -0.08620275557041168, -4.993603960074728e-33, -0.020050762221217155, 0.01943758688867092, -0.041650597006082535, 0.003136433195322752, -0.09224503487348557, -0.04428623616695404, 0.10121755301952362, -0.017280345782637596, -0.032488204538822174, 0.00009816660167416558, -0.009409262798726559, -0.04573751986026764, -0.007517509162425995, -0.050511881709098816, 0.02833312377333641, 0.016110824421048164, -0.14375805854797363, -0.05238404497504234, 0.0230557918548584, 0.005641879979521036, -0.02722974866628647, 0.03753728047013283, -0.075158029794693, 0.020631007850170135, -0.023686371743679047, -0.02860221080482006, 0.005657152738422155, -0.024749990552663803, 0.05279504135251045, -0.11769553273916245, 0.03680012747645378, 0.055618517100811005, -0.021438879892230034, 0.0502520315349102, 0.06345558911561966, 0.029113903641700745, 0.03466060012578964, 0.08351582288742065, 0.02296488545835018, 0.04214642941951752, 0.03286432474851608, 0.05087931826710701, -0.03309600055217743, 0.0510171502828598, -0.02200223319232464, 0.03628036379814148, -0.0182406697422266, 0.0064948913641273975, -0.11575540155172348, -0.018260033801198006, 0.04381188005208969, -0.04102422669529915, 0.11286897957324982, 0.03263799473643303, -0.012971181422472, -0.03461053967475891, 0.017307177186012268, -0.08572886139154434, -0.09681256115436554, 0.01510780118405819, 0.03578481450676918, -0.10974966734647751, -0.01392407063394785, 0.03128568455576897, -0.01004616729915142, -0.0658281147480011, -0.00386839103884995, -0.006383125204592943, -0.014095677994191647, -0.04354364424943924, 0.005225935485213995, -0.08746720850467682, -0.07755941897630692, -0.06698018312454224, 0.08953515440225601, -0.015596842393279076, -0.07730502635240555, -0.044597476720809937, -0.01873771846294403, 0.06376654654741287, -0.0523550808429718, -0.02856537513434887, -0.034356970340013504, -0.02113909088075161, 0.0080656036734581, 0.005484132096171379, -0.01837405189871788, 0.12674708664417267, -0.041501712054014206, 0.015858344733715057, -0.022644853219389915, -0.0021272795274853706, 0.034770652651786804, -0.017053499817848206, 0.012428213842213154, -4.7082583165547476e-8, -0.054979294538497925, -0.10024353116750717, -0.09706394374370575, 0.030970148742198944, 0.022628866136074066, 0.09441012144088745, 0.007453113328665495, -0.024955647066235542, -0.046051960438489914, 0.014737344346940517, -0.03527730703353882, 0.021137278527021408, -0.09915054589509964, -0.055826336145401, -0.05403347313404083, 0.012819386087357998, -0.10877501219511032, 0.045982375741004944, -0.004749089479446411, 0.025654057040810585, 0.035212088376283646, 0.082073874771595, -0.08122069388628006, 0.005077797453850508, -0.038474876433610916, -0.036470916122198105, 0.04210777208209038, 0.049344852566719055, -0.06716333329677582, 0.0030520521104335785, -0.004951608832925558, 0.01910833828151226, 0.03320673480629921, -0.060558393597602844, -0.07623688131570816, 0.037145331501960754, 0.030646497383713722, 0.018678339198231697, 0.014891726896166801, 0.009660790674388409, 0.04699433222413063, 0.03641302511096001, -0.04507169499993324, -0.027184657752513885, -0.060853373259305954, -0.061183299869298935, 0.007385839242488146, 0.027954068034887314, 0.020889729261398315, 0.002324311528354883, 0.06599089503288269, 0.03778310492634773, 0.07689773291349411, 0.0677558109164238, 0.012702389620244503, 0.047960057854652405, 0.051487118005752563, -0.07904542982578278, 0.030167054384946823, 0.03129523620009422, 0.09833483397960663, -0.012264071963727474, 0.06555096060037613, -0.0393538661301136 ]
0.092106
# Gmail Pub/Sub -> OpenClaw Goal: Gmail watch -> Pub/Sub push -> `gog gmail watch serve` -> OpenClaw webhook. ## Prereqs - `gcloud` installed and logged in ([install guide](https://docs.cloud.google.com/sdk/docs/install-sdk)). - `gog` (gogcli) installed and authorized for the Gmail account ([gogcli.sh](https://gogcli.sh/)). - OpenClaw hooks enabled (see [Webhooks](/automation/webhook)). - `tailscale` logged in ([tailscale.com](https://tailscale.com/)). Supported setup uses Tailscale Funnel for the public HTTPS endpoint. Other tunnel services can work, but are DIY/unsupported and require manual wiring. Right now, Tailscale is what we support. Example hook config (enable Gmail preset mapping): ```json5 { hooks: { enabled: true, token: "OPENCLAW\_HOOK\_TOKEN", path: "/hooks", presets: ["gmail"], }, } ``` To deliver the Gmail summary to a chat surface, override the preset with a mapping that sets `deliver` + optional `channel`/`to`: ```json5 { hooks: { enabled: true, token: "OPENCLAW\_HOOK\_TOKEN", presets: ["gmail"], mappings: [ { match: { path: "gmail" }, action: "agent", wakeMode: "now", name: "Gmail", sessionKey: "hook:gmail:{{messages[0].id}}", messageTemplate: "New email from {{messages[0].from}}\nSubject: {{messages[0].subject}}\n{{messages[0].snippet}}\n{{messages[0].body}}", model: "openai/gpt-5.2-mini", deliver: true, channel: "last", // to: "+15551234567" }, ], }, } ``` If you want a fixed channel, set `channel` + `to`. Otherwise `channel: "last"` uses the last delivery route (falls back to WhatsApp). To force a cheaper model for Gmail runs, set `model` in the mapping (`provider/model` or alias). If you enforce `agents.defaults.models`, include it there. To set a default model and thinking level specifically for Gmail hooks, add `hooks.gmail.model` / `hooks.gmail.thinking` in your config: ```json5 { hooks: { gmail: { model: "openrouter/meta-llama/llama-3.3-70b-instruct:free", thinking: "off", }, }, } ``` Notes: - Per-hook `model`/`thinking` in the mapping still overrides these defaults. - Fallback order: `hooks.gmail.model` → `agents.defaults.model.fallbacks` → primary (auth/rate-limit/timeouts). - If `agents.defaults.models` is set, the Gmail model must be in the allowlist. - Gmail hook content is wrapped with external-content safety boundaries by default. To disable (dangerous), set `hooks.gmail.allowUnsafeExternalContent: true`. To customize payload handling further, add `hooks.mappings` or a JS/TS transform module under `hooks.transformsDir` (see [Webhooks](/automation/webhook)). ## Wizard (recommended) Use the OpenClaw helper to wire everything together (installs deps on macOS via brew): ```bash openclaw webhooks gmail setup \ --account openclaw@gmail.com ``` Defaults: - Uses Tailscale Funnel for the public push endpoint. - Writes `hooks.gmail` config for `openclaw webhooks gmail run`. - Enables the Gmail hook preset (`hooks.presets: ["gmail"]`). Path note: when `tailscale.mode` is enabled, OpenClaw automatically sets `hooks.gmail.serve.path` to `/` and keeps the public path at `hooks.gmail.tailscale.path` (default `/gmail-pubsub`) because Tailscale strips the set-path prefix before proxying. If you need the backend to receive the prefixed path, set `hooks.gmail.tailscale.target` (or `--tailscale-target`) to a full URL like `http://127.0.0.1:8788/gmail-pubsub` and match `hooks.gmail.serve.path`. Want a custom endpoint? Use `--push-endpoint ` or `--tailscale off`. Platform note: on macOS the wizard installs `gcloud`, `gogcli`, and `tailscale` via Homebrew; on Linux install them manually first. Gateway auto-start (recommended): - When `hooks.enabled=true` and `hooks.gmail.account` is set, the Gateway starts `gog gmail watch serve` on boot and auto-renews the watch. - Set `OPENCLAW\_SKIP\_GMAIL\_WATCHER=1` to opt out (useful if you run the daemon yourself). - Do not run the manual daemon at the same time, or you will hit `listen tcp 127.0.0.1:8788: bind: address already in use`. Manual daemon (starts `gog gmail watch serve` + auto-renew): ```bash openclaw webhooks gmail run ``` ## One-time setup 1. Select the GCP project \*\*that owns the OAuth client\*\* used by `gog`. ```bash gcloud auth login gcloud config set project ``` Note: Gmail watch requires the Pub/Sub topic to live in the same project as the OAuth client. 2. Enable APIs: ```bash gcloud services enable gmail.googleapis.com pubsub.googleapis.com ``` 3. Create a topic: ```bash gcloud pubsub topics create gog-gmail-watch ``` 4. Allow Gmail push to publish: ```bash gcloud pubsub topics add-iam-policy-binding gog-gmail-watch \ --member=serviceAccount:gmail-api-push@system.gserviceaccount.com \
https://github.com/openclaw/openclaw/blob/main//docs/automation/gmail-pubsub.md
main
opebclaw
[ -0.10544077306985855, 0.029086440801620483, 0.03301706910133362, -0.01699214242398739, -0.04020959138870239, -0.054259855300188065, -0.01839391700923443, -0.056735582649707794, 0.007117161992937326, 0.007919106632471085, -0.010412645526230335, -0.04754551127552986, -0.0057194908149540424, -0.005544026382267475, 0.09298312664031982, 0.05036645010113716, 0.100633904337883, -0.0402035266160965, 0.009633488953113556, -0.05487924814224243, -0.04396079108119011, -0.033430129289627075, 0.01870480552315712, 0.004109627101570368, -0.08479063957929611, -0.10162216424942017, -0.0444880835711956, -0.013138136826455593, -0.04013652727007866, 0.03345108404755592, 0.02475770004093647, -0.03898343816399574, -0.07275719940662384, 0.08429572731256485, -0.04682295396924019, 0.034912168979644775, 0.022524500265717506, 0.026876214891672134, -0.03824719041585922, 0.023621059954166412, 0.09555486589670181, -0.10071655362844467, -0.03170301020145416, -0.06156062334775925, -0.011576523073017597, -0.01638801209628582, -0.022493112832307816, -0.02111990377306938, -0.04412494972348213, 0.03538873791694641, -0.0171121284365654, -0.06884530186653137, 0.028690850362181664, -0.006497709080576897, -0.02768981084227562, 0.040717680007219315, -0.09110233932733536, 0.018859410658478737, 0.10140115767717361, 0.031561288982629776, 0.033995628356933594, -0.059130940586328506, -0.05616898834705353, -0.024009855464100838, -0.06821628659963608, 0.02719487063586712, 0.03895824775099754, -0.056204162538051605, 0.05613039806485176, -0.01529603824019432, -0.023727023974061012, 0.009173644706606865, -0.02705470658838749, -0.01973329856991768, -0.052681196480989456, 0.04061887040734291, -0.028967346996068954, 0.03896675258874893, -0.030404025688767433, -0.05371152609586716, -0.04554395377635956, -0.026040203869342804, -0.0064246151596307755, 0.09354766458272934, -0.03303786367177963, 0.04775281250476837, 0.010969079099595547, 0.009124224074184895, 0.029637565836310387, -0.007648174185305834, 0.06481263786554337, -0.011353939771652222, -0.09391425549983978, -0.008195783011615276, 0.05865378677845001, 0.035307981073856354, -0.07405532896518707, -0.009780272841453552, -0.037178847938776016, 0.0313296876847744, 0.03130456060171127, 0.004833569750189781, 0.06767109036445618, -0.014723015949130058, 0.048642806708812714, -0.006585109978914261, -0.03623590245842934, 0.07745209336280823, 0.06053905189037323, 0.05564084276556969, 0.013975953683257103, -0.005240011960268021, 0.09139502793550491, -0.06743655353784561, -0.07558398693799973, 0.08292895555496216, -0.06274723261594772, 0.020778706297278404, 0.0711975023150444, 0.0861315056681633, 0.07213994860649109, 0.036770496517419815, -0.013674100860953331, -0.025353094562888145, 0.033287517726421356, -0.004371237941086292, 0.033954620361328125, 5.212647046774892e-33, 0.06773518025875092, -0.013140968978404999, 0.032421182841062546, -0.07629983127117157, 0.037449367344379425, 0.03858509659767151, 0.03023926354944706, -0.03517869859933853, -0.027907004579901695, 0.026987368240952492, -0.012438691221177578, 0.07104898244142532, -0.03071718104183674, -0.052236657589673996, -0.05371153727173805, 0.044520746916532516, -0.049988191574811935, 0.019141333177685738, 0.0955924466252327, -0.050168901681900024, -0.03362331911921501, -0.05758603289723396, 0.015702350065112114, -0.07112707942724228, 0.02766045369207859, 0.024174785241484642, -0.0056432015262544155, -0.04383249208331108, -0.005320813041180372, 0.06259332597255707, 0.042194657027721405, -0.038270484656095505, 0.02603112906217575, 0.03711136803030968, -0.04661743342876434, -0.020798511803150177, -0.1271553486585617, -0.0497092604637146, -0.035295259207487106, -0.029121818020939827, 0.012838166207075119, -0.021815896034240723, -0.061041947454214096, -0.04504239186644554, -0.10113591700792313, -0.0387868694961071, 0.030792778357863426, 0.002795981476083398, 0.07268360257148743, 0.004709831438958645, 0.024814456701278687, -0.049736857414245605, -0.05361403152346611, -0.05169161036610603, 0.005511519964784384, 0.02889006771147251, 0.055075373500585556, 0.01146864052861929, -0.009622610174119473, -0.0028775108512490988, -0.046363767236471176, 0.05568695068359375, 0.025262540206313133, 0.003323114477097988, 0.0452108308672905, -0.044825922697782516, -0.05531108379364014, 0.07311417162418365, -0.07002659887075424, -0.015198937617242336, 0.020969169214367867, -0.03094150498509407, 0.06554684042930603, 0.11441830545663834, -0.056103337556123734, -0.060123588889837265, 0.032597869634628296, 0.06280546635389328, 0.021591026335954666, -0.014050585217773914, 0.04564599692821503, 0.007110213860869408, 0.020050404593348503, 0.08714934438467026, -0.03832773491740227, 0.06587950140237808, 0.029011620208621025, -0.05733247473835945, -0.06642978638410568, 0.07490552216768265, -0.07129869610071182, -0.017196448519825935, 0.06205368414521217, 0.02682328224182129, -0.06418540328741074, -6.379889059912422e-33, -0.02820519544184208, -0.0061933803372085094, -0.03148428723216057, 0.01723683811724186, 0.08867170661687851, 0.018743151798844337, 0.1611555963754654, -0.07216441631317139, -0.000774467596784234, 0.0384761206805706, -0.019386792555451393, 0.06524840742349625, 0.03985154628753662, 0.0021168848033994436, 0.006987924221903086, -0.03923061490058899, 0.016994431614875793, -0.0865483358502388, -0.019907081499695778, -0.004288559779524803, -0.028862658888101578, 0.018272673711180687, 0.03977248817682266, 0.05142751708626747, 0.06506220996379852, -0.025777524337172508, 0.06886985152959824, 0.04483122378587723, -0.05634383112192154, -0.0032624932937324047, 0.014119528234004974, 0.024160277098417282, 0.00913100317120552, -0.0010906324023380876, 0.027201272547245026, -0.07715057581663132, 0.027565717697143555, 0.12531186640262604, 0.059994135051965714, -0.08775094896554947, 0.035856228321790695, -0.06379704922437668, -0.01656288467347622, -0.039570897817611694, 0.045365214347839355, 0.116866834461689, -0.007947245612740517, 0.027110058814287186, -0.14552773535251617, -0.01660010777413845, -0.04035442695021629, 0.0797220766544342, -0.0015079828444868326, 0.03649353235960007, -0.04942423105239868, 0.12087468057870865, 0.0013797214487567544, -0.0541573129594326, -0.02018977329134941, -0.05132123455405235, -0.03214650973677635, -0.12883618474006653, 0.04911921173334122, 0.1019263043999672, 0.020044252276420593, -0.01447488646954298, -0.05295690521597862, 0.03993329405784607, -0.04174195975065231, -0.03035629540681839, -0.07250071316957474, -0.07782596349716187, 0.023125097155570984, -0.10742084681987762, 0.03559326380491257, 0.01784539595246315, 0.042890772223472595, -0.06888514012098312, 0.02335543930530548, 0.009839067235589027, -0.016117379069328308, 0.03957496955990791, -0.012959751300513744, -0.05794942006468773, 0.06381013989448547, -0.022216111421585083, -0.05235947296023369, 0.10944393277168274, 0.11060193926095963, 0.07575837522745132, -0.08650555461645126, 0.05749078840017319, -0.08360451459884644, 0.006547949742525816, 0.034770458936691284, -5.2179956355757895e-8, 0.021467991173267365, 0.02959194965660572, -0.008228853344917297, 0.07240096479654312, -0.008839378133416176, 0.023477718234062195, 0.0006374930962920189, 0.008596441708505154, -0.05233396962285042, 0.0228322371840477, 0.004863339941948652, -0.027437185868620872, -0.06283361464738846, 0.045876506716012955, -0.07718540728092194, -0.037920743227005005, 0.001596272923052311, -0.02754751406610012, -0.0029355224687606096, -0.04823555424809456, -0.06183288246393204, -0.006439296528697014, 0.05352923274040222, 0.01577262207865715, -0.020090490579605103, 0.025777485221624374, 0.01955290324985981, -0.013730541802942753, -0.05117993801832199, 0.009004169143736362, -0.050017327070236206, -0.04153559356927872, -0.04530129209160805, -0.03622569143772125, -0.046587295830249786, 0.04708817973732948, -0.1320928931236267, 0.01028140913695097, 0.007135269232094288, 0.040496595203876495, 0.043395474553108215, 0.043547019362449646, 0.0271976999938488, -0.021335329860448837, -0.07809937745332718, 0.0328221321105957, 0.020570699125528336, 0.026239801198244095, 0.057453542947769165, 0.11008858680725098, 0.0025905873626470566, -0.04344072937965393, 0.027876373380422592, 0.024199632927775383, 0.10047181695699692, 0.02831600047647953, 0.09212718158960342, -0.1326061189174652, -0.015876656398177147, 0.05674557760357857, 0.0073411958292126656, -0.008487214334309101, 0.004615704528987408, 0.01796605996787548 ]
-0.029956
requires the Pub/Sub topic to live in the same project as the OAuth client. 2. Enable APIs: ```bash gcloud services enable gmail.googleapis.com pubsub.googleapis.com ``` 3. Create a topic: ```bash gcloud pubsub topics create gog-gmail-watch ``` 4. Allow Gmail push to publish: ```bash gcloud pubsub topics add-iam-policy-binding gog-gmail-watch \ --member=serviceAccount:gmail-api-push@system.gserviceaccount.com \ --role=roles/pubsub.publisher ``` ## Start the watch ```bash gog gmail watch start \ --account openclaw@gmail.com \ --label INBOX \ --topic projects//topics/gog-gmail-watch ``` Save the `history\_id` from the output (for debugging). ## Run the push handler Local example (shared token auth): ```bash gog gmail watch serve \ --account openclaw@gmail.com \ --bind 127.0.0.1 \ --port 8788 \ --path /gmail-pubsub \ --token \ --hook-url http://127.0.0.1:18789/hooks/gmail \ --hook-token OPENCLAW\_HOOK\_TOKEN \ --include-body \ --max-bytes 20000 ``` Notes: - `--token` protects the push endpoint (`x-gog-token` or `?token=`). - `--hook-url` points to OpenClaw `/hooks/gmail` (mapped; isolated run + summary to main). - `--include-body` and `--max-bytes` control the body snippet sent to OpenClaw. Recommended: `openclaw webhooks gmail run` wraps the same flow and auto-renews the watch. ## Expose the handler (advanced, unsupported) If you need a non-Tailscale tunnel, wire it manually and use the public URL in the push subscription (unsupported, no guardrails): ```bash cloudflared tunnel --url http://127.0.0.1:8788 --no-autoupdate ``` Use the generated URL as the push endpoint: ```bash gcloud pubsub subscriptions create gog-gmail-watch-push \ --topic gog-gmail-watch \ --push-endpoint "https:///gmail-pubsub?token=" ``` Production: use a stable HTTPS endpoint and configure Pub/Sub OIDC JWT, then run: ```bash gog gmail watch serve --verify-oidc --oidc-email ``` ## Test Send a message to the watched inbox: ```bash gog gmail send \ --account openclaw@gmail.com \ --to openclaw@gmail.com \ --subject "watch test" \ --body "ping" ``` Check watch state and history: ```bash gog gmail watch status --account openclaw@gmail.com gog gmail history --account openclaw@gmail.com --since ``` ## Troubleshooting - `Invalid topicName`: project mismatch (topic not in the OAuth client project). - `User not authorized`: missing `roles/pubsub.publisher` on the topic. - Empty messages: Gmail push only provides `historyId`; fetch via `gog gmail history`. ## Cleanup ```bash gog gmail watch stop --account openclaw@gmail.com gcloud pubsub subscriptions delete gog-gmail-watch-push gcloud pubsub topics delete gog-gmail-watch ```
https://github.com/openclaw/openclaw/blob/main//docs/automation/gmail-pubsub.md
main
opebclaw
[ -0.004116282798349857, -0.062223900109529495, 0.01219751127064228, -0.024584583938121796, 0.021880505606532097, -0.03772275894880295, -0.03576425462961197, -0.052391376346349716, 0.03870230168104172, 0.011906650848686695, -0.05825968459248543, -0.03888091817498207, 0.07007709890604019, 0.009104364551603794, 0.06718924641609192, 0.012513719499111176, 0.053350962698459625, -0.10339178144931793, -0.0024424351286143064, -0.026213226839900017, -0.08504866808652878, 0.030639521777629852, 0.06877860426902771, 0.013638489879667759, -0.06114049255847931, -0.0939120203256607, -0.005018132273107767, -0.09578578174114227, -0.02482113242149353, 0.06962128728628159, 0.08710341155529022, -0.023343989625573158, -0.08666359633207321, 0.04477323964238167, -0.014687635004520416, 0.03887052461504936, 0.0178750678896904, 0.050723448395729065, -0.03051953762769699, -0.013284002430737019, 0.0719369649887085, -0.06721668690443039, -0.04753975197672844, -0.07685358077287674, 0.037529777735471725, -0.00028274673968553543, -0.011912130750715733, -0.06199658289551735, -0.030619006603956223, 0.07502812892198563, -0.014375525526702404, -0.12563195824623108, -0.00007689109770581126, -0.07352526485919952, -0.00457325205206871, 0.06782139837741852, -0.12568078935146332, 0.07224024832248688, 0.08481211960315704, -0.011558216996490955, -0.013430957682430744, -0.02892439253628254, -0.09907588362693787, -0.06204572692513466, -0.03477216139435768, 0.021322164684534073, 0.022023338824510574, -0.0009336845832876861, 0.012665740214288235, 0.00043621179065667093, 0.03467521071434021, 0.05146731063723564, -0.09749548137187958, -0.08653899282217026, -0.039266154170036316, -0.007033345755189657, -0.08079352974891663, 0.058492809534072876, 0.031090551987290382, -0.04319281503558159, -0.017580436542630196, -0.053808026015758514, 0.0029576169326901436, 0.09296811372041702, -0.08200061321258545, -0.022810226306319237, 0.041602298617362976, -0.013016898185014725, 0.006428132299333811, 0.012628071010112762, 0.06447191536426544, -0.01633010059595108, 0.001966458512470126, -0.03690839931368828, 0.10205917805433273, 0.008502368815243244, -0.07150381803512573, 0.022290091961622238, 0.02843625098466873, 0.024693449959158897, 0.031451839953660965, 0.04260751232504845, 0.03251737356185913, -0.0009029916836880147, 0.024537190794944763, -0.003391524078324437, -0.05683814734220505, 0.039376627653837204, 0.025985220447182655, 0.0896318331360817, 0.03091478906571865, 0.08222109824419022, 0.03030223399400711, -0.06791898608207703, -0.004783047363162041, 0.0324142724275589, -0.0009336846997030079, 0.037251174449920654, -0.00671024527400732, 0.08555826544761658, 0.08953103423118591, -0.027218066155910492, -0.008130461908876896, -0.010480144061148167, -0.038836076855659485, -0.018568044528365135, -0.013876495882868767, 1.5856759413730244e-33, 0.1136847510933876, -0.08601629734039307, 0.0615684799849987, 0.023773539811372757, -0.013409261591732502, 0.04202082380652428, -0.009574749507009983, -0.0402957908809185, 0.0005050150211900473, -0.03615768998861313, 0.0285309050232172, 0.0993909165263176, -0.020875686779618263, 0.01118339505046606, -0.0026559242978692055, -0.0028719708789139986, -0.015371113084256649, 0.014217447489500046, 0.07646366953849792, -0.08970048278570175, -0.07038625329732895, -0.004655809141695499, 0.03635255619883537, -0.016343137249350548, 0.07322666049003601, 0.014553765766322613, 0.05184902250766754, -0.07898003607988358, -0.024593815207481384, 0.0176991019397974, 0.04851996898651123, -0.04164566472172737, -0.01058267243206501, 0.03996860980987549, -0.05414154380559921, -0.02306973561644554, -0.07416575402021408, -0.03719692677259445, -0.007696830201894045, -0.0010665594600141048, 0.026923034340143204, -0.03851728141307831, -0.0120922289788723, -0.06955984234809875, -0.02451189234852791, 0.015595044009387493, 0.12034223973751068, -0.016782643273472786, 0.12531933188438416, 0.02785423956811428, 0.07796795666217804, -0.07251574844121933, -0.10142306238412857, -0.09630469232797623, 0.0378517247736454, 0.024760961532592773, -0.027608590200543404, -0.004670789930969477, -0.019367357715964317, -0.05635596066713333, -0.0510944202542305, 0.04428277909755707, 0.10255566984415054, 0.03290301561355591, 0.045390430837869644, 0.02551504597067833, -0.10329946130514145, 0.033914826810359955, 0.002005148446187377, 0.0117315873503685, 0.02159370854496956, -0.01708652637898922, 0.03608430176973343, 0.0338381789624691, -0.03845417499542236, -0.014860302209854126, 0.01835636794567108, -0.014781813137233257, -0.007136041764169931, 0.026530753821134567, 0.022702733054757118, -0.008370673283934593, -0.04703633114695549, 0.03216168284416199, -0.017216769978404045, 0.08231688290834427, 0.06325393915176392, -0.0034158648923039436, -0.06297358870506287, 0.020553508773446083, -0.0307631678879261, 0.022171130403876305, 0.01240560133010149, 0.018953250721096992, -0.035145580768585205, -4.4615994614635466e-33, -0.012161675840616226, -0.13533544540405273, -0.03446203097701073, -0.031422730535268784, 0.10502947121858597, -0.05923864245414734, 0.02664550580084324, -0.06285824626684189, 0.0546828918159008, 0.06387607008218765, -0.12429141253232956, 0.02821984887123108, -0.03250729292631149, 0.0607084222137928, -0.024338772520422935, -0.054870590567588806, -0.02707747370004654, -0.02345440164208412, -0.03245141729712486, -0.02708246000111103, -0.0707247257232666, 0.0350244864821434, 0.09034718573093414, 0.035484716296195984, 0.058561407029628754, -0.006581677123904228, 0.04640091955661774, 0.014222502708435059, 0.03674319013953209, -0.018391624093055725, 0.019531479105353355, 0.038587041199207306, -0.0481707826256752, 0.034247592091560364, 0.028574049472808838, -0.009330438449978828, 0.04998817667365074, 0.050066255033016205, 0.024358751252293587, -0.07492445409297943, 0.01567866839468479, -0.046997006982564926, -0.009813258424401283, -0.10279636085033417, 0.060657352209091187, 0.08187852054834366, 0.04995758458971977, 0.0626068115234375, -0.10553313791751862, -0.036063242703676224, 0.03964298591017723, -0.00416190130636096, 0.04179758206009865, 0.017181482166051865, 0.014519228599965572, 0.061026450246572495, 0.009194483980536461, -0.0331951379776001, 0.005583012476563454, -0.060157425701618195, 0.002641604281961918, -0.09000599384307861, 0.03729920834302902, 0.06709598749876022, -0.012922980822622776, -0.02162797935307026, 0.06365619599819183, 0.06489013880491257, -0.018391987308859825, -0.0018706779228523374, -0.09151536226272583, -0.07868853956460953, -0.03767571598291397, -0.07818375527858734, 0.06448680907487869, 0.06365637481212616, 0.02501065656542778, -0.06200091168284416, 0.006957280449569225, -0.02542812004685402, -0.057742081582546234, 0.02910115197300911, -0.047307346016168594, -0.06597524136304855, 0.00904352217912674, -0.0894494354724884, 0.00941222533583641, 0.11897803097963333, 0.11851063370704651, 0.06157946214079857, -0.034943100064992905, 0.005548966582864523, -0.0010530779836699367, -0.04195104539394379, -0.027772627770900726, -4.802516784252475e-8, 0.010760132223367691, 0.04914989322423935, -0.056904640048742294, 0.11092088371515274, -0.028648966923356056, -0.018416820093989372, -0.00592778529971838, -0.07165466248989105, 0.040099192410707474, -0.012250522151589394, -0.04649554565548897, -0.06256784498691559, -0.07001708447933197, 0.01824430376291275, -0.021841373294591904, -0.0761740505695343, -0.010285758413374424, -0.027100296691060066, 0.0029346903320401907, -0.004859215579926968, -0.04946119710803032, 0.002325870329514146, 0.04213307052850723, -0.040345199406147, -0.030927248299121857, -0.020482642576098442, 0.0256958045065403, 0.022392699494957924, -0.04776333272457123, 0.020386025309562683, 0.0019119807984679937, 0.006515102926641703, -0.07668259739875793, -0.09260880202054977, -0.041299622505903244, -0.0765453353524208, 0.046495161950588226, -0.04541568458080292, 0.02261449582874775, 0.023990007117390633, 0.021256878972053528, 0.005454847123473883, 0.07140102237462997, -0.016214631497859955, -0.0896795466542244, 0.007736876141279936, 0.08803650736808777, 0.00970678310841322, 0.09218098968267441, 0.07112544775009155, -0.08678679168224335, -0.005850963294506073, 0.08624406903982162, 0.04216216504573822, 0.05018872767686844, -0.00725404592230916, 0.056509580463171005, -0.04493068903684616, 0.0539969764649868, -0.03271161764860153, 0.015164535492658615, 0.0450909361243248, -0.01093413308262825, 0.007809846196323633 ]
-0.116312
# Cron jobs (Gateway scheduler) > \*\*Cron vs Heartbeat?\*\* See [Cron vs Heartbeat](/automation/cron-vs-heartbeat) for guidance on when to use each. Cron is the Gateway’s built-in scheduler. It persists jobs, wakes the agent at the right time, and can optionally deliver output back to a chat. If you want \_“run this every morning”\_ or \_“poke the agent in 20 minutes”\_, cron is the mechanism. ## TL;DR - Cron runs \*\*inside the Gateway\*\* (not inside the model). - Jobs persist under `~/.openclaw/cron/` so restarts don’t lose schedules. - Two execution styles: - \*\*Main session\*\*: enqueue a system event, then run on the next heartbeat. - \*\*Isolated\*\*: run a dedicated agent turn in `cron:`, with delivery (announce by default or none). - Wakeups are first-class: a job can request “wake now” vs “next heartbeat”. ## Quick start (actionable) Create a one-shot reminder, verify it exists, and run it immediately: ```bash openclaw cron add \ --name "Reminder" \ --at "2026-02-01T16:00:00Z" \ --session main \ --system-event "Reminder: check the cron docs draft" \ --wake now \ --delete-after-run openclaw cron list openclaw cron run --force openclaw cron runs --id ``` Schedule a recurring isolated job with delivery: ```bash openclaw cron add \ --name "Morning brief" \ --cron "0 7 \* \* \*" \ --tz "America/Los\_Angeles" \ --session isolated \ --message "Summarize overnight updates." \ --announce \ --channel slack \ --to "channel:C1234567890" ``` ## Tool-call equivalents (Gateway cron tool) For the canonical JSON shapes and examples, see [JSON schema for tool calls](/automation/cron-jobs#json-schema-for-tool-calls). ## Where cron jobs are stored Cron jobs are persisted on the Gateway host at `~/.openclaw/cron/jobs.json` by default. The Gateway loads the file into memory and writes it back on changes, so manual edits are only safe when the Gateway is stopped. Prefer `openclaw cron add/edit` or the cron tool call API for changes. ## Beginner-friendly overview Think of a cron job as: \*\*when\*\* to run + \*\*what\*\* to do. 1. \*\*Choose a schedule\*\* - One-shot reminder → `schedule.kind = "at"` (CLI: `--at`) - Repeating job → `schedule.kind = "every"` or `schedule.kind = "cron"` - If your ISO timestamp omits a timezone, it is treated as \*\*UTC\*\*. 2. \*\*Choose where it runs\*\* - `sessionTarget: "main"` → run during the next heartbeat with main context. - `sessionTarget: "isolated"` → run a dedicated agent turn in `cron:`. 3. \*\*Choose the payload\*\* - Main session → `payload.kind = "systemEvent"` - Isolated session → `payload.kind = "agentTurn"` Optional: one-shot jobs (`schedule.kind = "at"`) delete after success by default. Set `deleteAfterRun: false` to keep them (they will disable after success). ## Concepts ### Jobs A cron job is a stored record with: - a \*\*schedule\*\* (when it should run), - a \*\*payload\*\* (what it should do), - optional \*\*delivery mode\*\* (announce or none). - optional \*\*agent binding\*\* (`agentId`): run the job under a specific agent; if missing or unknown, the gateway falls back to the default agent. Jobs are identified by a stable `jobId` (used by CLI/Gateway APIs). In agent tool calls, `jobId` is canonical; legacy `id` is accepted for compatibility. One-shot jobs auto-delete after success by default; set `deleteAfterRun: false` to keep them. ### Schedules Cron supports three schedule kinds: - `at`: one-shot timestamp via `schedule.at` (ISO 8601). - `every`: fixed interval (ms). - `cron`: 5-field cron expression with optional IANA timezone. Cron expressions use `croner`. If a timezone is omitted, the Gateway host’s local timezone is used. ### Main vs isolated execution #### Main session jobs (system events) Main jobs enqueue a system event and optionally wake the heartbeat runner. They must use `payload.kind = "systemEvent"`. - `wakeMode: "next-heartbeat"` (default): event waits for the next scheduled heartbeat. -
https://github.com/openclaw/openclaw/blob/main//docs/automation/cron-jobs.md
main
opebclaw
[ -0.06729067862033844, -0.028343988582491875, -0.04670986905694008, 0.03819410502910614, 0.009240676648914814, -0.018664702773094177, -0.05003082752227783, -0.02127564325928688, 0.076092429459095, -0.06874408572912216, -0.03336596488952637, 0.022716617211699486, -0.017688265070319176, -0.0034783161245286465, 0.033961012959480286, 0.013594543561339378, 0.04667604714632034, -0.10301734507083893, -0.03911120444536209, -0.0197982769459486, -0.004591948818415403, 0.01599709689617157, -0.0035416800528764725, 0.04666551947593689, -0.1112721711397171, -0.0715530514717102, 0.08791028708219528, -0.01300917286425829, 0.007623487617820501, 0.021788647398352623, 0.07032588124275208, -0.026661239564418793, -0.007292895577847958, 0.03636661544442177, 0.03074222430586815, 0.09462980926036835, 0.07418794184923172, 0.04003524035215378, 9.013486419462424e-7, 0.01646185666322708, 0.09428325295448303, -0.09382128715515137, -0.005193979945033789, -0.05904120206832886, 0.056203633546829224, -0.04019637405872345, -0.08763093501329422, -0.02681088075041771, 0.009473203681409359, 0.0034661830868571997, -0.04491673409938812, -0.047605834901332855, -0.007093141786754131, 0.04058197885751724, 0.0773693099617958, 0.14466536045074463, 0.061936069279909134, -0.02553420141339302, 0.04340014234185219, -0.0821661725640297, -0.02518516220152378, -0.00883855763822794, -0.036877743899822235, 0.03288424015045166, -0.0962395966053009, -0.04778311774134636, -0.09510817378759384, -0.010405797511339188, 0.09693591296672821, -0.01740388013422489, -0.028694389387965202, -0.018353162333369255, -0.04936738312244415, -0.07518084347248077, -0.0035486312117427588, 0.029560886323451996, 0.02149878442287445, -0.07331816852092743, -0.08753206580877304, -0.0351736955344677, -0.05153711140155792, -0.03108818084001541, -0.02254612371325493, -0.025787413120269775, -0.021846765652298927, 0.029080094769597054, 0.08292938023805618, 0.016352195292711258, 0.06451547145843506, 0.00455701258033514, 0.0645446702837944, 0.008359691128134727, 0.029687419533729553, -0.014063148759305477, 0.004659834783524275, 0.07859139889478683, -0.008275515399873257, -0.00240168790332973, 0.017802253365516663, 0.013516050763428211, 0.003500925377011299, 0.022590359672904015, -0.017102081328630447, 0.028819238767027855, 0.008387514390051365, 0.0022382326424121857, -0.01893819123506546, 0.07324955612421036, 0.03700483590364456, -0.058084577322006226, 0.032153114676475525, 0.030356282368302345, 0.13564950227737427, 0.03131480515003204, 0.05473100021481514, 0.08607391268014908, -0.02566121146082878, 0.06486598402261734, 0.031048471108078957, 0.10983960330486298, 0.07314128428697586, -0.03636438399553299, 0.02114912122488022, -0.14129608869552612, 0.08194167166948318, 0.01409910712391138, 0.0213550366461277, 5.7730129179935535e-33, -0.022177862003445625, -0.021783282980322838, -0.03620617091655731, -0.007336869835853577, 0.09672900289297104, -0.061149969696998596, -0.019786721095442772, 0.06607946008443832, 0.03863741457462311, -0.027423515915870667, -0.06174060329794884, 0.021601945161819458, -0.015501927584409714, 0.04332285374403, -0.07616231590509415, -0.05459985136985779, -0.01832720823585987, 0.00063187291380018, 0.030613629147410393, -0.046820130199193954, 0.01920243725180626, -0.06115788593888283, -0.06059392914175987, 0.06417088210582733, 0.009786056354641914, -0.0008780958596616983, 0.056369733065366745, 0.04123637452721596, -0.037935882806777954, 0.010348127223551273, 0.028872162103652954, 0.08833467960357666, -0.036613523960113525, 0.07587867975234985, -0.03967173025012016, 0.09316528588533401, -0.10392726212739944, 0.013033137656748295, -0.059114132076501846, -0.02298331819474697, -0.04026278853416443, -0.010326355695724487, -0.08192016184329987, -0.050154946744441986, 0.0019129401771351695, -0.14545252919197083, -0.030359352007508278, 0.010125765576958656, 0.04785332456231117, -0.015568436123430729, 0.045118317008018494, 0.04783948138356209, 0.09036065638065338, -0.007826032117009163, -0.01430282462388277, 0.005836061667650938, -0.016631226986646652, -0.04111397638916969, 0.032696351408958435, 0.040679365396499634, 0.04322301968932152, -0.015480637550354004, -0.0012400515843182802, 0.046376656740903854, 0.0709027573466301, 0.032773494720458984, 0.006205916404724121, -0.07698820531368256, 0.01925840601325035, 0.051545649766922, 0.047934647649526596, 0.07900935411453247, -0.023519888520240784, -0.030215037986636162, 0.01197903323918581, -0.04783599078655243, 0.00208076904527843, -0.025966549292206764, -0.05959481745958328, 0.006265612784773111, 0.06886600703001022, 0.07311907410621643, 0.0072478363290429115, -0.021881483495235443, 0.06929461658000946, -0.03361893072724342, -0.03486758470535278, -0.0374533049762249, 0.00503234937787056, 0.05843767151236534, -0.042426031082868576, -0.026873065158724785, 0.03832323104143143, 0.07130654156208038, -0.028876319527626038, -5.688732177091503e-33, 0.01771848089993, -0.025566766038537025, -0.06265822798013687, 0.025650888681411743, -0.013022411614656448, 0.0032898772042244673, 0.02501766011118889, -0.0013672226341441274, 0.029555702582001686, -0.015065868385136127, -0.0172585379332304, 0.011242183856666088, 0.005297277122735977, -0.024658137932419777, 0.05880406126379967, -0.07845243811607361, 0.05079630762338638, -0.12897463142871857, -0.06678496301174164, 0.09290154278278351, -0.007313247304409742, 0.006528950296342373, -0.11305475234985352, -0.03287336230278015, 0.06614276021718979, 0.048364460468292236, -0.015804920345544815, 0.06768014281988144, -0.031251706182956696, -0.016512710601091385, -0.023296309635043144, -0.0565715916454792, 0.013010098598897457, 0.03883088380098343, 0.012871786020696163, 0.01700296625494957, -0.0494479201734066, 0.056742437183856964, 0.029356922954320908, 0.08344268798828125, 0.16698116064071655, 0.007073456887155771, -0.019976280629634857, -0.018221210688352585, -0.011573709547519684, 0.03221261501312256, -0.09036634862422943, 0.000487096345750615, -0.0830305963754654, 0.00286846118979156, -0.046945612877607346, -0.01925603300333023, -0.001626417855732143, 0.06924683600664139, 0.04068508371710777, 0.017243441194295883, 0.07672135531902313, 0.011252488009631634, -0.015450659207999706, -0.030313782393932343, -0.024038732051849365, -0.0735914409160614, -0.009897329844534397, 0.09087332338094711, -0.02592598833143711, -0.042907413095235825, -0.01823669858276844, -0.02588852122426033, 0.018329616636037827, -0.04858038201928139, 0.014101142063736916, 0.03850625455379486, -0.04188386723399162, 0.011535163968801498, -0.06894431263208389, -0.011052331887185574, -0.06200651079416275, -0.1061597689986229, -0.09667787700891495, 0.023077532649040222, -0.08770699054002762, -0.05957217887043953, 0.011281822808086872, 0.01853456348180771, -0.10754778236150742, -0.007699870504438877, -0.031811103224754333, 0.003379090689122677, 0.08263108134269714, 0.02388126775622368, 0.021371716633439064, -0.005123560316860676, -0.010402405634522438, 0.029697619378566742, -0.0164218470454216, -5.471567376957864e-8, -0.018868444487452507, -0.05426092445850372, 0.09577339142560959, 0.03503729775547981, 0.00332162925042212, -0.10032106935977936, 0.10199213027954102, -0.08076411485671997, -0.030219480395317078, 0.10001222789287567, 0.03087865188717842, -0.048535801470279694, 0.022913645952939987, -0.0036650572437793016, -0.006398710887879133, 0.03895707428455353, 0.02057153359055519, -0.026109769940376282, 0.005156707484275103, -0.08591502904891968, 0.014818748459219933, 0.0028498044703155756, 0.028355395421385765, 0.055185891687870026, 0.04317910969257355, 0.03400079160928726, 0.023976195603609085, 0.03405791521072388, -0.09577351063489914, 0.029980691149830818, -0.0314452201128006, -0.008171997964382172, 0.043803561478853226, 0.03646030277013779, -0.07554182410240173, 0.01529920194298029, 0.018000734969973564, -0.06487651914358139, 0.00032484938856214285, 0.008598430082201958, 0.06518527120351791, -0.03628959134221077, -0.05707021430134773, -0.07979002594947815, 0.028020242229104042, -0.05978609248995781, -0.06872981041669846, -0.011027845554053783, 0.009563671424984932, 0.033062636852264404, -0.04643387719988823, 0.005611781030893326, 0.05416962876915932, -0.018386278301477432, 0.05672049894928932, -0.026031404733657837, 0.07939773797988892, -0.11877530068159103, 0.03565474972128868, 0.023018889129161835, 0.009493954479694366, 0.07561100274324417, -0.006977235432714224, -0.10824768245220184 ]
0.102626
is omitted, the Gateway host’s local timezone is used. ### Main vs isolated execution #### Main session jobs (system events) Main jobs enqueue a system event and optionally wake the heartbeat runner. They must use `payload.kind = "systemEvent"`. - `wakeMode: "next-heartbeat"` (default): event waits for the next scheduled heartbeat. - `wakeMode: "now"`: event triggers an immediate heartbeat run. This is the best fit when you want the normal heartbeat prompt + main-session context. See [Heartbeat](/gateway/heartbeat). #### Isolated jobs (dedicated cron sessions) Isolated jobs run a dedicated agent turn in session `cron:`. Key behaviors: - Prompt is prefixed with `[cron: ]` for traceability. - Each run starts a \*\*fresh session id\*\* (no prior conversation carry-over). - Default behavior: if `delivery` is omitted, isolated jobs announce a summary (`delivery.mode = "announce"`). - `delivery.mode` (isolated-only) chooses what happens: - `announce`: deliver a summary to the target channel and post a brief summary to the main session. - `none`: internal only (no delivery, no main-session summary). - `wakeMode` controls when the main-session summary posts: - `now`: immediate heartbeat. - `next-heartbeat`: waits for the next scheduled heartbeat. Use isolated jobs for noisy, frequent, or "background chores" that shouldn't spam your main chat history. ### Payload shapes (what runs) Two payload kinds are supported: - `systemEvent`: main-session only, routed through the heartbeat prompt. - `agentTurn`: isolated-session only, runs a dedicated agent turn. Common `agentTurn` fields: - `message`: required text prompt. - `model` / `thinking`: optional overrides (see below). - `timeoutSeconds`: optional timeout override. Delivery config (isolated jobs only): - `delivery.mode`: `none` | `announce`. - `delivery.channel`: `last` or a specific channel. - `delivery.to`: channel-specific target (phone/chat/channel id). - `delivery.bestEffort`: avoid failing the job if announce delivery fails. Announce delivery suppresses messaging tool sends for the run; use `delivery.channel`/`delivery.to` to target the chat instead. When `delivery.mode = "none"`, no summary is posted to the main session. If `delivery` is omitted for isolated jobs, OpenClaw defaults to `announce`. #### Announce delivery flow When `delivery.mode = "announce"`, cron delivers directly via the outbound channel adapters. The main agent is not spun up to craft or forward the message. Behavior details: - Content: delivery uses the isolated run's outbound payloads (text/media) with normal chunking and channel formatting. - Heartbeat-only responses (`HEARTBEAT\_OK` with no real content) are not delivered. - If the isolated run already sent a message to the same target via the message tool, delivery is skipped to avoid duplicates. - Missing or invalid delivery targets fail the job unless `delivery.bestEffort = true`. - A short summary is posted to the main session only when `delivery.mode = "announce"`. - The main-session summary respects `wakeMode`: `now` triggers an immediate heartbeat and `next-heartbeat` waits for the next scheduled heartbeat. ### Model and thinking overrides Isolated jobs (`agentTurn`) can override the model and thinking level: - `model`: Provider/model string (e.g., `anthropic/claude-sonnet-4-20250514`) or alias (e.g., `opus`) - `thinking`: Thinking level (`off`, `minimal`, `low`, `medium`, `high`, `xhigh`; GPT-5.2 + Codex models only) Note: You can set `model` on main-session jobs too, but it changes the shared main session model. We recommend model overrides only for isolated jobs to avoid unexpected context shifts. Resolution priority: 1. Job payload override (highest) 2. Hook-specific defaults (e.g., `hooks.gmail.model`) 3. Agent config default ### Delivery (channel + target) Isolated jobs can deliver output to a channel via the top-level `delivery` config: - `delivery.mode`: `announce` (deliver a summary) or `none`. - `delivery.channel`: `whatsapp` / `telegram` / `discord` / `slack` / `mattermost` (plugin) / `signal` / `imessage` / `last`. - `delivery.to`: channel-specific recipient target. Delivery config is only valid for isolated jobs (`sessionTarget: "isolated"`). If `delivery.channel` or `delivery.to` is omitted, cron can
https://github.com/openclaw/openclaw/blob/main//docs/automation/cron-jobs.md
main
opebclaw
[ -0.04005056992173195, 0.017201125621795654, -0.044584132730960846, 0.015733391046524048, 0.06779041141271591, -0.04367103800177574, -0.03843432292342186, -0.021993761882185936, 0.03967303782701492, -0.07523752748966217, -0.04126539081335068, -0.042811319231987, -0.01499181054532528, -0.0371159128844738, 0.050927385687828064, -0.034009214490652084, 0.057440660893917084, -0.1407124102115631, 0.04421968013048172, -0.058082465082407, -0.023181522265076637, 0.021476440131664276, 0.05813225358724594, 0.05873675271868706, -0.04730165749788284, -0.07124123722314835, 0.0333627425134182, 0.02122144214808941, 0.05287264287471771, 0.02077547088265419, 0.05762685090303421, -0.009286683052778244, -0.001994963502511382, 0.028360238298773766, -0.010045884177088737, 0.10987196862697601, 0.14005142450332642, 0.048491470515728, -0.06663170456886292, 0.019473707303404808, 0.12696592509746552, -0.05882574990391731, 0.0004069968417752534, -0.010915877297520638, 0.039289481937885284, -0.04782082140445709, -0.11180384457111359, -0.019538242369890213, -0.022705629467964172, 0.02129109390079975, 0.02512463368475437, -0.06034841760993004, -0.001978812040761113, 0.0623222291469574, 0.04197046533226967, 0.15487749874591827, 0.031798332929611206, 0.010899700224399567, 0.07085680961608887, -0.097976453602314, -0.07185476273298264, 0.012258371338248253, -0.015546255744993687, 0.024459997192025185, -0.04463774338364601, -0.053010717034339905, -0.062438834458589554, -0.007312208414077759, 0.08918754011392593, -0.016888298094272614, 0.026386305689811707, -0.03637870401144028, -0.052676260471343994, -0.07877574115991592, -0.03001151978969574, 0.03143928572535515, 0.008289813064038754, -0.06832929700613022, -0.11526305228471756, 0.00416190642863512, -0.033932365477085114, -0.05965833738446236, -0.04798014834523201, -0.02313348650932312, -0.032932836562395096, -0.014701864682137966, 0.009413563646376133, 0.008281906135380268, 0.031214850023388863, 0.003573016729205847, 0.05104195699095726, -0.054185789078474045, 0.03257476165890694, 0.008688820526003838, 0.03633103147149086, 0.061462823301553726, -0.0015230956487357616, 0.032382458448410034, 0.022815419360995293, 0.013488322496414185, -0.0018486063927412033, 0.027274668216705322, 0.009640182368457317, 0.07533839344978333, 0.027222422882914543, 0.026463592424988747, -0.07233237475156784, 0.017408503219485283, 0.06777387112379074, -0.05037058889865875, 0.013991601765155792, 0.043329086154699326, 0.11091598123311996, 0.02855060249567032, 0.04876759648323059, 0.12718695402145386, -0.006461906712502241, 0.06758704781532288, 0.03882674127817154, 0.08417786657810211, 0.07516880333423615, -0.05213985592126846, -0.004579494707286358, -0.1363278031349182, 0.07484537363052368, 0.011922991834580898, 0.027023479342460632, 4.979254112787065e-33, 0.020691821351647377, -0.01557924970984459, -0.0008627246716059744, 0.019591892138123512, 0.07581831514835358, -0.009772506542503834, -0.015197561122477055, 0.002254678402096033, -0.03477589040994644, 0.010959298349916935, -0.09828819334506989, 0.012897740118205547, 0.007083802949637175, 0.007045472972095013, -0.07440382987260818, -0.038196392357349396, -0.006385234650224447, -0.014378374442458153, 0.09624174982309341, -0.03808245062828064, -0.005811950657516718, -0.059400733560323715, -0.07643743604421616, 0.05339152738451958, 0.01223211083561182, -0.009716014377772808, 0.03722083941102028, 0.00906212255358696, 0.0024502750020474195, 0.027219081297516823, -0.010949208401143551, 0.052834007889032364, -0.0037256027571856976, 0.049395665526390076, -0.02318626642227173, 0.06544885039329529, -0.09137790650129318, -0.0034092729911208153, -0.06847694516181946, -0.01131779607385397, 0.021522941067814827, -0.017930898815393448, -0.09108990430831909, -0.075454480946064, 0.008489473722875118, -0.10533420741558075, -0.049246449023485184, -0.000928761379327625, 0.12342754751443863, 0.01756642572581768, -0.025699133053421974, 0.045410238206386566, 0.09772905707359314, -0.060381073504686356, 0.019535614177584648, -0.005541131366044283, 0.03256649151444435, -0.001558923628181219, 0.02564077265560627, 0.0065212612971663475, 0.017588719725608826, -0.01585649885237217, -0.020241301506757736, 0.03277834132313728, 0.05589168891310692, 0.05681435018777847, -0.057236433029174805, -0.1074916422367096, 0.02016020379960537, 0.03843339905142784, 0.015721382573246956, 0.07999040186405182, -0.055191196501255035, 0.0016986372647807002, 0.03483319282531738, -0.013277395628392696, 0.021238911896944046, 0.01141674816608429, -0.029134301468729973, -0.011768104508519173, 0.051053985953330994, 0.07423977553844452, -0.03052549622952938, 0.05232074856758118, 0.05563369393348694, -0.001160669606178999, -0.012259664945304394, -0.001023589400574565, -0.071098193526268, 0.04049498960375786, -0.016877079382538795, 0.002972530433908105, 0.05681127309799194, 0.09590048342943192, -0.09361985325813293, -5.3943494533952315e-33, 0.005282321013510227, 0.002062250394374132, -0.07789666950702667, 0.004889841191470623, -0.05315332114696503, 0.04100523144006729, 0.07019895315170288, -0.008751384913921356, 0.02427305094897747, -0.01592833362519741, 0.02876404859125614, 0.019666330888867378, 0.01622457057237625, 0.005773085635155439, 0.023391645401716232, -0.004921189974993467, 0.0563637837767601, -0.06873035430908203, -0.05319913104176521, 0.06834465265274048, 0.0001292274973820895, 0.008734794333577156, -0.14050988852977753, -0.022492172196507454, 0.06154831871390343, 0.020321300253272057, -0.05060920864343643, 0.04239901900291443, -0.0435013584792614, -0.05988796055316925, -0.032819200307130814, -0.01346943061798811, -0.03134516626596451, 0.05638129264116287, -0.038846585899591446, -0.01913682371377945, -0.047977134585380554, 0.07335460931062698, 0.011342111974954605, 0.028952162712812424, 0.11336611211299896, 0.024316342547535896, -0.03741045668721199, -0.02826370671391487, -0.05170382186770439, 0.07794125378131866, -0.023140843957662582, 0.01800544001162052, -0.11264482140541077, 0.01984604261815548, -0.0809631496667862, -0.02098521776497364, 0.011983703821897507, 0.09693367779254913, 0.02423599548637867, 0.021647151559591293, 0.027460269629955292, 0.03531050309538841, -0.041633572429418564, -0.10407885909080505, 0.033931005746126175, -0.05973894149065018, -0.02742958255112171, 0.0017221979796886444, 0.019408617168664932, -0.032770659774541855, -0.0064208474941551685, 0.005061321426182985, 0.07133080810308456, -0.04925993084907532, 0.019811229780316353, 0.0390896275639534, -0.03953956440091133, 0.031088443472981453, -0.04156475514173508, 0.038108132779598236, -0.049458228051662445, -0.13329462707042694, -0.10450582951307297, 0.012258623726665974, -0.06062576547265053, -0.04187719151377678, 0.014911787584424019, -0.020401986315846443, -0.05710190162062645, 0.012500038370490074, 0.021814821287989616, 0.03494822233915329, 0.08016584813594818, 0.0216849222779274, 0.015798531472682953, 0.008478122763335705, -0.06610996276140213, 0.011780867353081703, 0.005414504092186689, -5.726522900317832e-8, 0.003831008682027459, -0.06197434663772583, 0.0019475908484309912, 0.024769751355051994, -0.020474735647439957, -0.06497396528720856, 0.09466203302145004, -0.12635411322116852, -0.04052536562085152, 0.0926833376288414, -0.03693069890141487, -0.07024004310369492, 0.04439902678132057, 0.017415450885891914, 0.007720172870904207, 0.0573195144534111, -0.008423401042819023, 0.025240957736968994, -0.02397632971405983, -0.09617869555950165, 0.00321810320019722, -0.019674716517329216, 0.007920857518911362, 0.030233805999159813, 0.010056794621050358, 0.021048273891210556, 0.012365818955004215, 0.01207032985985279, -0.035065796226263046, -0.005535506177693605, -0.07245524227619171, -0.01808207854628563, -0.02384905330836773, 0.023314880207180977, -0.13009525835514069, 0.08447331935167313, 0.02578473649919033, -0.02574935369193554, -0.006293260958045721, -0.008487160317599773, 0.048176005482673645, -0.05922143906354904, -0.05782248079776764, -0.056939683854579926, -0.022582828998565674, -0.05763512849807739, -0.025374215096235275, 0.030505254864692688, -0.00009901579323923215, 0.02279924415051937, 0.026669813320040703, -0.023853275924921036, 0.07953204959630966, -0.03028043359518051, 0.10339205712080002, -0.011384449899196625, 0.04630684480071068, -0.10000315308570862, 0.02121804840862751, -0.009160036221146584, 0.026527071371674538, 0.042682088911533356, -0.011488905176520348, -0.10072313249111176 ]
0.097829
config: - `delivery.mode`: `announce` (deliver a summary) or `none`. - `delivery.channel`: `whatsapp` / `telegram` / `discord` / `slack` / `mattermost` (plugin) / `signal` / `imessage` / `last`. - `delivery.to`: channel-specific recipient target. Delivery config is only valid for isolated jobs (`sessionTarget: "isolated"`). If `delivery.channel` or `delivery.to` is omitted, cron can fall back to the main session’s “last route” (the last place the agent replied). Target format reminders: - Slack/Discord/Mattermost (plugin) targets should use explicit prefixes (e.g. `channel:`, `user:`) to avoid ambiguity. - Telegram topics should use the `:topic:` form (see below). #### Telegram delivery targets (topics / forum threads) Telegram supports forum topics via `message\_thread\_id`. For cron delivery, you can encode the topic/thread into the `to` field: - `-1001234567890` (chat id only) - `-1001234567890:topic:123` (preferred: explicit topic marker) - `-1001234567890:123` (shorthand: numeric suffix) Prefixed targets like `telegram:...` / `telegram:group:...` are also accepted: - `telegram:group:-1001234567890:topic:123` ## JSON schema for tool calls Use these shapes when calling Gateway `cron.\*` tools directly (agent tool calls or RPC). CLI flags accept human durations like `20m`, but tool calls should use an ISO 8601 string for `schedule.at` and milliseconds for `schedule.everyMs`. ### cron.add params One-shot, main session job (system event): ```json { "name": "Reminder", "schedule": { "kind": "at", "at": "2026-02-01T16:00:00Z" }, "sessionTarget": "main", "wakeMode": "now", "payload": { "kind": "systemEvent", "text": "Reminder text" }, "deleteAfterRun": true } ``` Recurring, isolated job with delivery: ```json { "name": "Morning brief", "schedule": { "kind": "cron", "expr": "0 7 \* \* \*", "tz": "America/Los\_Angeles" }, "sessionTarget": "isolated", "wakeMode": "next-heartbeat", "payload": { "kind": "agentTurn", "message": "Summarize overnight updates." }, "delivery": { "mode": "announce", "channel": "slack", "to": "channel:C1234567890", "bestEffort": true } } ``` Notes: - `schedule.kind`: `at` (`at`), `every` (`everyMs`), or `cron` (`expr`, optional `tz`). - `schedule.at` accepts ISO 8601 (timezone optional; treated as UTC when omitted). - `everyMs` is milliseconds. - `sessionTarget` must be `"main"` or `"isolated"` and must match `payload.kind`. - Optional fields: `agentId`, `description`, `enabled`, `deleteAfterRun` (defaults to true for `at`), `delivery`. - `wakeMode` defaults to `"next-heartbeat"` when omitted. ### cron.update params ```json { "jobId": "job-123", "patch": { "enabled": false, "schedule": { "kind": "every", "everyMs": 3600000 } } } ``` Notes: - `jobId` is canonical; `id` is accepted for compatibility. - Use `agentId: null` in the patch to clear an agent binding. ### cron.run and cron.remove params ```json { "jobId": "job-123", "mode": "force" } ``` ```json { "jobId": "job-123" } ``` ## Storage & history - Job store: `~/.openclaw/cron/jobs.json` (Gateway-managed JSON). - Run history: `~/.openclaw/cron/runs/.jsonl` (JSONL, auto-pruned). - Override store path: `cron.store` in config. ## Configuration ```json5 { cron: { enabled: true, // default true store: "~/.openclaw/cron/jobs.json", maxConcurrentRuns: 1, // default 1 }, } ``` Disable cron entirely: - `cron.enabled: false` (config) - `OPENCLAW\_SKIP\_CRON=1` (env) ## CLI quickstart One-shot reminder (UTC ISO, auto-delete after success): ```bash openclaw cron add \ --name "Send reminder" \ --at "2026-01-12T18:00:00Z" \ --session main \ --system-event "Reminder: submit expense report." \ --wake now \ --delete-after-run ``` One-shot reminder (main session, wake immediately): ```bash openclaw cron add \ --name "Calendar check" \ --at "20m" \ --session main \ --system-event "Next heartbeat: check calendar." \ --wake now ``` Recurring isolated job (announce to WhatsApp): ```bash openclaw cron add \ --name "Morning status" \ --cron "0 7 \* \* \*" \ --tz "America/Los\_Angeles" \ --session isolated \ --message "Summarize inbox + calendar for today." \ --announce \ --channel whatsapp \ --to "+15551234567" ``` Recurring isolated job (deliver to a Telegram topic): ```bash openclaw cron add \ --name "Nightly summary (topic)" \ --cron "0 22 \* \* \*" \ --tz "America/Los\_Angeles" \ --session isolated \ --message "Summarize today; send to the nightly topic." \ --announce \ --channel telegram
https://github.com/openclaw/openclaw/blob/main//docs/automation/cron-jobs.md
main
opebclaw
[ -0.021576542407274246, -0.057315170764923096, -0.009943985380232334, -0.007890489883720875, 0.017809057608246803, -0.020865580067038536, 0.08638085424900055, 0.028348509222269058, -0.0007709380006417632, 0.08124446123838425, 0.002522667171433568, -0.050692420452833176, -0.005594640504568815, 0.10243242233991623, 0.0774831473827362, -0.012577122077345848, 0.002054989105090499, -0.1657543182373047, -0.04885561019182205, -0.014395340345799923, 0.056960783898830414, 0.07733074575662613, 0.04076825827360153, 0.08765245229005814, -0.015299689956009388, -0.12396986037492752, -0.01747572422027588, 0.03471026569604874, -0.012392428703606129, 0.01686723530292511, 0.04686255380511284, 0.035142477601766586, -0.047309376299381256, 0.03054959885776043, 0.024160457774996758, 0.12134815752506256, 0.038477033376693726, -0.011161799542605877, 0.09200246632099152, 0.04242565110325813, 0.010594960302114487, -0.049032509326934814, -0.08397853374481201, -0.011309003457427025, 0.1013164296746254, -0.08109130710363388, -0.00313399126753211, 0.023466268554329872, -0.016594989225268364, 0.04369621351361275, 0.05214160680770874, -0.03879263624548912, -0.03996530920267105, 0.13772368431091309, 0.049934081733226776, 0.12120316177606583, -0.06786239892244339, 0.09931007772684097, 0.08809080719947815, -0.08616200089454651, -0.07137377560138702, -0.05521690472960472, -0.017120856791734695, -0.05092824622988701, -0.09253038465976715, -0.014727438800036907, -0.054325543344020844, 0.018925463780760765, -0.03315688669681549, 0.010166643187403679, 0.005840235855430365, -0.02984444610774517, -0.06581593304872513, -0.04906182363629341, 0.03699241951107979, -0.02513027936220169, 0.05960095673799515, 0.01318170316517353, -0.15583956241607666, -0.048718929290771484, -0.01319124922156334, -0.05174907296895981, -0.010538212023675442, -0.014957364648580551, -0.03608854487538338, -0.015873858705163002, 0.04326338320970535, -0.017906026914715767, 0.023203197866678238, -0.019613545387983322, 0.03524744138121605, -0.03312354534864426, -0.018704326823353767, 0.044577594846487045, -0.01882859133183956, 0.028008177876472473, -0.036052267998456955, 0.038634661585092545, -0.033898964524269104, 0.05364380031824112, 0.04901609197258949, -0.010630223900079727, -0.024258054792881012, -0.010767072439193726, 0.0625426173210144, 0.016818208619952202, -0.03025098145008087, 0.02945435792207718, 0.031073443591594696, -0.026127681136131287, -0.0816018283367157, 0.04223715513944626, 0.04116908460855484, 0.025360779836773872, 0.05223569646477699, 0.08002130687236786, -0.010932249017059803, 0.08828795701265335, 0.03906499594449997, 0.013375288806855679, 0.08906951546669006, -0.06133943423628807, 0.001123006222769618, 0.02999277226626873, -0.030088379979133606, 0.06917290389537811, 0.09886101633310318, 2.517959592655219e-33, 0.01353449746966362, -0.0038084338884800673, -0.0713067352771759, 0.05745755881071091, -0.022013572975993156, -0.0062378509901463985, -0.07448162138462067, 0.03931894525885582, 0.01841019280254841, -0.053301867097616196, -0.1018843874335289, -0.026024598628282547, -0.019512105733156204, 0.03894359618425369, -0.07449401170015335, -0.05097205191850662, 0.011340046301484108, 0.008140676654875278, 0.013630984351038933, 0.022127589210867882, -0.021221566945314407, 0.021452760323882103, -0.0980583056807518, 0.001498896861448884, 0.04973592981696129, 0.03508463501930237, 0.05650540813803673, -0.015823597088456154, -0.005733986850827932, -0.01765403337776661, -0.006003420799970627, 0.06518809497356415, 0.08452022075653076, 0.0663333535194397, -0.017150647938251495, 0.004038163460791111, -0.09788136184215546, 0.006568692624568939, -0.06663193553686142, -0.021661078557372093, 0.020284084603190422, 0.02631331980228424, -0.06331364810466766, -0.08562485128641129, 0.041364848613739014, -0.04430965334177017, 0.036608897149562836, -0.020999666303396225, 0.09368796646595001, -0.021770711988210678, -0.010683553293347359, 0.001988766947761178, 0.06671112775802612, 0.014266790822148323, 0.04407135024666786, -0.0707477480173111, -0.013464706018567085, -0.09374977648258209, 0.012080483138561249, -0.04209986701607704, 0.012329616583883762, -0.0793629139661789, -0.0030991665553301573, 0.0014586095931008458, 0.03917906805872917, 0.010886214673519135, -0.09172855317592621, 0.03403191640973091, 0.059015993028879166, 0.006125920917838812, -0.07485395669937134, 0.07854542881250381, -0.06420834362506866, 0.03604264184832573, -0.015215640887618065, -0.06514906138181686, -0.016507096588611603, 0.01760602742433548, -0.035185813903808594, 0.011063577607274055, 0.006283868569880724, 0.08325960487127304, -0.016793813556432724, -0.017471520230174065, 0.04101628065109253, 0.00016532719018869102, 0.05211466923356056, -0.06212474778294563, -0.013830827549099922, 0.04913143441081047, -0.061052046716213226, 0.07341879606246948, -0.035226624459028244, 0.07083897292613983, -0.03719267621636391, -2.7746609265809208e-33, -0.009237674996256828, 0.04593299329280853, -0.09183903783559799, 0.021665234118700027, -0.029932981356978416, 0.008086410351097584, 0.07094437628984451, -0.03182877227663994, 0.076778843998909, 0.009408701211214066, -0.06938006728887558, -0.03641239181160927, 0.0006603460642509162, -0.05839095637202263, -0.03905058652162552, -0.00007453655416611582, -0.009515863843262196, -0.04704291746020317, -0.05374322086572647, -0.013849373906850815, -0.024840639904141426, -0.012719683349132538, -0.07583228498697281, -0.01664946973323822, 0.10192643851041794, -0.0054734996519982815, 0.04441393166780472, 0.06208542734384537, 0.0060950047336518764, -0.10183602571487427, -0.000226423580897972, -0.07080265134572983, -0.005464487709105015, 0.023672176524996758, 0.004274444188922644, 0.004234931897372007, -0.007771856617182493, 0.12954242527484894, 0.035717353224754333, -0.008487788029015064, 0.1345474272966385, 0.01389238703995943, -0.05563230440020561, 0.04073790833353996, -0.0618831031024456, 0.07009651511907578, -0.009277919307351112, 0.027748988941311836, -0.14187277853488922, 0.06570927798748016, 0.014403635635972023, -0.06903277337551117, 0.029406525194644928, 0.00524236960336566, 0.04446631669998169, 0.014425993897020817, 0.0011485909344628453, 0.004882092121988535, -0.00942499004304409, -0.052439529448747635, 0.027884848415851593, -0.05104530230164528, 0.06472893804311752, -0.044015996158123016, 0.061884187161922455, -0.10089010745286942, -0.007111892569810152, 0.009839924052357674, 0.03255655989050865, 0.01773194596171379, 0.047082267701625824, -0.06423375755548477, -0.021364768967032433, -0.025344420224428177, 0.04871209338307381, -0.028533106669783592, -0.08617594093084335, -0.10705495625734329, -0.05264952778816223, 0.05304068326950073, -0.045905180275440216, 0.04215933009982109, -0.01937929354608059, 0.04296578839421272, -0.061498694121837616, 0.053319644182920456, 0.05994514375925064, 0.0576494075357914, 0.021855272352695465, -0.010928556323051453, 0.01429011207073927, -0.009451380930840969, 0.05714491382241249, 0.02063230238854885, 0.0021285447292029858, -5.329155072786307e-8, -0.006007625255733728, -0.0398116260766983, -0.06618312746286392, 0.002823438961058855, -0.003451834199950099, -0.0102847283706069, 0.04875833913683891, -0.08170042186975479, 0.01314479485154152, 0.01601305417716503, -0.0706644356250763, -0.017455272376537323, -0.03435489907860756, 0.03639059141278267, -0.03378648683428764, -0.022222476080060005, -0.054530076682567596, -0.02425030991435051, -0.020510612055659294, -0.05345524474978447, -0.0012924611801281571, 0.0021314669866114855, -0.05519596114754677, 0.046400148421525955, 0.04740840569138527, -0.014899966306984425, -0.00004847768650506623, 0.09026745706796646, -0.0361994244158268, 0.022848322987556458, 0.0037357632536441088, -0.07319086790084839, 0.009582653641700745, -0.026668159291148186, -0.11137900501489639, 0.11248642206192017, -0.014120470732450485, -0.0005347339902073145, 0.016915449872612953, 0.06473512202501297, 0.08735976368188858, -0.049687668681144714, 0.025514699518680573, -0.04623127728700638, -0.019214607775211334, -0.06717120856046677, -0.03944707661867142, -0.016015609726309776, 0.011938300915062428, 0.019122429192066193, -0.014904279261827469, -0.028099002316594124, 0.052558235824108124, 0.002574183512479067, 0.060969073325395584, -0.03376426547765732, 0.06729952991008759, -0.0849703699350357, 0.0882551446557045, 0.005318511743098497, -0.00428861565887928, 0.037466298788785934, -0.032169099897146225, -0.0281254630535841 ]
0.087347
--channel whatsapp \ --to "+15551234567" ``` Recurring isolated job (deliver to a Telegram topic): ```bash openclaw cron add \ --name "Nightly summary (topic)" \ --cron "0 22 \* \* \*" \ --tz "America/Los\_Angeles" \ --session isolated \ --message "Summarize today; send to the nightly topic." \ --announce \ --channel telegram \ --to "-1001234567890:topic:123" ``` Isolated job with model and thinking override: ```bash openclaw cron add \ --name "Deep analysis" \ --cron "0 6 \* \* 1" \ --tz "America/Los\_Angeles" \ --session isolated \ --message "Weekly deep analysis of project progress." \ --model "opus" \ --thinking high \ --announce \ --channel whatsapp \ --to "+15551234567" ``` Agent selection (multi-agent setups): ```bash # Pin a job to agent "ops" (falls back to default if that agent is missing) openclaw cron add --name "Ops sweep" --cron "0 6 \* \* \*" --session isolated --message "Check ops queue" --agent ops # Switch or clear the agent on an existing job openclaw cron edit --agent ops openclaw cron edit --clear-agent ``` Manual run (debug): ```bash openclaw cron run --force ``` Edit an existing job (patch fields): ```bash openclaw cron edit \ --message "Updated prompt" \ --model "opus" \ --thinking low ``` Run history: ```bash openclaw cron runs --id --limit 50 ``` Immediate system event without creating a job: ```bash openclaw system event --mode now --text "Next heartbeat: check battery." ``` ## Gateway API surface - `cron.list`, `cron.status`, `cron.add`, `cron.update`, `cron.remove` - `cron.run` (force or due), `cron.runs` For immediate system events without a job, use [`openclaw system event`](/cli/system). ## Troubleshooting ### “Nothing runs” - Check cron is enabled: `cron.enabled` and `OPENCLAW\_SKIP\_CRON`. - Check the Gateway is running continuously (cron runs inside the Gateway process). - For `cron` schedules: confirm timezone (`--tz`) vs the host timezone. ### Telegram delivers to the wrong place - For forum topics, use `-100…:topic:` so it’s explicit and unambiguous. - If you see `telegram:...` prefixes in logs or stored “last route” targets, that’s normal; cron delivery accepts them and still parses topic IDs correctly.
https://github.com/openclaw/openclaw/blob/main//docs/automation/cron-jobs.md
main
opebclaw
[ -0.026423294097185135, -0.04546390846371651, -0.038852352648973465, -0.03611496463418007, -0.003870065324008465, -0.002274203347042203, 0.07054253667593002, 0.007935483008623123, 0.06458999961614609, 0.04066409915685654, 0.00946749933063984, -0.06647641956806183, -0.02269737422466278, 0.08809779584407806, 0.04258564114570618, 0.0012481738813221455, 0.006449011154472828, -0.19171589612960815, -0.07058936357498169, -0.03563818708062172, 0.024313826113939285, 0.06532273441553116, 0.03735175356268883, 0.03508568927645683, -0.017572946846485138, -0.02950931526720524, -0.02500513382256031, 0.010945809073746204, -0.034184858202934265, 0.042974043637514114, 0.037543319165706635, 0.07999541610479355, -0.017484106123447418, 0.04234861582517624, 0.09072724729776382, 0.12472765147686005, -0.02243032492697239, 0.01874690316617489, 0.0647377297282219, 0.06696006655693054, -0.005918215960264206, -0.05334499105811119, -0.08169965445995331, -0.05525596812367439, 0.0028649773448705673, -0.13414666056632996, -0.05850454047322273, -0.011663234792649746, -0.007974107749760151, -0.00838786456733942, -0.04680216684937477, -0.034625109285116196, -0.007989023812115192, 0.10018014162778854, 0.04239388927817345, 0.06877852231264114, -0.07961104810237885, 0.08347869664430618, 0.06337307393550873, -0.09591096639633179, -0.06104443967342377, 0.009631034918129444, -0.04375237226486206, -0.00949589628726244, -0.050240613520145416, -0.021902618929743767, -0.1065596416592598, 0.06581258028745651, -0.04004956781864166, 0.052728064358234406, -0.008643328212201595, -0.016138261184096336, -0.06414587050676346, -0.059081461280584335, 0.020202182233333588, -0.008775127120316029, 0.016214720904827118, -0.0033505826722830534, -0.09426574409008026, -0.08061251044273376, 0.004983879625797272, -0.09151256829500198, -0.09250424057245255, -0.030969534069299698, -0.032985586673021317, 0.04013998433947563, 0.020927414298057556, 0.012622234411537647, 0.057232290506362915, -0.02886236272752285, -0.04602411016821861, -0.0557996891438961, 0.032404910773038864, 0.03717586770653725, 0.022148657590150833, 0.03686488792300224, -0.04616278409957886, 0.021698910742998123, -0.022513611242175102, 0.07809587568044662, 0.05129890888929367, -0.018569262698292732, -0.01494416780769825, -0.03832041844725609, -0.012397311627864838, 0.020982053130865097, 0.03432777523994446, 0.05694050341844559, 0.024509349837899208, -0.05015147104859352, -0.05779169127345085, 0.0727858766913414, 0.05640160292387009, -0.03262986242771149, 0.06538838148117065, 0.07638687640428543, 0.03607367351651192, 0.0555751733481884, -0.007943501695990562, 0.05360482260584831, 0.17436304688453674, -0.06747373193502426, -0.004317030310630798, 0.03163551539182663, -0.017740579321980476, 0.029216943308711052, 0.08201047033071518, 5.155882608244676e-34, 0.054739810526371, 0.017504055052995682, -0.03509596735239029, 0.030912866815924644, 0.05786845460534096, 0.0353693850338459, -0.04223276302218437, 0.06430569291114807, -0.02469838783144951, -0.017107253894209862, -0.0697777271270752, -0.011933543719351292, -0.042859677225351334, 0.04310574382543564, -0.06086297333240509, -0.032269805669784546, 0.0006596703897230327, 0.05132440850138664, 0.043044500052928925, -0.001528064371086657, 0.030450934544205666, 0.020349664613604546, -0.08338989317417145, -0.0070085227489471436, 0.035911042243242264, 0.015747856348752975, 0.08360448479652405, -0.06705581396818161, -0.027826089411973953, 0.01924600638449192, -0.011471277102828026, 0.05662297084927559, 0.023410318419337273, 0.05581716448068619, -0.0032088295556604862, 0.022054437547922134, -0.1409553587436676, -0.014019064605236053, 0.014009744860231876, -0.028023844584822655, 0.014918630011379719, -0.014560475945472717, -0.06217145919799805, -0.06492096185684204, 0.09762391448020935, -0.05040738731622696, 0.008342204615473747, -0.001610632287338376, -0.027859333902597427, 0.011078509502112865, 0.025950200855731964, 0.01622290536761284, 0.026327889412641525, -0.027620865032076836, -0.020305242389440536, -0.01975793018937111, 0.015201698988676071, -0.039799515157938004, 0.04989943653345108, 0.03357498720288277, -0.03175603970885277, 0.015163284726440907, -0.018174555152654648, 0.023767830803990364, 0.046717334538698196, 0.0025208673905581236, -0.04547968879342079, 0.0672350600361824, 0.030307026579976082, 0.031425684690475464, -0.054902467876672745, 0.08497201651334763, 0.019029127433896065, -0.0006773538189008832, -0.025703562423586845, -0.06751246750354767, 0.0030651206616312265, 0.02323349192738533, -0.01423037052154541, 0.012180713936686516, 0.04703795164823532, 0.04336388036608696, -0.018534159287810326, -0.035912442952394485, 0.042402539402246475, 0.047220222651958466, 0.04705461487174034, -0.049933597445487976, -0.07631826400756836, 0.10017374902963638, -0.03951618820428848, 0.05689498782157898, -0.04032602906227112, -0.008888800628483295, -0.008758515119552612, -2.429770516707677e-33, 0.00588234793394804, 0.009996745735406876, -0.06813088059425354, -0.01677824929356575, 0.03897286579012871, -0.05115471035242081, 0.006215189583599567, -0.012620029039680958, 0.011717966757714748, -0.0014283921336755157, -0.027883216738700867, -0.03319798409938812, -0.037346795201301575, -0.05751773715019226, 0.017463836818933487, -0.04477150738239288, -0.0011087084421887994, -0.0580587275326252, -0.07031317055225372, 0.031000623479485512, 0.005818319972604513, 0.06281588226556778, -0.09858499467372894, 0.06253919750452042, 0.07456009089946747, -0.02946394495666027, 0.028195345774292946, 0.10405820608139038, 0.05151579901576042, -0.03513256832957268, -0.05300140008330345, -0.07600163668394089, -0.06553129106760025, 0.028175706043839455, -0.007853113114833832, 0.0330028310418129, 0.01176184881478548, 0.07386166602373123, 0.029742112383246422, 0.023165620863437653, 0.08088158816099167, -0.04216189309954643, -0.07968036830425262, -0.026349682360887527, -0.0631469339132309, 0.054990045726299286, -0.03926677256822586, 0.0030937017872929573, -0.1402425616979599, 0.04981350526213646, 0.0036241004709154367, -0.05017222464084625, -0.02388135902583599, 0.020229438319802284, 0.03981413319706917, -0.008543964475393295, 0.026744429022073746, -0.04038611799478531, -0.08601398020982742, -0.07614336907863617, 0.04057083651423454, -0.022181451320648193, 0.056117091327905655, -0.026536783203482628, 0.0775466114282608, -0.14184272289276123, 0.016492292284965515, -0.005444375332444906, 0.014314305037260056, -0.04182789847254753, 0.05045397952198982, -0.0458192452788353, -0.049913834780454636, -0.009391065686941147, 0.06479325145483017, 0.005728682037442923, -0.09052163362503052, -0.10992272198200226, 0.0174928680062294, 0.09589274227619171, -0.10689544677734375, 0.025771133601665497, 0.008208505809307098, 0.010992624796926975, 0.007045000325888395, 0.0525643415749073, 0.0005404698313213885, 0.09230474382638931, -0.01398903876543045, 0.0051963175646960735, -0.03277872875332832, 0.00444054277613759, 0.04721946269273758, 0.0033568418584764004, 0.017428580671548843, -5.1601396933165233e-8, -0.0313219353556633, -0.05067380890250206, -0.001853741123341024, 0.030884411185979843, -0.018821710720658302, -0.11016663163900375, -0.0024401319678872824, -0.06881088018417358, 0.048626672476530075, -0.03674236685037613, 0.007739256601780653, -0.07740993797779083, -0.020810654386878014, 0.05271090194582939, -0.03647816553711891, -0.031916096806526184, -0.05460553243756294, -0.04787934944033623, -0.02553935907781124, -0.10428839176893234, 0.04486103355884552, 0.03716326504945755, -0.014003701508045197, 0.044390786439180374, 0.0014794411836192012, -0.03137505054473877, -0.027226952835917473, 0.1227303296327591, -0.0653768926858902, 0.05059629678726196, 0.029230760410428047, -0.09240985661745071, -0.06564853340387344, -0.015923449769616127, -0.08122683316469193, 0.03772890567779541, 0.04459398239850998, -0.04279656335711479, -0.01928763836622238, 0.007591927889734507, 0.09072504937648773, -0.015955612063407898, -0.0055820937268435955, 0.003050968749448657, 0.025836467742919922, -0.0668998435139656, -0.021679356694221497, -0.05935705080628395, 0.0541614294052124, -0.029673157259821892, -0.013012304902076721, -0.014169219881296158, 0.054048046469688416, 0.013704441487789154, 0.06854050606489182, 0.023695511743426323, 0.1002599373459816, -0.04570741206407547, 0.04325122386217117, 0.04866399988532066, 0.02787753939628601, 0.036638058722019196, -0.07240132242441177, 0.025529960170388222 ]
0.05159
# Polls ## Supported channels - WhatsApp (web channel) - Discord - MS Teams (Adaptive Cards) ## CLI ```bash # WhatsApp openclaw message poll --target +15555550123 \ --poll-question "Lunch today?" --poll-option "Yes" --poll-option "No" --poll-option "Maybe" openclaw message poll --target 123456789@g.us \ --poll-question "Meeting time?" --poll-option "10am" --poll-option "2pm" --poll-option "4pm" --poll-multi # Discord openclaw message poll --channel discord --target channel:123456789 \ --poll-question "Snack?" --poll-option "Pizza" --poll-option "Sushi" openclaw message poll --channel discord --target channel:123456789 \ --poll-question "Plan?" --poll-option "A" --poll-option "B" --poll-duration-hours 48 # MS Teams openclaw message poll --channel msteams --target conversation:19:abc@thread.tacv2 \ --poll-question "Lunch?" --poll-option "Pizza" --poll-option "Sushi" ``` Options: - `--channel`: `whatsapp` (default), `discord`, or `msteams` - `--poll-multi`: allow selecting multiple options - `--poll-duration-hours`: Discord-only (defaults to 24 when omitted) ## Gateway RPC Method: `poll` Params: - `to` (string, required) - `question` (string, required) - `options` (string[], required) - `maxSelections` (number, optional) - `durationHours` (number, optional) - `channel` (string, optional, default: `whatsapp`) - `idempotencyKey` (string, required) ## Channel differences - WhatsApp: 2-12 options, `maxSelections` must be within option count, ignores `durationHours`. - Discord: 2-10 options, `durationHours` clamped to 1-768 hours (default 24). `maxSelections > 1` enables multi-select; Discord does not support a strict selection count. - MS Teams: Adaptive Card polls (OpenClaw-managed). No native poll API; `durationHours` is ignored. ## Agent tool (Message) Use the `message` tool with `poll` action (`to`, `pollQuestion`, `pollOption`, optional `pollMulti`, `pollDurationHours`, `channel`). Note: Discord has no “pick exactly N” mode; `pollMulti` maps to multi-select. Teams polls are rendered as Adaptive Cards and require the gateway to stay online to record votes in `~/.openclaw/msteams-polls.json`.
https://github.com/openclaw/openclaw/blob/main//docs/automation/poll.md
main
opebclaw
[ -0.0035454113967716694, -0.04101027548313141, 0.01180607546120882, 0.0714617595076561, 0.04698072373867035, 0.026174167171120644, 0.08409719914197922, -0.07521643489599228, 0.03396306559443474, -0.03129907324910164, -0.009869687259197235, -0.06336891651153564, -0.037449680268764496, 0.01635936088860035, 0.11394643038511276, -0.013161029666662216, 0.07883404940366745, -0.16973641514778137, -0.0583583228290081, 0.02684113010764122, 0.0019788045901805162, 0.002909107366576791, 0.04069085419178009, -0.015362565405666828, 0.035649530589580536, -0.05601263791322708, -0.005332239903509617, 0.05434132367372513, -0.03220532089471817, -0.03651953488588333, 0.011991084553301334, 0.07571278512477875, 0.01277356781065464, 0.014130013063549995, 0.05852509289979935, -0.07910149544477463, 0.04685366526246071, -0.018556246533989906, 0.0283244289457798, 0.07310657948255539, -0.032314740121364594, -0.08744954317808151, -0.027825523167848587, -0.005529419984668493, -0.030636999756097794, -0.040545038878917694, -0.07758401334285736, -0.06316254287958145, -0.02634251117706299, 0.06849364191293716, -0.058094434440135956, -0.014854797162115574, -0.0013391406973823905, 0.013371504843235016, 0.10999590903520584, 0.024468673393130302, -0.13512484729290009, 0.02924673818051815, 0.04384851083159447, 0.01050498802214861, -0.06648053973913193, -0.056913819164037704, -0.08057937026023865, 0.04593754559755325, -0.10366819053888321, 0.03544321283698082, -0.07666178047657013, 0.03375460207462311, 0.0245323795825243, 0.010664129629731178, -0.08483608812093735, 0.029728686437010765, -0.025994466617703438, -0.0172866377979517, 0.004329108167439699, 0.03707434982061386, -0.022437911480665207, -0.015437604859471321, -0.03563738241791725, -0.06021406874060631, -0.10547362267971039, -0.060697607696056366, -0.08821525424718857, 0.03767344728112221, 0.0897826999425888, 0.02030566893517971, -0.007695100735872984, 0.048134319484233856, -0.052108682692050934, -0.06467282772064209, -0.09032036364078522, 0.021885497495532036, -0.023531898856163025, 0.04501739889383316, -0.011701531708240509, 0.0300951786339283, -0.04132934287190437, -0.04808416590094566, 0.0017011510208249092, 0.05753361061215401, 0.012678301893174648, 0.015806537121534348, -0.053514834493398666, -0.025959627702832222, -0.025472503155469894, -0.015647785738110542, -0.047973357141017914, 0.06432519853115082, 0.04709063097834587, 0.04132682457566261, -0.07018880546092987, 0.003082767128944397, 0.09184499830007553, -0.07809613645076752, -0.014947538264095783, -0.02337448112666607, 0.014359934255480766, 0.0208384208381176, 0.07796908915042877, 0.07240927219390869, 0.08728975802659988, -0.0070932768285274506, -0.06850963830947876, -0.04589786380529404, 0.04076460003852844, 0.0008468020823784173, 0.0042699966579675674, 3.4360926796764135e-33, 0.05926845595240593, -0.03887166827917099, 0.00187779706902802, 0.05207732319831848, 0.09816946089267731, 0.06894087046384811, -0.02757098712027073, -0.004111213609576225, -0.04540516808629036, 0.022477947175502777, -0.015291696414351463, 0.040534403175115585, -0.021740427240729332, 0.027802785858511925, 0.0660821720957756, -0.016351133584976196, -0.029213828966021538, 0.07876516133546829, -0.05084962770342827, -0.07489956170320511, 0.006897266022861004, 0.07597903162240982, -0.0020035577472299337, 0.00014101166743785143, 0.06611564755439758, 0.00517708994448185, 0.05475914850831032, -0.03362428396940231, 0.025174573063850403, 0.03296330198645592, -0.03358045592904091, -0.047661084681749344, -0.05577589198946953, -0.02610485628247261, 0.003994263708591461, -0.01233822200447321, -0.10539253056049347, -0.005806943867355585, -0.06956438720226288, 0.005161487963050604, -0.002612908137962222, -0.006305145565420389, -0.10348625481128693, 0.02414650470018387, -0.004558877553790808, 0.012467656284570694, 0.01941865123808384, -0.018122969195246696, 0.020743509754538536, -0.021804606541991234, -0.007741695269942284, -0.025340788066387177, -0.022008974105119705, 0.021815428510308266, -0.007069104351103306, -0.04417531192302704, -0.0019397319993004203, 0.000995944137685001, -0.05997946113348007, -0.004787006881088018, -0.017853735014796257, 0.07753679901361465, 0.008486036211252213, -0.09523151814937592, 0.0430837981402874, 0.0517299622297287, -0.04227779433131218, -0.049608439207077026, 0.014572812244296074, -0.016326751559972763, 0.06781414151191711, 0.02551053836941719, -0.008593629114329815, 0.05327795073390007, -0.06262508034706116, -0.03504372388124466, -0.05025673657655716, 0.003399738110601902, 0.04152651131153107, 0.029659757390618324, 0.07982869446277618, -0.044733062386512756, -0.07039526104927063, -0.06177990511059761, 0.0731663703918457, 0.011939175426959991, 0.09068146347999573, -0.06029907241463661, -0.06987951695919037, 0.02802523598074913, -0.10037562251091003, 0.04625287279486656, 0.03028881922364235, -0.10394328087568283, -0.06426572799682617, -3.742374344938884e-33, -0.04503828287124634, -0.020476294681429863, -0.015614396892488003, 0.0461965948343277, 0.029110386967658997, -0.016671301797032356, 0.07293407618999481, -0.043138206005096436, 0.1083824411034584, 0.02107933722436428, -0.051146335899829865, 0.0016220144461840391, 0.06652195006608963, -0.07299236953258514, -0.020168641582131386, 0.03168656677007675, -0.05427224934101105, -0.05228156968951225, -0.008990894071757793, 0.04254124313592911, -0.0332087017595768, 0.03723515197634697, -0.04803020879626274, 0.16017061471939087, 0.009032866917550564, -0.0114675248041749, 0.09708881378173828, 0.03575607389211655, 0.09805317223072052, -0.08313342183828354, -0.03777455538511276, -0.07706967741250992, -0.06839026510715485, 0.04630698263645172, 0.07638231664896011, 0.02036280557513237, 0.015842601656913757, 0.0026611299254000187, 0.020482277497649193, 0.0739830806851387, 0.007274242118000984, -0.0627375990152359, -0.01391719188541174, -0.0018874508095905185, -0.04457777366042137, 0.058243878185749054, -0.04978509619832039, -0.032596416771411896, -0.14920587837696075, 0.009362947195768356, 0.03966456651687622, -0.007777529768645763, -0.011336644180119038, 0.07550827413797379, 0.02007231116294861, -0.013716571033000946, 0.004552014637738466, -0.0347071997821331, 0.008297205902636051, -0.015174823813140392, 0.06402448564767838, -0.0015216754982247949, 0.04918373003602028, -0.012166365049779415, 0.10627774894237518, -0.034676693379879, 0.01015347708016634, -0.05868392437696457, -0.006415396463125944, -0.022261055186390877, -0.0035760095342993736, -0.022875074297189713, -0.012311765924096107, -0.043647658079862595, 0.05694634094834328, 0.03239413723349571, -0.01856602355837822, -0.021940115839242935, -0.01833566464483738, 0.02006569132208824, -0.07009249925613403, 0.01667884737253189, 0.021176783367991447, 0.02593073435127735, 0.021694818511605263, 0.029797779396176338, 0.025847358629107475, 0.11042018234729767, 0.03237466886639595, 0.02583467587828636, 0.018553586676716805, 0.027157695963978767, 0.08851901441812515, 0.07536308467388153, -0.008409122005105019, -4.5943021831362785e-8, -0.010763468220829964, -0.09082267433404922, 0.004849156830459833, 0.037023335695266724, 0.000970574386883527, -0.029817530885338783, -0.009975891560316086, -0.04809136316180229, 0.0630711242556572, -0.0067872293293476105, 0.10691777616739273, 0.023867638781666756, -0.059696368873119354, -0.00004093004099559039, 0.022425806149840355, -0.02714703418314457, -0.03646673634648323, 0.02145984396338463, 0.04197884723544121, -0.047866303473711014, 0.07853926718235016, 0.036435697227716446, -0.03369178622961044, 0.06316912919282913, 0.005160499829798937, 0.02206462062895298, -0.03620496019721031, 0.07852358371019363, -0.044973697513341904, 0.028906134888529778, 0.02348782680928707, -0.0890202596783638, -0.04900292307138443, -0.04731994867324829, -0.04534367099404335, -0.05224219337105751, -0.04613235220313072, -0.004114203620702028, 0.037433575838804245, 0.052449122071266174, 0.1252979338169098, -0.00996053870767355, -0.08664391934871674, 0.04002368450164795, -0.034629497677087784, -0.01421375386416912, -0.04263455420732498, -0.05458986014127731, -0.055626485496759415, -0.02128530666232109, -0.041226327419281006, 0.009065655060112476, 0.07634466886520386, -0.007889755070209503, -0.0004356542485766113, 0.057539042085409164, 0.07053477317094803, -0.02155146561563015, 0.058766093105077744, 0.024271966889500618, 0.076382577419281, 0.11160781979560852, -0.10152959823608398, 0.05625936761498451 ]
0.004043
# Webhooks Gateway can expose a small HTTP webhook endpoint for external triggers. ## Enable ```json5 { hooks: { enabled: true, token: "shared-secret", path: "/hooks", }, } ``` Notes: - `hooks.token` is required when `hooks.enabled=true`. - `hooks.path` defaults to `/hooks`. ## Auth Every request must include the hook token. Prefer headers: - `Authorization: Bearer ` (recommended) - `x-openclaw-token: ` - `?token=` (deprecated; logs a warning and will be removed in a future major release) ## Endpoints ### `POST /hooks/wake` Payload: ```json { "text": "System line", "mode": "now" } ``` - `text` \*\*required\*\* (string): The description of the event (e.g., "New email received"). - `mode` optional (`now` | `next-heartbeat`): Whether to trigger an immediate heartbeat (default `now`) or wait for the next periodic check. Effect: - Enqueues a system event for the \*\*main\*\* session - If `mode=now`, triggers an immediate heartbeat ### `POST /hooks/agent` Payload: ```json { "message": "Run this", "name": "Email", "sessionKey": "hook:email:msg-123", "wakeMode": "now", "deliver": true, "channel": "last", "to": "+15551234567", "model": "openai/gpt-5.2-mini", "thinking": "low", "timeoutSeconds": 120 } ``` - `message` \*\*required\*\* (string): The prompt or message for the agent to process. - `name` optional (string): Human-readable name for the hook (e.g., "GitHub"), used as a prefix in session summaries. - `sessionKey` optional (string): The key used to identify the agent's session. Defaults to a random `hook:`. Using a consistent key allows for a multi-turn conversation within the hook context. - `wakeMode` optional (`now` | `next-heartbeat`): Whether to trigger an immediate heartbeat (default `now`) or wait for the next periodic check. - `deliver` optional (boolean): If `true`, the agent's response will be sent to the messaging channel. Defaults to `true`. Responses that are only heartbeat acknowledgments are automatically skipped. - `channel` optional (string): The messaging channel for delivery. One of: `last`, `whatsapp`, `telegram`, `discord`, `slack`, `mattermost` (plugin), `signal`, `imessage`, `msteams`. Defaults to `last`. - `to` optional (string): The recipient identifier for the channel (e.g., phone number for WhatsApp/Signal, chat ID for Telegram, channel ID for Discord/Slack/Mattermost (plugin), conversation ID for MS Teams). Defaults to the last recipient in the main session. - `model` optional (string): Model override (e.g., `anthropic/claude-3-5-sonnet` or an alias). Must be in the allowed model list if restricted. - `thinking` optional (string): Thinking level override (e.g., `low`, `medium`, `high`). - `timeoutSeconds` optional (number): Maximum duration for the agent run in seconds. Effect: - Runs an \*\*isolated\*\* agent turn (own session key) - Always posts a summary into the \*\*main\*\* session - If `wakeMode=now`, triggers an immediate heartbeat ### `POST /hooks/` (mapped) Custom hook names are resolved via `hooks.mappings` (see configuration). A mapping can turn arbitrary payloads into `wake` or `agent` actions, with optional templates or code transforms. Mapping options (summary): - `hooks.presets: ["gmail"]` enables the built-in Gmail mapping. - `hooks.mappings` lets you define `match`, `action`, and templates in config. - `hooks.transformsDir` + `transform.module` loads a JS/TS module for custom logic. - Use `match.source` to keep a generic ingest endpoint (payload-driven routing). - TS transforms require a TS loader (e.g. `bun` or `tsx`) or precompiled `.js` at runtime. - Set `deliver: true` + `channel`/`to` on mappings to route replies to a chat surface (`channel` defaults to `last` and falls back to WhatsApp). - `allowUnsafeExternalContent: true` disables the external content safety wrapper for that hook (dangerous; only for trusted internal sources). - `openclaw webhooks gmail setup` writes `hooks.gmail` config for `openclaw webhooks gmail run`. See [Gmail Pub/Sub](/automation/gmail-pubsub) for the full Gmail watch flow. ## Responses - `200` for `/hooks/wake` - `202` for `/hooks/agent` (async run started) - `401` on auth failure - `400` on invalid payload - `413` on oversized payloads ## Examples ```bash curl -X POST http://127.0.0.1:18789/hooks/wake \
https://github.com/openclaw/openclaw/blob/main//docs/automation/webhook.md
main
opebclaw
[ -0.11129555106163025, 0.056731440126895905, -0.0428193062543869, 0.008752652443945408, 0.05110746994614601, -0.1085568442940712, -0.028716064989566803, 0.009536472149193287, 0.03613744676113129, -0.0006160273333080113, -0.04073973372578621, -0.08353676646947861, -0.005994491279125214, -0.03972436115145683, 0.09623783081769943, 0.09630899876356125, 0.012985983863472939, -0.051241692155599594, -0.020735522732138634, -0.06768737733364105, -0.0006976329023018479, 0.01804635301232338, 0.010028410702943802, 0.023957742378115654, -0.0705319344997406, -0.09830713272094727, -0.00025751240900717676, 0.03321829438209534, -0.04088292643427849, 0.013869436457753181, 0.03363070636987686, -0.09595125913619995, -0.057940851897001266, 0.009291373193264008, -0.02117139659821987, 0.059243153780698776, 0.10303544998168945, -0.024445297196507454, -0.026200752705335617, 0.021839991211891174, 0.057602833956480026, -0.0584925077855587, -0.04373151808977127, -0.051371537148952484, 0.003993821796029806, -0.012280762195587158, -0.05463551729917526, -0.042193297296762466, -0.10788718611001968, 0.048472482711076736, -0.021436849609017372, -0.08148496598005295, -0.03677695617079735, -0.003955333959311247, -0.01816815510392189, -0.04396773874759674, -0.0225510336458683, 0.004099878948181868, 0.053731802850961685, -0.07336962223052979, 0.0382896289229393, -0.07958416640758514, 0.044532615691423416, 0.027994239702820778, -0.07718480378389359, -0.035299111157655716, -0.03492444008588791, -0.015009276568889618, 0.06828362494707108, 0.015070289373397827, -0.0022963157389312983, -0.009589140303432941, -0.08627983182668686, -0.04369683563709259, -0.0032904273830354214, 0.06789993494749069, 0.03711805120110512, 0.014760227873921394, -0.019429713487625122, -0.01418444886803627, -0.044681984931230545, -0.009637774899601936, -0.03390840068459511, 0.037668559700250626, -0.05163595825433731, 0.10553304105997086, -0.01677592284977436, 0.031738486140966415, -0.02289760299026966, 0.012029173783957958, 0.046161677688360214, -0.09689396619796753, -0.0686718225479126, 0.0027042971923947334, -0.032147593796253204, 0.021932750940322876, -0.032843753695487976, -0.017124412581324577, -0.08793982118368149, 0.07347339391708374, 0.03009730577468872, 0.011367466300725937, 0.022119859233498573, 0.028639614582061768, 0.07537008821964264, -0.025370925664901733, 0.002475353889167309, 0.07253441214561462, 0.024032190442085266, -0.02989257127046585, -0.004351016599684954, -0.04047291725873947, 0.05005588009953499, -0.04798515513539314, -0.009607636369764805, 0.11596360057592392, 0.027573438361287117, 0.014437084086239338, 0.04720087721943855, 0.042101554572582245, 0.08942390978336334, 0.006551045458763838, -0.004594219848513603, -0.026291554793715477, 0.07031529396772385, -0.0029600844718515873, 0.05878559872508049, 4.2327314460424164e-33, 0.06255824118852615, 0.057144176214933395, 0.00908689759671688, 0.00015039066784083843, 0.03725678101181984, -0.07710617780685425, 0.052644237875938416, 0.027293086051940918, -0.05191749334335327, 0.024233750998973846, -0.029641658067703247, 0.05504250526428223, 0.03356931731104851, -0.033955592662096024, -0.030610010027885437, -0.021162912249565125, -0.04815063625574112, -0.0346890352666378, 0.09236551076173782, 0.009061804972589016, 0.012250921688973904, -0.1313321739435196, -0.02411053143441677, 0.011514215730130672, -0.013297375291585922, 0.03303411230444908, 0.005750035401433706, 0.03702979162335396, -0.038128554821014404, 0.05195946618914604, 0.035648442804813385, 0.004199035465717316, 0.04029911383986473, 0.001576681388542056, -0.06540296971797943, -0.027961425483226776, -0.09231822192668915, -0.010198310948908329, -0.01778908632695675, -0.08547588437795639, 0.03657255321741104, -0.001199326361529529, -0.12761488556861877, -0.022082116454839706, -0.05119811370968819, -0.10150718688964844, -0.058783452957868576, 0.0033490911591798067, 0.08582654595375061, -0.054554641246795654, 0.007870849221944809, -0.0225067101418972, 0.08963079750537872, -0.030537884682416916, 0.0018268721178174019, 0.0026375295128673315, 0.00908027682453394, -0.01957469806075096, -0.018624618649482727, -0.011688696220517159, -0.003584476886317134, -0.0038568296004086733, 0.04039960354566574, -0.03089255839586258, 0.06846806406974792, 0.042394183576107025, 0.012136791832745075, 0.03795456141233444, -0.04984777048230171, -0.019972924143075943, 0.01823245733976364, 0.01876968890428543, 0.009958082810044289, 0.01394212432205677, -0.09027739614248276, -0.026453860104084015, 0.033000484108924866, 0.014428774826228619, 0.060033947229385376, 0.03303169831633568, 0.1468995064496994, -0.07277277857065201, -0.042096417397260666, 0.06498777121305466, 0.025293374434113503, 0.02447166107594967, -0.012609862722456455, -0.07872196286916733, -0.07815918326377869, 0.1388998180627823, -0.007332156877964735, -0.0048011550679802895, 0.04057465121150017, 0.003392899641767144, -0.06081893667578697, -6.867550238190741e-33, 0.016243647783994675, -0.005854729097336531, -0.09886055439710617, 0.02395019307732582, 0.01580900140106678, 0.04794325679540634, 0.06318356841802597, -0.019156979396939278, 0.012077096849679947, 0.05000665411353111, 0.0009284328552894294, 0.01693754270672798, 0.02151719480752945, 0.040405500680208206, 0.02538496069610119, -0.04670444875955582, -0.057080794125795364, -0.06903506815433502, 0.0422666110098362, 0.009332288056612015, -0.02036360278725624, 0.017814677208662033, -0.02519262209534645, -0.00028468313394114375, 0.04172046482563019, -0.01142429281026125, 0.006604059133678675, 0.04554053395986557, -0.1154237687587738, -0.07558689266443253, 0.011954713612794876, -0.00858991127461195, -0.0003042006283067167, 0.08800848573446274, 0.010814795270562172, -0.11486916989088058, 0.03570130839943886, 0.11623193323612213, 0.04377637431025505, -0.02803100273013115, 0.1284055858850479, -0.019148528575897217, -0.019178101792931557, 0.002201506169512868, -0.02389294095337391, 0.04896598309278488, -0.046414632350206375, 0.0189351923763752, -0.07264784723520279, 0.036701321601867676, -0.07795490324497223, 0.05434029921889305, -0.008804487995803356, 0.08215552568435669, -0.04785783216357231, 0.1026228666305542, 0.04839114472270012, -0.038774728775024414, -0.022707728669047356, -0.060126516968011856, -0.07597558945417404, -0.11150836944580078, -0.01308910921216011, 0.08335617929697037, 0.0767238587141037, -0.10008137673139572, 0.00035113556077703834, -0.015555988065898418, -0.03554453328251839, -0.045826274901628494, 0.04986807331442833, -0.029942389577627182, -0.015770455822348595, -0.06186724826693535, 0.01579049788415432, -0.0033204243518412113, -0.002763038035482168, -0.1431831419467926, -0.039097245782613754, -0.011031880974769592, -0.07489074766635895, -0.02130696550011635, 0.0597246028482914, -0.003275627037510276, 0.021729229018092155, 0.0019499475602060556, -0.025164777413010597, 0.10407526046037674, 0.014196736738085747, 0.03393996134400368, -0.04095348343253136, 0.00969352200627327, -0.07396626472473145, -0.02534131146967411, -0.017378123477101326, -5.687615711735816e-8, -0.041545409709215164, -0.029103342443704605, -0.022593144327402115, 0.12369837611913681, 0.001261410303413868, 0.04009631648659706, 0.023150287568569183, -0.0652698501944542, -0.0725003033876419, 0.01247786357998848, 0.036563221365213394, 0.05158977210521698, -0.00046312177437357605, 0.0034904461354017258, -0.04971269145607948, -0.019916586577892303, -0.005653612781316042, 0.0030460674315690994, -0.012453633360564709, -0.1131434515118599, -0.017858561128377914, -0.009256179444491863, 0.06382618844509125, -0.08647242188453674, 0.04458494856953621, 0.036707840859889984, 0.024165097624063492, 0.08582846075296402, -0.03198346495628357, -0.06358560174703598, -0.06758255511522293, -0.07124447822570801, -0.013856474310159683, -0.0013613024493679404, -0.07115266472101212, 0.040229085832834244, -0.05523628368973732, -0.0035404141526669264, -0.03320698440074921, -0.026065785437822342, 0.05907326191663742, 0.06074065715074539, -0.06404146552085876, -0.007458473090082407, -0.042358651757240295, 0.08285693824291229, 0.035741761326789856, 0.04135936126112938, 0.03149823844432831, 0.0673837810754776, -0.01524360291659832, -0.045354317873716354, 0.07550032436847687, 0.043237123638391495, 0.02972261980175972, 0.032213158905506134, 0.06491910666227341, -0.05116730555891991, 0.05451592430472374, 0.05695026367902756, 0.09503477811813354, 0.0248959232121706, 0.01705431006848812, -0.02491076849400997 ]
0.13723
for `openclaw webhooks gmail run`. See [Gmail Pub/Sub](/automation/gmail-pubsub) for the full Gmail watch flow. ## Responses - `200` for `/hooks/wake` - `202` for `/hooks/agent` (async run started) - `401` on auth failure - `400` on invalid payload - `413` on oversized payloads ## Examples ```bash curl -X POST http://127.0.0.1:18789/hooks/wake \ -H 'Authorization: Bearer SECRET' \ -H 'Content-Type: application/json' \ -d '{"text":"New email received","mode":"now"}' ``` ```bash curl -X POST http://127.0.0.1:18789/hooks/agent \ -H 'x-openclaw-token: SECRET' \ -H 'Content-Type: application/json' \ -d '{"message":"Summarize inbox","name":"Email","wakeMode":"next-heartbeat"}' ``` ### Use a different model Add `model` to the agent payload (or mapping) to override the model for that run: ```bash curl -X POST http://127.0.0.1:18789/hooks/agent \ -H 'x-openclaw-token: SECRET' \ -H 'Content-Type: application/json' \ -d '{"message":"Summarize inbox","name":"Email","model":"openai/gpt-5.2-mini"}' ``` If you enforce `agents.defaults.models`, make sure the override model is included there. ```bash curl -X POST http://127.0.0.1:18789/hooks/gmail \ -H 'Authorization: Bearer SECRET' \ -H 'Content-Type: application/json' \ -d '{"source":"gmail","messages":[{"from":"Ada","subject":"Hello","snippet":"Hi"}]}' ``` ## Security - Keep hook endpoints behind loopback, tailnet, or trusted reverse proxy. - Use a dedicated hook token; do not reuse gateway auth tokens. - Avoid including sensitive raw payloads in webhook logs. - Hook payloads are treated as untrusted and wrapped with safety boundaries by default. If you must disable this for a specific hook, set `allowUnsafeExternalContent: true` in that hook's mapping (dangerous).
https://github.com/openclaw/openclaw/blob/main//docs/automation/webhook.md
main
opebclaw
[ -0.06902021914720535, 0.05864441394805908, -0.04668238386511803, 0.008834799751639366, 0.019244790077209473, -0.09438928961753845, -0.030110269784927368, -0.048940014094114304, 0.0354464054107666, -0.038769058883190155, -0.0488533116877079, -0.08268475532531738, 0.00686868978664279, -0.02385629341006279, 0.06723754853010178, 0.10979222506284714, 0.06108977273106575, -0.03920231759548187, -0.04493861645460129, -0.028822531923651695, -0.04653511196374893, 0.029404349625110626, 0.037176720798015594, 0.029241742566227913, -0.06868001818656921, -0.06778591871261597, -0.028944117948412895, -0.05483048036694527, -0.05135458707809448, 0.002330973045900464, 0.06307293474674225, -0.04690353944897652, -0.03248889744281769, 0.02941633202135563, 0.05293803662061691, 0.10693080723285675, 0.053621742874383926, 0.009557608515024185, -0.07394485175609589, 0.024165118113160133, 0.0949498787522316, -0.061439063400030136, -0.05425820127129555, -0.06111482158303261, -0.0045599425211548805, -0.03347151353955269, -0.022539248690009117, -0.052976761013269424, -0.04367157444357872, 0.061218541115522385, -0.07840684801340103, -0.04775621369481087, -0.0038633719086647034, 0.001953386701643467, -0.03729347139596939, -0.05811634287238121, -0.08845823258161545, 0.05470554158091545, 0.07316762953996658, -0.029868921265006065, 0.03966185823082924, -0.03700617328286171, -0.0079052047803998, 0.014320814050734043, -0.08003336191177368, -0.021124623715877533, -0.08773308247327805, -0.05181686952710152, 0.03153467923402786, -0.035158973187208176, -0.01843932457268238, -0.027858177199959755, -0.14023461937904358, -0.0494852177798748, 0.01656184531748295, 0.034334972500801086, 0.04364151507616043, -0.048204418271780014, -0.0261091198772192, -0.02673020400106907, -0.12616632878780365, -0.07177705317735672, -0.0326344333589077, 0.04889311641454697, -0.012716610915958881, 0.1384345293045044, 0.0050618816167116165, 0.031334541738033295, -0.0060852267779409885, 0.028099875897169113, 0.03464615345001221, -0.03129472956061363, -0.06148578226566315, 0.0004955987678840756, 0.06013168767094612, 0.0394982174038887, -0.07521370053291321, 0.01913031004369259, -0.06576615571975708, 0.0931592732667923, 0.07753834873437881, 0.0018288701539859176, 0.027483519166707993, 0.0258350670337677, 0.01952594891190529, -0.04234324395656586, 0.00029231776716187596, 0.035749368369579315, 0.006326689850538969, -0.000794619380030781, 0.041785385459661484, -0.046916816383600235, 0.0926109105348587, -0.03221696615219116, 0.008446487598121166, 0.05373441055417061, -0.05306920409202576, 0.037127066403627396, 0.028489604592323303, 0.1490718275308609, 0.16410356760025024, -0.007627302315086126, -0.019748607650399208, -0.03858192265033722, 0.07325456291437149, 0.011613274924457073, 0.08270321786403656, 3.9648737523724496e-33, 0.04095691069960594, 0.0016250418266281486, 0.02491053193807602, 0.06524083018302917, 0.026148870587348938, -0.041839271783828735, 0.0610664002597332, 0.010119641199707985, -0.02635893039405346, 0.011999005451798439, -0.019475145265460014, 0.05659355968236923, 0.00668630376458168, -0.03673426806926727, -0.08153164386749268, -0.009711610153317451, -0.019702332094311714, -0.0008961845305748284, 0.10018691420555115, -0.010243291035294533, 0.007593073416501284, -0.05249961465597153, -0.03509696200489998, -0.00344861694611609, -0.03927416726946831, -0.019696025177836418, 0.0003353282227180898, 0.007362511474639177, -0.06332973390817642, 0.062379419803619385, 0.08456504344940186, -0.01678440347313881, 0.030255360528826714, 0.03870902583003044, -0.058126892894506454, -0.0367923267185688, -0.04928667098283768, -0.012040880508720875, -0.05817919224500656, -0.034064531326293945, -0.03282815217971802, 0.02344367280602455, -0.07019789516925812, -0.03556923568248749, -0.042694006115198135, -0.08980106562376022, 0.0443466491997242, 0.006360122002661228, 0.04150906950235367, 0.001832338748499751, 0.06552386283874512, -0.03270580247044563, 0.015054230578243732, -0.0634026899933815, 0.004732735455036163, -0.016528375446796417, 0.018100975081324577, -0.02039361745119095, -0.018299506977200508, -0.0014503148850053549, -0.027675552293658257, 0.028972556814551353, 0.0325554721057415, -0.03184337913990021, 0.11772916465997696, -0.04388126730918884, 0.0347517691552639, 0.07507287710905075, -0.0978926345705986, 0.02708815410733223, -0.009866934269666672, -0.02580144815146923, 0.020698601379990578, 0.04774700477719307, -0.06746133416891098, -0.10202135890722275, 0.10285396873950958, 0.024632640182971954, 0.04913664609193802, 0.012538370676338673, 0.10363766551017761, -0.021495623514056206, 0.010413387790322304, 0.038506221026182175, -0.044194962829351425, 0.05915188044309616, -0.02111995965242386, -0.054482053965330124, -0.07748020440340042, 0.08170893043279648, -0.021918172016739845, 0.0011949233012273908, 0.019293982535600662, -0.05325756594538689, -0.047804784029722214, -6.644545735528306e-33, -0.021885650232434273, -0.053337763994932175, -0.07528066635131836, -0.0021956665441393852, 0.0588076077401638, 0.04223150014877319, 0.05593735724687576, -0.009337881579995155, 0.03819194808602333, 0.014212770387530327, -0.012990619987249374, 0.029379282146692276, 0.00040713694761507213, 0.015224129892885685, 0.01785993203520775, -0.09068217873573303, -0.002966718515381217, -0.06893151253461838, 0.013126613572239876, 0.005641923286020756, -0.04865699261426926, 0.050308290868997574, 0.023820074275135994, 0.037920910865068436, 0.0285737793892622, -0.024663489311933517, 0.014684436842799187, 0.04828919470310211, -0.02088729292154312, -0.04029376432299614, 0.019812339916825294, 0.0333186574280262, -0.06670057773590088, 0.12551628053188324, -0.012234821915626526, -0.07083789259195328, 0.035484679043293, 0.12088459730148315, 0.040045659989118576, -0.021783092990517616, 0.07765374332666397, -0.022718604654073715, -0.044389914721250534, -0.06219756230711937, 0.020444775000214577, 0.04624754562973976, -0.02021310292184353, -0.017816904932260513, -0.07899533212184906, 0.02252114936709404, -0.017024949193000793, 0.04555673524737358, 0.035753052681684494, 0.07101582735776901, -0.03652195259928703, 0.09818989038467407, 0.027443399652838707, -0.04640670865774155, 0.0025703711435198784, -0.11575833708047867, -0.05632882937788963, -0.07117486745119095, 0.034913673996925354, 0.059993550181388855, 0.03369766101241112, -0.034203797578811646, -0.03258111700415611, 0.03226982802152634, -0.062016695737838745, -0.051566045731306076, 0.020488180220127106, -0.049085404723882675, -0.03169002756476402, -0.05170407146215439, 0.011419987305998802, -0.011019852943718433, 0.00165204843506217, -0.09872794896364212, -0.0043586064130067825, 0.0658244788646698, -0.05772390216588974, 0.04242871329188347, 0.01584688574075699, 0.008897616527974606, 0.03906990587711334, -0.004498409107327461, -0.05782497301697731, 0.10358795523643494, 0.09699399024248123, 0.08594990521669388, -0.019146012142300606, 0.039762768894433975, -0.05074133351445198, -0.0178503580391407, -0.020116029307246208, -5.3681720402209976e-8, -0.029922420158982277, -0.06016409769654274, -0.017164919525384903, 0.09279359132051468, -0.01897559128701687, 0.02938479371368885, -0.027186501771211624, -0.02555457502603531, -0.020678596571087837, -0.009269589558243752, 0.04697870463132858, 0.01529749296605587, -0.018044739961624146, -0.015023542568087578, 0.002617116551846266, -0.06054026260972023, -0.07853720337152481, -0.06079639866948128, -0.013423347845673561, -0.08620445430278778, 0.005376978777348995, 0.027501944452524185, 0.04409603774547577, -0.07102908939123154, -0.011299317702651024, -0.003696778556331992, 0.02287873439490795, 0.03424456715583801, -0.10007009655237198, -0.052478156983852386, -0.061633117496967316, -0.05503463372588158, -0.021962042897939682, -0.09514525532722473, -0.04786123335361481, 0.003762149717658758, -0.005338686518371105, -0.06238460913300514, -0.04010845720767975, 0.003759424900636077, 0.06499402970075607, 0.03141514211893082, 0.00490296445786953, -0.04114347696304321, -0.04530831426382065, 0.03949408605694771, 0.026006337255239487, 0.0014012757455930114, 0.05711641535162926, 0.008939997293055058, -0.01884782873094082, -0.012539912015199661, 0.018124016001820564, 0.07165629416704178, 0.029613887891173363, 0.009793471544981003, 0.09320276975631714, -0.14610569179058075, -0.0048992023803293705, 0.033136215060949326, 0.08293725550174713, 0.05660030618309975, 0.037526555359363556, 0.011440075933933258 ]
0.049248
# Cron vs Heartbeat: When to Use Each Both heartbeats and cron jobs let you run tasks on a schedule. This guide helps you choose the right mechanism for your use case. ## Quick Decision Guide | Use Case | Recommended | Why | | ------------------------------------ | ------------------- | ---------------------------------------- | | Check inbox every 30 min | Heartbeat | Batches with other checks, context-aware | | Send daily report at 9am sharp | Cron (isolated) | Exact timing needed | | Monitor calendar for upcoming events | Heartbeat | Natural fit for periodic awareness | | Run weekly deep analysis | Cron (isolated) | Standalone task, can use different model | | Remind me in 20 minutes | Cron (main, `--at`) | One-shot with precise timing | | Background project health check | Heartbeat | Piggybacks on existing cycle | ## Heartbeat: Periodic Awareness Heartbeats run in the \*\*main session\*\* at a regular interval (default: 30 min). They're designed for the agent to check on things and surface anything important. ### When to use heartbeat - \*\*Multiple periodic checks\*\*: Instead of 5 separate cron jobs checking inbox, calendar, weather, notifications, and project status, a single heartbeat can batch all of these. - \*\*Context-aware decisions\*\*: The agent has full main-session context, so it can make smart decisions about what's urgent vs. what can wait. - \*\*Conversational continuity\*\*: Heartbeat runs share the same session, so the agent remembers recent conversations and can follow up naturally. - \*\*Low-overhead monitoring\*\*: One heartbeat replaces many small polling tasks. ### Heartbeat advantages - \*\*Batches multiple checks\*\*: One agent turn can review inbox, calendar, and notifications together. - \*\*Reduces API calls\*\*: A single heartbeat is cheaper than 5 isolated cron jobs. - \*\*Context-aware\*\*: The agent knows what you've been working on and can prioritize accordingly. - \*\*Smart suppression\*\*: If nothing needs attention, the agent replies `HEARTBEAT\_OK` and no message is delivered. - \*\*Natural timing\*\*: Drifts slightly based on queue load, which is fine for most monitoring. ### Heartbeat example: HEARTBEAT.md checklist ```md # Heartbeat checklist - Check email for urgent messages - Review calendar for events in next 2 hours - If a background task finished, summarize results - If idle for 8+ hours, send a brief check-in ``` The agent reads this on each heartbeat and handles all items in one turn. ### Configuring heartbeat ```json5 { agents: { defaults: { heartbeat: { every: "30m", // interval target: "last", // where to deliver alerts activeHours: { start: "08:00", end: "22:00" }, // optional }, }, }, } ``` See [Heartbeat](/gateway/heartbeat) for full configuration. ## Cron: Precise Scheduling Cron jobs run at \*\*exact times\*\* and can run in isolated sessions without affecting main context. ### When to use cron - \*\*Exact timing required\*\*: "Send this at 9:00 AM every Monday" (not "sometime around 9"). - \*\*Standalone tasks\*\*: Tasks that don't need conversational context. - \*\*Different model/thinking\*\*: Heavy analysis that warrants a more powerful model. - \*\*One-shot reminders\*\*: "Remind me in 20 minutes" with `--at`. - \*\*Noisy/frequent tasks\*\*: Tasks that would clutter main session history. - \*\*External triggers\*\*: Tasks that should run independently of whether the agent is otherwise active. ### Cron advantages - \*\*Exact timing\*\*: 5-field cron expressions with timezone support. - \*\*Session isolation\*\*: Runs in `cron:` without polluting main history. - \*\*Model overrides\*\*: Use a cheaper or more powerful model per job. - \*\*Delivery control\*\*: Isolated jobs default to `announce` (summary); choose `none` as needed. - \*\*Immediate delivery\*\*: Announce mode posts directly without waiting for heartbeat. - \*\*No agent context needed\*\*: Runs even if main session is idle or compacted. - \*\*One-shot support\*\*: `--at` for
https://github.com/openclaw/openclaw/blob/main//docs/automation/cron-vs-heartbeat.md
main
opebclaw
[ -0.07519125938415527, -0.023175479844212532, -0.037862811237573624, 0.010508916340768337, 0.050870854407548904, -0.0268099308013916, -0.03848059102892876, 0.049626946449279785, 0.040041979402303696, -0.045735251158475876, 0.004391656257212162, -0.07539655268192291, -0.013989060185849667, 0.01663035899400711, -0.01445457898080349, -0.04447613283991814, 0.026034021750092506, -0.13241267204284668, -0.04297328367829323, -0.011814494617283344, -0.01799330674111843, -0.06030741706490517, 0.03864102065563202, 0.04396578669548035, -0.060239069163799286, -0.006507669575512409, 0.012296786531805992, -0.026642320677638054, 0.005964373238384724, 0.050009265542030334, 0.03857541084289551, -0.019874315708875656, 0.030664285644888878, 0.05177784338593483, -0.01331143919378519, 0.11459694802761078, 0.04894836246967316, 0.04118944704532623, -0.027325157076120377, -0.020869243890047073, 0.0024013405200093985, -0.05174877494573593, -0.021940814331173897, 0.004323531407862902, 0.03035939298570156, -0.07223396748304367, -0.08268860727548599, -0.02259735018014908, -0.011561421677470207, 0.021937815472483635, -0.05424949899315834, -0.0673733502626419, -0.06801137328147888, 0.01793351024389267, 0.09172976762056351, 0.10523101687431335, 0.007469359319657087, 0.0006911196396686137, 0.010445590130984783, -0.10392293334007263, -0.03828439489006996, -0.032463058829307556, -0.06388377398252487, -0.02365165576338768, -0.007151782047003508, 0.004920725245028734, -0.03433999791741371, 0.04347750544548035, 0.07936713844537735, -0.0039916867390275, 0.016266893595457077, -0.012645771726965904, -0.028205126523971558, -0.06255359947681427, -0.052756890654563904, 0.036893632262945175, 0.030564749613404274, -0.044269368052482605, -0.08528303354978561, -0.04097269847989082, -0.09227105975151062, -0.018052801489830017, -0.04373026266694069, -0.08972067385911942, 0.01696702465415001, -0.019633444026112556, 0.08780837804079056, 0.10117124021053314, 0.025100158527493477, -0.00038940904778428376, 0.11018311977386475, 0.06543848663568497, 0.012923418544232845, -0.04359165206551552, 0.047383345663547516, 0.05350353941321373, -0.03828910365700722, 0.06993462145328522, 0.011716528795659542, -0.000829223426990211, 0.04820738732814789, -0.024970319122076035, -0.00970397051423788, -0.0025196184869855642, 0.05524558946490288, 0.0008456757059320807, -0.011489071883261204, 0.02762575075030327, -0.0033656542655080557, -0.03774852678179741, 0.034411147236824036, 0.04944303631782532, 0.09999114274978638, -0.025553371757268906, 0.07363705337047577, 0.08110120892524719, -0.03488781675696373, 0.046515580266714096, 0.059321269392967224, 0.13269604742527008, 0.07356481999158859, -0.008660385385155678, 0.009455113671720028, -0.12421020865440369, 0.018857240676879883, -0.0016402944456785917, 0.039289627224206924, -3.4425105114899185e-33, -0.01876829005777836, 0.039464350789785385, 0.016169153153896332, -0.03046761266887188, 0.04828118160367012, -0.04247415065765381, -0.02928800880908966, 0.07756552845239639, 0.03143471106886864, -0.05098504200577736, -0.041438568383455276, 0.056868866086006165, -0.04237520694732666, 0.026709971949458122, -0.08122462779283524, -0.07227721065282822, 0.018476802855730057, -0.011497795581817627, 0.023319538682699203, -0.012282880023121834, -0.008649524301290512, -0.10822013765573502, -0.08632709085941315, 0.04858734458684921, 0.05508624017238617, -0.08235810697078705, 0.11643925309181213, 0.08108701556921005, -0.07939154654741287, -0.007405031938105822, 0.04570600390434265, 0.07821282744407654, -0.06066412478685379, 0.02685372531414032, -0.00832742266356945, 0.027286803349852562, -0.04885231330990791, 0.055197760462760925, -0.03550655022263527, -0.0266666691750288, 0.011162451468408108, 0.016343506053090096, -0.07104023545980453, -0.039664510637521744, 0.06513344496488571, -0.06253767758607864, 0.0029865626711398363, -0.0386611633002758, 0.006601378787308931, -0.04371749982237816, 0.08956430107355118, -0.004548028111457825, 0.01940144971013069, -0.06059752032160759, -0.02050105296075344, 0.05716736242175102, 0.0753377228975296, -0.04629146307706833, 0.03557223826646805, 0.09082338213920593, 0.06074889749288559, -0.05215974897146225, -0.014535875990986824, 0.03776320442557335, -0.0087860357016325, 0.06951503455638885, -0.03961540386080742, -0.019684510305523872, 0.055814508348703384, 0.0590631328523159, 0.04084421694278717, 0.057570796459913254, 0.008923586457967758, -0.05678499862551689, 0.043798141181468964, -0.02524355612695217, 0.04048948734998703, -0.030171796679496765, -0.1432773321866989, 0.044193413108587265, -0.014062554575502872, 0.09826243668794632, -0.01141334604471922, 0.03621876239776611, 0.04956354945898056, -0.02868347242474556, -0.042489226907491684, 0.041527777910232544, -0.09849990904331207, 0.026827434077858925, -0.053615815937519073, -0.009670522063970566, 0.036498624831438065, 0.009411456063389778, -0.014149794355034828, 1.7527807285370668e-33, 0.03856692090630531, -0.004335814621299505, 0.02865651436150074, 0.01253466121852398, 0.08164987713098526, 0.022829344496130943, -0.009470067918300629, -0.01604633405804634, 0.05129439756274223, 0.0018856972455978394, -0.06178300455212593, -0.07465530186891556, -0.01795770786702633, 0.006245974451303482, -0.06687487661838531, -0.03408314287662506, 0.02313707396388054, -0.11471331119537354, -0.061349786818027496, 0.059702787548303604, -0.004804499447345734, 0.07023053616285324, -0.09044461697340012, 0.014898019842803478, 0.020900381729006767, 0.04022921621799469, -0.06656751781702042, 0.017886530607938766, 0.004454177804291248, -0.0444331020116806, -0.0614609457552433, -0.08901485800743103, 0.039788760244846344, 0.005581654142588377, -0.018528979271650314, -0.026901550590991974, 0.013811456970870495, 0.0535174235701561, 0.031180763617157936, 0.10126650333404541, 0.11209572851657867, 0.06905894726514816, 0.0040266127325594425, 0.008685064502060413, -0.07262170314788818, 0.06453283131122589, -0.012926281429827213, -0.024457037448883057, -0.16099636256694794, 0.03378746286034584, -0.06334381550550461, 0.009521798230707645, -0.042210064828395844, 0.03380156308412552, 0.031108751893043518, -0.04136376827955246, 0.02291140891611576, -0.03415582329034805, -0.06572718173265457, 0.03686755523085594, -0.006760532967746258, -0.05964832380414009, -0.006135181989520788, -0.0034571043215692043, 0.0034534980077296495, -0.015129690058529377, 0.016432251781225204, -0.03347965329885483, 0.019642937928438187, -0.017994016408920288, -0.004376560915261507, 0.06466517597436905, -0.05746479704976082, 0.012429052963852882, -0.04092986509203911, -0.019352760165929794, -0.05486234277486801, -0.07562170922756195, -0.034464556723833084, 0.021540354937314987, -0.09718362241983414, -0.05662120506167412, 0.014018381014466286, 0.022402025759220123, -0.11990195512771606, 0.06028679758310318, 0.031107312068343163, -0.06198539584875107, 0.05093323066830635, -0.023641670122742653, -0.02737063728272915, 0.009263725951313972, -0.003452705917879939, 0.04998517408967018, 0.016433434560894966, -4.8990955292538274e-8, 0.06001507118344307, -0.025587931275367737, 0.08423871546983719, 0.014562869444489479, 0.025157582014799118, -0.08385653793811798, -0.009894732385873795, -0.04148827865719795, 0.04780682548880577, 0.05918247997760773, 0.02701956406235695, -0.10201026499271393, -0.030650535598397255, -0.01855011284351349, 0.02203802764415741, -0.016681073233485222, 0.03860468789935112, -0.01861323043704033, -0.007621691096574068, -0.03702092915773392, 0.0701615959405899, 0.039817966520786285, 0.004717986565083265, 0.004035893827676773, 0.018081840127706528, -0.030037246644496918, 0.03828813508152962, 0.09865793585777283, -0.04205840826034546, 0.0010176955256611109, -0.016434015706181526, -0.03973333537578583, 0.00039955141255632043, -0.0014700350584462285, -0.04837856814265251, -0.0678289532661438, 0.049660276621580124, -0.04810076206922531, -0.004421139135956764, 0.08462265878915787, 0.07419323921203613, -0.020378991961479187, -0.04265070706605911, -0.027145935222506523, 0.013739904388785362, -0.08493303507566452, -0.05240695923566818, -0.10324963182210922, 0.03359702229499817, 0.044930532574653625, 0.04184135049581528, -0.036148250102996826, 0.10451693832874298, 0.012341011315584183, 0.06555738300085068, 0.04123777151107788, 0.07654564082622528, -0.09737778455018997, 0.05049705505371094, 0.06499923765659332, 0.06201084703207016, 0.019428888335824013, -0.04988512396812439, -0.007625599857419729 ]
0.107944
cheaper or more powerful model per job. - \*\*Delivery control\*\*: Isolated jobs default to `announce` (summary); choose `none` as needed. - \*\*Immediate delivery\*\*: Announce mode posts directly without waiting for heartbeat. - \*\*No agent context needed\*\*: Runs even if main session is idle or compacted. - \*\*One-shot support\*\*: `--at` for precise future timestamps. ### Cron example: Daily morning briefing ```bash openclaw cron add \ --name "Morning briefing" \ --cron "0 7 \* \* \*" \ --tz "America/New\_York" \ --session isolated \ --message "Generate today's briefing: weather, calendar, top emails, news summary." \ --model opus \ --announce \ --channel whatsapp \ --to "+15551234567" ``` This runs at exactly 7:00 AM New York time, uses Opus for quality, and announces a summary directly to WhatsApp. ### Cron example: One-shot reminder ```bash openclaw cron add \ --name "Meeting reminder" \ --at "20m" \ --session main \ --system-event "Reminder: standup meeting starts in 10 minutes." \ --wake now \ --delete-after-run ``` See [Cron jobs](/automation/cron-jobs) for full CLI reference. ## Decision Flowchart ``` Does the task need to run at an EXACT time? YES -> Use cron NO -> Continue... Does the task need isolation from main session? YES -> Use cron (isolated) NO -> Continue... Can this task be batched with other periodic checks? YES -> Use heartbeat (add to HEARTBEAT.md) NO -> Use cron Is this a one-shot reminder? YES -> Use cron with --at NO -> Continue... Does it need a different model or thinking level? YES -> Use cron (isolated) with --model/--thinking NO -> Use heartbeat ``` ## Combining Both The most efficient setup uses \*\*both\*\*: 1. \*\*Heartbeat\*\* handles routine monitoring (inbox, calendar, notifications) in one batched turn every 30 minutes. 2. \*\*Cron\*\* handles precise schedules (daily reports, weekly reviews) and one-shot reminders. ### Example: Efficient automation setup \*\*HEARTBEAT.md\*\* (checked every 30 min): ```md # Heartbeat checklist - Scan inbox for urgent emails - Check calendar for events in next 2h - Review any pending tasks - Light check-in if quiet for 8+ hours ``` \*\*Cron jobs\*\* (precise timing): ```bash # Daily morning briefing at 7am openclaw cron add --name "Morning brief" --cron "0 7 \* \* \*" --session isolated --message "..." --announce # Weekly project review on Mondays at 9am openclaw cron add --name "Weekly review" --cron "0 9 \* \* 1" --session isolated --message "..." --model opus # One-shot reminder openclaw cron add --name "Call back" --at "2h" --session main --system-event "Call back the client" --wake now ``` ## Lobster: Deterministic workflows with approvals Lobster is the workflow runtime for \*\*multi-step tool pipelines\*\* that need deterministic execution and explicit approvals. Use it when the task is more than a single agent turn, and you want a resumable workflow with human checkpoints. ### When Lobster fits - \*\*Multi-step automation\*\*: You need a fixed pipeline of tool calls, not a one-off prompt. - \*\*Approval gates\*\*: Side effects should pause until you approve, then resume. - \*\*Resumable runs\*\*: Continue a paused workflow without re-running earlier steps. ### How it pairs with heartbeat and cron - \*\*Heartbeat/cron\*\* decide \_when\_ a run happens. - \*\*Lobster\*\* defines \_what steps\_ happen once the run starts. For scheduled workflows, use cron or heartbeat to trigger an agent turn that calls Lobster. For ad-hoc workflows, call Lobster directly. ### Operational notes (from the code) - Lobster runs as a \*\*local subprocess\*\* (`lobster` CLI) in tool mode and returns a \*\*JSON envelope\*\*. - If the tool returns `needs\_approval`, you resume with a `resumeToken` and `approve` flag. - The tool is an \*\*optional plugin\*\*; enable it additively via `tools.alsoAllow: ["lobster"]` (recommended). - If you pass `lobsterPath`, it must be an
https://github.com/openclaw/openclaw/blob/main//docs/automation/cron-vs-heartbeat.md
main
opebclaw
[ -0.09512773156166077, 0.007654462940990925, -0.041075512766838074, 0.04290914162993431, 0.019547872245311737, -0.014101628214120865, 0.028438983485102654, 0.023612305521965027, 0.06208251044154167, 0.019780760630965233, -0.0173351988196373, -0.03348611667752266, -0.029874999076128006, 0.048268336802721024, 0.047048017382621765, -0.026723474264144897, 0.07029721140861511, -0.1257525384426117, -0.03698603808879852, -0.021322937682271004, 0.028254903852939606, 0.043303702026605606, 0.019222842529416084, 0.08480177074670792, -0.01782667078077793, -0.03827382251620293, -0.01713993027806282, 0.011483230628073215, 0.02878832444548607, 0.00888647697865963, 0.014104701578617096, -0.01745644211769104, 0.040591612458229065, 0.07886313647031784, 0.05692466348409653, 0.07946819067001343, 0.08482279628515244, 0.028897181153297424, 0.006907842122018337, 0.007934076711535454, 0.021870074793696404, -0.057135436683893204, -0.0920029953122139, -0.02186943218111992, 0.035772014409303665, -0.10224275290966034, -0.05515776202082634, -0.0027772202156484127, -0.04950419068336487, 0.00829710066318512, -0.05595124140381813, -0.07233753055334091, -0.009171506389975548, 0.03061797469854355, 0.05982975661754608, 0.05968613550066948, -0.05741510167717934, 0.017988497391343117, 0.0286805871874094, -0.05914130061864853, -0.10346474498510361, -0.016756681725382805, -0.08196429163217545, 0.03603312373161316, -0.00970488041639328, -0.014953291974961758, -0.0879095271229744, 0.02302648313343525, 0.011111879721283913, 0.005130251869559288, -0.06888188421726227, -0.005962084513157606, -0.02942565456032753, -0.03316792845726013, -0.027067840099334717, -0.021188482642173767, 0.044087979942560196, -0.035586655139923096, -0.07224120944738388, -0.07825568318367004, -0.018762020394206047, -0.08621617406606674, -0.054633546620607376, -0.006125255487859249, -0.016506437212228775, 0.011797078885138035, 0.053961578756570816, 0.024589335545897484, 0.0932781994342804, -0.05771373212337494, -0.04820751026272774, -0.04302822798490524, -0.0033009275794029236, 0.007034008856862783, -0.03684459254145622, 0.04366358369588852, -0.016178376972675323, 0.027112433686852455, -0.027412883937358856, 0.08527439087629318, 0.02594318799674511, 0.016859114170074463, 0.013595658354461193, -0.005494876764714718, 0.028941499069333076, 0.005050291307270527, -0.03437286242842674, 0.025694848969578743, 0.00593761820346117, -0.02521936409175396, -0.012561820447444916, 0.04778539389371872, 0.007978768087923527, -0.09718435257673264, 0.07171320915222168, 0.04344700276851654, -0.06014261767268181, 0.03249910846352577, 0.043461110442876816, 0.07030928134918213, 0.13521282374858856, -0.02121400088071823, -0.02866777777671814, 0.009995771571993828, -0.006046273745596409, -0.00030938308918848634, 0.06160702183842659, 7.036344614813098e-33, 0.028815506026148796, 0.030691465362906456, -0.0009508662624284625, 0.04950818419456482, 0.06307794898748398, 0.03654075041413307, -0.04107516631484032, 0.06895560771226883, 0.02188240736722946, -0.003365865210071206, -0.04695338383316994, 0.011606251820921898, -0.04453109949827194, 0.046009793877601624, -0.029710976406931877, -0.039863839745521545, 0.02957514114677906, 0.08617178350687027, 0.08698973804712296, 0.03391309827566147, -0.0019225873984396458, 0.012060687877237797, -0.11860809475183487, 0.02274436689913273, 0.08358689397573471, 0.020331788808107376, 0.09612009674310684, -0.000570568023249507, -0.08078583329916, 0.04084714502096176, 0.021023526787757874, 0.025151362642645836, 0.02904936857521534, 0.05860886722803116, 0.0012919623404741287, 0.023422319442033768, -0.18594121932983398, -0.04187997058033943, 0.045990440994501114, -0.042325280606746674, -0.06245044618844986, -0.002524685114622116, -0.10459750145673752, -0.0756237804889679, 0.0005841063102707267, -0.03877368941903114, -0.033215004950761795, 0.016732141375541687, -0.015719741582870483, 0.025271309539675713, 0.0765971913933754, 0.05499468743801117, 0.033905189484357834, 0.0017779363552108407, -0.02124931663274765, -0.02141796052455902, 0.0488077849149704, -0.06473027169704437, 0.05873574689030647, 0.056103259325027466, -0.04057976230978966, 0.0018529766239225864, -0.023356745019555092, -0.018850043416023254, 0.06308375298976898, 0.013434084132313728, -0.06795701384544373, 0.014473161660134792, 0.027939356863498688, 0.08713407814502716, -0.03384430706501007, 0.0956353172659874, -0.016518546268343925, 0.008286725729703903, 0.004979326855391264, -0.07445872575044632, 0.07338817417621613, 0.020735904574394226, -0.027748459950089455, 0.018897879868745804, 0.0858600065112114, 0.05817360058426857, 0.00042988223140127957, -0.017598338425159454, 0.0409875251352787, 0.04060538485646248, 0.04046766459941864, 0.02709377184510231, -0.09186378866434097, 0.055225830525159836, -0.047874219715595245, 0.005927490070462227, -0.006910968106240034, 0.0038893113378435373, -0.0471520833671093, -7.814669546535274e-33, 0.06714971363544464, -0.029829872772097588, -0.10518045723438263, 0.023182114586234093, -0.026476599276065826, -0.0017748076934367418, 0.04671476036310196, -0.03907790407538414, 0.026187656447291374, -0.011689607053995132, -0.03508967533707619, -0.01470042485743761, -0.0022181845270097256, -0.027971722185611725, 0.022300291806459427, 0.008158324286341667, 0.0034397763665765524, -0.11407224088907242, -0.08947008103132248, 0.057079121470451355, 0.02206418849527836, 0.045932866632938385, -0.07797131687402725, 0.07845618575811386, 0.07071813195943832, -0.03232577443122864, -0.02368488349020481, 0.08709576725959778, -0.014068396762013435, -0.01977095752954483, -0.08003884553909302, -0.04954403638839722, -0.020449824631214142, -0.016032161191105843, -0.06306048482656479, 0.00634984765201807, -0.02466549538075924, 0.0997428148984909, 0.0730389729142189, 0.05887317284941673, 0.10308936983346939, -0.016944367438554764, -0.02865677699446678, -0.0038261848967522383, -0.04064652696251869, 0.06388251483440399, -0.06476494669914246, -0.012451586313545704, -0.14837242662906647, 0.025954613462090492, -0.07316287606954575, -0.0657644122838974, -0.07233548909425735, 0.02522462233901024, -0.012758364900946617, -0.06332147866487503, -0.03808067739009857, -0.07537813484668732, -0.09430563449859619, -0.020743289962410927, 0.017306305468082428, -0.014364036731421947, 0.04255151003599167, -0.011614639312028885, 0.03408198058605194, -0.126474991440773, 0.03300943225622177, -0.07113730907440186, 0.016658831387758255, -0.04536358267068863, 0.10312268137931824, -0.03480657935142517, -0.06416342407464981, -0.0041235401295125484, -0.026018798351287842, 0.01791338250041008, -0.02787548117339611, -0.10339578241109848, -0.030990391969680786, 0.12545911967754364, -0.0885256677865982, 0.014731382019817829, 0.03774331137537956, -0.0008169019129127264, -0.03178928792476654, 0.0680004209280014, -0.0017904756823554635, 0.056830037385225296, 0.000059218727983534336, -0.006208174396306276, -0.028054287657141685, 0.08145279437303543, 0.03607996180653572, 0.053801279515028, 0.01708579994738102, -6.072753677699438e-8, -0.03803595155477524, -0.054591864347457886, 0.06499771773815155, 0.006194708403199911, -0.02895154058933258, -0.1028205007314682, 0.00806383229792118, -0.10602462291717529, 0.03919725865125656, -0.028852002695202827, 0.041266556829214096, -0.04980799928307533, -0.03119061142206192, 0.032498396933078766, -0.013577769510447979, 0.005798831582069397, 0.00041383045027032495, -0.04813803732395172, -0.05162582919001579, -0.09660790860652924, 0.03714653477072716, 0.037866052240133286, -0.009406700730323792, -0.010254018008708954, 0.04577275365591049, -0.011535423807799816, -0.021726109087467194, 0.09354696422815323, -0.010336719453334808, 0.045079752802848816, 0.009964114055037498, -0.08306433260440826, -0.06840057671070099, 0.006723668426275253, -0.0654599741101265, 0.023439394310116768, -0.0074009401723742485, -0.04380176588892937, -0.019389884546399117, 0.05188564583659172, 0.10512591898441315, -0.0004891833523288369, -0.03817429766058922, 0.012899497523903847, 0.00899412389844656, -0.035024676471948624, -0.027624055743217468, -0.10982950031757355, 0.0010624007554724813, -0.0029587303288280964, -0.00914666149765253, -0.02835582196712494, 0.038478367030620575, 0.036816757172346115, 0.038690537214279175, 0.024978475645184517, 0.09129402786493301, -0.11145918071269989, 0.06204252690076828, 0.052454061806201935, -0.004449268337339163, -0.0181961078196764, -0.04417050629854202, 0.03898433968424797 ]
0.140175