Skip to content

fix(turn): preserve the original executor for confirmed Codex operations - #9965

Merged
huangruiteng merged 1 commit into
codex/oar-deep-fusion-phase2from
codex/retain-confirmed-codex-operation-host
Dec 3, 2026
Merged

huangruiteng merged 1 commit into
codex/oar-deep-fusion-phase2from
codex/retain-confirmed-codex-operation-host

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Preserve confirmed Codex operations across engine changes

With the Phase 2 changes, enabling OAR for ordinary sessions can also switch the executor of an explicitly selected Codex operation. A request that was confirmed on the native app-server then fails to resume its original session and asks for fresh approval. The CLI still describes this configuration as app-server-operation-tools-v0.

This companion to #9861 targets its integration branch. The explicit --codex-operation-tools entry now stays with the same app-server on initial launch and callback. The ordinary Codex runner continues to select OAR. Session, profile, goal, confirmation and receipt checks still run.

Authored by OpenAI Codex (model agent). Base: codex/oar-deep-fusion-phase2, commit 2d96b4c8336e44bdd467fd4a7b421a877fcf74f7.

Evidence

  • A signed request with an existing confirmation failed on the parent with a profile-change error after OAR became available. The same callback on this change reused the original session, confirmation and claim. A subsequent turn retained the original start receipt.
  • With the installed Codex executable positively identified by an isolated OAR runtime probe, parsed CLI options selected OAR on the parent and the app-server on this change. The inspected transport said app-server in both cases. This experiment stopped at the adapter boundary.
  • The public CLI dry-run and execution cases use both File and SQLite. The operation tests use a local app-server fixture. Ordinary OAR success and failure run against the local OAR session service with a scripted model.
  • Scope is Codex managed operations. The DSH operation adapter on the parent still selects OAR; restoring or qualifying that path is separate work. This change adds no GUI or persisted fields.

The final operation, callback, preflight and OAR suites passed 108 tests. Four were skipped: two need a Linux setuid launcher and two are opt-in live-host release tests. Differential premerge passed. Its maintainability advisory on loopx/status.py (1,343 lines against 1,339) is identical on the parent and this head. No production session or live model was used.

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

启用普通 OAR,同时由显式 Codex operation 工具配置发起受管操作或处理原会话确认回调的调用方。 冻结 #9861 基线在 OAR probe 为真时,把显式 operation tools 也送往 OAR。两后端的原生已确认回调均被 profile changed 拒绝。 保持专属 Codex operation transport 的原会话连续性,同时保留普通 Codex 的 OAR 路由。 原生 app-server 使用本地协议夹具。普通 Codex 路径在真实本地 OAR session host 上使用脚本模型,并用本机 Codex 的实际 probe 验证默认路由。生产会话、模型及 DSH operation 迁移未验。

审读提交 29e4620,冻结基线 2d96b4c。

改动思路 / Approach

仅显式 Codex operation host 及既有原生协议用例。 收窄已有分支,删除与普通引擎同步的显式操作重路由。回调、原会话、状态和结算依旧走原 owners。普通 Codex 路径仍以实际二进制探针选择 OAR。

具体改动 / Changes

  • 同一基线/head 的 CLI 对照在两后端强制 OAR probe 为真。基线首次分派至 OAR,已有确认进入 OAR 路由后因为 profile drift 拒绝。候选各用原 app-server thread/start,再使用相同 thread ID 的 thread/resume。
  • 真实确认和操作回执 owner 在启动前、原 CLI 启动后重放均返回 existing_turn。只保留一次启动请求,保持 confirmation event、claim、原 native session 和 host-start witness。直接重投原确认 CLI 由一次启动条件拒绝,仅作负例。
  • 通过真实本地 OAR 0.142.0 服务探测本机 CLI,再经普通默认分支用 scripted provider 做成功与失败对照。一开始隔离环境缺 OAR npm 依赖,装入候选锁定版本后同一扩大 suite 全过。

显式 operation tools 沿既有 app-server transport。首入、确认与当前原会话保持同一身份。 冻结验收依据

  • explicit_transport_scope · 显式选项在普通 OAR 可用后保持 app-server。复验通过。
  • confirmed_original_session · 确认仅能归原会话启动,重放不消耗或重派。复验通过。
  • ordinary_oar_parity · 无该开关时普通 OAR 真实本地会话成功及拒绝语义保持。复验通过。

关键代码讲解

对主干的风险 / Risks

