Skip to content

test(chat): wire session recovery into amendment HTTP fixtures - #6812

Merged
huangruiteng merged 2 commits into
mainfrom
codex/ci-browser-input-20261018
Oct 18, 2026
Merged

huangruiteng merged 2 commits into
mainfrom
codex/ci-browser-input-20261018

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

Request-control HTTP regressions crash when reading a Session because their shared server fixture has no runtime_controller. The production snapshot handler now reconciles exited turns before returning history, so these tests disconnect before reaching their revision and replay assertions. The failure appears in both File and SQLite qualification shards.

Compose the existing ChatSessionStore and real ChatRuntimeController once in the shared HTTP fixture, close the controller during teardown, and reuse that store in request-control setup.

原 HTTP fixture 缺少 Session 回读所需的真实 runtime controller,导致连接中断,修订与重放断言尚未执行便失败。本改动补齐既有 fixture 的组装与清理,并复用同一个 store;原验收断言完整保留。

Verified head 82c64f2bb6e3d73f9f4e256c1cd5a67a20d655ac against base a0fb547af9aac4e4d36f59fb05cb64eb56fd750f:

  • Before: the named SQLite regression reproduces locally with RemoteDisconnected, caused by the missing runtime_controller attribute.
  • After: both complete changed modules pass: 13 passed, 0 skipped, exercising real HTTP readback with isolated File/SQLite Goals, revision replay and source-rebinding refusal.
  • Changed-file Ruff, public/private scan, bilingual RFC diff check and whitespace checks pass. Standard premerge passes 5 direct checks; its catalog selects no additional canaries for this test-only diff.
  • Exact-scope quality receipt cqr_5d2615355bb30e5e6ab8 is valid; fingerprint 5d2615355bb30e5e6ab8756d66a0ce77cdc531f723b43c41e4830c0b2d6f9a39.

Full hosted Python qualification remains incomplete: the observed run has cancelled shards, no complete Python JUnit/coverage set, and a separately recorded CLI-output comparison failure. This PR qualifies the repaired HTTP fixture; it does not establish full-workflow or sustained qualification.

Hosted CI follow-through for the unchanged 82c64f2bb6e3d73f9f4e256c1cd5a67a20d655ac head: kernel job 117652135520 passed its repository invariants and 409 TypeScript tests, then stopped at Ruff on an unused Path import in tests/control_plane/test_checkpoint_retention.py. That file is byte-identical in this head and its main base. The lint cleanup is proposed in #6820; full hosted CI remains unqualified.

同一作者 head 的托管检查已定位到主干测试文件中的未使用导入,后续清理见 #6820。本 PR 的 HTTP 修复与作者 head 保持不变,完整 CI 资格仍未通过。

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)

动机

维护者需要依靠真实会话回读判断请求修订、撤销和结果返回是否正确,而不能让测试在到达这些断言前就断开 HTTP 连接。

原共享 HTTP fixture 没有生产回读所需的 runtime controller,导致 File/SQLite 的会话读取抛属性错误,修订与重放断言无法执行。当前只补齐原 controller 和 store 的组装、复用与清理,让既有断言真正经过原生入口。

两个完整模块在精确 head 独立通过13项;实际基线同样13项中4项因缺 runtime_controller 而 RemoteDisconnected,其余9项通过。原修订、重放、来源不可重绑、旧结果隔离和存储恢复断言保持。

本次只修复已有测试 fixture,不改变生产权限、会话恢复、请求协议、超时或验收断言,不提供真实模型运行或完整托管 CI 资格。

规定 Ruff 仍有实际基线原有的 checkpoint Path 未使用导入错误;完整托管、跨平台与覆盖率资格保留,当前没有查询或等待 CI。

改动思路

补齐测试原本要使用的生产 owner,不绕过它。共享 fixture 的 controller、HTTP handler 和请求 setup 现在都指向同一个 ChatSessionStore;会话回读继续执行 recover_exited_turn,随后才投影原消息和请求卡片。真实 controller 只负责原恢复规则,未启动假 Codex 入口或额外模型调用。

