Repository navigation
test: restore default delegation test collection - #7571
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)
动机 / 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.
Goal And Delivered Outcome
Default pytest collection fails because
tests/control_plane/test_delegation_turn_context.pyandtests/test_delegation_turn_context.pyimport under the same module name. Rename the newer native Host input module totest_delegation_native_host_context.py; preserve every byte of both test modules and the existing pytest import configuration.f5e9be367rejects paired collection withimport file mismatch(exit 2). The final head collects the full default set and runs both complete modules successfully.loopx-project/loopx:main; branch rebased onto2cdff65d8. Qualification also checks the same one-file rename against the observed targetbf54e77a5.Author Declaration
tests/control_plane/test_delegation_native_host_context.pypyproject.tomlunchangedScope And Continuation
Validation
f36c89eccf8cef3b1b57a947faeba977f5d4daa1.PYTHONPATH=packages/loopx-finance-value-discovery/srcfor the existing optional finance package.regression_parityf5e9be367exits 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_entrypointuv 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.integrationuv 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_backendstaticstaticcanary premerge --from-git-diffat final head againstbf54e77a5: 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.unitFrontend / Visual Evidence
Type of Change
LoopX Area
Technical Direction
Shared-authority RFC fixture impact
N/A; no shared-authority or migration progress is claimed.
Boundary Checklist
Signed-off-bytrailer.