159 项扩展定向测试通过、4 项跳过。独立基线和候选各通过五个观察用例,候选另通过两个完整回调重放对照。标准 premerge 六项直接检查、十项选中,无阻断,保留继承维护性 advisory。 隔离测试零外部写、零 consume、零 quota;确认与启动回执各自保留。 普通 OAR 的规划和适配器仍使用真实 probe,应用层收到脚本结果和原 typed failure。

我的整体评价 / Verdict

通过。原会话、人工确认与首次启动回执在显式 Codex operation 路径保留,普通 OAR 仍可用。 涉及执行器选择、协议、回执和回调。 原生 app-server 使用本地协议夹具。普通 Codex 路径在真实本地 OAR session host 上使用脚本模型,并用本机 Codex 的实际 probe 验证默认路由。生产会话、模型及 DSH operation 迁移未验。

English verdict: APPROVE. Explicit Codex operation tools keep the app-server transport for launch and confirmed resume. Replayed wakes retain one reserved Turn and the original receipt, while ordinary Codex still uses OAR.

@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

显式开启 --codex-operation-tools 运行受管操作(managed operation)的维护者与自动化回调流程会在同一二进制环境启用 OAR(Open Agent Runtime)默认执行引擎后触发此问题。修改前,若某个受管操作请求先在原生 Codex app-server 上完成准备与人工确认,随后系统对普通会话默认启用 OAR,回调阶段进入 run_codex_operation_host 时会因提前分流至 run_oar_operation_host 而把 transport 变为 oar-codex-operation-tools-v0,导致 select_managed_operation_session 报 operation profile changed 拒绝恢复原会话并迫使操作员重新发起审批;修改后,--codex-operation-tools 入口始终固定在原生 app-server-operation-tools-v0 传输层,回调能够直接复用原有会话、确认凭证与执行声明。显式 --codex-operation-tools 的首次启动与确认后回调均稳定保持 app-server-operation-tools-v0 执行身份,同时不带操作工具的普通 Codex Turn 仍继续按现有引擎探针选择 OAR。本 PR 仅处理 Codex 受管操作入口,不修改 DSH 受管操作适配器的 OAR 路由,也不新增持久化字段或确认协议。OAR 传输层对已确认受管操作(confirmed operations)的端到端审批绑定与派发资格尚未在 TypeScript 控制面完成独立准入,留待后续专门工作收敛。

在集成分支 codex/oar-deep-fusion-phase2(基线提交 2d96b4c8336e44bdd467fd4a7b421a877fcf74f7)上,CLI 预检与控制面绑定检查(managedOperationBindingCurrent)依然将该入口标识为 app-server-operation-tools-v0。若保留隐式 OAR 分流,任何跨引擎切换窗口内的已确认操作都会在回调时因 operation_transport 与 profile_digest 变化而失效;保持原 app-server 执行器是修复该回归的最小完整切片。

改动思路 / Approach

run_codex_operation_host 本身就是 --codex-operation-tools 显式选定的 app-server-operation-tools-v0 传输所有者,删除其内部隐式切向 run_oar_operation_host 的旁路分支即可在原所有权边界内消除跨引擎切换导致的会话与确认漂移,无需新增配置开关或双写状态。当前 PR 边界严格收敛于 loopx/control_plane/turn_driver/codex_operation_host.py 的 Codex 受管操作入口与配套回归测试,普通 run_codex_cli_host 的 OAR 选择逻辑以及 dsh_operation_host.py 保持不变。

从控制流看,CLI 入口 build_codex_cli_host_runner 在检测到 args.codex_operation_tools 为真时调用 run_codex_operation_host,否则落入普通 run_codex_cli_host(后者仍保留 oar_execution_engine_selected() 与 _codex_binary_supports_oar() 探针)。移除 run_codex_operation_host 中的 OAR 抢占分支后,正路径直接计算 app-server-operation-tools-v0 的 profile_digest,通过 select_managed_operation_session 校验会话一致性,再由 operations.require_confirmed_operation_resume 验证已确认操作路由并启动受管 CodexChatAgentSession。

触发场景 基线 2d96b4c8336e 路径与结果 当前 Head 29e462029683 路径与结果
--codex-operation-tools 确认回调且环境启用默认 OAR run_codex_operation_host 转入 run_oar_operation_host,因 transport 变为 oar-codex-operation-tools-v0 触发 profile changed 报错 留在 run_codex_operation_host(app-server-operation-tools-v0),成功恢复原会话并消费已确认操作
普通 Codex Turn(未启用 --codex-operation-tools) run_codex_cli_host 在探针通过时走 OAR 行为不变,继续由 run_codex_cli_host 选择 OAR