同域简化是删除 _source 的第二次 store 分配,复用已有共享对象;清理顺序保留 server shutdown、thread join、server close,再关闭 controller 和原 effect runtime。没有新抽象、测试框架、权限或额外用户准备。

具体改动

完整两份测试文件 +9/-3,未改变任何原验收断言。已先读实际基线 a0fb547 的 good-smokes,其内容与已读规范完全相同:

  • Start With The Contract:以原 Session/request revision owner 为 oracle,不把新的输出当期望。
  • Review Checklist:走真实 HTTP、File/SQLite、失败与恢复,测试不接触活动 Goal。
  • Prefer Semantic Pressure:实际旧 fixture 在同一组原断言前断开,当前完整通过,区别可独立复现。

关键内容讲解

api fixture 创建真实 controller/store,并在结束关闭 controller。原 source_goal 的隔离 File/SQLite、原HTTP调用、超时与过滤检查保持。

_source 改为复用 server.chat_store,原预览不写、修订2、精确重放、stale basis 拒绝、来源不可重绑、rev2/3 interim/conclusion 和旧消息隔离均未删除。生产 snapshot 仍先调用原恢复方法。

对主干的风险

独立两个完整模块:13 passed、0 skipped、29.42s,串行、不带 coverage。实际不可变基线运行相同模块:9 passed、4 failed、0 errors,26.30s;两组 File/SQLite 的原会话修订回读与 interim-return 测试各在 GET Session 断开,捕获到四份缺 runtime_controller 的 AttributeError。当前修复没有改断言、时限或生产异常处理来隐藏错误。

完整 loopx/apps/packages/scripts/docs/.github tree OID 与实际基线相同。原 File storage unavailable 后恢复、来源反绑定和 revision/replay/result-return 负例都在这13项中。这里是源码环境的真实本地 HTTP/native backend,非已安装 App、真实远端 host 或模型验收。

规定完整 Ruff 在 a0 与当前82c均失败,完整356字节诊断完全相同:未修改的 tests/control_plane/test_checkpoint_retention.py:4:21 有 Path F401。生产与该失败路径未变,当前不变量有独立正反证据,按策略为 pre_existing_unrelated,不阻止本差异代码批准,但 required lint/quality hold 保留。后来主干清理不是这个精确 head 的通过结果。

标准 premerge 5 direct、0 selected 通过;不称为额外 canary 或 Ruff 豁免。PR正文的托管日志仅作历史背景,本轮未打开 CI 链接、查询、轮询或等待。Full hosted/platform/coverage 仍未资格化。已有相邻维护提案不替代这个不同的 fixture 边界,也不因合并数而证明价值。

我的整体评价

APPROVE — 82c64f2,未发现当前新增阻塞问题。 这是 justified increment:让本来必须执行的请求修订和原路结果回读断言通过真实 owner 执行,保留 long_horizon 与 user_experience;生产行为和普通用户操作没有增加。小范围复用已有 store/controller 比假恢复或扩大框架更合适,持久化兼容路径未变。

独立代码批准与必需 lint/quality、完整资格及 merge authority 分开。保持原有资格缺口,不新增形式化后继;任何更新 head 都需要重新判断。

English verdict: APPROVE — 82c64f2. Both complete modules independently pass13; immutable-base same13 yield9 pass/4 RemoteDisconnected failures with missing runtime_controller. Production trees/assertions unchanged. Configured Ruff retains the byte-identical pre-existing F401 in an untouched file; required lint/quality holds remain. No CI or live model/installed qualification claimed.

@huangruiteng
huangruiteng merged commit 381a34a into main Oct 18, 2026
4 of 5 checks passed
@huangruiteng
huangruiteng deleted the codex/ci-browser-input-20261018 branch October 18, 2026 16:50
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