Skip to content

Align operation host configuration readback with Turn CLI flags - #9964

Merged
huangruiteng merged 2 commits into
mainfrom
codex/operation-transport-host-readback
Dec 3, 2026
Merged

huangruiteng merged 2 commits into
mainfrom
codex/operation-transport-host-readback

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Goal and delivered outcome

A coordinator could plan a delegated operation with a configuration the Turn CLI would immediately reject. For example, selecting a Codex host with only a DSH operation module was reported as valid for Codex. Specifying both operation flags was also reported as valid on either host.

The managed executor now passes both flag observations to the existing TypeScript readback owner. That owner reports the host supported by the selected operation transport. Selecting both flags yields no compatible host and a configuration correction. The coordinator sees the invalid route before dispatch.

Author declaration

Written by OpenAI Codex (model agent). Target branch: main.

Implemented against

The host-option contract in loopx/cli_commands/turn.py and the operation transport readback in loopx/control_plane/work_items/operation_agent_handoff.ts at dca99cb9b6d0.

Criterion Disposition Evidence
Planning and CLI inspection agree on the host for the selected flags Implemented Both valid configurations and all three previously misreported combinations are exercised with File and SQLite.
Configuration inspection cannot establish runtime qualification or start a host Preserved The cases assert runtime_qualified=false and check for absence of a host launch.

Validation

The new test ran against base and head. Six base cases failed (three mismatches across two backends) and four compatible cases passed. All ten passed on head. The focused transport, executor and coordination suites passed all 92 tests. A separate coordinator planning read showed the incompatible route as blocked and kept the compatible but unprobed route at unknown readiness.

Local premerge passed with one inherited maintainability advisory on other files. Two additional delegation preflight tests fail on the unchanged base: their fixture omits the required turn instance argument.

Scope and continuation

This corrects configuration readback on main. The execution engine selected by the OAR candidate remains a separate runtime concern. On that candidate, a local selection probe using parsed CLI arguments reached the OAR operation adapter for DSH under both default and legacy engine settings, while the displayed transport revision remained native. For Codex with a simulated positive executable probe, the default selected OAR and legacy selected the native adapter. The probe stopped at dispatch and made no model calls. This PR does not qualify OAR operation submission.

Frontend / visual evidence

UI impact: none. This uses the existing executor availability and remediation fields. No persisted state changes. The 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.2-sol · OpenAI · runtime_reported · xhigh

Approval conclusion (author-owned PR; GitHub blocks formal self-approval).

动机 / Motivation

通过 agent-context 规划并通过 delegation inspect 检查受管操作路线的协调者。 基线误认 Codex 上的 DSH 单选及两宿主双开为有效配置,CLI 已拒绝这些请求。 让委托在 dispatch 前看到真实的宿主专属配置限制。 实际 planner 和 inspect CLI 只读验证,未启动模型。DSH 模块相对路径和同时指定 --dsh-runner 是两版均存在的独立 CLI 拒绝,仍由原参数 owner 处理。

审读提交 510b775,冻结基线 dca99cb。

改动思路 / Approach

Python 入口参数映射、TypeScript 传输配置 readback 与对应的 File/SQLite 回归。 Python 传真实 argv 的两个布尔观测,TypeScript 返回 typed 理由和支持宿主,现有 inspect owner 在原条件拒绝。

具体改动 / Changes

  • 冻结基线的三种误判在 File 和 SQLite 都复现。候选把两种错配、两种双开都投影成 blocked,真实 inspect 继续退出 1。DSH 加 Codex 单选本来已拒绝,仍保留。
  • 双开返回空 supported_hosts 和 correct_execution_profile。合法单选的支持列表各只有本宿主,inspect 与规划底层读回一致。未观测模型运行。
  • 合法配置获 configuration_valid=true、runtime_qualified=false。两项都关时无 transport 字段,而且每臂零宿主启动、零 effect。
  • 独立对照也看到既有的 DSH 相对模块路径及自定义 runner 与模块冲突。两版 transport 模型仍把选中的宿主视作配置匹配,实际 CLI 各有原拒绝。这两类条件超出本次宿主开关修正。

沿 Turn 的既有专属参数约束,并保留配置与运行时未验证的区别。 冻结验收依据

  • host_transport_match · 规划和原 CLI 对专属选项的宿主约束一致。复验通过。
  • mutually_exclusive_transport · 两项同时启用无兼容宿主,默认关闭保持。复验通过。
  • runtime_unverified · 合法配置保留运行时未验证和确认门禁。复验通过。

