Repository navigation
Preserve manager return attempts when the registry is unavailable - #8751
Conversation
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
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
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
评审提交 755f952e2178898e04df7221c652d3827a979ceb,对照目标基线 1cdd9bbefd1d849ac8aa733bd3d80bc13ad0b722。
动机 / Motivation
通过原会话接收异步协作结果的用户及维护回传 worker 的操作者。 发送端已取得外部消息定位符,进程在回读完成前退出。后台 runner 启动时项目注册表暂时缺失、损坏或回退到旧视图。 已有外部发送定位符时,目标 base 遇到注册表缺失或暂时读到 legacy 快照会按旧模式改写 exact 投递收据。恢复后再调用一次 provider send,Chat 的消息去重只能保住本地一条。 候选保留原投递收据和消息。注册表恢复后只核验原消息,真实 Chat HTTP 读回一条已送达记录。 本轮使用本地项目注册表、原 Chat journal、真实 HTTP 与合成 provider。运行中的飞书 App 和生产服务待真实回读。
改动思路 / Approach
读取注册表失败交给现有 HostedWorker 重试。TypeScript 在选择候选和锁内事务复查时核对收据所需 profile,沿用原 GoalRef、provider attempt 和消息 ID。 保留现有 worker 与锁内事务。两处检查分别保护注册表故障和读到有效 legacy 快照时的原收据。
具体改动 / Changes
关键代码讲解
- Python 的
drain先读取项目注册表,再扫描投递收据。注册表不可读时,本次扫描失败,现有后台 worker 按原间隔重试。注册表读取与恢复 - TypeScript 的
deliveryProfileMatches从现有 GoalRef 或 admission 判断收据是否需要 exact profile。扫描先筛选,进入事务锁后复查,旧扫描也无法覆盖已保存的精确记录。候选筛选 事务复查 - 入口测试覆盖 exact 与真实 legacy 的缺失、损坏、恢复;事务测试覆盖晚到的 legacy 写入,文档说明同一定位符上的只读核验。原会话 HTTP 测试 旧 profile 事务测试 回传恢复行为
按 docs/architecture/rfcs/app-conversation-and-async-inbox-v0.md 的目标基线,original-attempt-recovery、exact-source-isolation、visible-original-return 均得到当前证据。原请求仍由原 GoalRef、来源与收件会话约束。原会话回传与重启验收
对主干的风险 / Risks
同一隔离 hosted runner 中,旧版在注册表缺失及暂时换成可读 legacy 快照时均遗失原 attempt。恢复后各出现两次合成 provider send。候选在故障期间逐字保留收据;恢复只执行一次 verify,没有再发送。健康 legacy 恢复也只核验一次,三个对照均读回唯一 Chat 结果。
语义与 CI 对齐
两个目标提交的同输入对照覆盖 missing、可读 legacy 快照和 malformed legacy。两组 Python 共 225 项通过,标准 premerge 15 项选中检查通过。两处 digest 单一 owner 检查在同一 base 和 head 重现,其他选中的 TS 检查通过。 两处静态失败分别位于 native_child_result_inbox.ts 和 result_files_api.py,与本次修改无重叠。完整验证门继续按原结果处理。
我的整体评价 / Verdict
APPROVE。 回传现在能在注册表恢复后沿原路线核验已有发送,扫描与锁内提交都保留原定位符。继续复用同一回传事务、状态和重试策略。
English verdict: APPROVE at 755f952e2178898e04df7221c652d3827a979ceb. Hosted base/head tests reproduced the lost attempt and duplicate call on base, then verified a single original delivery and no resend on head.
Goal And Delivered Outcome
A manager return can lose its saved provider attempt if the registry becomes unreadable after a send. The worker used to treat that read failure as legacy mode. For a return bound to an exact Goal instance, the legacy transaction could replace the receipt, dropping the original attempt and allowing a later send.
The worker now retries the registry read before scanning. The existing TypeScript transaction also rejects legacy mutations of saved exact receipts. Recovery verifies the original provider message and updates the same Chat result. The intended base is
main.Author Declaration
test_unreadable_return_registry_preserves_the_original_attempta legacy transaction cannot rewrite a saved exact attemptScope And Continuation
Complete for this recovery defect. The existing worker, persisted records and verification policy remain in use. This proposal is ready for review; the full TypeScript suite and managed change-quality receipt currently hold merge qualification.
Validation
755f952e2178898e04df7221c652d3827a979cebreal_entrypointpassedpytest -q tests/test_collaboration_goal_instance.py tests/test_manager_context_roundtrip.py: 225 passed. The shipped pump uses the real local registry, return store and Chat HTTP readback with a fixture provider. A missing or malformed registry leaves the attempt unchanged; restoring it produces one verification, one Chat result and no second send. Both registry profiles are covered.integrationpassedregression_paritypassedstaticpassedintegrationpassedintegrationfailednpm run test:control-plane: 6,481 passed, 84 skipped, 1 failed.content_digest_single_owner.test.tsfinds a duplicate SHA-256 matcher innative_child_result_inbox.ts. The exactmainrevision and this head reproduce the same failure; the full lane remains failed.integrationfailed(incomplete run)result_files_api.py. Three steward report cases timed out in the broad run; all 24 selected steward cases passed on isolated rerun. The broad run does not qualify the full Python suite. GitHub CI remains pending.manualnot_runFrontend / Visual Evidence
Type of Change
LoopX Area
Shared-authority RFC fixture impact
N/A. This repairs the existing return path without migrating any store or provider.
Boundary Checklist