Repository navigation
Conversation
Lark only allows editing a card for 14 days. When updateCard fails with MessageUpdateExpiredError (230031), the project coordinator previously threw and the pinned progress card stayed stale forever. Treat an expired update like a withdrawn message: unpin the stale card, send a fresh card, pin it, and persist the new card id. Add regression tests for the expired and unrelated-error paths. Co-Authored-By: Claude Code <[email protected]>
|
自动评审初步意见(最终以维护者审阅为准) 修复方向认可:230031(超过飞书 14 天编辑窗口)后把旧卡 unpin、重发新卡并持久化新 但当前 head 有一项阻断回归和一项设计缺口需要处理: P1(阻断):破坏
P2(设计缺口):持续失败下重发无上限 探针(真实 P3(观察项,不阻断)
验证记录: |
|
Thanks — addressing the P1/P2 design gap: the expired-card repost will move into the runtime sync's per-digest budget (with a per-chat cooldown) instead of being swallowed in |
按卡片和实际渲染摘要核对后台 PATCH 预算,耗尽后才对过期卡限频重发。保留显式恢复路径,记录取消置顶失败并允许对已保存的新卡补置顶。
|
Pushed
Tests: 48/48 |
|
CI has been queued since 06:58Z (the |
deepcoldy
left a comment
There was a problem hiding this comment.
增量复审结论:暂不建议合入(4 个 P2)
复审基于远端 head cd0c9a0b;本地在最新 master 上的 rebase 树 da0ee4b417 验证。原先 project-card-runtime-sync 的 CI 回归已经消失,纯后台持续过期路径也已有预算、冷却、模式切换和并发 tick 覆盖。但以下四条自动路径 / 失败组合仍会使恢复状态机失效;每条都用真实 ProjectCoordinator、真实项目存储及 fenced 探针复现。
1. [P2] 自动 report 仍绕过全部重发限频
src/services/project-coordinator.ts:291-296 以 action !== 'refresh' 判定 repostOnExpired:true。但 report 不只是人工 /project 命令:worker 的自动进展上报也从 src/services/project-workstream-attachments.ts:600-603、:643-649 进入同一 run()。因此这些自动写入完全绕开 runtime sync 的 PATCH 预算、每 digest 去重与 10 分钟冷却。
探针令所有卡的 updateCard 持续抛 230031、send/pin/unpin 正常:在完成 init/dispatch 基线后,20 次自动 report 额外产生 20 张新卡、20 次 pin、20 次 unpin。这与本 PR 要消除的持续重发缺口相同。建议不要按 action 名称推断「人工显式操作」,由调用方明确选择发布策略;自动 report 应复用 sync 预算与冷却。
2. [P2] 第三次是瞬时错误会抹掉已经确认的过期状态
src/services/project-card-runtime-sync.ts:81-88 只在「预算耗尽的这一次错误」为 230031 时设置 awaitingRepost。同一 digest 前两次 PATCH 已返回 230031、第三次遇到网络错误时,状态变成 failures=3, awaitingRepost=false;后续 tick 在 :87-88 直接返回。过期是永久事实,后一次瞬时错误不应撤销重发资格。
真实 sync 探针按「expired → expired → transient」注入错误,随后再跑 20 tick:总计仍只有 3 次 PATCH、0 次 repost、1 张初始卡,旧卡保持陈旧。建议按 digest 记录 sawExpired,预算耗尽时依据整个窗口而非最后一次错误决定重发。
3. [P2] unpin 未确认后仍覆盖旧 ID,旧置顶永久失联
src/services/project-coordinator.ts:562-575 对 unpinMessage=false 或异常仅 warn 并继续;sendAndPinCard() 随后在 :594-600 把存储切到新 ID,没有保存待清理旧 ID。现有 test/project-group-mode.test.ts:448-466 只钉住「仍换卡并 warn」,没有验证旧置顶最终清理。
探针令旧卡过期、unpinMessage(oldId)=false,新卡 send/pin 成功:存储立即变为 om_card_2/pinned:true;继续 20 次成功更新后,旧 om_card_1 的 unpin 调用仍只有第一次,再无恢复入口。建议 unpin 未确认时中止本次重发并保留旧卡状态,或持久化待清理旧 ID,后续限频重试。
4. [P2] 后台重发的新卡 pin 失败后被记为成功,不再补置顶
后台 refreshCard() 固定 repostOnExpired:false,所以 src/services/project-coordinator.ts:555 不会在成功 PATCH 后调用 confirmCardPin()。而 src/services/project-card-runtime-sync.ts:103-107 不检查重发结果的 card.pinned,即使新卡 pin 返回 false 也 rememberPublished() 写入 failures:0,同 digest 后续直接跳过。
真实 sync 探针令旧卡过期、unpin/send 成功、新卡第一次 pin 返回 false:重发后存储为 om_card_2/pinned:false;随后 20 个 tick 没有任何补 pin 调用,旧卡已取消置顶,新卡也一直未置顶。建议把未确认 pin 保留为待恢复状态并限频重试,或让后台成功路径同样执行幂等补置顶。
验证记录
- 本地相关回归:8 个测试文件 164/164 passed(runtime-sync、group-mode、workstream-attachments、coordinator-runtime、task-event-route、group-command、group-mode-api、import-legacy-route)。
bun run typecheck:通过。- 远端
cd0c9a0b的 build、4 个 vitest 分片、4 个 Bun 分片及二进制检查均为 SUCCESS;上述问题位于现有测试未覆盖的行为组合,不是当前 CI 红。 - 探针均在
bun scripts/fenced-run.ts下运行,只使用临时 HOME / 存储与假 transport,未触达真实飞书或 fleet。
|
Thanks for the incremental review. Addressing all four P2s: explicit publish policy instead of action-name inference (automatic |
让自动回报只提交业务状态,统一由后台按摘要和冷却发布。累计编辑过期信号,未确认旧卡解除置顶时保留旧 ID,并持久化新卡补置顶的重试窗口。
|
Pushed
Tests: 117/117 targeted, 44/44 adjacent, |
同一旧卡的替换发送使用稳定 UUID 并转发飞书幂等去重,写库失败或重启后的重试可取回原 messageId;命中去重后 PATCH 最新卡片内容,避免恢复期间业务或运行态变化造成重复卡。重发失败只记录每群冷却,不再把对应摘要永久视为完成,unpin/send 瞬败可在冷却后自动重试。 补充真实写盘失败、同步器与协调器重建、内容变化、对齐 PATCH 瞬败及 unpin/send 冷却回归。独立探针复验覆盖 revision 变化、runtime 变化、重启和部分失败;移除 UUID 或失败冷却记录的变异均咬红。 Co-Authored-By: Claude Code <[email protected]>
deepcoldy
left a comment
There was a problem hiding this comment.
已在 ca1e3f05c 上追加并 fast-forward 推送 0a3cfb5fc,未改写作者已有提交。
本次补充修复
- 同一旧卡的替换发送使用稳定 UUID(app、chat、旧 messageId),并透传到现有飞书
sendMessage幂等协议。send 成功但新 ID 写库失败时,后续重试或进程重建可取回原 messageId,不再永久静默或盲目另发新卡。 - 命中去重后,对同一 messageId 再 PATCH 最新 cardJson;恢复期间即使用户写入改变 revision、或 owner 显示名等 runtime 内容改变,也只有一张逻辑替换卡,且内容最终收敛到最新版本。
- unpin/send 瞬败只进入每群 10 分钟冷却,不再把该 digest 永久视为已尝试完成;成功重发才按 digest 去重。冷却后可自动重试。
探针与变异证据
真实 coordinator + runtime sync + 临时 JSON 存储、可控时钟:
- 写库失败后 revision 改变、仅 runtime Alpha→Beta、Coordinator+Sync 重建:均复用同一 UUID 和原 messageId,只有 1 张替换卡,最终内容为最新版本。
- 内容对齐 PATCH 瞬败:后续 tick 或重建后仅 PATCH 同一 ID,不再次 send;随后按
pinRetryAt补置顶。 - 原四项验收在最终 head 复跑:20 次自动 report 新增 send/pin/unpin 均为 0;混合错误成功重发一次;unpin 失败先中止并保留旧 ID、恢复后清理;pin 到期补成功后 20 tick 不再重复。
- 隔离变异:移除 send UUID 后 3 条恢复用例咬红;移除失败冷却记录后 unpin/send 两条用例咬红。
验证
bun run build:通过。- 18 个直接消费方与测试卫生文件:1111/1111 passed。
- Bun:
project-card-runtime-sync27/27、project-group-mode32/32、project-workstream-attachments62/62。 git diff --check:通过;推送后 API 确认 head 为0a3cfb5fc46a551e9ce4215263b97beacda1667e。
deepcoldy
left a comment
There was a problem hiding this comment.
#109 合并树背书:接受窄例外(仅绑定以下精确提交与树)
结论:接受 #109,无需为同步 master 另出新 head 重跑首跑 CI。 可按既定流程 squash;如果 master 再次前进,本背书失效。
独立核对
- PR head:
0a3cfb5fc46a551e9ce4215263b97beacda1667e,冻结未变。 - 当前 master:
36f11a21e3594b881c2f9737a401661dc74de24f(包含在你给定b5cff66a之后新增的 #3883)。 git merge-tree --write-tree 36f11a21 0a3cfb5f:无冲突,预测 tree 为3cfa106c5ecd19dbd73bafe5b9ba94dcb141eca0;本地实际合成合并树后git write-tree逐字相等。- 先前
b5cff66a对应的本地合并 commit/tree0451841d / fbd44b99也核对一致,但没有用它替代当前 master 的验证。
交集判断
- #3883 在
daemon.ts只新增第 244 行 import,以及第 36270 行附近两个 worker-pool 回调;与本 PR 的 project card runtime sync 块没有相邻 hunk、共享标识符或语句交叠。 - 你列出的 #3876 decisionBoard 块与本 PR projectCardRuntimeSync 块之间仍由 projectImports 和 projectCardContext 两个独立块隔开;
dashboard-ipc-server.ts两侧同样为非相邻机械并集。 - 自动合并结果与逐文件检查一致,未发现需要人工语义取舍的交叠。
当前树实测
bun run build:通过(含完整 TypeScript 编译与 typecheck)。- 本 PR 消费方、测试卫生及 #3883 自带测试共 20 文件:1146/1146 passed。
- 首轮并发运行中
event-dispatcher的慢插件 ACK 用例出现一次时序失败;随后单用例通过、整文件 767/767 通过,同一 20 文件组合复跑也全部通过,没有稳定失败用例。 - CI run
45834571700:attempt=1,headSha 精确为0a3cfb5f,14/14 checks 全部 completed + success,包括聚合test。
|
感谢贡献,这个修复已合入 master(squash 1789521)。 最终落地的能力:项目群置顶进度卡超过飞书 14 天编辑窗口(
验证:最新主干合并树上 后续:飞书真机上卡片置顶与重发的实际视觉效果,留待版本发布后验证。欢迎继续贡献。 |
|
🚀 Released in v3.59.35 |
Problem
Lark only allows editing a card for 14 days. When a project group's pinned progress card is older than that,
updateCardfails withMessageUpdateExpiredError(230031).ProjectCoordinator.publish()only treated withdrawn messages as "repost", so every later project update threw and the pinned card stayed stale forever.Fix
Treat an expired edit window like a withdrawn message: unpin the stale card, send a fresh card, pin it, and persist the new
card.messageId. Unrelated update failures still propagate.Tests
vitest run test/project-group-mode.test.ts→ 26 passed.Verification
Applied the same change to a local release, restarted the daemon, and triggered a project update: the new card was sent and pinned, the stale card was unpinned, and
project-groups.jsonstored the new card id.🤖 Generated with Claude Code