Skip to content

Preserve manager return attempts when the registry is unavailable - #8751

Merged
huangruiteng merged 1 commit into
mainfrom
codex/quality-audit-core-recovery-20261114
Nov 14, 2026
Merged

huangruiteng merged 1 commit into
mainfrom
codex/quality-audit-core-recovery-20261114

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

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

Criterion Disposition Owner Test
A transient source-read failure retains the original attempt; recovery verifies without resending implemented Hosted Manager return pump and saved-attempt transaction test_unreadable_return_registry_preserves_the_original_attempt
A stale legacy transaction cannot advance an exact receipt implemented Locked Manager return transaction a legacy transaction cannot rewrite a saved exact attempt

Scope 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

  • Tested revision: 755f952e2178898e04df7221c652d3827a979ceb
  • Run state: finished for the checks below; the broad local Python run was stopped before completion.
  • Input classes: synthetic, public_fixture
Check kind Result Evidence
real_entrypoint passed pytest -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.
integration passed 129 Lark adapter fixtures passed, including private return restart and saved-attempt recovery. No live provider was contacted.
regression_parity passed The four outage cases fail against the old worker. The transaction regression also fails against the old TypeScript owner. The focused native return suite passes all 59 tests on this revision, including unchanged legacy behavior.
static passed TypeScript typecheck, Ruff, configured mypy, public boundary scan and RFC pairing.
integration passed Standard premerge direct checks and all 15 selected checks passed. The managed gate still rejects the exact-scope receipt because of the failed full TypeScript suite below.
integration failed npm run test:control-plane: 6,481 passed, 84 skipped, 1 failed. content_digest_single_owner.test.ts finds a duplicate SHA-256 matcher in native_child_result_inbox.ts. The exact main revision and this head reproduce the same failure; the full lane remains failed.
integration failed (incomplete run) Broad local Python suite was stopped at about 15%: 5,897 passed, 414 skipped, and 4 failed. The exact base reproduces the static failure for a second bare SHA-256 matcher in 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.
manual not_run Live Lark delivery and installed rollout. The local fixture exercises the recovery flow without contacting a live provider.

Frontend / Visual Evidence

  • UI impact: none. Existing Chat receipt readback is verified over HTTP.

Type of Change

  • Bug fix
  • Documentation update
  • Test update

LoopX Area

  • Control plane
  • Capability or extension

Shared-authority RFC fixture impact

N/A. This repairs the existing return path without migrating any store or provider.

Boundary Checklist

  • No private data, paths, traces or credentials are published.
  • Scope is limited to the reproduced return recovery bug.
  • RFC pairing check passes; no paired RFC changed.
  • UI impact marked above.
  • Commit includes DCO sign-off.

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.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.

@huangruiteng
huangruiteng merged commit fcc193d into main Nov 14, 2026
41 of 58 checks passed
@huangruiteng
huangruiteng deleted the codex/quality-audit-core-recovery-20261114 branch November 14, 2026 11:57
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.

2 participants