具体改动 / Changes

生产代码变更仅涉及 1 个文件(+2/-30 行),测试变更涉及 1 个文件(+26/-4 行),无文档或生成产物改动。对照已接受规范 docs/architecture/rfcs/human-confirmed-domain-operations-v0.md(固定修订 2d96b4c8336e44bdd467fd4a7b421a877fcf74f7),验收条目 confirmation-triggered-continuation(确认触发的后续执行必须在常规 Goal/Todo/lease/profile 校验下自动复用原原生会话与执行配置)在当前 Head 状态为 implemented,由 run_codex_operation_host 与回归用例共同验证。

关键代码讲解

  1. run_codex_operation_host:移除了在 worker is None and mcp_server is None and oar_execution_engine_selected() and _codex_binary_supports_oar(...) 时动态导入并委派给 run_oar_operation_host 的分支及对应无用导入。这样无论环境变量 LOOPX_EXECUTION_ENGINE 是否切回默认 OAR,只要调用方显式请求 --codex-operation-tools,其 TRANSPORT 恒为 app-server-operation-tools-v0,profile_digest、Goal 准入围栏(FirstPartyHostGoalAdmission)与 require_confirmed_operation_resume 均保持确定性。
  2. _enable_default_oar_for_codex 与 test_confirmed_operation_is_automatically_carried_into_accepted_native_turn:测试先在 LOOPX_EXECUTION_ENGINE=legacy 下通过 _claimed_native_fixture 建立签名请求(_signed_request)与已认领的原生操作会话,随后清除 LOOPX_EXECUTION_ENGINE 并在 codex_cli._OAR_CODEX_BINARY_CACHE 注入二进制支持 OAR 的探针缓存,验证回调 Turn 仍走 app-server 并携带原确认信息完成执行。
  3. test_admitted_turn_cli_launches_owned_transport_without_plain_cli_fallback:参数化覆盖 file 与 sqlite 两种权威存储后端,在开启默认 OAR 探针缓存的前提下通过真实 CLI 入口执行 --codex-operation-tools,验证其启动受管 app-server 传输而非降级到普通 CLI 或误切入未完成受管操作准入的 OAR 会话服务。

对主干的风险 / Risks

  • 最强回归与反例分析:潜在风险点在于移除转发分支后是否会影响普通 Codex 会话的 OAR 启用,或放宽受管操作的安全围栏。核查调用链可见,codex_cli.py 第 1522 行的 oar_execution_engine_selected() and _codex_binary_supports_oar(resolved) 完全独立于 codex_operation_host.py;同时 sandbox not in {"read-only", "workspace-write"}、隔离 worker 的只读与无外部 MCP 限制、select_managed_operation_session 的 profile 校验以及 on_event("turn.started") 的启动回执栅栏均原样保留。若回调时会话 ID 或模型参数被篡改,负路径仍由 require_confirmed_operation_resume 立即拒绝且不启动子进程。
  • 范围适配与默认隔离(scope_fit / default_off_isolation):生产活跃调用点为 loopx/cli_commands/turn_host_request.py:129(仅当显式传入 --codex-operation-tools 时触发)。未传入该标志时默认关闭,普通 Turn 入口、schema、配额与调度行为与基线一致。
  • 权限语义与类型状态(authority_semantics / typed_state_rule):复用既有固定常量 TRANSPORT = "app-server-operation-tools-v0" 与类型化会话结构,未引入宽泛执行权限或领域特定错误文案。
  • 本地验证矩阵:
    • 基线反事实回放(将 codex_operation_host.py 切回 2d96b4c8336e44bdd467fd4a7b421a877fcf74f7 运行新增/更新的 3 个用例):FAIL(3 failed,复现 OAR 抢占导致的回调失败)-> 当前 Head 29e462029683934308c0d18298916dd2e617c0ec:PASS(3 passed)。
    • 目标与关联套件 uv run --extra test python -m pytest tests/test_codex_operation_host.py tests/control_plane/test_codex_operation_launch.py -q:PASS(95 passed, 4 skipped;跳过项为 Linux setuid 专属与 opt-in 真机发布测试)。
    • 双语 RFC、契约与风险门禁:check_rfc_bilingual.py PASS;loopx check --scan-path PASS(errors=0, warnings=0);loopx canary premerge --from-git-diff --git-diff-base origin/codex/oar-deep-fusion-phase2 PASS(selected=10, failures=0,其中 semantic-vocabulary-drift-smoke.py 与 8/8 风险画像冒烟全部通过,另有 1 项与本次变更文件无关的历史可维护性提示 advisory_inherited_failure)。

