[Service] # 桥进程异常退出(SIGKILL / OOM / timeout / watchdog / 非零退出)时发一封邮件。 # 正常 stop/restart 不上报:脚本内 isAbnormalExit 会按 SERVICE_RESULT 提前返回。 # 进程内 uncaughtException 捕获不了 SIGKILL/OOM,所以由 systemd 统一覆盖。 ExecStopPost=-/usr/bin/node /opt/agentmail/bin/service-failure-notify.mjs --report --service opencode-serve.service # 下次启动补发上次 Gateway 不可达时暂存的报告(per-agent spool,不跨 Agent 混发) ExecStartPost=-/usr/bin/node /opt/agentmail/bin/service-failure-notify.mjs --flush --service opencode-serve.service