Repository navigation
Reject recalled Lark messages before admission or reply - #8847
Conversation
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.1-sol · OpenAI · runtime_reported · reasoning_effort=max
Request changes conclusion (author-owned PR; GitHub blocks formal self-review)
评审提交 bf5c9aa944c3a9055c8d169f6ae2ee2a37d6e4aa,对照基线 f38fae05bb9a1c2cc54a2641359224cc253d32ac。
动机 / Motivation
[P2] 让确认撤回的 Steward 卡片退出待交付队列。 已捕获 /triage 后,原消息在首次卡片核对前或最终发送前标记为 deleted=true。 候选的来源核验返回空值,卡片将其当作暂时不可读。独立用例在主干 4 项通过。候选两个撤回场景待处理计数都为 1,路径仍列入两种扫描,缺少原来的 original_source_changed。已编辑正文和暂时读不到的两组均保留预期行为,所有场景零 provider 写。 在已有 source proof 中保留可识别、已经过身份核对的撤回结果,供卡片 reconcile 执行 original_source_changed。普通准入和回帖继续拒绝,暂时读不到仍可重试。 撤回分支 卡片对账
在 Lark 私聊和群话题撤回消息的人,以及正在等待 Steward 卡片的私聊使用者。撤回后的 provider 记录仍可保留正文、发送者与群话题关系。旧的普通回复路径会把这条记录当作可执行的来源。候选会阻断被撤回消息的准入与普通回复,群话题根也参与检查。已捕获的 Steward 卡片遇到撤回时仍被记为待交付。改动集中在源核验和既有交付状态。卡片格式、回调订阅和已保存答案的冻结输入比较另走各自流程。
规范 docs/reference/protocols/manager-evidence-and-continuity-v0.md @ f38fae05bb9a1c2cc54a2641359224cc253d32ac。核对 Recheck current scope and target revision,即发送或准入前重新核对授权和原请求所指的当前来源,未知效果继续由原 receipt owner 对账。 规范原文
改动思路 / Approach
在现有 Lark 来源核验处拒绝已撤回消息可以复用当前读回。卡片 reconcile 同时需要识别已核实的撤回,才能结束自己的待交付项。普通私聊、群话题和原 root 保持拒绝。Steward 卡片继续用现有日志区分可重试的未确认来源和已核实的撤回。
Lark CLI 固定版本在渲染正文时仍传递布尔字段 deleted。群话题还需核对原始消息的数据和根消息。 官方格式化实现
具体改动 / Changes
关键代码讲解
LarkPrivateConversations._source_message。私聊渲染结果、群规范消息及原始 root 都检查 deleted。此处返回空值时,卡片也失去了已经证实的撤回状态。 private_conversations.py L628LarkPrivateConversations._source_verified。已有出站核验沿用来源检查,普通回复在最终预览后遇到撤回时不会写 provider 或记录发送尝试。 private_conversations.py L693private_steward_triage.reconcile。已有失败分支把暂不可读留待重试,把确认撤回或正文改变写入 original_source_changed。候选在确认撤回时先进入前一个分支。 private_steward_triage.py L305
对主干的风险 / Risks
普通消息的六个撤回用例在主干失败,在候选通过。完整源核验套件里,双方的九个历史失败具有相同测试 ID 和错误签名。新的 Steward 用例独立观察 provider 写、磁盘状态和待交付计数。把现有编辑源的测试参数扩为明确撤回、暂时不可读,并覆盖投递前二次读。检查零 provider 写、两个队列的成员和绑定待交付数。 候选的 diff 预合并检查通过。 相关测试
我的整体评价 / Verdict
请求修改。保留群聊和私聊的撤回拦截,同时恢复 Steward 对已确认撤回的终止状态。正常调度与回执语义仍在现有 owner 内。 验证使用隔离 Core、真实本地 transport 与合成 provider。真实 Lark 和安装态待验。 变更未触及界面渲染。
English verdict: REQUEST_CHANGES. keep the recall gate and preserve the terminal disposition for a queued Steward card whose source is confirmed recalled.
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI (runtime_reported, max)
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机 / Motivation
飞书用户撤回原消息后,普通 Chat 和 Steward 应按该会话当前可核验的来源决定是否准入、回帖或保留待发卡片。 Lark CLI 可以同时返回正文与 deleted=true。旧 worker 仍可能使用这个正文。上一候选挡住普通入口,但已确认撤回的 Steward 卡片持续占用两个队列。 当前 worker 核对原来源,确认撤回后让原卡退出待处理,临时读不到时保留原请求。 复验使用真实本地 worker 与合成 Lark provider。生产账户和安装态的采用需各自验收。
改动思路 / Approach
沿用现有 Lark 来源证明。普通 caller 收到拒绝。私聊 Steward 在原身份匹配且源明确撤回时得到标记,由现有 original_source_changed 退队。 GitHub 固定旧 base 显示 1,792 个文件。核对提交图和树对象,其中 1,788 个来自已验证主干祖先的历史。相对共同祖先及当前 main 的实际合并树,补丁各为同样四个文件。 复验普通准入、原话题回复和原待发卡。分别在 canonical 与 rendered 响应单侧报告撤回,并观察队列与真实本地持久化结果。
具体改动 / Changes
精确 head cb6f9970310eed6c4c907d56b2b805f96e93fc76,diff base 41ea75e89892ed88d0ae543e97e31aad0a181c47,4 个文件 +102/-15。逐项复核 verified-live-source、same-original-group-root、scoped-card-retirement。验收约定
关键代码讲解
- 私聊核对原消息和身份后才传递明确撤回。普通回复仍拒绝这份来源。源码
- 群聊检查当前 provider 消息及原话题根的撤回状态。源码
- Steward 首次核验和实际发送前均接入同一来源判断,确认撤回走原退队状态。源码
- 原回归分别覆盖召回、发送前召回、读取暂时失败和两类队列。源码
对主干的风险 / Risks
候选 39 项针对性验证和 607 项本地 Lark 回归通过。当前 main 与四文件组成的合并树也通过同一组 39 项。上一头三个卡片退队用例失败,现头均通过。独立样本里,发送者不同则保留;身份吻合且任一来源明确撤回,只退休原卡。相邻两个卡片内容保持原值,后加入的有效卡在暂时读取失败后恢复一次交付。
语义与 CI 对齐
主干与候选的 Todo read-model smoke 都卡在同一个现有 quota 反向 status import。该文件字节一致,保留为合入验证里的失败。远端 CI、真实账户与正式安装态采用留待对应验证。
我的整体评价 / Verdict
同意这一精确提交。原卡撤回不会触发准入或回复,已确认的原卡退出两种待处理扫描。未核实或暂时不可读的源仍可恢复。实际合并树只包含四个相关文件。
English verdict: APPROVE. APPROVE at cb6f997. Exact and current-main integration tests verify source-scoped recall and recoverable transient holds. The identical inherited Todo boundary failure is retained.
Signed-off-by: huangruiteng <huangrt01@163.com>
cb6f997 to
7dc4164
Compare
huangruiteng
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · GPT-5 · OpenAI · self_reported
Approval conclusion
动机 / Motivation
受影响 caller 是使用 LoopX 私聊或群话题回复的 Lark 用户、运行聊天 worker 的维护者和私有 Steward 卡片的接收者。Lark 的读回结果可能在消息撤回后仍保留发送者和渲染正文,因此旧路径会继续把一条已经撤回的私聊或群话题消息当作有效来源,甚至在校验之后、真正发送之前撤回时仍尝试回复。旧路径中 deleted=true 仍可能带正文进入 admission,且卡片一直 pending;当前 head 拒绝普通来源,并以 original_source_changed 终止原卡。
这一提交同时修复了 PR diff 的展示边界:旧 head 基于过时 main,GitHub 因而显示 1,792 个文件和超过 25 万行新增;重放到当前 main@cc290b259b 后,实际补丁就是 4 个文件、+102/-15,评审范围与页面 diff 已一致。
可观察结果是撤回消息不会创建 Turn、执行 provider write 或形成发送 attempt;确认撤回的原卡离开待处理队列,transient unavailable 仍保留重试。No provider subscription, cache, public UI, new authority or alternative sender state is introduced.
改动思路 / Approach
入口仍是 LarkPrivateConversations._source_message 对当前 provider 来源的核验。普通私聊、规范群消息和原群话题 root 都检查 deleted=true;普通 caller 得到失败,不进入 Core admission。Steward 卡片需要在核实撤回后执行原有终止状态,所以只有卡片 reconcile 显式请求 report_private_recall=True,并只在身份与正文仍匹配时拿到精确 {"deleted": true} 标记。
没有新增 provider 调用、来源缓存、撤回订阅或第二套发送状态。临时读取失败仍返回不可读并保留卡片,确认撤回才走既有 original_source_changed;相邻卡片和后续有效卡不受影响。Production code changes only two branches inside existing owners. 当前 PR 边界是 Lark source recall and exact Steward-card retirement.
具体改动 / Changes
相对 main@cc290b259b,精确 head 7dc41645531a0cc840d004532a46eea20ff7a0e0 修改 4 个文件、+102/-15。规范基线是 docs/reference/protocols/manager-evidence-and-continuity-v0.md @ cc290b259bfa7a08fb9cc7d24dcb736972ac0321;verified-live-source、same-original-group-root、scoped-card-retirement 均已实现。架构判断是 Production code changes only two branches inside existing owners.
关键代码讲解
private_conversations.py:449的_source_message在私聊 rendered/canonical 来源、群消息和原 topic root 上统一检查撤回;report_private_recall只供已绑定原卡的 Steward 路径请求精确撤回结果。private_steward_triage.py:327的reconcile在首次卡检查和发送前二次检查都复用同一 source proof。只有原身份匹配且来源明确撤回时退队,transient unavailable 仍返回 0 并保留下一次重试机会。tests/test_lark_source_authority_reply.py:69覆盖撤回消息仍带正文时不能 admission,以及 preview 后撤回时没有 provider write、发送 attempt 或 verified delivery;群话题同时覆盖当前消息与原 root。tests/test_lark_private_conversations.py:1861覆盖编辑、已撤回、发送前撤回和暂不可读后恢复,并直接观察两种待处理队列及卡片的 terminal 状态。
对主干的风险 / Risks
最强回归是 Steward 把“暂时读不到”和“确认撤回”混为一谈:前者若退队会丢工作,后者若保留会一直重试。当前分支用显式 boolean 把确认撤回标记限制在已匹配原卡路径,其他 caller 仍只拿到拒绝;对应测试覆盖两个扫描队列、零 provider write 和发送前二次核验。
PASS:19 个定向撤回/退队用例在最新 main 上通过;Ruff lint、四文件 whitespace、Python compile、bilingual diff 与 8 个 extension-runtime risk-profile smokes 通过。安装 root npm 依赖后 semantic-vocabulary smoke 也通过。
FAIL(独立于本 PR):todo-readmodel-boundary-smoke.py 在 exact head 与不可变 origin/main 上以相同 loopx/control_plane/quota/live_decision.py:681 from ...status import 失败。该文件不在本 diff 中,保留为 merge-readiness 风险而不改写成通过。两个 Lark 测试文件的完整长套件在本轮约 11% 后因耗时主动终止;改动相关的 19 个用例已完整执行。真实 Lark 账户与 installed App 仍未验证,远端新 head CI 不作为本结论的替代证据。
语义与 CI 对齐
该变更复用既有 source authority vocabulary 和 Steward retirement 状态,没有新增 provider id、持久字段或 authority。撤回是来源失效,不是新的运行模式;普通准入、普通回复、群 root 和卡片 reconcile 对同一条 provider 事实作一致判断。
我的整体评价 / Verdict
批准当前精确提交。长期任务维度上,撤回来源不会再产生新的 Turn、回复 attempt 或永久待处理卡;用户体验上,撤回后的 Steward 工作会明确结束,而临时读取故障仍保持可恢复。代码体量保持为 4 文件的窄修复,复用既有来源核验和卡对账 owner,没有引入第二套状态机。
PR diff 展示问题已由重放到当前 main 修复,页面现在与实际补丁一致。未运行真实 Lark、正式安装态和完整成本验收;继承的 Todo readmodel 失败与长尾套件耗时边界已明确保留。
English verdict: APPROVE at 7dc4164. Recalled Lark sources cannot admit or reply, confirmed recall retires the original Steward card, transient failures remain recoverable, and the PR diff is now correctly limited to four files against current main.
Goal And Delivered Outcome
Lark's message readback can retain the sender and rendered body alongside
deleted=true. The ordinary Lark source check treated that body as a live request. In the regression fixtures a recalled private or group message reached Core admission, and recalling a source during preview still let the reply dispatch. A recalled topic root also continued to authorize a follow-up reply.Reject an explicit recall in the existing source proof. Private observations, canonical group messages and the original group topic root all use this check. The provider data already read for admission and reply is sufficient.
Author Declaration
Written by
model_agent(OpenAI Codex). The source binding and recovery contract requires current source proof. The installed Lark CLI version matches the formatter at v1.0.97, which retains the recall flag and still renders a supplied body.Scope And Continuation
The existing Lark runtime owns the admission and outbound source read. This change adds no provider call. #8845 uses the same source proof when sending recovered answers and separately matches their frozen input.
Validation
Tested
bf5c9aa944c3a9055c8d169f6ae2ee2a37d6e4aaonmainatf38fae05bb9a1c2cc54a2641359224cc253d32acwith real local Chat runtime and storage and synthetic provider/host inputs.regression_paritypassedintegrationpassed83c33d9033passed 106 tests. Covers the entire source-authority suite, original reply context, private image recovery and all three recovered-answer routes.integrationfailedmain. The existing test hooks reject an unused default keyword. #8845 covers that call shape.staticpassedHosted CI and independent review are pending. Live Lark and an installed product runtime are unverified.
Frontend and Visual Evidence
UI impact
none. The existing Lark worker holds admission or delivery when the source read reports a recall.Type of Change
LoopX Area
Shared-authority RFC fixture impact is N/A for the Lark transport boundary.
Boundary Checklist
Steward card follow-up
A verified private recall now retires a queued Steward card through its existing
original_source_changedstate. It works during the first source check and after the card is prepared, immediately before sending. A temporary failure to read the exact source leaves the card pending. Ordinary admission and reply reject recalled private and group messages, including group topic roots.cb6f9970310eed6c4c907d56b2b805f96e93fc76, 94 focused local tests passed. Eleven recall cases also passed with the affected transport modules loaded from the built wheel. The suite uses the local worker and a synthetic Lark provider. Live Lark and adoption by an installed application remain unverified.41ea75e89892ed88d0ae543e97e31aad0a181c47passed six direct and twelve selected checks. The required Todo read-model check failed on both main and this head at the existing reverse status import. The unchanged check passes with #9046 in an isolated merge tree. All six direct and eighteen selected checks pass on that combined tree, with one inherited maintainability advisory. The exact-head quality receipt records the standalone failure. Current-head independent review and premerge against repaired main are pending.GitHub displays 1,792 files from its older pinned base. The comparison against the verified main revision has four changed files, with 102 additions and 15 deletions.