关键代码讲解

对主干的风险 / Risks

同一冻结 base/head 各运行 20 个只读情景。扩展测试 151 项通过、12 项跳过、1 项失败;该 plan 默认模式断言在两版同样失败。标准 premerge 六项直接检查、十七项选中检查无阻断,保留一项继承维护性 advisory。 配置通过不启动 host,不生成操作,不建立运行时资格或执行权。 低层的 DSH 依赖探针是可用性事实,不确认模块能启动或运行。

我的整体评价 / Verdict

通过。宿主专属开关、双开冲突和配置有效后未验证运行时的边界均有真实 CLI 证据。 覆盖后端 planner 和 CLI JSON 投影。 实际 planner 和 inspect CLI 只读验证,未启动模型。DSH 模块相对路径和同时指定 --dsh-runner 是两版均存在的独立 CLI 拒绝,仍由原参数 owner 处理。

English verdict: APPROVE. The delegated planner and CLI now agree on host-specific flags and conflicts. A valid single flag preserves runtime_qualified=false.

* fix(turn): expose DSH native module option conflicts in planning

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

* fix(turn): honor the final DSH option after an empty value

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

* Keep empty host selections invalid across repeated arguments

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

---------

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@huangruiteng huangruiteng left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent · Gemini · Google · self_reported

动机 / Motivation

在委托规划(delegation planning)、delegation inspect 与确认操作唤醒(operation wake)中读取受管操作传输配置的维护者与自动化调度器,会在 CLI 同时传入冲突操作开关、相对 DSH 模块路径、不兼容 --dsh-runner 或空值参数时遇到规划回读与真实 Turn CLI 行为不一致的问题。修改前,projectManagedOperationTransport 只要检测到 dsh_operation_module_configured 就把支持宿主放宽为双宿主且未拒绝 --codex-operation-tools 与 --dsh-operation-module 同传冲突,同时未校验模块绝对路径与 --dsh-runner 互斥,导致规划阶段误判配置有效而派发到 Turn CLI 时报错拒绝;修改后(含已合入本分支的前置子切片),Python host_binding.py 与 TypeScript operation_agent_handoff.ts 精确对齐单宿主标志互斥、DSH 模块绝对路径、--dsh-runner 冲突及 turn_host_arg_option 空值覆盖规则,同时对合法单一标志保持 runtime_qualified: false。委托规划器、delegation inspect 与实际 Turn CLI 在宿主专属操作标志、双标志冲突、相对模块路径、--dsh-runner 互斥及重复参数覆盖上给出完全一致的 configuration_valid 与结构化拒绝原因,且单一合法标志继续保守维持 runtime_qualified: false。本 PR 仅收敛受管操作宿主配置的静态预检回读契约,不执行真实 SDK/进程启动探测,也不授予任何运行或操作批准权限。OAR 内置工具选择器(oar)与原生 DSH SDK 双模路由将在 OAR Phase 2 集成分支独立演进并在阶段收口时合入主干。

在 main 基线(合并基点 dca99cb9b6d0650ac846318f5d64c61e867dba44)上,Turn CLI 对 --host codex-cli --dsh-operation-module ...、--host dsh --codex-operation-tools、双操作标志同传、相对模块路径以及 --dsh-operation-module 加 --dsh-runner 均会立即拒绝,但委托规划器与回读模型此前对部分组合仍返回 configuration_valid: true,造成不可启动的绑定进入派发阶段。当前分支精确 Head a9fdf7805589d800c6df9e3704385de6db30e015 完整集成了宿主专属标志对齐与 DSH 模块预检修复。

改动思路 / Approach

在既有 Python host_binding.py 参数采集层与 TypeScript operation_agent_handoff.ts::projectManagedOperationTransport 单一状态投影所有者内补齐标志互斥、路径绝对性与 runner 冲突判断,不新增配置字段或平行校验器。当前 PR 边界覆盖 turn_selection.py、operation_wake.py、host_binding.py、operation_agent_handoff.ts 及回归测试 test_operation_transport_readback.py,不触碰实际宿主子进程启动与会话存储格式。

从调用链看,managed_executor_cli_binding(turn_selection.py)与 managed_executor_binding_from_host_args(host_binding.py)统一提取 codex_operation_tools、原始 dsh_operation_module_path 与 dsh_runner_configured,经 _with_operation_transport 调用 TypeScript projectManagedOperationTransport,一次性裁决宿主匹配、双标志冲突、runner 互斥与模块绝对路径。

