跳到主要内容

操作 Teams 会议流水线

在已从 Teams 会议 启用该功能后,请使用本指南。

本页涵盖:

  • 操作员 CLI 流程
  • 常规订阅维护
  • 故障分类排查
  • 上线检查
  • 发布工作表

核心操作员命令

验证配置快照

hermes teams-pipeline validate

在任何配置更改后首先使用此命令。

检查令牌健康状态

hermes teams-pipeline token-health
hermes teams-pipeline token-health --force-refresh

当怀疑存在过期的身份验证状态时,使用 --force-refresh

检查订阅

hermes teams-pipeline subscriptions

续订即将过期的订阅

hermes teams-pipeline maintain-subscriptions
hermes teams-pipeline maintain-subscriptions --dry-run

自动化订阅续订(生产环境必需)

Microsoft Graph 订阅最多在 72 小时后过期。 如果没有进行续订,会议通知将在 3 天后静默停止,导致流水线看似“损坏”。这是任何基于 Graph 的集成的头号运营故障模式。

必须按计划运行 maintain-subscriptions。从以下三个选项中选择一个:

Hermes 附带内置的 cron 调度器。--no-agent 模式将脚本作为任务运行(而不是使用 LLM),且 --script 必须指向 ~/.hermes/scripts/ 下的文件。首先创建脚本:

mkdir -p ~/.hermes/scripts
cat > ~/.hermes/scripts/maintain-teams-subscriptions.sh <<'EOF'
#!/usr/bin/env bash
exec hermes teams-pipeline maintain-subscriptions
EOF
chmod +x ~/.hermes/scripts/maintain-teams-subscriptions.sh

然后注册一个每 12 小时运行一次的仅脚本 cron 任务(相对于 72 小时的过期窗口提供 6 倍的余量):

hermes cron create "0 */12 * * *" \
--name "teams-pipeline-maintain-subscriptions" \
--no-agent \
--script maintain-teams-subscriptions.sh \
--deliver local

验证其已注册并检查下次运行时间:

hermes cron list
hermes cron status # scheduler status

创建 /etc/systemd/system/hermes-teams-pipeline-maintain.service

[Unit]
Description=Hermes Teams pipeline subscription maintenance
After=network-online.target

[Service]
Type=oneshot
User=hermes
EnvironmentFile=/etc/hermes/env
ExecStart=/usr/local/bin/hermes teams-pipeline maintain-subscriptions

以及 /etc/systemd/system/hermes-teams-pipeline-maintain.timer

[Unit]
Description=Run Hermes Teams pipeline subscription maintenance every 12 hours

[Timer]
OnBootSec=5min
OnUnitActiveSec=12h
Persistent=true

[Install]
WantedBy=timers.target

启用:

sudo systemctl daemon-reload
sudo systemctl enable --now hermes-teams-pipeline-maintain.timer
systemctl list-timers hermes-teams-pipeline-maintain.timer

选项 3:普通 crontab

0 */12 * * * /usr/local/bin/hermes teams-pipeline maintain-subscriptions >> /var/log/hermes/teams-pipeline-maintain.log 2>&1

确保 cron 环境拥有 MSGRAPH_* 凭据。最简单的修复方法是在 crontab 调用的包装脚本顶部 source ~/.hermes/.env

验证续订是否正常工作

设置好计划后,在第一次计划运行后检查续订活动:

hermes teams-pipeline subscriptions   # should show expirationDateTime advanced
hermes teams-pipeline maintain-subscriptions --dry-run # should show "0 expiring soon" most of the time

如果你发现 Graph webhook 在恰好约 72 小时后神秘地“停止工作”,首先要检查的是:续订任务是否实际运行了?

检查最近的任务

hermes teams-pipeline list
hermes teams-pipeline list --status failed
hermes teams-pipeline show <job-id>

重放存储的任务

hermes teams-pipeline run <job-id>

