Repository navigation
Keep the original OAR session for confirmed operations - #9967
huangruiteng merged 2 commits into
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.2-sol · OpenAI · runtime_reported · xhigh
Approval conclusion (author-owned PR; GitHub blocks formal self-approval).
动机 / Motivation
经 OAR 发起受管操作,并需要用原会话在确认后继续的 DSH 与 Codex 调用方。 冻结 #9861 基线把 OAR DSH 会话记成了原生传输。确认后复用原配置时,两个后端都在第二轮第一个模型请求前误报 profile changed。 同一个受管操作可在 OAR 原会话中接续,确认和首次消费边界得到保留。 走查和实测覆盖直接 OAR 执行器、本地脚本模型及无实际操作的回执。原生 Codex OAR 模型路径、分离的 CLI wake 和生产会话未实测。
改动思路 / Approach
OAR 操作会话写回、返回 ID 核验、共享受管绑定及两端回归。 复用既有会话 owner 与 operation transport 枚举。持久化已选 transport 并向共享绑定校验补齐两个识别值。原有效身份、显式确认和消耗仍由原 owner 校验。
具体改动 / Changes
- 在冻结 #9861 的精确提交复验。真实 OAR 与 DSH 首轮四次脚本模型请求产生一个待确认提案,基线错误写成原生 transport,确认后恢复立即拒绝,零额外请求和零新的启动回执。
- 当前头的 File/SQLite 各走完两轮九次请求。脚本模型从实际 provider 消息读回确认前拒绝、首次获准、重复 already_consumed 和不执行的报告。原生 session ID、transport 和原提案身份保持。
- Python 验证同一宿主也拒绝选择另一 transport。TypeScript 区分原生、OAR、错宿主和未知传输,并保留精确 Goal/Todo、agent、session 与 profile 约束。绝不通过历史标签放行。
所有宿主共用原人工确认契约。会话身份由宿主实际返回,精确绑定完成后首次消费才能授权对应操作。 冻结验收依据
exact_operation_origin· 原受管会话、宿主和已选 transport 一致。复验通过。untrusted_session_refused· 缺失、变化或错配的会话拒绝后续 prompt。复验通过。confirm_before_one_consume· 人工确认前拒绝,确认后只允许首次消费。复验通过。
关键代码讲解
- 持久化实际 transport,并保留原 session 元数据。 ManagedOperationSession.store
- 在安装原生 callback 上下文前比较返回会话 ID。 run_oar_operation_host
- 在原精确身份字段约束内按宿主识别原生和 OAR transport。 managedOperationBindingCurrent
- 夹具核对拒绝关闭与零额外 prompt。 test_oar_refuses_missing_or_replaced_native_session_before_prompt
对主干的风险 / Risks
162 项 Python 用例通过,4 项跳过。16 项 TypeScript 用例通过。standard premerge 的 6 项直接与 17 项选中检查均通过,保留继承的维护性提示。 真实的隔离 action store 记录了预确认拒绝、一次获准消费、重复拒绝和 not_executed。未产生外部域写入。 协议夹具另核验缺失或替换的会话 ID 均在 prompt 前关闭。正常 Codex app-server 的操作套件也包含在回归中。
我的整体评价 / Verdict
通过。原 OAR 会话可在确认后继续,首次消费和重复拒绝在两种存储上均已复验。 本次改动涉及执行器和回执。 走查和实测覆盖直接 OAR 执行器、本地脚本模型及无实际操作的回执。原生 Codex OAR 模型路径、分离的 CLI wake 和生产会话未实测。
English verdict: APPROVE. OAR sessions retain their selected transport and native identity, with confirmation and one-time consumption verified on File and SQLite.
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
huangruiteng
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · Gemini · Google · self_reported
动机 / Motivation
在 OAR(Open Agent Runtime)上发起人工确认受管操作(confirmed managed operations)并在审批通过后唤醒继续执行的 DSH 与 Codex 调用方,会在会话恢复与绑定校验阶段遇到原 OAR 会话传输标识丢失、初始化竞争句柄泄漏的问题。修改前,受管会话持久化层按宿主名硬编码写入传统 dsh-native-operation-tools-v0 / app-server-operation-tools-v0,managedOperationBindingCurrent 也不接受 OAR 操作传输标识,且初始化竞争失败时不会关闭已打开的 OAR 会话句柄,导致 OAR 受管操作在确认唤醒后因 operation_transport 不匹配无法恢复原会话或残留句柄;修改后(含已合入本分支的句柄清理切片),会话持久化与回滚原样保留适配器选定的 oar-dsh-operation-mcp-v0 / oar-codex-operation-mcp-v0,managedOperationBindingCurrent 显式接纳两类 OAR 传输,且 ExitStack 确保每次成功打开的句柄均被精确关闭一次。OAR 受管操作在 File 与 SQLite 上完整保留原选定传输标识与原生会话 ID,人工确认后精确恢复同一会话并单次消费确认凭证,同时初始化竞争失败时自动关闭已打开的 OAR 句柄且不覆盖获胜绑定。本 PR 仅处理 OAR 受管操作传输持久化、绑定核验与会话句柄生命周期清理,不改变人工确认授权边界或 OAR DSH 输出上限策略。OAR DSH 桥接层的每请求输出上限预检拦截与显式原生 SDK 模块双模共存分别由后续栈式切片(第四波与第五波)承接。
在 codex/oar-deep-fusion-phase2 基线(合并基点 2d96b4c8336e44bdd467fd4a7b421a877fcf74f7)上,run_oar_operation_host 虽然以 oar-dsh-operation-mcp-v0 或 oar-codex-operation-mcp-v0 调用 select_managed_operation_session,但底层 _write_codex_cli_session 落盘时却忽略所选传输、强行写成旧版原生标识,导致同一会话第二次唤醒时自相矛盾地触发 operation profile changed;同时 TS 控制面 managedOperationBindingCurrent 只白名单了旧版传输,拒绝唤醒已确认的 OAR 操作。当前分支精确 Head 873b99f2d986afb0facb1be8b8541f31307e4ffa 一并合入了初始化失锁关闭句柄修复。
改动思路 / Approach
复用既有 codex_sessions.py 会话文档持久化层、oar_operation_host.py 会话执行器与 TypeScript operation_agent_handoff.ts::managedOperationBindingCurrent 单一绑定校验所有者,通过透传适配器实际选定的 transport 与 ExitStack 托管消除硬编码失配与句柄泄漏。当前 PR 边界覆盖 codex_sessions.py、oar_operation_host.py、operation_agent_handoff.ts 及其 Python/TS 测试(test_operation_requests.py、operation_agent_handoff.test.ts),不新增 CLI 标志或外部协议。
从首轮准备到确认后唤醒的闭环路径如下:run_oar_operation_host 打开会话并向 ExitStack 注册 close_opened_session,随后将 native_session_id 与实际 transport 写入会话文档(同时在未绑定恢复态下防止把请求自带的占位会话 ID 误传给 resume);确认唤醒时,managedOperationBindingCurrent 核对 session.operation_transport 属于对应宿主的受管传输集合,放行原会话恢复并单次消费确认记录。
| 环节 | 基线 2d96b4c8336e 行为 |
当前 Head 873b99f2d986 行为 |
|---|---|---|
首轮 OAR 会话落盘 operation_transport |
被硬编码改写为旧版 dsh-native-* / app-server-* |
精确保存适配器传入的 oar-dsh-operation-mcp-v0 / oar-codex-operation-mcp-v0 |
确认唤醒时 managedOperationBindingCurrent |
拒绝 OAR operation_transport |
按宿主精确接纳对应 OAR 传输并保持跨宿主隔离 |
open_session 后初始化提交并发失锁 |
泄漏已打开的 session_key |
ExitStack 自动执行一次 close_session 并保留获胜方绑定 |
具体改动 / Changes
共修改 3 个生产文件与 2 个 Python/TS 测试文件。对照已接受规范 docs/architecture/rfcs/human-confirmed-domain-operations-v0.md(固定修订 2d96b4c8336e44bdd467fd4a7b421a877fcf74f7),验收条目 oar-confirmed-operation-session-continuity 在当前 Head 状态为 implemented。
关键代码讲解
ManagedOperationSession与_write_codex_cli_session:在ManagedOperationSession、_store_codex_cli_session、restore_codex_cli_session_if_current与_write_codex_cli_session全链路透传operation_transport,仅在旧版直接调用未传值时回退宿主默认标识。run_oar_operation_host:仅当存在已校验binding时才在open_params中携带resume_session_id/resume,并在open_session返回后立即通过ExitStack注册幂等close_opened_session,校验返回的非空native_session_id后再提交会话绑定。managedOperationBindingCurrent:按managedHost(executor)分别允许dsh的oar-dsh-operation-mcp-v0与codex-cli的oar-codex-operation-mcp-v0,严禁跨宿主混用或未知传输绕过。test_operation_requests.py与operation_agent_handoff.test.ts:在 File 与 SQLite 双后端验证 OAR 会话首轮准备、人工确认、原会话恢复、单次消费、篡改原生会话拒绝及初始化竞争句柄关闭。
对主干的风险 / Risks
- 最强回归与反例分析:潜在风险是放宽
managedOperationBindingCurrent后允许dsh会话伪装成codex-cli传输或允许未授权传输通过准备门禁。核查 TS 条件表达式可见,dsh与codex-cli分支各自严格限定本宿主的两个合法常量,且operation_agent_handoff.test.ts与test_operation_requests.py均验证了跨宿主与未知传输拒绝。 - 范围适配与默认隔离:仅对显式进入受管操作模式的会话文档生效,普通无操作工具会话不写
operation_transport。 - 本地验证矩阵:
- Python 与 TypeScript 单元及集成测试:
PASS(57 passed in 25.99s + tsx(1 suite passed))。 check_rfc_bilingual.py、git diff --check、loopx check --scan-path、loopx canary premerge:PASS(selected=17, failures=0,errors=0,warnings=0)。
- Python 与 TypeScript 单元及集成测试:
我的整体评价 / Verdict
从长程演进(long_horizon: improved)与用户体验(user_experience: improved)评估,本 PR 打通了 OAR 受管操作从首次挂起等待确认到唤醒恢复同一原生会话并确定性回收句柄的完整闭环;内部控制面与运行时会话管理改动不涉及视觉界面(visual_review: not_applicable)。实现复用既有会话存储与 TS 绑定裁决所有者(code_volume: necessary,compatibility_assessment: retain,change_proportionality: proportionate,semantic_alignment: not_applicable)。当前远端精确 Head 为 873b99f2d986afb0facb1be8b8541f31307e4ffa,证据完备,予以批准。
English verdict: APPROVE at 873b99f — persists the selected OAR operation transport across File and SQLite, admits matching OAR bindings on confirmed wake, and closes opened OAR handles on initialization loss; 57 passed in 25.99s + tsx(1 suite passed) and premerge checks passed.
…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>
Confirmed operations can resume their original OAR session
On the Phase 2 candidate (#9861), DSH can create a proposal through the OAR tool bridge. The session writer records the old native transport, so the next Turn rejects the original session even with unchanged configuration and fixture confirmation.
Persist the transport selected when the operation session was created. The handoff owner recognizes the native and OAR transport for the matching host and continues to check the session, Goal, Todo, profile digest, model and reasoning effort. OAR requires the returned native session identity before installing the callback context. A missing or replaced identity closes the session before the prompt.
Existing native records retain their format. Previously mislabeled records are not rewritten or granted a new executor. This change reuses the existing OAR transport identifiers and session schema.
Verification
already_consumedwith execution disallowed, and the store retained the reportednot_executedoutcome.