CLI 参数场景 修复前规划回读 当前 Head a9fdf7805589 规划回读与 CLI
--host dsh --codex-operation-tools 或反向错配 部分错配未按所选标志限定 supported_hosts configuration_valid: false,operation_transport_host_unsupported
同时传入 --codex-operation-tools 与 --dsh-operation-module 未识别冲突 supported_hosts: [],remediation: ["correct_execution_profile"]
--host dsh --dsh-operation-module rel.js 或加 --dsh-runner 误报 configuration_valid: true 分别返回 operation_transport_module_path_relative / operation_transport_runner_conflict
合法单一操作标志且 profile 完整 configuration_valid: true configuration_valid: true 且严格保持 runtime_qualified: false

具体改动 / Changes

共涉及 4 个生产文件与 1 个测试文件。对照已接受规范 docs/architecture/rfcs/human-confirmed-domain-operations-v0.md(固定修订 dca99cb9b6d0650ac846318f5d64c61e867dba44),验收条目 operation-transport-host-readback-parity 在当前 Head 状态为 implemented。

关键代码讲解

  1. _with_operation_transport 与 turn_host_arg_option:将 codex_operation_tools、dsh_operation_module_configured、dsh_operation_module_absolute 及 dsh_runner_configured 完整传入 operation.managed_transport.project;turn_host_arg_option 通过 strip: bool = True 同时兼顾枚举选项空值拒绝(--host=)与原始 DSH 选项末次覆盖(--dsh-runner=、--dsh-operation-module=)。
  2. projectManagedOperationTransport:引入 conflictingFlags = codexTools && dshModule 使冲突标志下 supportedHosts = [] 并返回 correct_execution_profile;按所选标志精确绑定 ["dsh"] 或 ["codex-cli"],依次校验 runner 冲突、模块绝对路径、sandbox 与 profile。
  3. test_operation_transport_readback.py:在 File 与 SQLite 双后端成对核验委托规划回读与真实 CLI 参数解析在全部正反例上的一致性。

对主干的风险 / Risks

  • 最强回归与反例分析:潜在风险是收紧预检后误伤未启用操作工具的普通 --host dsh --dsh-runner 委托任务。核查 host_binding.py 第 399 行可见,dsh_runner_configured 仅在 module_path 存在时作为冲突信号传入操作传输投影,普通 DSH 委托任务的探测与凭据逻辑完全不变;同时合法单标志仍保持 runtime_qualified: false,不会把静态配置误当运行时就绪。
  • 范围适配与默认隔离:仅当配置 --codex-operation-tools 或 --dsh-operation-module 时激活 _with_operation_transport,默认关闭路径零行为变化。
  • 本地验证矩阵:
    • uv run --extra test python -m pytest tests/control_plane/test_operation_transport_readback.py -q:PASS(48 passed in 37.29s)。
    • check_rfc_bilingual.py、git diff --check、loopx check --scan-path、loopx canary premerge:PASS(selected=18, failures=0,errors=0,warnings=0)。

我的整体评价 / Verdict

从长程演进(long_horizon: improved)与用户体验(user_experience: improved)评估,本 PR 消除了委托规划器与 Turn CLI 在宿主专属操作标志、双标志冲突及 DSH 模块参数上的语义漂移,让配置错误在派发前即可获得准确诊断;纯控制面与 CLI 配置回读变更不涉及视觉界面(visual_review: not_applicable)。实现完全收敛于既有 Python/TS 宿主绑定与传输投影所有者(code_volume: necessary,compatibility_assessment: retain,change_proportionality: proportionate,semantic_alignment: not_applicable)。当前远端精确 Head 为 a9fdf7805589d800c6df9e3704385de6db30e015,证据完备,予以批准。

English verdict: APPROVE at a9fdf78 — aligns delegated operation-transport readback with Turn CLI host flags, dual-flag conflicts, relative DSH module paths, and runner exclusions while keeping runtime_qualified=false; 48 passed in 37.29s and premerge checks passed.

@huangruiteng
huangruiteng merged commit 42821fe into main Dec 3, 2026
26 of 29 checks passed
@huangruiteng
huangruiteng deleted the codex/operation-transport-host-readback branch December 3, 2026 15:25
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