Skip to content

test: restore default delegation test collection - #7571

Merged
huangruiteng merged 1 commit into
mainfrom
codex/review-b-delegation-collection
Oct 28, 2026
Merged

huangruiteng merged 1 commit into
mainfrom
codex/review-b-delegation-collection

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

Default pytest collection fails because tests/control_plane/test_delegation_turn_context.py and tests/test_delegation_turn_context.py import under the same module name. Rename the newer native Host input module to test_delegation_native_host_context.py; preserve every byte of both test modules and the existing pytest import configuration.

  • Outcome basis: the reproduced collection defect; related to fix(collaboration): deliver original handoff in native Turn context #7562.
  • Before → after: immutable main f5e9be367 rejects paired collection with import file mismatch (exit 2). The final head collects the full default set and runs both complete modules successfully.
  • Intended base: loopx-project/loopx:main; branch rebased onto 2cdff65d8. Qualification also checks the same one-file rename against the observed target bf54e77a5.

Author Declaration

  • Written by: model_agent — OpenAI Codex (GPT-6 family).
  • Specification and revision: no written specification; the reproduced defect and bounded repair request in this PR are the basis.
Criterion Disposition Path Evidence
Restore default paired/full collection implemented tests/control_plane/test_delegation_native_host_context.py Failed-before reproduction; final default collection passes
Retain all existing delegation semantics implemented Both delegation test modules 100% byte-identical rename; all 16 + 7 cases pass
Preserve existing import configuration implemented pyproject.toml unchanged Final tests use normal pytest import mode
Submit a reviewable proposal implemented This normal PR Exact head and validation disclosed; independent review pending
  • Self-check: read both complete modules and applicable repository instructions; checked actual node inventories, byte equality, DCO, public boundary and the final diff. No new helper, fixture or abstraction is needed.

Scope And Continuation

  • Complete author repair for this collection defect. Independent exact-head review remains with the existing review queue/maintainer before merge.
  • The test modules, their fixtures and production code are unchanged. The rename is independently testable and reversible. Broader repository test health remains a separate ongoing task.

Validation

  • Tested revision: f36c89eccf8cef3b1b57a947faeba977f5d4daa1.
  • Run state: finished.
  • Input classes: synthetic, public_fixture.
  • Environment: Python 3.12.15, pytest 9.1.1; source-checkout test dependencies. Pytest commands used PYTHONPATH=packages/loopx-finance-value-discovery/src for the existing optional finance package.
Check kind Result Public-safe evidence / limitation
regression_parity passed Before-fix paired collection at f5e9be367 exits 2 with the duplicate-module mismatch. Both original module blobs are still identical at the final baseline. The negative pytest run remains a failed run.
real_entrypoint passed uv run --extra test python -m pytest -q --collect-only: 30,899 nodes collected with default import mode. All prior 30,887 nodes retained; the 12 additional cases come from intervening main #7558.
integration passed uv run --extra test python -m pytest -q tests/control_plane/test_delegation_native_host_context.py tests/test_delegation_turn_context.py: 23 passed, zero failures/errors/skips.
real_backend passed The same module cases use isolated real File/SQLite stores and disposable Host/process stdin. They cover original-material preservation, wrong identity, missing/substituted source, replay, agenda read/adopt/return and private isolation. No live App or model was exercised.
static passed Ruff on both complete modules; whitespace checks; byte equality and unchanged root module; DCO trailer.
static passed Standard source-checkout canary premerge --from-git-diff at final head against bf54e77a5: 5 direct checks pass, 0 catalog checks selected, 0 failures/skips/manual holds. Exact-scope change-quality receipt valid (cqr_2c898b85b9b731e1e6fe); no safe-fix pass used.
unit not_run Execution of the full 30,899-case repository suite, other Python versions and Windows was not performed. Collection success is not whole-suite success. Remote CI has not been qualified by this author.
  • Coverage rationale: both entire affected modules execute, and default whole-repository discovery verifies the filename collision is removed without lost nodes. No runtime/store behavior, UI or protocol changes require new production-path qualification.

Frontend / Visual Evidence

  • UI impact: none.
  • Before / after / first viewport / preview / states / attention / craft review: N/A; test discovery only.
  • Source data: none.