我的整体评价 / Verdict

从长程演进(long_horizon: improved)与用户体验(user_experience: improved)评估,本 PR 消除了引擎默认切换引发的跨回合确认作废与重复人工审批摩擦;本变更属于内部运行时与 CLI 执行器路由修复,不涉及前端或渲染界面改动(visual_review: not_applicable)。基线与当前 Head 的同输入对比证实了预期的有界行为收敛;代码体量净减 28 行生产代码(code_volume: necessary,compatibility_assessment: retain,保留既有持久化会话契约),改动规模与问题严重度高度匹配(change_proportionality: proportionate)。语义词汇表完全复用既有传输标识(semantic_alignment: not_applicable),残余风险仅限已明确分界的 DSH/OAR 独立后续工作。当前远端精确 Head 为 29e462029683934308c0d18298916dd2e617c0ec,证据完备,予以批准。

English verdict: APPROVE at 29e4620 — preserves app-server-operation-tools-v0 across ordinary OAR engine enablement so confirmed Codex operations resume their bound session without spurious profile-drift failures; baseline counterfactual and 95 local tests plus differential premerge passed.

@huangruiteng
huangruiteng merged commit 9f652a5 into codex/oar-deep-fusion-phase2 Dec 3, 2026
29 of 33 checks passed
@huangruiteng
huangruiteng deleted the codex/retain-confirmed-codex-operation-host branch December 3, 2026 14:45
songoow added a commit that referenced this pull request Dec 6, 2026
…rker migrations, 16 runtimes, SQLite WAL & Workbench UI (Phase 0–4) (#9854)

* chore(runtime): raise minimum Node.js floor to 24.0.0 and adopt @botiverse/oar@0.142.0

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

* feat(hosts): add persistent TS OarSessionHost, in-process Control Plane MCP, and Python Keep-Alive client

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

* fix(runtime): align Node.js floor to SQLite-qualified 24.21.0 across docs and checks

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

* feat(oar): harden OAR session host policy, streaming, MCP callbacks, and doctor readiness

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

* feat(hosts): migrate DSH, Claude/ACP, and bounded Codex hosts onto OAR

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

* fix(oar): declare loopback HTTP transport owner and retain turn_dsh_host.version

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

* feat(oar): stream sanitized native child items and decouple legacy codex exec

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

* feat(oar): add unified OAR Goal Worker and opencode2 --engine oar routing

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

* feat(chat): decouple ordinary Codex Chat onto OAR while preserving isolated shell

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

* fix(oar): reuse canonical EffectiveAction.TERMINAL_NO_FOLLOWUP in goal_worker

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

* Exercise DSH dispatch closeout at the OAR prompt boundary (#9980)

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

* fix(turn): retain the selected Codex operation transport (#9965)

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

* Keep the original OAR session for confirmed operations (#9967)

* 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 (#9982)

* 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>

* Use the selected OAR runtime for DSH operation preflight (#9968)

* 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>

* Preserve explicit DSH module loading across confirmed operation wakes (#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>

* fix(oar,runtime): address PR #9854 review findings across Desktop Node floor and OAR host

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

* fix(oar): address Phase 2 review findings across ACP, DSH, OAR operation host, and runtime loader

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

* fix(oar): address PR #9866 review findings for Codex Chat and Goal Worker

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

* fix(oar): reserve explicit sessionKey before async openSession setup

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

* feat(oar): expose all 16 OAR runtimes in CLI/Chat, align workbench to 0.142.0, and add Windows Job containment

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

* feat(oar): add sessions.sqlite WAL store, in-process MCP write tools, and Dashboard OAR observe/brands/forms

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

* fix(oar): include session host sources in Python wheels

Signed-off-by: Codex <codex@openai.com>

* fix(oar): serialize goal worker lease ownership changes

Signed-off-by: Codex <codex@openai.com>

* fix(chat): verify OAR session health and observed configuration

Signed-off-by: Codex <codex@openai.com>

* fix(oar): abort active sessions before draining shutdown requests

Signed-off-by: Codex <codex@openai.com>

* fix(oar): integrate governed Turn sessions and preserve registered Chat endpoints

Signed-off-by: Codex <codex@openai.com>

* fix(oar): preserve legacy transport and reject incomplete turns

Restore explicit SDK/stdio rollback with compatible session bindings. Preserve custom ACP arguments and idle deadlines, guard Codex prompt admission, and reject interrupted or aborted results before successful finalization. Reject unsupported DSH overlays without silently dropping configuration.

Signed-off-by: Codex <codex@openai.com>

* fix(oar): verify resumed permissions and contain callbacks

Reject raw launch arguments that override LoopX permission or tool constraints. Check Codex native resume/fork sandbox readback before admitting model input, and reject unchecked HTTP callback redirects. Cover the boundaries with an actual OAR Codex protocol fixture and real local HTTP servers; document explicit transport rollback and fail-closed limits.

Signed-off-by: Codex <codex@openai.com>

* fix(oar): require completed turns and verify generic Chat health

Reject handled or malformed terminal payloads before publishing generic Chat answers or governed Turn results. Check the live OAR session inventory before reusing a cached generic Chat adapter, including released and exited status. Cover real removed-session behavior and require explicit ended/completed outcomes.

Signed-off-by: Codex <codex@openai.com>

* test(oar): use completed outcomes in operation resume fixtures

Signed-off-by: Codex <codex@openai.com>

* refactor(hosts): separate Codex preflight and OAR prompt dispatch

Keep session planning checks and native-child prompt observation in focused helpers, and build the operation route once after native identity is confirmed. Preserve admission, interruption, failure mapping, and legacy selection behavior while satisfying the existing maintainability gate.

Update the operation session test fixture to report its successful completed turn explicitly under the tightened terminal-outcome contract.

Signed-off-by: Codex <codex@openai.com>

* fix(packaging): ship locked OAR runtime dependencies

Prepare required pure-JS npm packages during wheel and source builds, retaining resources and licenses with an input/file manifest for offline sdist reuse. Share that build owner with runtime and desktop archives and preserve the embedded tree through Windows installation.

Resolve installed OAR readiness from adjacent dependencies and avoid scanning third-party declarations for runtime identity. Qualify isolated wheel installs and offline sdist rebuilds through the real daemon and a scripted native app-server.

Signed-off-by: Codex <codex@openai.com>

* fix(packaging): include the shared OAR bundle in Core wheels

Stage the exact npm inputs and a small Core build hook that delegates wheel/sdist dependencies to the shared OAR distribution owner. Preserve published resources and licenses without treating node_modules as Python namespaces. Qualify isolated Core installation, native session prompt roundtrip, offline sdist rebuild, and rejection of changed bundle inputs.

Signed-off-by: Codex <codex@openai.com>

* Fix checkout packaging on Windows and stage OAR for promoted source installs

Includes the quorum readback fix from upstream commit 1df072e.

Signed-off-by: Codex <codex@openai.com>

* Include locked npm inputs in the source archive smoke fixture

Signed-off-by: Codex <codex@openai.com>

* Wait for actual heartbeat persistence and use an atomic lease takeover in the regression test

Signed-off-by: Codex <codex@openai.com>

* Interrupt active OAR turns on session close

Send close_session over the control channel so it can dispose a session while its prompt is waiting. Cover the interrupt and final readback against a live scripted host.

Signed-off-by: Codex <codex@openai.com>

* Exercise interrupted DSH turns through the OAR streaming API

Update the recovery fixture to implement the same prompt_stream interface used by the DSH adapter so the file and SQLite tests verify typed stop handling.

Signed-off-by: Codex <codex@openai.com>

* fix(oar): route shutdown via control channel, pin UTF-8 in npm build, and update Node 24.21.0 probe fixture

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

* fix(oar): invalidate released DSH Chat sessions, slim host functions under ratchet, and align machine credential tests

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

* fix(oar): preserve explicit zero budgets in opencode2-goal-worker CLI forwarding

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

* fix(oar): defer oar_turn_host import from turn CLI registration and update supported host parity test

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

* fix(oar): narrow model_settings mypy types, pin standardwebhooks 1.3.0 in Dashboard, and isolate PATH in runtime-readiness-live

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

* fix(oar): resolve P1/P2 review blockers and wire Workbench original OAR status

Addresses all P1 merge blockers and P2 functional regressions from review on ec40a9f:

P1 fixes:
- Fail-closed permission enforcement in session_policy.ts (explicit permission_enforced / enforcement_mechanism) and stop advertising unsupported built-in OAR runtimes (Qwen/Grok/Kimi/etc.) as read_only in endpoint_catalog.py
- Collision-proof Goal Worker state/lease naming (sanitized prefix + SHA-256 suffix) plus strict goalId verification on state read/write and lease acquire/refresh
- Settle inner outcome.kind == 'completed' before outer interrupted handling in goal_worker.ts, and preserve inFlightDispatch for reconciliation on uncertain interrupts
- Preserve native_session_sha256 on OAR Codex timeout/resumable BuiltInHostError so failed-turn retry blocks replaced session bindings

P2 & routing fixes:
- Surface SQLite appendRecord() failures as explicit persistence degradation and failed_record_seqs across sendPrompt, sessionTelemetry, readRecords, and oar_observation
- Add oar_session_not_found / oar_session_unavailable / oar_session_archived / transport_lost to OAR_TERMINAL_SESSION_REJECTIONS, clear dead OAR bindings and resume saved Claude native session_id on session loss, mark healthcheck false on unrecovered OAR loss, and fix misleading sign-in error text
- Defer Codex finalize_request() into prompt_stream's launch_guard (after open_session) and wire on_usage_observed into OAR Codex turns
- Clamp Goal Worker per-turn timeoutMs to remaining maxDurationMs budget
- Stop re-prepending objective + 12 history turns in DshChatAdapter when reusing an open persistent OAR session
- Stop excluding ordinary Dashboard Codex Chat from OAR solely because account_runtime_root is passed when no custom transport/override is active

Workbench convergence:
- Wire GET /api/loopx/api/chat/sessions/{sessionId}/oar-status in apps/workbench/packages/web OriginalConversations with strict session_id verification

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

* Connect Workbench OAR conversations to the shared Core host

Route managed Workbench sessions through Core while preserving standalone execution and per-account configuration. Read native status and model settings in Workbench, and remove the PR-specific Dashboard SDK and controls.

Signed-off-by: Codex <codex@openai.com>

* Keep upgraded Workbench sessions on the shared Core host

Recover the Core runtime for existing Workbench service registrations. Verify that a reused daemon delegates OAR sessions to Core and exercise the upgrade against the native adapter in CI.

Signed-off-by: Codex <codex@openai.com>

* fix(chat): route ordinary Codex through OAR and preserve registered ACP transports

Use the captured default Codex home for new ordinary OAR sessions, keep explicit accounts and cold native resumes intact, and scope interruption to the selected turn. Keep registered ACP commands on stdio and report Core endpoints without verified read-only enforcement as unavailable.

Signed-off-by: Codex <codex@openai.com>

* Share the resolved OAR host with Workbench-managed Core

Signed-off-by: Codex <codex@openai.com>

* Route ordinary Core Codex chats through OAR with their bound account environment

Signed-off-by: Codex <codex@openai.com>

* Persist Steward DSH deadlines as timed out even after partial output

Signed-off-by: Codex <codex@openai.com>

* Report Core Chat readiness against the read-only session it can open

Signed-off-by: Codex <codex@openai.com>

* Release failed Steward sessions on their original OAR host

Signed-off-by: Codex <codex@openai.com>

* Keep persistence recovery state only for degraded OAR archives

Signed-off-by: Codex <codex@openai.com>

* Fence Workbench cancellation to its dispatched OAR turn

Signed-off-by: Codex <codex@openai.com>

* Keep the shared Windows OAR job alive until its daemon exits

Signed-off-by: Codex <codex@openai.com>

* Bind Workbench original-session status to the current registered Goal lifetime

Signed-off-by: Codex <codex@openai.com>

* Show the exact Node requirement in Workbench OAR discovery

Signed-off-by: Codex <codex@openai.com>

* Choose a workspace-scoped runtime for new OAR Goal workers and preserve existing bindings

Signed-off-by: Codex <codex@openai.com>

* Apply one hard deadline across native OAR startup and prompt dispatch

Signed-off-by: Codex <codex@openai.com>

* Reconcile OAR archive ownership and completeness and page legacy history

Signed-off-by: Codex <codex@openai.com>

* fix(worker): report the active runtime and verify the first native reply

Signed-off-by: Codex <codex@openai.com>

* test(oar): qualify a second client continuing after the launcher exits

Signed-off-by: Codex <codex@openai.com>

* fix(oar): page mixed native and legacy archives within the transport limit

Signed-off-by: Codex <codex@openai.com>

* fix(oar): retain known archive gaps across crashes and mixed-version writers

Signed-off-by: Codex <codex@openai.com>

* fix(oar): enforce remaining startup budgets and release unacknowledged sessions

Signed-off-by: Codex <codex@openai.com>

* Fence timed-out OAR streams to the dispatched session and turn

Signed-off-by: Codex <codex@openai.com>

* Page live and archived OAR record reads within the transport budget

Signed-off-by: Codex <codex@openai.com>

* Use the repository Python resolver for Workbench qualification and account for the Controller digest reader

Signed-off-by: Codex <codex@openai.com>

* Resolve Core as the runtime owner for a verified split installation

Signed-off-by: Codex <codex@openai.com>

* Serve advertised report readbacks during research browser qualification

Signed-off-by: Codex <codex@openai.com>

* Keep settled Turn recovery bound to the original journal without reclaiming its Todo

Signed-off-by: Codex <codex@openai.com>

* fix(oar): budget archive health and recover workers across large native records

Signed-off-by: Codex <codex@openai.com>

* fix(chat): keep bound health and close operations on the original OAR daemon

Signed-off-by: Codex <codex@openai.com>

* fix(chat): enforce ACP and DSH deadlines and cancel only the dispatched native turn

Signed-off-by: Codex <codex@openai.com>

* test(quota): register the settlement reader with the canonical digest contract

Signed-off-by: Codex <codex@openai.com>

* Bound OAR Goal worker waits by the remaining duration budget

Signed-off-by: songoow <22676124+songoow@users.noreply.github.com>

* Keep Workbench Stop responsive during OAR status refresh

Signed-off-by: Codex <codex@openai.com>

* Invalidate cached OAR daemons when installed authority contracts change

Signed-off-by: songoow <22676124+songoow@users.noreply.github.com>

* fix(chat): recover OAR routing and require completed native compaction

Signed-off-by: Codex <codex@openai.com>

* test(chat): separate dispatched DSH deadlines from native startup

Signed-off-by: Codex <codex@openai.com>

* fix(turn): bind settled recovery to the receipt and its exact journal

Signed-off-by: Codex <codex@openai.com>

* fix(chat): fence OAR history compaction against concurrent close

Signed-off-by: Codex <codex@openai.com>

* fix(oar): stop quota probes at the Goal deadline and on lease loss

Signed-off-by: Codex <codex@openai.com>

* fix(oar): reconcile durable archive on force-resume and align Node 24.21.0 docs

Resolves two blocking review findings on PR #9854:

- P1 (OAR Goal worker recovery): persist the archive stream sessionKey alongside
  the original inputId in inFlightDispatch, back self-owned worker hubs with a
  durable OarSessionSqliteStore, and check durable session records first on
  restart and --force-resume. Settle completed turns without re-dispatching,
  retry only when definitively rejected before execution, stay paused when
  evidence is unknown or degraded, and separate explicit operator override into
  --discard-uncertain-dispatch.
- P2 (Node minimum version parity): align Host Integration protocol, frontend
  delivery, and SQLite authority store docs with the shared 24.21.0 floor in
  node_probe.py, node_version.ts, and Desktop services.rs, and lock parity plus
  22.22.3/24.21.0 probe fixtures in regression tests.

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

* fix(chat): preserve the trusted owner Codex sandbox when OAR is enabled

Signed-off-by: Codex <codex@openai.com>

* fix(oar): settle archived worker turns before quota or provider startup

Signed-off-by: Codex <codex@openai.com>

* fix(chat): settle OAR Codex replies from completed native answer items

Signed-off-by: Codex <codex@openai.com>

* fix(workbench): retain the selected Core port across service restarts

Signed-off-by: Codex <codex@openai.com>

* fix(turn): preserve receipt-bound recovery at settled CLI entry

Reuse journal locator verification before a new plan can be constructed, retain checkpoint recovery guidance, and never recommend an ambiguous instance alias.

Signed-off-by: Codex <codex@openai.com>

* test(oar): exercise Windows Job lifetime with direct Node processes

Match the production daemon executable, assert observed process identity and exact Job counts, and check that descendant writes stop after daemon exit. The earlier Python fixture had an unexplained extra process; native Windows validation remains required.

Signed-off-by: Codex <codex@openai.com>

* test(oar): report exact Windows Job membership before lifecycle failure

The native Node fixture still reports two active processes before any Host is launched. Preserve both exact count checks, observe actual PIDs and unexpected process images, and run the descendant shutdown check even when the initial accounting assertion fails. This is diagnostic coverage, not a production containment fix.

Signed-off-by: Codex <codex@openai.com>

* test(oar): account for Windows console hosts in Job membership

Native Windows CI observed one conhost.exe per fixture process and the full Job drained on daemon exit. Require all exact fixture PIDs and matching accounting, allow only positively identified console hosts within the fixture population, and retain negative cases and full descendant cleanup. Do not change production containment.

Signed-off-by: Codex <codex@openai.com>

* fix(chat): type optional workspace_instructions_loaded kwargs for CodexAppServerAdapter.start

Unpacking a plain dict[str, bool] into CodexAppServerAdapter.start fails strict mypy against the newly added oar_runtime_id and oar_scripted_turns parameters. Use a total=False TypedDict to keep zero-Any typing and identical runtime behavior.

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

* fix(oar): resolve Phase 0 security, daemon, Node floor, and Workbench blockers

Addresses Phase 0 review findings and subtraction items on PR #9854:

- Security & authorization (TS/Py): strip LOOPX_OAR_HOST_TOKEN from process.env
  after read, use timingSafeEqual auth, always apply secret deny-overlay for
  child runtimes and shared daemon spawns; enforce fail-closed writeDirectory,
  toolScope, Claude userQuestions, inherit mode, and expanded Claude launchArgs
  guards; revoke MCP turn write grants before timeout abort with bounded
  dispose fallback, eliminate double session.abort() races, and guard
  streamSink against post-response coalesceText frames.
- Python daemon & guarded turns: replace stderr=PIPE with unlinked
  TemporaryFile, run daemon from tempdir, reap exited children, harden Windows
  runtime-dir/locator isolation and POSIX shutdown containment, replace atexit
  with weakref.finalize, enforce monotonic _exchange() deadlines, unify abort
  watchers into OarSessionClient.run_guarded_turn(), and keep CodexChatAgent
  defaulting to direct app-server (OAR opt-in via LOOPX_OAR_CODEX_CHAT=1).
- Node capability floor split & tooling: restore EFFECT_MIN_NODE=22.22.3 while
  enforcing OAR_MIN_NODE=24.21.0 for OAR/Workbench/Desktop, promote qualifying
  >=24.21.0 Node in Desktop services.rs ahead of older system binaries, add
  doctor oar_runtime check reusing one probe, and harden opencode2_goal_worker
  (node_typescript_flags, private cache, graceful SIGTERM, bounded deque log).
- Subtraction & Workbench fixes: remove dead oar_operation_host.py, unreachable
  ACPStdioAdapter._start_via_oar(), unused oar_steering_reservations, redundant
  entry.conversation fold, and global process.env mutation in runtime_loader;
  extract scripted_test_runtime.ts; fix runtime_loader manualCompaction and
  bottega metadata, oar_observation.py 5s timeout + null ended status,
  oar-core.ts bridge termination/eviction, workbench.ts startup timeout cleanup
  and stop budget, and parallelized ThreadManager.shutdown().

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

* fix(workbench): retain managed Core until Workbench shutdown completes

Preserve the shared Core and its ownership record if the lifecycle socket remains live after the stop budget. Regress the detached timeout path before retrying through native service shutdown.

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

* fix(desktop): keep Node search fixture test-only and satisfy clippy

The runtime search helper without extra directories is used only in tests. Compile it only there and simplify the optional version comparison without changing its behavior.

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

* fix(oar): fence chat cancellation and verify native resume and fork identity

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

* fix(oar): protect Windows locator before atomic publication

Reuse the package-owned native private IO helper with the launching Python interpreter, before writing the authentication token. Preserve fail-closed discovery and cover native shared-host and direct daemon startup.

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

* test(oar): resolve the qualified Python for Windows locator tests

Use the existing checkout interpreter resolver rather than a bare python alias, retaining the native ACL protection and verification checks.

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

* fix(oar): fence abandoned Codex opens and preserve turn-local persistence failures

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

* refactor(oar): isolate Workbench CLI coverage and group Node version fields

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

---------

Signed-off-by: song <xinxinsong66@gmail.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: Codex <codex@openai.com>
Signed-off-by: songoow <22676124+songoow@users.noreply.github.com>
Signed-off-by: song <liusongstep@gmail.com>
Co-authored-by: song <xinxinsong66@gmail.com>
Co-authored-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.

2 participants