fix: prime bypasses the stale service worker; never saves an empty capture
After the 2026-11-10 Wodify redeploy, prime captured zero actions and every query reported NOT PRIMED. It looked like another endpoint move. It was not: every allowlisted path and response shape is unchanged. The app's service worker was serving the old OutSystems runtime to pages running the new screen code. That mixed app throws in Controller.callServerDataSource before any data action is sent, so there was nothing to observe. Measured per tab setting: bypassing the service worker alone fixes it; disabling the HTTP cache alone does not. - cdp.open_page: Network.setBypassServiceWorker on the prime tab. Per-tab, nothing in the profile is unregistered or cleared. - cdp.close: close the tab the session opened. Every prime leaked one. - prime: refuse to save a capture with no actions, leave the existing cache alone, and say why. Page errors are collected and reported, which is what separates "the browser's copy of the app is broken" from "Wodify moved its endpoints". - Skill/: the cron prompts applied the generic exit-code table to `list` commands. For `list`, 3 is session expired, 4/5 are stale / not primed, 6 is an unindexed class id. Exit 5 was not handled at all. Also document the `waitlist` value of the YOU column. - CLAUDE.md / README: record the diagnosis, the measurements, the Firebase red herring, and both exit-code tables. Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
1 parent
cd7924d890
commit
a15efa0874
9 files changed
+498
-16
No files matched your search
+4
-1
@@ -12,7 +12,10 @@
|
||||
|
||||
- **没有预约就完全静默**——不发 "今天没课" 这种废话
|
||||
- WOD 内容是 nice-to-have:拉不到也照常 nag,绝不编造课表
|
||||
- CLI 挂了按 exit code 分级处理(2=session 过期,3/4=先 prime 再重试)
|
||||
- CLI 挂了按 exit code 分级处理。两个 job 只用 `list` 命令,它的退出码是:
|
||||
3=session 过期(停下,等人重新登录),4/5=缓存过期或未 prime(prime 一次再重试一次),
|
||||
6=class ID 未索引,2=参数错误。注意这和 `bookings` 等通用命令的退出码(2/3/4)不同
|
||||
- YOU 列取值:`signed in`(已签到)、`reserved`(已预约)、`waitlist`(候补,不算确认的预约)
|
||||
|
||||
## 安装(Hermes Agent 示例)
|
||||
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
1. 获取今天的日期(YYYY-MM-DD)
|
||||
2. 运行 `wodify list date <今天日期>` 查看当天课程列表
|
||||
3. 检查输出中的 YOU 列:
|
||||
3. 检查输出中的 YOU 列(你的课前面还会有 `»` 标记):
|
||||
- 如果有 `reserved` 或 `signed in` 的课 → 继续步骤 4
|
||||
- 如果是 `waitlist`(候补中,名额未确认)→ 也继续步骤 4,但简报里要写明"候补中",不要说成已预约
|
||||
- 如果没有任何预约(全是 `-`)→ **什么都不输出,直接结束**(不要发任何消息)
|
||||
4. 拿到预约课的 ID,运行 `wodify list workout <ID>` 获取训练内容
|
||||
5. 根据训练内容生成简报并发送
|
||||
@@ -44,4 +45,13 @@
|
||||
- 如果有多节课都预约了,每节都出一份简报
|
||||
- 保持简洁,不要长篇大论
|
||||
- wodify CLI 路径:~/.local/bin/wodify(或 PATH 中的 `wodify`)
|
||||
- 如果 wodify 返回 exit code 2(session expired),输出:"⚠️ Wodify session 过期了,需要重新登录才能查 WOD。" 然后结束。
|
||||
|
||||
## Wodify CLI 退出码处理(`list date` / `list workout`)
|
||||
|
||||
`list` 命令的退出码和 `bookings` 等通用命令**不一样**,别混用:
|
||||
|
||||
- exit 3:session 过期。输出:"⚠️ Wodify session 过期了,需要重新登录才能查 WOD。" 然后结束。**不要** prime,prime 救不了过期的 session。
|
||||
- exit 4(Wodify 重新部署,缓存过期)/ exit 5(未 prime):运行一次 `wodify prime --workout-date <今天日期>`,然后把刚才失败的命令重试一次。
|
||||
- prime 自己失败(exit 1)或重试后仍失败:输出一行 "⚠️ Wodify CLI 暂时不可用:<prime 或 CLI 打印的那一行错误>",然后结束。不要循环 prime,也不要猜课表。
|
||||
- exit 6:这个 class ID 不在本地索引里 → 先对那一天跑 `wodify list date`,再重试。
|
||||
- exit 2:参数写错了(日期或 ID 格式),改正后重试一次。
|
||||
@@ -4,11 +4,14 @@
|
||||
|
||||
1. 获取今天的日期(YYYY-MM-DD)
|
||||
2. 运行 `~/.local/bin/wodify list date <今天日期> --refresh` 查看当天课程(签到状态必须实时获取,一小时缓存也可能早于刚发生的签到)
|
||||
3. 检查是否有「你」预约了的课(YOU 列显示 booked / signed in)
|
||||
3. 检查是否有「你」的课(行首有 `»`,YOU 列不是 `-`)。YOU 列的取值:
|
||||
- `signed in`:已签到,确认上了课
|
||||
- `reserved`:只是预约了,不能当作实际上了课
|
||||
- `waitlist`:候补,没排上 —— 到晚上还是 `waitlist` 就等于没上课,**按没有预约处理**
|
||||
|
||||
## 判断逻辑
|
||||
|
||||
- **如果没有预约**:什么都不要说。静默退出,不发任何消息。
|
||||
- **如果没有预约**(全是 `-`,或只有 `waitlist`):什么都不要说。静默退出,不发任何消息。
|
||||
- **如果有预约**:尝试运行 `~/.local/bin/wodify list workout <class_id>` 获取 WOD 内容,然后**无论如何都要**主动来找用户问问题,nag 他记录今天的锻炼数据。
|
||||
|
||||
## 有预约时的行为
|
||||
@@ -26,10 +29,14 @@
|
||||
|
||||
**⚠️ 核心规则:只要有预约就必须发消息 nag。WOD 内容是 nice-to-have,不是必要条件。** 有些课程类型本身就没有 WOD 数据;`list workout` 也可能因为 CLI prime 失败、attendees action 无法 prime 等原因拿不到内容 —— 这些都只影响第 2 步,不影响整个 nag。用预约信息(课名/时间/教练)+ 骨架问题(重量 / Level / 成绩 / AW 截图 / 感觉)照常提问。
|
||||
|
||||
## Wodify CLI 退出码处理
|
||||
## Wodify CLI 退出码处理(`list date` / `list workout`)
|
||||
|
||||
- exit 2: session 过期,告诉用户需要重新登录
|
||||
- exit 3/4: 运行 `~/.local/bin/wodify prime` 后重试
|
||||
`list` 命令的退出码和 `bookings` 等通用命令**不一样**,别混用:
|
||||
|
||||
- exit 3: session 过期,告诉用户需要重新登录。**不要** prime,prime 救不了过期的 session
|
||||
- exit 4(Wodify 重新部署,缓存过期)/ exit 5(未 prime): 运行一次 `~/.local/bin/wodify prime --workout-date <今天日期>` 后,把失败的命令重试一次。prime 自己失败(exit 1)就不要再循环
|
||||
- exit 6: class ID 不在本地索引里,先跑当天的 `list date` 再重试
|
||||
- exit 2: 参数写错了(日期或 ID 格式),改正后重试一次
|
||||
- exit 0 但无课程: 当天没课,静默退出
|
||||
|
||||
## 重要
|
||||
|
||||
Reference in new issue
Block a user