Type of Change

  • Bug fix
  • Test update

LoopX Area

  • Build, packaging, installer, or CI

Technical Direction

  • Narrow test-discovery reliability repair; no new roadmap maturity or runtime-benefit claim.

Shared-authority RFC fixture impact

N/A; no shared-authority or migration progress is claimed.

Boundary Checklist

  • Diff and PR content contain no private state, credentials, raw traces, internal links or local machine paths.
  • No maintainer-owned benchmark work duplicated.
  • Change stays scoped to the reproduced collection defect.
  • No paired RFC changed; bilingual diff check passes.
  • UI impact is none.
  • Every commit includes a DCO Signed-off-by trailer.

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)

动机 / Motivation

维护者运行默认 pytest 收集与委派测试时遇到问题。 旧版同时收集两组委派测试会发生 import file mismatch;新版本只改模块文件名,默认收集成功且两组覆盖均保留。

这会让整仓测试在执行前中止,分别运行单个模块会漏掉这个问题。默认 pytest 成功收集完整仓库的 30,899 项测试,受影响的 23 项执行通过。 本次只修复测试发现,不改变委派运行时、pytest 导入模式或实际模型执行。

改动思路 / Approach

保留 pytest 现有默认导入机制,将较新的 native Host 输入测试改成独立 basename。删除测试会丢失保护,调整全局 import mode 会扩大影响;单个文件重命名已完整解决当前故障。运行时、配置、fixture 和断言均保留,两个模块继续验证不同的委派边界。

具体改动 / Changes

准确 head:f36c89eccf8cef3b1b57a947faeba977f5d4daa1;不可变 merge base:2cdff65d886d13121ffd78dccd96dd7413ab9d01。

关键内容讲解

唯一 diff 是 native Host 测试文件 的 R100 重命名,0 行增删。逐字节核对旧文件与新文件完全相同,根目录同名模块及 pyproject.toml 也完全一致;没有残留的旧路径引用。本问题没有另行书面验收规范,依据独立复现的默认收集故障和原覆盖保持判断。

native 模块的 16 个 File/SQLite case 保留原消息进入 capture/实际 Codex stdin、错绑拒绝、历史 profile 和 worker replay;根目录 7 个 case 保留两轮 agenda、返回显式消费、跨 Agent 隔离与溢出全文入口。两者职责不同,相关 #7562 引入的保护没有被合并、削薄或替换。

对主干的风险 / Risks

PASS:旧 base 两模块分别可收集 16/7 项,一起收集退出 2,实际错误为 import file mismatch。当前默认整仓收集退出 0,共 30,899 项;仅归一化重命名路径后,受影响的 23 个 node ID 完全一致,两模块实际执行 23 passed、0 skipped。

PASS:两文件 Ruff 与 standard premerge,通过 5 项 direct checks;本 diff 选择 0 项 canary,0 failure、0 manual hold。沿现有可选 finance provider 路径提供相同 PYTHONPATH,没有修改收集模式或配置。未查询或等待 CI。完整收集不代表执行了全部测试;已有测试使用真实 CLI/File/SQLite 和合成 Host transport,未据此宣称真实模型采用。

我的整体评价 / Verdict

APPROVE,仅对该准确 head 的测试发现修复。改动量必要,现有两组有效保护保持,不需要另增测试框架或产品控制项。持续工作边界:运行时、持久状态和调度源码未改;原有两轮接续、返回消费、恢复重放及拒绝错绑的测试内容和覆盖保持。 使用体验:开发者可沿原默认 pytest 入口收集测试,无需分别运行模块或改导入配置。

检查的是 pytest 测试发现和两个测试文件,未改变任何渲染页面,截图不适用。 正式 App、真实模型和全套测试执行未在本次验证。 当前源码结论与合并权限、安装采用分开。

English verdict: APPROVE — f36c89eccf8cef3b1b57a947faeba977f5d4daa1 restores default test collection; all 23 affected tests pass with unchanged contents and coverage.

@huangruiteng
huangruiteng merged commit 6eb1eed into main Oct 28, 2026
22 of 34 checks passed
@huangruiteng
huangruiteng deleted the codex/review-b-delegation-collection branch October 28, 2026 13:55
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