干跑会议工件获取

hermes teams-pipeline fetch --meeting-id <meeting-id>
hermes teams-pipeline fetch --join-web-url "<join-url>"

常规运行手册

首次设置后

按顺序运行以下命令:

hermes teams-pipeline validate
hermes teams-pipeline token-health --force-refresh
hermes teams-pipeline subscriptions

然后触发或等待真实的会议事件并确认:

hermes teams-pipeline list
hermes teams-pipeline show <job-id>

每日或定期检查

  • 运行 hermes teams-pipeline maintain-subscriptions --dry-run
  • 检查 hermes teams-pipeline list --status failed
  • 验证 Teams 交付目标是否仍为正确的聊天或频道

更改 webhook URL 或交付目标之前

  • 更新公共通知 URL 或 Teams 目标配置
  • 运行 hermes teams-pipeline validate
  • 续订或重新创建受影响的订阅
  • 确认新事件进入预期的接收端

故障分类排查

未创建任何任务

检查:

  • msgraph_webhook 是否已启用
  • 公共通知 URL 是否指向 /msgraph/webhook
  • 订阅中的客户端状态是否与 MSGRAPH_WEBHOOK_CLIENT_STATE 匹配
  • 远程订阅是否仍然存在且未过期

任务停留在重试状态或在摘要生成前失败

检查:

  • 转录权限和可用性
  • 录制权限和工件可用性
  • 如果启用了录制回退,检查 ffmpeg 可用性
  • Graph 令牌健康状态

已生成摘要但未交付到 Teams

检查:

  • platforms.teams.enabled: true
  • delivery_mode
  • webhook 模式下的 incoming_webhook_url
  • Graph 模式下的 chat_idteam_id 加上 channel_id
  • 如果使用 Graph 发帖,检查 Teams 身份验证配置

重复或意外的重放

检查:

  • 是否使用 hermes teams-pipeline run 手动重放了任务
  • 该会议的接收端记录是否已存在
  • 是否在本地配置中有意启用了重新发送路径

上线检查清单

  • Graph 凭据存在且正确
  • msgraph_webhook 已启用且可从公共互联网访问
  • MSGRAPH_WEBHOOK_CLIENT_STATE 已设置并与订阅匹配
  • 已创建转录订阅
  • 如果需要 STT 回退,则已创建录制订阅
  • 如果启用了录制回退,则已安装 ffmpeg
  • Teams 出站交付目标已配置并验证
  • 仅在确实需要时配置 Notion 和 Linear 接收端
  • hermes teams-pipeline validate 返回 OK 快照
  • hermes teams-pipeline token-health --force-refresh 成功执行
  • maintain-subscriptions 已安排(Hermes cron、systemd timer 或 crontab — 参见 自动化订阅续订)。如果没有此项,Graph 订阅将在 72 小时内静默过期。
  • 真实的端到端会议事件已生成存储的作业
  • 至少有一个摘要已到达预期的交付接收端

交付模式决策指南

模式适用场景权衡
incoming_webhook只需简单发布到 Teams设置最简单,控制力较少
graph需要通过 Graph 发布到频道或聊天控制力更强,但需要更多身份验证和目标配置

操作员工作表

在 rollout 之前填写此表:

项目
公共通知 URL
Graph 租户 ID
Graph 客户端 ID
Webhook 客户端状态
转录资源订阅
录制资源订阅
Teams 交付模式
Teams 聊天 ID 或团队/频道
Notion 数据库 ID
Linear 团队 ID
存储路径覆盖(如果有)
每日检查负责人

变更审查工作表

在更改部署之前使用此表:

问题回答
我们是否正在更改公共 webhook URL?
我们是否正在轮换 Graph 凭据?
我们是否正在更改 Teams 交付模式?
我们是否正在迁移到新的 Teams 聊天或频道?
是否需要重新创建或续订订阅?
我们是否需要进行全新的端到端验证运行?