configure-notifications
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseConfigure OMX Notifications
配置OMX通知
Unified and only entry point for notification setup.
- Native integrations (first-class): Discord, Telegram, Slack
- Generic extensibility integrations: ,
custom_webhook_commandcustom_cli_command
Standalone configure skills (,configure-discord,configure-telegram,configure-slack) are removed.configure-openclaw
通知设置的统一且唯一入口。
- 原生集成(第一优先级): Discord, Telegram, Slack
- 通用扩展集成: ,
custom_webhook_commandcustom_cli_command
独立的配置技能(、configure-discord、configure-telegram、configure-slack)已被移除。configure-openclaw
Step 1: Inspect Current State
步骤1:查看当前状态
bash
CONFIG_FILE="$HOME/.codex/.omx-config.json"
if [ -f "$CONFIG_FILE" ]; then
jq -r '
{
notifications_enabled: (.notifications.enabled // false),
discord: (.notifications.discord.enabled // false),
discord_bot: (.notifications["discord-bot"].enabled // false),
telegram: (.notifications.telegram.enabled // false),
slack: (.notifications.slack.enabled // false),
openclaw: (.notifications.openclaw.enabled // false),
custom_webhook_command: (.notifications.custom_webhook_command.enabled // false),
custom_cli_command: (.notifications.custom_cli_command.enabled // false),
verbosity: (.notifications.verbosity // "session"),
idleCooldownSeconds: (.notifications.idleCooldownSeconds // 60),
reply_enabled: (.notifications.reply.enabled // false)
}
' "$CONFIG_FILE"
else
echo "NO_CONFIG_FILE"
fibash
CONFIG_FILE="$HOME/.codex/.omx-config.json"
if [ -f "$CONFIG_FILE" ]; then
jq -r '
{
notifications_enabled: (.notifications.enabled // false),
discord: (.notifications.discord.enabled // false),
discord_bot: (.notifications["discord-bot"].enabled // false),
telegram: (.notifications.telegram.enabled // false),
slack: (.notifications.slack.enabled // false),
openclaw: (.notifications.openclaw.enabled // false),
custom_webhook_command: (.notifications.custom_webhook_command.enabled // false),
custom_cli_command: (.notifications.custom_cli_command.enabled // false),
verbosity: (.notifications.verbosity // "session"),
idleCooldownSeconds: (.notifications.idleCooldownSeconds // 60),
reply_enabled: (.notifications.reply.enabled // false)
}
' "$CONFIG_FILE"
else
echo "NO_CONFIG_FILE"
fiStep 2: Main Menu
步骤2:主菜单
Use AskUserQuestion:
Question: "What would you like to configure?"
Options:
- Discord (native) - webhook or bot
- Telegram (native) - bot token + chat id
- Slack (native) - incoming webhook
- Generic webhook command -
custom_webhook_command - Generic CLI command -
custom_cli_command - Cross-cutting settings - verbosity, idle cooldown, profiles, reply listener
- Disable all notifications - set
notifications.enabled = false
使用AskUserQuestion:
问题: "你想要配置什么内容?"
选项:
- Discord(原生) - webhook或机器人
- Telegram(原生) - 机器人token + 聊天id
- Slack(原生) - incoming webhook
- 通用webhook命令 -
custom_webhook_command - 通用CLI命令 -
custom_cli_command - 跨域设置 - 详细程度、空闲冷却、配置文件、回复监听器
- 禁用所有通知 - 设置
notifications.enabled = false
Step 3: Configure Native Platforms (Discord / Telegram / Slack)
步骤3:配置原生平台(Discord / Telegram / Slack)
Collect and validate platform-specific values, then write directly under native keys:
- Discord webhook:
notifications.discord - Discord bot:
notifications["discord-bot"] - Telegram:
notifications.telegram - Slack:
notifications.slack
Do not write these as generic command/webhook aliases.
收集并验证平台特定的值,然后直接写入原生对应的键下:
- Discord webhook:
notifications.discord - Discord bot:
notifications["discord-bot"] - Telegram:
notifications.telegram - Slack:
notifications.slack
不要将这些配置为通用命令/webhook别名。
Step 4: Configure Generic Extensibility
步骤4:配置通用扩展
4a) custom_webhook_command
custom_webhook_command4a) custom_webhook_command
custom_webhook_commandUse AskUserQuestion to collect:
- URL
- Optional headers
- Optional method (default, or
POST)PUT - Optional event list (,
session-end,ask-user-question,session-start,session-idle)stop - Optional instruction template
Write:
bash
jq \
--arg url "$URL" \
--arg method "${METHOD:-POST}" \
--arg instruction "${INSTRUCTION:-OMX event {{event}} for {{projectPath}}}" \
'.notifications = (.notifications // {enabled: true}) |
.notifications.enabled = true |
.notifications.custom_webhook_command = {
enabled: true,
url: $url,
method: $method,
instruction: $instruction,
events: ["session-end", "ask-user-question"]
}' "$CONFIG_FILE" > "$CONFIG_FILE.tmp" && mv "$CONFIG_FILE.tmp" "$CONFIG_FILE"使用AskUserQuestion收集以下信息:
- URL
- 可选请求头
- 可选请求方法(默认,或
POST)PUT - 可选事件列表(、
session-end、ask-user-question、session-start、session-idle)stop - 可选指令模板
写入配置:
bash
jq \
--arg url "$URL" \
--arg method "${METHOD:-POST}" \
--arg instruction "${INSTRUCTION:-OMX event {{event}} for {{projectPath}}}" \
'.notifications = (.notifications // {enabled: true}) |
.notifications.enabled = true |
.notifications.custom_webhook_command = {
enabled: true,
url: $url,
method: $method,
instruction: $instruction,
events: ["session-end", "ask-user-question"]
}' "$CONFIG_FILE" > "$CONFIG_FILE.tmp" && mv "$CONFIG_FILE.tmp" "$CONFIG_FILE"4b) custom_cli_command
custom_cli_command4b) custom_cli_command
custom_cli_commandUse AskUserQuestion to collect:
- Command template (supports ,
{{event}},{{instruction}},{{sessionId}}){{projectPath}} - Optional event list
- Optional instruction template
Write:
bash
jq \
--arg command "$COMMAND_TEMPLATE" \
--arg instruction "${INSTRUCTION:-OMX event {{event}} for {{projectPath}}}" \
'.notifications = (.notifications // {enabled: true}) |
.notifications.enabled = true |
.notifications.custom_cli_command = {
enabled: true,
command: $command,
instruction: $instruction,
events: ["session-end", "ask-user-question"]
}' "$CONFIG_FILE" > "$CONFIG_FILE.tmp" && mv "$CONFIG_FILE.tmp" "$CONFIG_FILE"Activation gate: OpenClaw-backed dispatch is active only when. For command gateways, also requireOMX_OPENCLAW=1. Optional timeout env override:OMX_OPENCLAW_COMMAND=1(ms).OMX_OPENCLAW_COMMAND_TIMEOUT_MS
使用AskUserQuestion收集以下信息:
- 命令模板(支持、
{{event}}、{{instruction}}、{{sessionId}}){{projectPath}} - 可选事件列表
- 可选指令模板
写入配置:
bash
jq \
--arg command "$COMMAND_TEMPLATE" \
--arg instruction "${INSTRUCTION:-OMX event {{event}} for {{projectPath}}}" \
'.notifications = (.notifications // {enabled: true}) |
.notifications.enabled = true |
.notifications.custom_cli_command = {
enabled: true,
command: $command,
instruction: $instruction,
events: ["session-end", "ask-user-question"]
}' "$CONFIG_FILE" > "$CONFIG_FILE.tmp" && mv "$CONFIG_FILE.tmp" "$CONFIG_FILE"激活开关:仅当时,基于OpenClaw的分发功能才会激活。 对于命令网关,还需要设置OMX_OPENCLAW=1。 可选超时环境变量覆盖:OMX_OPENCLAW_COMMAND=1(单位毫秒)。OMX_OPENCLAW_COMMAND_TIMEOUT_MS
4b-1) OpenClaw + Clawdbot Agent Workflow (recommended for dev)
4b-1) OpenClaw + Clawdbot Agent 工作流(开发环境推荐)
If the user explicitly asks to route hook notifications through clawdbot agent turns
(not direct message/webhook forwarding), use a command gateway that invokes
and delivers back to Discord.
clawdbot agentNotes:
- Hook name mapping is intentional: notifications -> OpenClaw hook
session-stop.stop - OMX shell-escapes template substitutions for command gateways (including ).
{{instruction}} - Keep templates concise and avoid untrusted shell metacharacters.
instruction - During troubleshooting, avoid swallowing command output; route it to a log file.
- Timeout precedence: >
gateways.<name>.timeout>OMX_OPENCLAW_COMMAND_TIMEOUT_MS.5000 - For clawdbot agent workflows, set to
gateways.<name>.timeout(recommended).120000 - For dev operations, enforce Korean output in all hook instructions.
- Include both and
session={{sessionId}}in hook text for traceability.tmux={{tmuxSession}} - If follow-up is needed, explicitly instruct clawdbot to consult and continue in
SOUL.md.#omc-dev - Error handling: Append to prevent OMX hook failures from blocking the session.
|| true - JSONL logging: Use extension and append (
.jsonl) for structured log aggregation.>> - Reply target format: Use for reliability (preferred over channel aliases).
--reply-to 'channel:CHANNEL_ID'
Example (targeting with production-tested settings):
#omc-devbash
jq \
--arg command "(clawdbot agent --session-id omx-hooks --message {{instruction}} --thinking minimal --deliver --reply-channel discord --reply-to 'channel:1468539002985644084' --timeout 120 --json >>/tmp/omx-openclaw-agent.jsonl 2>&1 || true)" \
'.notifications = (.notifications // {enabled: true}) |
.notifications.enabled = true |
.notifications.verbosity = "verbose" |
.notifications.events = (.notifications.events // {}) |
.notifications.events["session-start"] = {enabled: true} |
.notifications.events["session-idle"] = {enabled: true} |
.notifications.events["ask-user-question"] = {enabled: true} |
.notifications.events["session-stop"] = {enabled: true} |
.notifications.events["session-end"] = {enabled: true} |
.notifications.openclaw = (.notifications.openclaw // {}) |
.notifications.openclaw.enabled = true |
.notifications.openclaw.gateways = (.notifications.openclaw.gateways // {}) |
.notifications.openclaw.gateways["local"] = {
type: "command",
command: $command,
timeout: 120000
} |
.notifications.openclaw.hooks = (.notifications.openclaw.hooks // {}) |
.notifications.openclaw.hooks["session-start"] = {
enabled: true,
gateway: "local",
instruction: "OMX hook=session-start project={{projectName}} session={{sessionId}} tmux={{tmuxSession}}. 한국어로 상태를 공유하고 SOUL.md를 참고해 필요한 후속 조치를 #omc-dev에 안내하세요."
} |
.notifications.openclaw.hooks["session-idle"] = {
enabled: true,
gateway: "local",
instruction: "OMX hook=session-idle project={{projectName}} session={{sessionId}} tmux={{tmuxSession}}. 한국어로 idle 상황을 간단히 공유하고 진행중인 작업 팔로업을 안내하세요."
} |
.notifications.openclaw.hooks["ask-user-question"] = {
enabled: true,
gateway: "local",
instruction: "OMX hook=ask-user-question session={{sessionId}} tmux={{tmuxSession}} question={{question}}. 한국어로 사용자 응답 필요를 #omc-dev에 알리고 즉시 액션 아이템을 제시하세요."
} |
.notifications.openclaw.hooks["stop"] = {
enabled: true,
gateway: "local",
instruction: "OMX hook=session-stop project={{projectName}} session={{sessionId}} tmux={{tmuxSession}}. 한국어로 중단 상태와 정리 액션을 SOUL.md 기준으로 전달하세요."
} |
.notifications.openclaw.hooks["session-end"] = {
enabled: true,
gateway: "local",
instruction: "OMX hook=session-end project={{projectName}} session={{sessionId}} tmux={{tmuxSession}} reason={{reason}}. 한국어로 완료 요약을 1줄로 남기고 필요한 후속 조치를 안내하세요."
}' "$CONFIG_FILE" > "$CONFIG_FILE.tmp" && mv "$CONFIG_FILE.tmp" "$CONFIG_FILE"Verification for this mode:
bash
clawdbot agent --session-id omx-hooks --message "OMX hook test via clawdbot agent path" \
--thinking minimal --deliver --reply-channel discord --reply-to 'channel:1468539002985644084' --timeout 120 --jsonDev runbook (Korean + tmux follow-up):
bash
undefined如果用户明确要求通过clawdbot agent 流转路由钩子通知(而非直接消息/webhook转发),使用调用并回传至Discord的命令网关。
clawdbot agent注意事项:
- 钩子名称映射规则:通知对应OpenClaw钩子
session-stop。stop - OMX会为命令网关的模板变量做shell转义(包括)。
{{instruction}} - 保持模板简洁,避免不可信的shell元字符。
instruction - 排查问题时,不要丢弃命令输出,将其路由到日志文件。
- 超时优先级:>
gateways.<name>.timeout>OMX_OPENCLAW_COMMAND_TIMEOUT_MS。5000 - 对于clawdbot agent工作流,推荐将设置为
gateways.<name>.timeout。120000 - 对于开发操作,要求所有钩子指令输出韩语。
- 在钩子文本中同时包含和
session={{sessionId}}便于追踪。tmux={{tmuxSession}} - 如果需要后续操作,明确指示clawdbot参考并在
SOUL.md频道继续处理。#omc-dev - 错误处理:追加避免OMX钩子失败阻塞会话。
|| true - JSONL日志:使用扩展名并采用追加(
.jsonl)方式便于结构化日志聚合。>> - 回复目标格式:使用保证可靠性(优先于频道别名)。
--reply-to 'channel:CHANNEL_ID'
示例(针对频道的生产验证过的配置):
#omc-devbash
jq \
--arg command "(clawdbot agent --session-id omx-hooks --message {{instruction}} --thinking minimal --deliver --reply-channel discord --reply-to 'channel:1468539002985644084' --timeout 120 --json >>/tmp/omx-openclaw-agent.jsonl 2>&1 || true)" \
'.notifications = (.notifications // {enabled: true}) |
.notifications.enabled = true |
.notifications.verbosity = "verbose" |
.notifications.events = (.notifications.events // {}) |
.notifications.events["session-start"] = {enabled: true} |
.notifications.events["session-idle"] = {enabled: true} |
.notifications.events["ask-user-question"] = {enabled: true} |
.notifications.events["session-stop"] = {enabled: true} |
.notifications.events["session-end"] = {enabled: true} |
.notifications.openclaw = (.notifications.openclaw // {}) |
.notifications.openclaw.enabled = true |
.notifications.openclaw.gateways = (.notifications.openclaw.gateways // {}) |
.notifications.openclaw.gateways["local"] = {
type: "command",
command: $command,
timeout: 120000
} |
.notifications.openclaw.hooks = (.notifications.openclaw.hooks // {}) |
.notifications.openclaw.hooks["session-start"] = {
enabled: true,
gateway: "local",
instruction: "OMX hook=session-start project={{projectName}} session={{sessionId}} tmux={{tmuxSession}}. 한국어로 상태를 공유하고 SOUL.md를 참고해 필요한 후속 조치를 #omc-dev에 안내하세요."
} |
.notifications.openclaw.hooks["session-idle"] = {
enabled: true,
gateway: "local",
instruction: "OMX hook=session-idle project={{projectName}} session={{sessionId}} tmux={{tmuxSession}}. 한국어로 idle 상황을 간단히 공유하고 진행중인 작업 팔로업을 안내하세요."
} |
.notifications.openclaw.hooks["ask-user-question"] = {
enabled: true,
gateway: "local",
instruction: "OMX hook=ask-user-question session={{sessionId}} tmux={{tmuxSession}} question={{question}}. 한국어로 사용자 응답 필요를 #omc-dev에 알리고 즉시 액션 아이템을 제시하세요."
} |
.notifications.openclaw.hooks["stop"] = {
enabled: true,
gateway: "local",
instruction: "OMX hook=session-stop project={{projectName}} session={{sessionId}} tmux={{tmuxSession}}. 한국어로 중단 상태와 정리 액션을 SOUL.md 기준으로 전달하세요."
} |
.notifications.openclaw.hooks["session-end"] = {
enabled: true,
gateway: "local",
instruction: "OMX hook=session-end project={{projectName}} session={{sessionId}} tmux={{tmuxSession}} reason={{reason}}. 한국어로 완료 요약을 1줄로 남기고 필요한 후속 조치를 안내하세요."
}' "$CONFIG_FILE" > "$CONFIG_FILE.tmp" && mv "$CONFIG_FILE.tmp" "$CONFIG_FILE"该模式的验证命令:
bash
clawdbot agent --session-id omx-hooks --message "OMX hook test via clawdbot agent path" \
--thinking minimal --deliver --reply-channel discord --reply-to 'channel:1468539002985644084' --timeout 120 --json开发运行手册(韩语 + tmux后续操作):
bash
undefined1) identify active OMX tmux sessions
1) identify active OMX tmux sessions
tmux list-sessions -F '#{session_name}' | rg '^omx-' || true
tmux list-sessions -F '#{session_name}' | rg '^omx-' || true
2) confirm hook templates include session/tmux context
2) confirm hook templates include session/tmux context
jq '.notifications.openclaw.hooks' "$CONFIG_FILE"
jq '.notifications.openclaw.hooks' "$CONFIG_FILE"
3) inspect agent JSONL logs when delivery looks broken
3) inspect agent JSONL logs when delivery looks broken
tail -n 120 /tmp/omx-openclaw-agent.jsonl | jq -s '.[] | {timestamp: (.timestamp // .time), status: (.status // .error // "ok")}'
tail -n 120 /tmp/omx-openclaw-agent.jsonl | jq -s '.[] | {timestamp: (.timestamp // .time), status: (.status // .error // "ok")}'
4) check for recent errors in logs
4) check for recent errors in logs
rg '"error"|"failed"|"timeout"' /tmp/omx-openclaw-agent.jsonl | tail -20
undefinedrg '"error"|"failed"|"timeout"' /tmp/omx-openclaw-agent.jsonl | tail -20
undefined4c) Compatibility + precedence contract
4c) 兼容性 + 优先级规则
OMX accepts both:
- explicit schema (legacy/runtime shape)
notifications.openclaw - generic aliases (,
custom_webhook_command)custom_cli_command
Deterministic precedence:
- wins when present and valid.
notifications.openclaw - Generic aliases are ignored in that case (with warning).
OMX同时支持两种配置方式:
- 显式的schema(遗留/运行时结构)
notifications.openclaw - 通用别名(、
custom_webhook_command)custom_cli_command
明确的优先级:
- 当存在且有效时优先级最高。
notifications.openclaw - 这种情况下通用别名会被忽略(同时输出警告)。
Step 5: Cross-Cutting Settings
步骤5:跨域设置
Verbosity
详细程度
- minimal / session (recommended) / agent / verbose
- minimal / session(推荐) / agent / verbose
Idle cooldown
空闲冷却
notifications.idleCooldownSeconds
notifications.idleCooldownSeconds
Profiles
配置文件
notifications.profilesnotifications.defaultProfile
notifications.profilesnotifications.defaultProfile
Reply listener
回复监听器
notifications.reply.enabled- env gates: , and for Discord
OMX_REPLY_ENABLED=trueOMX_REPLY_DISCORD_USER_IDS=...
notifications.reply.enabled- 环境变量开关:,如果是Discord还需要设置
OMX_REPLY_ENABLED=trueOMX_REPLY_DISCORD_USER_IDS=...
Step 6: Disable All Notifications
步骤6:禁用所有通知
bash
jq '.notifications.enabled = false' "$CONFIG_FILE" > "$CONFIG_FILE.tmp" && mv "$CONFIG_FILE.tmp" "$CONFIG_FILE"bash
jq '.notifications.enabled = false' "$CONFIG_FILE" > "$CONFIG_FILE.tmp" && mv "$CONFIG_FILE.tmp" "$CONFIG_FILE"Step 7: Verification Guidance
步骤7:验证指南
After writing config, run a smoke check:
bash
npm run buildFor OpenClaw-like HTTP integrations, verify both:
- smoke test
/hooks/wake - delivery verification
/hooks/agent
写入配置后,运行冒烟测试:
bash
npm run build对于类OpenClaw的HTTP集成,同时验证两项:
- 冒烟测试
/hooks/wake - 分发验证
/hooks/agent
Final Summary Template
最终汇总模板
Show:
- Native platforms enabled
- Generic aliases enabled (,
custom_webhook_command)custom_cli_command - Whether explicit exists (and therefore overrides aliases)
notifications.openclaw - Verbosity + idle cooldown + reply listener state
- Config path ()
~/.codex/.omx-config.json
展示以下内容:
- 已启用的原生平台
- 已启用的通用别名(、
custom_webhook_command)custom_cli_command - 是否存在显式的配置(因此会覆盖别名)
notifications.openclaw - 详细程度 + 空闲冷却 + 回复监听器状态
- 配置路径()
~/.codex/.omx-config.json