Skip to content

fix(lark): return worker conclusions after recorded recovery - #7555

Merged
loopx-agent merged 1 commit into
mainfrom
codex/private-return-recovery-20261028
Oct 28, 2026
Merged

loopx-agent merged 1 commit into
mainfrom
codex/private-return-recovery-20261028

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Worker conclusions can remain visible in the App while their original private Lark return stays pending after a safe Core continuation. The return adapter recognized only the older recovery client identity and rejected quota, routing and unfinished-work identities.

Resolve those returns through the existing Core recovery owner and require matching transport/Core recovery records. Original source, audience, grant and current Session/Turn checks remain in place; saved sends still recover by verification without repeating model work or unknown provider effects. The existing conversation and result surfaces remain the user entrypoints.

Validation uses the real admission → failed request → safe continuation → worker result → original return owners with synthetic model/provider IO, across shared/separate coordination roots and native/legacy source provenance. All 32 new cases pass; the same final oracle against the immutable base return method fails all four positive cases while 28 rejection controls pass. Adjacent regression and risk-selected premerge results will be recorded in the exact-head review. These tests do not certify installed adoption or real provider delivery; those are separate operational checks. The broader managed-task, report-quality and bidirectional-sync journeys remain open.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent · GPT-6 · OpenAI · self_reported

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

动机 / Motivation

使用原私聊交办长任务的用户会遇到这次缺陷。原请求因额度故障安全接续后,接收者已经交回结论,App 中可见,飞书原消息却因返回校验不识别接续身份而一直待回。本头通过真实 Core、交办与返回链路的合成验收证明,已记录的接续可以回原消息,待核验发送重启后只读回而不重复外发。本 PR 只修原路返回身份解析,不改变模型恢复资格、账号选择或业务执行。安装采用、真实 provider 送达及完整双向同步、自然语言周期任务和报告质量仍须分别验收。

改动思路 / Approach

已有 Core 决定哪些接续身份有效,Lark adapter 只定位原请求并复核两份关联记录;复用该 owner 比继续复制恢复后缀语法更稳妥。本头在既有 ReturnService、manager-context grant、原 Inbox 发送与独立读回之间交付可用修复,不新增状态、配置、调度器或消费者。我比较了不改、继续扩大 adapter 正则和复用现有 Core 三条路线。不改会让已经完成的接收者工作持续欠回;只补后缀会继续维护第二份恢复语法。现在正则只提取原请求位置,Core 负责已有恢复记录的身份和策略相关性,adapter 仍核验原来源和当前绑定。所有消息内容和发送回执沿原 owner,不靠再造恢复标志或手工同步来补洞。

下表是 f795a54 的源码路径说明,不作为测试证据:

触发 主干旧行为 本头行为
有效额度接续后交回结论 旧后缀校验拒绝,原路待回 核已有 Core 记录及双 journal 后回原消息
伪后缀或关联变化 拒绝或来源不成立 明确拒绝,零外发
已发送、尚未读回后重启 原有核验路径 继续核验同一发送,不重复业务或消息

具体改动 / Changes

采用修改前的 docs/reference/protocols/manager-evidence-and-continuity-v0.md,spec_revision 843be494266774b63b3de61d0adf5dd7f4f877a2。original-conversation-return 在本头 implemented:自动回原对话、传输恢复与业务完成分开;source-grant-recheck 在本头 implemented:发送前仍重验原 grant、绑定和消息,未核验不能当送达。规范原段落没有随实现改写;新增 periodic-reports 说明只解释已记录接续的返回行为。

