<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>飞书 on OHTLY Blog</title>
    <link>https://blog.ohtly.com/tags/%E9%A3%9E%E4%B9%A6/</link>
    <description>Recent content in 飞书 on OHTLY Blog</description>
    <generator>Hugo</generator>
    <language>zh-cn</language>
    <lastBuildDate>Fri, 29 May 2026 19:10:00 +0800</lastBuildDate>
    <atom:link href="https://blog.ohtly.com/tags/%E9%A3%9E%E4%B9%A6/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>告警通知到飞书：Alertmanager → OpenClaw 中转方案</title>
      <link>https://blog.ohtly.com/posts/2026-05-29-alertmanager-feishu/</link>
      <pubDate>Fri, 29 May 2026 19:10:00 +0800</pubDate>
      <guid>https://blog.ohtly.com/posts/2026-05-29-alertmanager-feishu/</guid>
      <description>&lt;p&gt;前两篇介绍了用 Alloy + Loki Ruler 实现日志告警：&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://blog.ohtly.com/posts/2026-05-29-couchdb-loki-monitoring/&#34; &gt;CouchDB 日志监控&lt;/a&gt;：文本日志的 LogQL 告警&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://blog.ohtly.com/posts/2026-05-29-windmill-loki-monitoring/&#34; &gt;Windmill 日志监控&lt;/a&gt;：JSON 日志的 LogQL 告警&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;两条链路最终都汇入 Alertmanager，由它统一分派到飞书。但 Alertmanager 原生没有飞书 receiver——它的 webhook 输出的是原始 JSON，飞书看不懂。中间需要一层适配器来转换格式。这个适配器就是 &lt;strong&gt;alert-transformer&lt;/strong&gt;。&lt;/p&gt;</description>
    </item>
    <item>
      <title>OpenClaw 异步通知：Agent Turn 与 Wake 选型指南</title>
      <link>https://blog.ohtly.com/posts/2026-05-27-openclaw-message-agent-turn-vs-wake/</link>
      <pubDate>Wed, 27 May 2026 19:20:00 +0800</pubDate>
      <guid>https://blog.ohtly.com/posts/2026-05-27-openclaw-message-agent-turn-vs-wake/</guid>
      <description>&lt;h2 id=&#34;为什么需要这个&#34;&gt;&#xA;  为什么需要这个&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e4%b8%ba%e4%bb%80%e4%b9%88%e9%9c%80%e8%a6%81%e8%bf%99%e4%b8%aa&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;AI Agent 经常需要执行耗时较长的异步任务（视频剪辑、字幕生成、模型推理等）。任务完成后，如何通知用户？&lt;/p&gt;&#xA;&lt;p&gt;有三种常见实现方式：&lt;/p&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;th&gt;方式&lt;/th&gt;&#xA;          &lt;th&gt;过程&lt;/th&gt;&#xA;          &lt;th&gt;优点&lt;/th&gt;&#xA;          &lt;th&gt;缺点&lt;/th&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;strong&gt;同步等待&lt;/strong&gt;&lt;/td&gt;&#xA;          &lt;td&gt;发起任务 → 一直等到完成 → 返回结果&lt;/td&gt;&#xA;          &lt;td&gt;实现简单&lt;/td&gt;&#xA;          &lt;td&gt;长时间阻塞，用户体验差&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;strong&gt;异步轮询&lt;/strong&gt;&lt;/td&gt;&#xA;          &lt;td&gt;发起任务 → 拿到 job_id → 不断查询 → 完成&lt;/td&gt;&#xA;          &lt;td&gt;不阻塞&lt;/td&gt;&#xA;          &lt;td&gt;对话不能断开，浪费 token&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;&lt;strong&gt;异步+通知&lt;/strong&gt;&lt;/td&gt;&#xA;          &lt;td&gt;发起任务 → 返回&amp;quot;已提交&amp;quot; → 完成后主动推送&lt;/td&gt;&#xA;          &lt;td&gt;体验最好，资源最优&lt;/td&gt;&#xA;          &lt;td&gt;需要服务端支持回调&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;p&gt;OpenClaw 的独特优势在于它拥有 &lt;strong&gt;Webhook/Hook 机制&lt;/strong&gt;，可以作为服务端接收外部回调，主动推送消息到飞书。&lt;/p&gt;&#xA;&lt;p&gt;对比其他 AI 工具：&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;OpenCode / Claude Code&lt;/strong&gt;：纯 CLI 工具，只有&amp;quot;触发→等待→返回&amp;quot;的模式，没有回调机制&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;OpenClaw&lt;/strong&gt;：内置 Gateway 服务，支持 &lt;code&gt;/hooks/*&lt;/code&gt; 端点，天然适合异步回调&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;所以 &lt;strong&gt;&amp;ldquo;异步+通知&amp;rdquo;&lt;/strong&gt; 是 OpenClaw 的场景的最优解。&lt;/p&gt;&#xA;&lt;h2 id=&#34;整体架构&#34;&gt;&#xA;  整体架构&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e6%95%b4%e4%bd%93%e6%9e%b6%e6%9e%84&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;div class=&#34;mermaid&#34;&gt;&#xA;sequenceDiagram&#xA;    participant U as 用户（飞书）&#xA;    participant O as OpenClaw Agent&#xA;    participant W as Windmill / 外部系统&#xA;    participant H as OpenClaw Hook&#xA;&#xA;    U-&gt;&gt;O: 发消息处理这个视频&#xA;    O-&gt;&gt;W: API 调用（异步）&#xA;    O--&gt;&gt;U: 任务已提交&#xA;    Note over W: 几分钟后...&#xA;    W--&gt;&gt;H: POST /hooks/agent&#xA;    H-&gt;&gt;H: 创建 Agent Turn&#xA;    H-&gt;&gt;U: 飞书消息（带下载链接）&#xA;&#xA;&lt;/div&gt;&#xA;&#xA;&lt;h2 id=&#34;agent-turn-与-wake&#34;&gt;&#xA;  Agent Turn 与 Wake&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#agent-turn-%e4%b8%8e-wake&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;OpenClaw 提供了两种代码触发的消息通知方式，它们都通过 Gateway 的 &lt;code&gt;/hooks/*&lt;/code&gt; 端点实现。&lt;/p&gt;</description>
    </item>
    <item>
      <title>OpenClaw 飞书能力实战：踩坑、绕路、最终打通云文档/日历/任务</title>
      <link>https://blog.ohtly.com/posts/2026-05-27-openclaw-feishu-practice/</link>
      <pubDate>Wed, 27 May 2026 11:08:00 +0800</pubDate>
      <guid>https://blog.ohtly.com/posts/2026-05-27-openclaw-feishu-practice/</guid>
      <description>&lt;h2 id=&#34;为什么选飞书&#34;&gt;&#xA;  为什么选飞书&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e4%b8%ba%e4%bb%80%e4%b9%88%e9%80%89%e9%a3%9e%e4%b9%a6&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;OpenClaw 接入 IM 的几种方式里，飞书是目前最好的选择。Telegram、Discord 都是国外平台，国内访问不稳定；微信个人号方案有封号风险。飞书拥有开放的 API 生态、免公网 IP 的长连接方式，以及云文档、多维表格、日历、任务等一体化工作能力，天然适合作为 AI Agent 的操作界面。&lt;/p&gt;&#xA;&lt;h2 id=&#34;踩坑飞书官方插件&#34;&gt;&#xA;  踩坑：飞书官方插件&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e8%b8%a9%e5%9d%91%e9%a3%9e%e4%b9%a6%e5%ae%98%e6%96%b9%e6%8f%92%e4%bb%b6&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;飞书官方推出了 OpenClaw 插件 &lt;code&gt;@larksuite/openclaw-lark&lt;/code&gt;，号称可以让 Agent 以用户身份操作飞书资源：创建文档、管理任务、查看日历等。我按照官方文档在服务器上安装并启用后，对话正常，Agent 也能回复消息。&lt;/p&gt;&#xA;&lt;p&gt;但问题来了——让 Agent 创建一个飞书任务，它回复&amp;quot;已创建&amp;quot;；让创建云文档，也说&amp;quot;已创建&amp;quot;。然而打开飞书，&lt;strong&gt;任务列表里空空如也，云文档里也没有任何新文件&lt;/strong&gt;。&lt;/p&gt;&#xA;&lt;p&gt;查日志发现了关键错误：&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;[plugins] plugin must declare contracts.tools before registering agent tools&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;追到 OpenClaw 主仓库，发现这是 OpenClaw 核心框架的一个 bug（&lt;a href=&#34;https://github.com/openclaw/openclaw/issues/80621&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;issue #80621&lt;/a&gt;）：插件明明正确声明了 &lt;code&gt;contracts.tools: true&lt;/code&gt;，但运行时在注册工具时被拒绝。修复补丁（&lt;a href=&#34;https://github.com/openclaw/openclaw/pull/84512&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;PR #84512&lt;/a&gt;）已提交，但尚未合入。&lt;/p&gt;&#xA;&lt;p&gt;所以 openclaw-lark 本身没有 bug，是上游 OpenClaw 框架的 &lt;code&gt;registerTool&lt;/code&gt; 检查逻辑有问题，导致飞书官方插件的所有工具（任务、文档、日历等）都无法注册到 Agent。Agent 回退到用 &lt;code&gt;message&lt;/code&gt; 工具发送文本消息，所以&amp;quot;已创建&amp;quot;只是发了一条消息到飞书聊天里，实际什么都没创建。&lt;/p&gt;&#xA;&lt;h2 id=&#34;绕路内置-feishu-插件--飞书-cli&#34;&gt;&#xA;  绕路：内置 feishu 插件 + 飞书 CLI&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e7%bb%95%e8%b7%af%e5%86%85%e7%bd%ae-feishu-%e6%8f%92%e4%bb%b6--%e9%a3%9e%e4%b9%a6-cli&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;既然飞书官方插件暂时不可用，替代方案是：&lt;strong&gt;OpenClaw 自带的 &lt;code&gt;@openclaw/feishu&lt;/code&gt; 插件 + 飞书 CLI&lt;/strong&gt;。&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
