Skip to content

refactor(oar): unload OAR patch shell and sunset dual-track legacy code - #10251

Merged
huangruiteng merged 163 commits into
mainfrom
codex/oar-cleanup-dual-track
Dec 6, 2026
Merged

huangruiteng merged 163 commits into
mainfrom
codex/oar-cleanup-dual-track

Conversation

@songoow

@songoow songoow commented Dec 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This PR targets main after the OAR foundation landed in #9854 (93be88db8). Upgrades @botiverse/oar to published npm 0.144.0, cleanly quarantines LoopX's remaining upstream-pending OAR shims, sunsets dual-track legacy execution paths across LoopX's four core hosts, and explicitly separates ordinary OAR Codex Chat from LoopX's high-isolation direct codex app-server security shell.

Diff & Deleted-Line Summary

  • Overall: 54 files changed, +3444 / -2657
  • Production loopx/: 16 files changed, +1074 / -1436 (-362 net lines, including deleting the entire 607-line loopx/control_plane/turn_driver/_codex_legacy_exec.py)
  • Original implementation commits:
    • 67de8f533 — chore(oar): upgrade @botiverse/oar to 0.144.0 and quarantine patch shell
    • a1924354e — refactor(oar): sunset dual-track legacy code across core hosts and isolate Codex Chat
    • a8930eef0 — test(oar): migrate remaining downstream codex-cli shims and test closeOnDisconnect

Part A — Unload OAR Patch Shell

  1. Upgrade @botiverse/oar 0.142.0 -> 0.144.0 (package.json, package-lock.json via https://registry.npmjs.org/ only, zero mirror URLs). Maintains 100% 0.144.0 compatibility while upstream PRs (botiverse/oar#1337, #1341, #1342, #1343) await npm release.
  2. loopx/control_plane/oar/session_policy.ts:
    • Forward-compatible with botiverse/oar#1337 (OAR_CODEX_SANDBOX): unconditionally pins per-session env.OAR_CODEX_SANDBOX ("read-only" / "workspace-write") for ordinary Codex policies while scrubbing case-insensitive caller overrides.
    • Cleanly isolates LoopX's writeDirectory network-disabled Codex profile (applyCodexWriteDirectoryProfile, sets env.OAR_CODEX_SANDBOX = null, enforcementMechanism: "codex_write_directory_profile").
    • Scrubs OAR_CODEX_SANDBOX in inherit mode and quarantines the pre-#1337 -c sandbox_mode/approval_policy compatibility shim in applyPre1337CodexSandboxCompat with an explicit removal trigger.
  3. loopx/control_plane/oar/session_hub.ts & session_host_server.ts:
    • Stripped dead variables in prepareDshMaxTokensOverlay, extracted verifyDshMaxTokensOverlayApplied, and quarantined the three upstream-pending shims behind minimal helper boundaries with explicit removal triggers:
      • DSH per-request maxTokens Cordis overlay -> botiverse/oar#1341
      • Codex resume sandbox readback assertion -> botiverse/oar#1337
      • Codex final_answer phase extraction (completedCodexChatAnswer) -> botiverse/oar#1342
    • Added opt-in closeOnDisconnect on oar.prompt_stream so SIGKILLed bounded Turn drivers abort and reap orphaned native host processes cleanly without affecting unrelated live sessions.

Part B — Sunset Dual-Track Legacy Code Across Core Paths

  1. Claude Chat (loopx/chat/providers.py): Deleted _start_turn_legacy, current_process subprocess fallback, and legacy branching — Claude Chat runs single-track on OAR (OarSessionHost).
  2. DSH Chat & Turn (loopx/chat/dsh.py, endpoint_catalog.py, hosts/dsh/turn_host_adapter.py, cli_commands/turn_dsh_host.py, host_binding.py):
    • Removed the production non-OAR legacy runner (DshChatAdapter.runner, _run_custom_runner, _run_legacy_dsh_turn) so production DSH Chat and ordinary DSH Turns run single-track on OAR (streaming: True, interrupt: True).
    • Preserved build_sdk_config and dsh_operation_host.py intact for DSH Operation Host / Cordis modules (dsh_cordis_requires_operation_module).
  3. Managed Codex Turn (_codex_legacy_exec.py deleted, codex_cli.py):
    • Deleted loopx/control_plane/turn_driver/_codex_legacy_exec.py (607 lines), _run_codex_cli_exec_session, _looks_like_python_shim, and dual-track fallback (git grep _codex_legacy_exec: 0 matches).
    • Unsupported/older Codex CLI binaries fail closed with BuiltInHostError("codex_cli_oar_upgrade_required", failure_kind="contract_rejected").
    • Validates request contract and enters launch_guard before probing the Codex binary; forwards private decision-capture stdio transport and closeOnDisconnect; enforces non-empty/consistent native_session_id on open and completion.
  4. Retire LOOPX_EXECUTION_ENGINE=legacy (loopx/hosts/oar_client.py, doctor.py, docs/reference/local-delegation.md):
    • Setting LOOPX_EXECUTION_ENGINE=legacy fails fast with OarHostError(code="oar_legacy_engine_removed") across all core host entrypoints and fails the required oar_runtime check in loopx doctor with clear migration guidance.
    • Fixed a real same-thread launch_guard() + check_running() file-lock self-deadlock in run_guarded_oar_turn (on legacy registries) exposed once legacy Codex fallback was retired.
  5. Codex Chat (loopx/chat/oar_codex_chat.py, chat_agent.py, capabilities/native_chat/codex_adapter.py):
    • Replaced the 18-flag inline eligibility check with typed CodexChatSecurityShellRequirements (grouped across Process & filesystem isolation, Auth & model routing, and Direct app-server protocol hooks), CodexChatBackendRoute, select_codex_chat_backend, and cohesive OarCodexChatBackend.
    • Guarded direct-RPC readback methods on CodexAppServerAdapter (completed_work_observation, answer_review_replaceable, steering_delivery_readback, _restore_native_history, healthcheck).
    • Why ordinary Codex Chat remains opt-in (LOOPX_OAR_CODEX_CHAT=1): audited both upstream contract gaps and confirmed they cannot be cleanly papered over inside LoopX without breaking parity:
      1. Native Codex control readback RPCs: @botiverse/oar declines generic session readback and does not yet expose Codex app-server readback RPCs (thread/turns/list, thread/items/list, thread/backgroundTerminals/list; driver-native readback tracked in botiverse/oar#631) needed by codex_adapter.py (steering_delivery_readback, completed_work_observation, answer_review_replaceable).
      2. implicit_codex_home cold-resume modelProvider pinning: @botiverse/oar's codexThreadOpen does not expose pre-resume config/read discovery or thread/resume { modelProvider } pinning required by codex_adapter.py and test_chat_codex_home.py.

Verification Ledger

  • npm run typecheck:control-plane: PASS (0 errors)
  • node --no-warnings --experimental-sqlite --experimental-strip-types --test tests/control_plane_ts/oar_*.test.ts: 51/51 PASS (including OAR_CODEX_SANDBOX pinning/scrubbing, writeDirectory isolation, and oar.prompt_stream closeOnDisconnect)
  • ruff (external-request-lint.toml, external-transport-lint.toml, and E9,F63,F7,F82,F401,F841 on all modified .py files): PASS
  • node scripts/ci/lint-external-transports.mjs: PASS
  • python -m loopx.cli check: PASS (ok: True, 0 errors)
  • python examples/loopx-turn-codex-cli-e2e-smoke.py --turn-count 3: PASS
  • tests/architecture/test_control_plane_import_boundaries.py: 32/32 PASS
  • Core & downstream pytest suites (OAR, DSH, Claude, Codex CLI turn & chat, test_chat_codex_history.py incl. strict mypy zero-Any contract, doctor, bindings, launch authority, interruption recovery, and all 10 migrated downstream codex-cli test files): 100% PASS (0 regressions; also verified all 34 context-strategy / semantic-unit-fold / epoch-prefetch tests with an in-memory tiktoken stub).

songwells and others added 30 commits December 1, 2026 20:53
…verse/oar@0.142.0

Signed-off-by: song <xinxinsong66@gmail.com>
…ne MCP, and Python Keep-Alive client

Signed-off-by: song <xinxinsong66@gmail.com>
…docs and checks

Signed-off-by: song <xinxinsong66@gmail.com>
…and doctor readiness

Signed-off-by: song <xinxinsong66@gmail.com>
…ost.version

Signed-off-by: song <xinxinsong66@gmail.com>
…dex exec

Signed-off-by: song <xinxinsong66@gmail.com>
…ting

Signed-off-by: song <xinxinsong66@gmail.com>
…olated shell

Signed-off-by: song <xinxinsong66@gmail.com>
…l_worker

Signed-off-by: song <xinxinsong66@gmail.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
* fix(turn): retain the selected operation transport across OAR resume

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

* Close managed OAR sessions when initialization loses its binding (#9984)

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

---------

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
* Resume ordinary DSH turns with the native OAR session identity

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

* Confirm the selected DSH binding before OAR dispatch

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

---------

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
* fix(turn): retain the selected operation transport across OAR resume

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

* Defer DSH operation runtime qualification to OAR session open

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

* Apply the operation host token bound in planning and CLI inspection

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

* Refuse bounded OAR DSH operations before model input

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

* Keep confirmed operations resumable when their executor is unavailable

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

---------

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

* fix(turn): retain the selected operation transport across OAR resume

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

* Defer DSH operation runtime qualification to OAR session open

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

* Apply the operation host token bound in planning and CLI inspection

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

* Preserve explicit DSH operation modules and opt into OAR tools by name

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

* Refuse bounded OAR DSH operations before model input

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

* Keep confirmed operations resumable when their executor is unavailable

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

* Reject conflicting DSH operation and runner selections in delegation planning

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

* Let ordinary DSH Turns validate the selected OAR runtime (#9993)

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

* fix(dsh): enforce and verify per-request max_tokens on ordinary OAR turns

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

---------

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

Signed-off-by: song <xinxinsong66@gmail.com>

# Conflicts:
#	package-lock.json
#	tests/test_pi_goal_mode.py
…e floor and OAR host

Signed-off-by: song <xinxinsong66@gmail.com>
…ion-phase2

Signed-off-by: song <xinxinsong66@gmail.com>

# Conflicts:
#	loopx/cli_commands/turn.py
#	loopx/cli_commands/turn_dsh_host.py
#	loopx/cli_commands/turn_registration.py
#	loopx/cli_commands/turn_selection.py
#	loopx/control_plane/oar/session_host_server.ts
#	loopx/control_plane/oar/session_hub.ts
#	loopx/control_plane/turn_driver/codex_cli.py
#	loopx/control_plane/turn_driver/codex_sessions.py
#	loopx/control_plane/turn_driver/host_binding.py
#	loopx/control_plane/work_items/operation_agent_handoff.ts
#	loopx/hosts/dsh/turn_host_adapter.py
#	loopx/hosts/oar_client.py
#	tests/control_plane/test_dsh_operation_entry.py
#	tests/control_plane/test_oar_session_client.py
#	tests/control_plane/test_operation_transport_readback.py
#	tests/control_plane_ts/oar_session_hub.test.ts
#	tests/test_codex_operation_host.py
#	tests/test_loopx_turn_driver.py
#	tests/test_loopx_turn_replan_successor.py
…ion host, and runtime loader

Signed-off-by: song <xinxinsong66@gmail.com>
…n-phase3

Signed-off-by: song <xinxinsong66@gmail.com>

# Conflicts:
#	loopx/control_plane/turn_driver/codex_cli.py
#	loopx/control_plane/turn_driver/oar_operation_host.py
…rker

Signed-off-by: song <xinxinsong66@gmail.com>
Signed-off-by: song <xinxinsong66@gmail.com>
…ion-phase2

Signed-off-by: song <xinxinsong66@gmail.com>
…n-phase3

Signed-off-by: song <xinxinsong66@gmail.com>
… 0.142.0, and add Windows Job containment

Signed-off-by: song <xinxinsong66@gmail.com>
… and Dashboard OAR observe/brands/forms

Signed-off-by: song <xinxinsong66@gmail.com>
Signed-off-by: Codex <codex@openai.com>
Signed-off-by: Codex <codex@openai.com>
…licts

Signed-off-by: song <xinxinsong66@gmail.com>
…hase0-1

Signed-off-by: song <xinxinsong66@gmail.com>
@mergify mergify Bot removed the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Dec 6, 2026

@songoow songoow 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 Astra Pro · OpenAI · self_reported

Request changes conclusion (author-owned PR; GitHub blocks formal self-review)

动机 / Motivation

通过托管 Codex 连续执行多个 Turn 的操作者会遇到这个变化。过去探测失败时会尝试旧执行器,现在只走 OAR;若后台服务启动失败,操作者看到的是升级 Codex 的提示。这次统一了会话生命周期,探测阶段的错误分类却让任务提前停止。真实账号的在线模型效果、桌面全平台发布以及其他 PR 的交付不在本次验证范围。

改动思路 / Approach

托管 Turn 由 Python 核对请求、可执行文件和 Goal 准入,再由 Node 会话宿主打开会话、发送提示并关闭。Claude 与 DSH Chat 共用这条主机链路,普通 Codex Chat 继续显式启用 OAR。涉及原生历史、特定账户或高隔离权限的会话仍交给直接的 app-server。这样的拆分有具体消费者,例如原生适配器要读线程工作状态,而当前 OAR 没有提供对应的 RPC。修复此次故障只需要保留探测错误的类型。

具体改动 / Changes

关键代码讲解

  • select_codex_chat_backend 先判断隔离和协议要求,再检查普通会话是否启用 OAR。原生适配器会根据选定后端决定是否可读工作状态、是否允许重建历史。DSH 自定义 Cordis 配置移到显式操作模块,托管 Codex 删除旧 exec 路径。依赖、wheel 测试和 CLI 样例也随 Core 升级。Chat 路由
  • _run_codex_via_oar 在启动许可内探测二进制并打开会话,执行完成后检查原生会话身份。新流选项能在有界请求执行期间客户端断连时关闭该会话。沙箱构造区分普通权限与限制写入单个目录的配置,避免把这两种约束混在同一条路径。Turn 入口
  • 父分支的规范 docs/reference/protocols/loopx-turn-v0.md(433dc527919178d7c9b82ed408d0692409fa4058)要求 transport_lost 返回带有界重试信息的宿主失败。本次在守护进程的探测阶段观测到该条件未满足。Turn v0 规范

对主干的风险 / Risks

语义与 CI 对齐

P2 · OAR 宿主启动失败被报成 Codex 需要升级。 使用相同的测试二进制和合法 Turn 请求,在探测 RPC 注入守护进程启动时会实际产生的 oar_host_startup_failed / transport_lost。父分支通过原有 exec 完成了这次测试 Turn。当前提交在探测异常处分支返回 false,公开入口报出 codex_cli_oar_upgrade_required / contract_rejected,连二进制都未启动。调用真实宿主恢复策略后,传输失败本应允许使用相同配置最多尝试三次,当前分类却给出不可重试。升级客户端对这个错误无效。异常转换 · 升级判断

把探测通道故障保留为可重试的传输错误,只有明确发现版本不受支持才提示升级。保留现有的旧版本二进制拒绝测试,在同一公开入口增加探测 RPC 失败用例,同时断言错误类型与下一次尝试的许可。检验该分支可运行 python -m pytest -q tests/test_codex_cli_host.py;现有该文件仅用布尔值模拟不支持的二进制。

我的整体评价 / Verdict

建议修复后复审。第一次启动恰逢宿主中断就会让连续执行中的工作停下来,操作者还会被引向错误的修复动作。本次修改的是宿主的执行和错误回读,未改动渲染页面。PASS:Core TypeScript 类型检查、52 项 OAR TypeScript 测试与 85 项 Python 宿主测试。三回合 CLI 样例首次在 Effect runtime 的 TCP 连接失败,切换 stdio 后三个回合均通过验证并提交。FAIL:上述传输故障下的恢复分类。UNVERIFIED:真实账号与多平台发布。此结论针对已同步父分支的提交 1732e3f。

English verdict: REQUEST_CHANGES — at 1732e3f, the passing host suites do not cover a reproduced probe transport failure that disables bounded retry.

songoow and others added 5 commits December 6, 2026 14:35
…ence failures

Signed-off-by: song <liusongstep@gmail.com>
Signed-off-by: Codex <codex@openai.com>
Signed-off-by: song <liusongstep@gmail.com>
…fields

Signed-off-by: Codex <codex@openai.com>
Signed-off-by: song <liusongstep@gmail.com>
Signed-off-by: Codex <codex@openai.com>
Signed-off-by: song <liusongstep@gmail.com>
…oke, and benchmark classifier

- Install locked Node/OAR dependencies (npm ci --ignore-scripts) in ark-turn.yml and memt-turn.yml so single-track OAR codex-cli turns in test_loopx_turn_driver.py have @botiverse/oar available.
- Update test_installed_core_starts_and_replays_a_checked_codex_goal read-only branch in tests/test_core_distribution.py to verify OAR's -c sandbox_mode="read-only", -c approval_policy="never", OAR_CODEX_SANDBOX="read-only", and absence of legacy --sandbox flag.
- Retain pure stateless CodexFailureObservation error-envelope classifier in loopx/control_plane/turn_driver/codex_cli.py (with zero legacy exec code) required by benchmark/microbench/models.py and benchmark/runtime/worker.py (fixing stage2c e2e 1 & 2 ImportError), with unit coverage in tests/test_codex_cli_host.py.
- Migrate _capturing_fake_codex in tests/control_plane/test_turn_prompt_prefix_stability.py (merged from main) from legacy codex exec flags to Codex app-server JSON-RPC capturing exact wire prompt and outputSchema bytes.

Signed-off-by: song <xinxinsong66@gmail.com>
Base automatically changed from codex/oar-deep-fusion-phase0-1 to main December 6, 2026 07:17
@mergify

mergify Bot commented Dec 6, 2026

Copy link
Copy Markdown

This pull request has merge conflicts with main and cannot be merged
until they are resolved. Please rebase or merge the base branch, @songoow.

Choose the remote for the base repository, not an out-of-date fork.
For a fork clone, first inspect git remote -v; upstream must point
to https://github.com/loopx-project/loopx.git. If it is absent, add it
with git remote add upstream https://github.com/loopx-project/loopx.git.
Then run:

git fetch upstream
git rebase upstream/main
# Resolve each conflict, git add the resolved files, then git rebase --continue.
git push --force-with-lease origin HEAD

For a same-repository clone whose origin points to
https://github.com/loopx-project/loopx.git, use origin instead of
upstream for fetch/rebase. If you prefer merging the base, use
git merge <base-remote>/main and push normally.

Keep the DCO Signed-off-by trailer on every commit when you rebase.
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Dec 6, 2026
Reapply the cleanup delta from the shared OAR stack ancestor onto the squash-merged main tree, preserving the subsequent release-qualification changes.

Signed-off-by: Codex <codex@openai.com>
Signed-off-by: song <liusongstep@gmail.com>
@mergify mergify Bot removed the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Dec 6, 2026
…-mismatch test, and verify retry allowance

- Restore _OAR_CODEX_BINARY_CACHE as dict[tuple[str, int], bool] (storing only verified True entries, never caching failures) so monkeypatch.setitem in tests/test_codex_operation_host.py succeeds while failed probes remain uncached (fixes 3 AttributeError regressions from b384657).
- Update tests/capabilities/test_codex_native_child_receipts.py::test_real_cli_rejected_resume_thread_cannot_publish_children to expect codex_cli_session_missing (failure_kind=session_missing), matching OarSessionHub.openSession's oar_session_not_found enforcement on mismatched resume thread IDs (24df8a3 / #9854).
- Strengthen tests/test_codex_cli_host.py to assert host_failure_retry_available (bounded retry allowance vs non-retryable contract_rejected) and repeated probe execution without cache poisoning.

Signed-off-by: song <xinxinsong66@gmail.com>
@songoow

songoow commented Dec 6, 2026

Copy link
Copy Markdown
Collaborator Author

Fast-forward follow-up commit cb6d0a6f0 pushed on top of c4d7aa2b5 (already synced with merged #9854 and including b384657c1 for the GPT-6 Astra Pro P2 probe transport-failure finding):

  • Preserve mapping compatibility on _OAR_CODEX_BINARY_CACHE (loopx/control_plane/turn_driver/codex_cli.py): restored _OAR_CODEX_BINARY_CACHE: dict[tuple[str, int], bool] = {} while continuing to store only verified True probe results (never caching failures). Fixes the 3 AttributeError: 'set' object has no attribute 'get' regressions in tests/test_codex_operation_host.py (monkeypatch.setitem).
  • Align resume-mismatch test with #9854 OarSessionHub enforcement (tests/capabilities/test_codex_native_child_receipts.py): updated test_real_cli_rejected_resume_thread_cannot_publish_children to expect codex_cli_session_missing (failure_kind="session_missing"), matching OarSessionHub.openSession() rejecting mismatched resume thread IDs with oar_session_not_found (24df8a3a8) while preserving the zero-child-receipt invariant.
  • Strengthen P2 probe-failure regression coverage (tests/test_codex_cli_host.py): directly asserts host_failure_retry_available(...) bounded retry allowance (attempt 1 allowed / exhausted at max_attempts = 3 for transport_lost and 2 for executor_timeout; False for contract_rejected) and repeated probe invocations proving failed probes never poison _OAR_CODEX_BINARY_CACHE.

Verification (cb6d0a6f0, Node v24.23.0 / Python 3.12.3)

  • npm run typecheck:control-plane: PASS
  • node --no-warnings --experimental-sqlite --experimental-strip-types --test tests/control_plane_ts/oar_*.test.ts: 53/53 PASS
  • ruff (--ignore-noqa external-request-lint.toml, external-transport-lint.toml, E9/F63/F7/F82/F401/F841), node scripts/ci/lint-external-transports.mjs, python -m loopx.cli check (ok: True, errors: 0), examples/loopx-turn-codex-cli-e2e-smoke.py --turn-count 3 (committed, 3 turns, session_resumed: True, replay_exit_code: 0): PASS
  • Targeted Python suites (test_codex_cli_host.py, test_codex_operation_host.py, test_codex_native_child_receipts.py, test_oar_transport_regressions.py, test_oar_phase3_integration.py, test_control_plane_import_boundaries.py): 248 passed, 4 skipped, 0 failed

Ready for re-review.

@songoow songoow 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 Astra Pro · OpenAI · self_reported

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

动机 / Motivation

使用托管 Codex Turn、Claude 或 DSH 的用户此前会遇到两套执行路径。主干在 OAR 探测失败后会启动旧执行器;当前版本保留原始传输错误并允许按原配置重试。三轮公开 CLI 操作按预期提交,重放没有重复扣费或写状态。此次验收覆盖 Core 运行时和聊天路由,线上模型质量与操作系统服务不在范围内。

改动思路 / Approach

会话生命周期、取消和沙箱由共享 OAR 宿主管理,重试由现有 Turn 规则决定。本 PR 收敛 Core 的 Turn 和聊天适配器,需使用原生能力的 Codex Chat 仍由直接连接负责。 普通聊天只有显式启用且二进制受支持时才走 OAR,权限配置、原生历史或强隔离优先走直接连接。

具体改动 / Changes

关键代码讲解

相对上一个提交,生产变更只涉及 Codex 二进制探测缓存。按(路径、mtime_ns)存储已确认的 True,超时、传输断开、明确不支持均不写入。 前一提交的操作宿主测试在预置成功探测时抛出 AttributeError(set 没有 get);同一测试在新提交通过。 探测缓存

用另一条线程 ID 响应原生 resume 时,Hub 返回 oar_session_not_found,托管宿主映射为 session_missing;真实适配器用例同时断言子任务启动数为零、没有写入子任务决策。 拒绝串线测试

同一未缓存请求在新 main 会转入旧执行器,在当前 PR 会保留 transport_lost。第一次可按原配置重试,达到尝试上限后停止;传输故障最多 3 次,执行器超时最多 2 次,明确不支持的版本直接拒绝。规范 docs/reference/protocols/loopx-turn-v0.md(dd4f32c4a8911d9db181d1eae4c96d835446887b)的验收项 transport_lost 已通过。 重试分支和上限

对主干的风险 / Risks

精确提交的六套 Python 测试共 248 项通过、4 项按条件跳过,OAR TypeScript 测试 53/53 通过。与当前 main dd4f32c 的合并树无冲突,195 项 Python 测试与 24 项 Hub 测试通过,4 项按条件跳过。控制平面类型检查和公开 CLI 三轮走通,重放没有再次调用宿主、写入状态或扣费。未运行要求 Linux setuid 启动器的两个用例、两个需要真实供应商的显式发布验收用例,以及打包桌面端验收。新提交的 GitHub 检查采样为 3 项成功,6 项运行中,5 项排队,无失败项。

我的整体评价 / Verdict

历史 P2 的正向、反向与耗尽分支均已验证,恢复不匹配时不会记录其他线程的子任务。建议合入当前提交。本 PR 收敛 Core 的 Turn 和聊天适配器,需使用原生能力的 Codex Chat 仍由直接连接负责。 PASS。

English verdict: APPROVE — cb6d0a6, approve. Only verified probe results are cached, retry allowance and exhaustion are tested, and a mismatched resumed session cannot publish child receipts. The current-main merge passed its bounded CLI and replay tests.

@huangruiteng
huangruiteng merged commit 95bd5cf into main Dec 6, 2026
36 of 47 checks passed
@huangruiteng
huangruiteng deleted the codex/oar-cleanup-dual-track branch December 6, 2026 10:44
songoow pushed a commit that referenced this pull request Dec 6, 2026
@songoow

songoow commented Dec 6, 2026

Copy link
Copy Markdown
Collaborator Author

Follow-up adversarial invariant-hardening and CI flake-fix PR opened at #10277 (codex/oar-policy-and-dual-track-hardening → main, commit cc6eee67f), covering session_policy.ts adversarial launchArgs/env/secret/inherit hardening, session_host_server.ts closeOnDisconnect invariants + oar_session_hub.test.ts ENOTEMPTY teardown fix, codex_cli.py/oar_client.py/oar_codex_chat.py probe/engine/isolation hardening, and exhaustive property/state-matrix suites.

songoow pushed a commit that referenced this pull request Dec 6, 2026
loopx-agent added a commit that referenced this pull request Dec 6, 2026
…single-track smokes (#10251), refresh RFC status index (#10292)

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
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.

4 participants