关键代码讲解

  • loopx/extensions/lark/private_conversations.py:876 的 return_inbox 先解析稳定原请求,再读取两个既有 journal。带后缀的客户端必须通过 Core 的 recovery_context,且恢复记录一致,随后全部原 Session/Turn/source/profile/grant 检查继续执行。宽定位正则不能独自授权消息。
  • loopx/capabilities/native_chat/external_conversations.py:225 的 ChatExternalConversations.recovery_context 没有被改写;它核验当前 Session 和准确 client,并保留 review/work 策略相关性。直接复用使未来恢复语法由原 owner 维护,避免 adapter 漏掉合法接续。
  • loopx/extensions/lark/manager_returns.py:79 的 _return_inbox 仍在发送前核原 manager-context authority,之后沿原 Inbox 和 provider source verifier 发送与读回。原 ReturnService 的保存发送恢复和冷启动核验没有新增执行分支。

生产增量为现有 resolver 的9行新增/1行替换;150行测试复用原 private_return fixture,经真实失败、Core 安全接续、原请求首次交办、接收者报告及原路送达,不伪造最终成功状态。9行文档说明同一边界。未增加 store、CLI、消费者、模型重试或私有运行数据。

对主干的风险 / Risks

没有阻塞性发现。最大反例是看似合法的后缀把错误来源结果送给原用户,因此不能只做字符串放宽。28项负例覆盖缺失/变化的恢复记录、未知后缀、策略不一致、撤权和原 sender 变化,均断言零外发。4项正例覆盖原生/历史来源以及共享/分离协调目录,发送后暂不可见再以冷 Chat store 核验,断言仍只有一次发送、一个原 canonical result、没有新模型调用和 Turn,旧失败字节不改。

PASS:精确头四个相关 suite 共219项通过,32项新增另跑通过;同一最终 oracle 换回不可变基线 resolver 后四个正例全部在零发送断言失败,28个控制通过。PASS:6项直接和11项风险选择检查,零失败/人工 hold,Ruff、公开边界和 RFC 检查通过。初始夹具沿用了恢复前 ingress,后续静态时钟精度和 fake provider 消息可见性设置也曾失败,均保留;最终完整生产 owner 链覆盖这些前提,不删除断言或放宽生产限制。合成 native 读回和 provider IO 不等于真实安装/外部消息资格。

语义与 CI 对齐

完整 diff 和调用者检查使用既有恢复词表,advisory 无新增支持的 carrier 仅为有界扫描结果,不能替代语义判断。54条 open PR 文件范围内,相关 #7531 补的是原 service 生命周期里的 queued execution pump,未改变这里的原返回身份或新建本 PR 的消费者;本头不接管该工作。当前 Goal 的 CQR 关闭,没有编造 receipt;按 wait_for_ci=false 未查询、轮询或等待 CI。自合并仍需当前精确 head 的原生 clear/readiness 与既有授权。

我的整体评价 / Verdict

这是有独立可验证用户结果的 justified_increment,long_horizon 与 user_experience 均 improved:已有授权和原业务结论无需用户增加陈述、选择或确认轮次,恢复后可以完成原消息闭环。已有 Core 决定哪些接续身份有效,Lark adapter 只定位原请求并复核两份关联记录;复用该 owner 比继续复制恢复后缀语法更稳妥。本头在既有 ReturnService、manager-context grant、原 Inbox 发送与独立读回之间交付可用修复,不新增状态、配置、调度器或消费者。检查原对话和返回调用路径后,确认本头没有修改页面、排版或渲染字段,因此无需新增视觉验收。真实安装与外部飞书送达尚待维护阶段核验,不将合成 IO 结果当作生产证据。普通历史记录和原 grant 保留,无新迁移;完整同步和周期报告的原接受范围没有因这次修复被关闭。当前生产采用尚未发生,后续必须核原服务自动补回及独立 provider/App 读回。

English verdict: APPROVE — f795a54; recorded recovery returns pass with source and saved-send safety preserved. Installed adoption and real provider delivery remain separate.

@loopx-agent
loopx-agent merged commit 19c2133 into main Oct 28, 2026
11 of 33 checks passed
@loopx-agent
loopx-agent deleted the codex/private-return-recovery-20261028 branch October 28, 2026 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant