返回博客

Comma 值班与 Bug 分诊指南

全天候盯着 #support 和告警频道,在云端电脑上复现客户报告,开一个草稿修复 PR,用一条讨论串从分诊一路跟到合并。

开始使用阅读文档

值班被打断之所以难受,很少是因为修 bug 要花几个小时,而是因为分诊要耗掉 45 分钟来回切换:读 #support 里一条含糊的消息、查有没有人已经开过 issue、复现故障、追日志,还要一边写修复一边更新三个频道。

Comma 替你 24/7 跑这个分诊循环。当 bug 报告出现在 #support 或你的收件箱里,Salix Loop 会唤醒一个 Worker 去调查,在云端电脑上复现问题,然后交给你一份干净的诊断,往往还附带一个已经在等你评审的草稿修复 PR。

准备

  • 频道:通过 Comma for Teams(或你的个人 Workspace)连接 Slack、Feishu 或 Lark 里的 #support / #alerts。

  • 工具:连接 GitHub、Linear、PostHog,如果团队在用,再连接只读的可观测性 / 日志 MCP 工具。

  • 算力:用 Comma 的云端电脑做隔离复现,或者用 Devices 下连着预发环境的 Linux Worker。

端到端的值班工作流

第 1 步:用 Loop 盯住真正的 bug 报告

text
Watch #support and my support inbox. When a new report describes a
crash, 5xx error, data mismatch, or broken workflow:
1. Check existing open Linear issues and recent GitHub PRs first to
   avoid filing duplicates.
2. Start a triage Task with the exact report, affected customer tier,
   and links to related code or recent deploys.

第 2 步:叫醒工程师之前先复现

在分诊 Task 里,Comma 的 Worker 会用云端电脑:

  • 在干净的环境里检出相关的提交。

  • 写一个最小的失败测试,或者对预发环境做一次浏览器复现。

  • 抓取失败的堆栈、截图或 HTTP 响应,并把已验证的复现和未验证的假设分开。

当根因清楚、范围明确时:

text
If you can reproduce the bug locally with a deterministic test, open a
draft PR with the regression test and minimal fix, create or update the
Linear issue, and post a 5-line summary in the #support thread. Leave
the customer reply in drafts until an engineer reviews the fix.

第 4 步:换班时留一份干净的交接

一个值班班次结束时:

text
Summarize all on-call triage Tasks from the last 24 hours for handoff:
- Resolved (with merged PR link)
- Mitigated / monitoring (what to watch)
- Still open (current hypothesis, next step, owner)
Post as a draft for #on-call-handoff.
Comma 任务看板:两个进行中的值班 Task、一个在 Needs Review 中等待审阅的修复,以及一条已完成的客户回复。
每份报告都变成一个 Task:复现、修复、审阅、回复。

示例:凌晨 3 点的告警如何收场

  1. 凌晨 2:48:一位客户在 #support 里报告,超过 10 MB 的 CSV 导出会超时。

  2. 凌晨 02:49:Loop 唤醒 Comma;它在 Linear 里没找到重复的未关闭 issue,于是查看最近涉及 export 的提交。

  3. 凌晨 02:54:Worker 在云端电脑上用单元测试复现了 10 MB 时的内存飙升,改成流式输出,并验证测试通过。

  4. 凌晨 02:57:Comma 开了草稿 PR #482,关联 Linear issue ENG-219,并把总结留在 Needs Review。

  5. 早上 08:15:值班工程师开始一天的工作时,看到的是一张卡片,附带通过的回归测试和干净的 diff,而不必从头开始。

值班安全规则

  • 绝不从未经评审的分诊 Task 自动部署或改动生产环境。生产环境的写入严格放在人工批准或专门的发布流水线之后。

  • 要明确的证据,不要猜测:让 Comma 直接说明“无法复现:缺少请求数据 / 账户状态”,而不是编造一个根因。

  • 尊重频道的安静:在 Slack/Feishu/Lark 里,在原讨论串内回复;如果有人接手并请 Comma 退出,Comma 会干净地离开这个讨论串。


Try Comma, Now.

开始使用