Skip to content

feat(oar): deep OAR fusion — persistent TS session host, host/chat/worker migrations, 16 runtimes, SQLite WAL & Workbench UI (Phase 0–4) - #9854

Merged
songoow merged 155 commits into
mainfrom
codex/oar-deep-fusion-phase0-1
Dec 6, 2026
Merged

songoow merged 155 commits into
mainfrom
codex/oar-deep-fusion-phase0-1

Conversation

@songoow

@songoow songoow commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

Supersedes #7568 (closed with migration explanation).

Consolidation Note: Stacked PRs #9861 (Phase 2), #9866 (Phase 3), #10097 (Phase 4a), and #10098 (Phase 4b) have been merged into this branch (codex/oar-deep-fusion-phase0-1 → main), consolidating the full Phase 0–4 OAR integration (169 files changed, +28,730 / -3,804) into a single reviewable PR. All 47 prior review threads across #9854 / #9861 / #9866 / #10097 / #10098 have been addressed and resolved.

Summary

This PR delivers the end-to-end Open Agent Runtime (@botiverse/oar@0.142.0) deep fusion into LoopX on top of the existing Node.js 24 TypeScript control plane and SqliteAuthorityStore:

  • Replaces one-shot subprocess spawning with a single-lockfile, persistent Node 24 TypeScript OarSessionHost daemon + Python keep-alive client (OarSessionClient) with dedicated live control transport (interrupt, steer, answer_question, close_session, shutdown).
  • Migrates DSH, Claude/ACP, bounded Codex CLI/managed-operation hosts, ordinary Codex Chat, and the opencode2 Goal Worker onto OAR while preserving strict LoopX authority, quota/lease semantics, permission boundaries, and rollback compatibility (LOOPX_EXECUTION_ENGINE=legacy).
  • Exposes all 16 built-in OAR runtimes across governed Turn CLI (--host oar --oar-runtime <id>) and Chat, aligns Workbench to @botiverse/oar@0.142.0, adds Windows Job Object containment, adds sessions.sqlite WAL persistence with legacy JSONL dual-read, wires in-process Control Plane MCP write tools (claim, task lease, terminal settlement) bound to active turn grants, and connects the Workbench model picker, live session status, and native session execution to Core.

Scope by Phase

Phase 0 + 1 — Runtime Foundation & Persistent TS Session Host (original #9854)

  • Node.js >=24.21.0 & single-lockfile @botiverse/oar@0.142.0: Raised Node floor across Core (loopx/control_plane/runtime/node_probe.py), Desktop Tauri nvm discovery (apps/desktop/loopx-control-plane/src-tauri/src/services.rs), CI, packaging, and docs; added @botiverse/oar@0.142.0 to root package.json and wheel/source packaging (loopx/hosts/oar_distribution.py).
  • Persistent TS OarSessionHost & Python OarSessionClient:
    • loopx/control_plane/oar/session_hub.ts, session_host_server.ts, session_policy.ts, runtime_loader.ts, control_plane_mcp.ts, error_mapping.ts, loopback_http.ts
    • loopx/hosts/oar_client.py — cross-process startup locking, POSIX locator ownership/permission validation, runtime fingerprint checks, dedicated _call_control channel so interrupt / steer / answer_question / close_session / shutdown never block behind an in-flight prompt(), and pendingSessionKeys concurrency reservation.

Phase 2 — DSH, Claude/ACP & Bounded Codex Host Migration (merged from #9861)

  • DSH Turn & Chat on OAR: loopx/hosts/dsh/turn_host_adapter.py, loopx/hosts/dsh/native_operation.py, loopx/chat/dsh.py — persists native OAR session identity, honors LOOPX_EXECUTION_ENGINE=legacy rollback, invalidates dead handles on terminal OAR errors (oar_session_not_found, runtime_exited, session_released, transport_lost) so Chat recovers cleanly while keeping transient errors healthy.
  • ACP Chat on OAR: loopx/chat/acp.py — populates confirmed model/reasoning settings from observed OAR session metadata, validates missing/mismatched configs, and enforces structured failure outcomes before answer.final publication.
  • Bounded Codex & Managed Operations: loopx/control_plane/turn_driver/oar_operation_host.py, codex_cli.py, _codex_legacy_exec.py, codex_operation_host.py — preserves FirstPartyHostGoalAdmission, native-child observation guards, and maintainability ratchet ceilings.

Phase 3 — Ordinary Codex Chat & Unified OAR Goal Worker (merged from #9866)

  • Ordinary Codex Chat decoupling: loopx/chat/oar_codex_chat.py, loopx/chat_agent.py — routes eligible ordinary Codex Chat sessions through OAR with attachment forwarding, inactivity timeout preservation, launch-fence holding, and expected_turn_id verification, while cleanly falling back to native stdio for history import / isolated shell / native turn options.
  • Unified OAR Goal Worker: loopx/control_plane/oar/goal_worker.ts, loopx/cli_commands/opencode2_goal_worker.py — quota-gated multi-turn worker with serialized lease heartbeats across prompts/waits, inFlightDispatch crash recovery, rejected-dispatch task preservation, and explicit zero-budget CLI validation (--max-turns 0, --max-duration-minutes 0).

Phase 4a — 16 OAR Runtimes, Workbench Alignment & Windows Containment (merged from #10097)

  • Governed Turn & Chat runtime surface: loopx/control_plane/turn_driver/oar_turn_host.py, driver.py (SUPPORTED_HOSTS includes "oar"), execution_profile.py (deferred CLI imports), loopx/chat/oar_chat_adapter.py, loopx/chat/session_open.py (owner-registered ACP endpoints take precedence over built-in OAR IDs).
  • Signal shutdown & Windows Job Objects: session_host_server.ts aborts active sessions (hub.disposeAll()) before draining on SIGTERM/SIGINT; oar_client.py adds Windows Job Object containment.
  • Workbench alignment: Aligned apps/workbench onto @botiverse/oar@0.142.0 with patched minimatch.

Phase 4b — SQLite WAL Store, In-Process MCP Write Tools & Workbench UI (merged from #10098)

  • Durable session store: loopx/control_plane/oar/session_sqlite_store.ts — permissions-hardened SQLite WAL store for sessions, records, and steering reservations with cold readback, full-stream folding, and legacy JSONL transcript dual-read.
  • In-process Control Plane MCP write tools: loopx/control_plane/oar/control_plane_mcp.ts — binds lease ownership to active grant actor, supports canonical reducer statuses (including dry_run), and isolates daemon identity by LOOPX_OAR_SESSIONS_DB.
  • Workbench integration. A Workbench started with loopx workbench start uses the shared Core OAR host on its execution machine. Ordinary threads read status from their machine in /status. Goal original conversations read their bound Core session. Both show the model and effort reported by the runtime. Standalone Workbench installations keep their local adapter. The OAR-specific Dashboard controls and SDK dependency have been removed.

Compatibility & Safety Guarantees

  • Rollback switch: LOOPX_EXECUTION_ENGINE=legacy restores legacy DSH/Codex paths without touching OAR.
  • Existing ACP endpoints: Owner-registered ACP endpoints in endpoint_registry retain precedence over built-in OAR runtime IDs.
  • Authority & permissions: OAR YOLO defaults are explicitly overridden by session_policy.ts; MCP write grants are actor-bound and revoked on turn end.
  • DCO compliance: All 86 commits in main..HEAD carry valid Signed-off-by: trailers (with GitHub web-flow verified integration merges).

Verification (Consolidated HEAD ec40a9f3a)

  • Static & lint gates (full repo):
    • ruff check --ignore-noqa --config scripts/ci/external-request-lint.toml loopx packages scripts apps — 0 errors
    • ruff check --ignore-noqa --config scripts/ci/external-transport-lint.toml loopx packages/*/src — 0 errors
    • ruff check --select E4,E7,E9,F tests loopx/canary loopx/control_plane loopx/domain_packs loopx/presentation — 0 errors
  • Python tests:
    • Consolidated OAR Phase 0–4b + architecture invariants + test_maintainability_ratchet.py + test_runtime_subprocess_utf8.py + test_host_parity_smoke.py + test_scheduler_heartbeat_receipt_fence.py + test_turn_machine_credential.py: 346 passed (the sole failure in test_control_plane_import_boundaries.py::test_public_facade_import_only_reexports_match_the_audited_allowlist is pre-existing on origin/main in untouched loopx/quota.py).
    • test_antigravity_adapter_preserves_caller_typing_contracts & test_turn_handler_import_defers_optional_workflows: 2/2 passed.
  • Node 24 TypeScript tests: node --test tests/control_plane_ts/oar_*.test.ts — 30/30 passed.
  • Workbench and browser validation. The Workbench build and type checks passed, along with 823 web tests, 24 daemon OAR tests, 46 Core TypeScript tests and 193 Python OAR tests. Chromium exercised the production Workbench UI and HTTP thread service with a local Grok ACP fixture. An independent Core client verified one live native session and the model and effort chosen before first send. Legacy Dashboard build and general model-selection browser checks also passed. The test environment denied Unix socket creation, so packaged CLI lifecycle tests could not complete.

…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>
@songoow
songoow force-pushed the codex/oar-deep-fusion-phase0-1 branch from 9f40214 to a66f98d Compare December 2, 2026 02:46
@songoow
songoow marked this pull request as ready for review December 2, 2026 02:46
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-02T02:52:48.951093Z a66f98d Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a66f98d232

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread loopx/hosts/oar_client.py Resolved
Comment thread loopx/control_plane/oar/session_hub.ts Resolved
Comment thread loopx/hosts/oar_client.py Resolved
Comment thread loopx/hosts/oar_client.py Resolved
Comment thread loopx/hosts/oar_client.py Resolved
…docs and checks

Signed-off-by: song <xinxinsong66@gmail.com>
@songoow
songoow requested a review from JasonBuildAI as a code owner December 2, 2026 03:01
…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>
@mergify

mergify Bot commented Dec 2, 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 2, 2026

@loopx-agent loopx-agent 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 · gpt-6.2-sol · OpenAI · runtime_reported · xhigh

动机 / Motivation

评审提交 1541c290edef4733666bb15da4f80491be1e8bea,提案比较基线 0950cea53f8eedfd7e56a397a447eecfc87bcc50,核对主干 f2a9c7ecd62fe02dc2bff282aa1116cd8ed34054。升级 Core 且由 macOS Desktop 启动、PATH 依赖 nvm 自动发现的现有使用者,以及后续 OAR Host 接入方。 默认 Core 接受 Node 22.22.3。Desktop 用相同最低版本给 Finder 启动时的 nvm 候选排序。提案希望用一个根 lockfile 和常驻 TypeScript OAR host 支撑后续迁移。 按 Phase 0/1 审查。Phase 2 的真实 Agent 路由迁移和随后通用接入不列为此头已经交付的功能。

现头把 Core、shell/PowerShell、CI 和英语及中文入口文档的 Node 下限移至 24.21.0,并加上独立的 OAR 客户端、会话宿主与控制平面桥。

改动思路 / Approach

根锁文件和懒加载有明确的启动成本目标。Core 探针持有最终版本资格,Desktop 持有发现和排序,必须能把合格 Node 送到 Core。 45 个文件含根锁文件和 CI,另增常驻宿主、runtime loader、session policy、MCP bridge、客户端和夹具。版本变化由默认启动共享。 Core node_probe/node_version 判定可运行版本,Desktop discovered_nvm_directories 决定候选顺序,OAR session host 仅处理显式客户端调用。

具体改动 / Changes

  • 根包安装 @botiverse/oar 0.142.0。最新头已把 CI 所用最低版本更新至 24.21.0,PR 描述中的旧版本和待补 workflow 文字落后于当前头。
  • TS 常驻服务收拢运行时加载、会话、MCP 桥与记录,Python 源检出测试走真实 Node RPC。环境变量选择与现用 Agent 路由的整合留在后续阶段。
  • Core 和大部分启动表面使用新门槛。Desktop 的 nvm fallback 仍以旧常量决定优先级,且公开 Desktop/Core 指南仍有旧版本。保留已有 OAR 线程作为实施证据,当前评审聚焦新发现的跨入口回归。

验收依据 · 原生路径说明 · 0950cea

  • DEFAULT-CORE-STARTUP 默认启动可选中已经安装且满足 Core 要求的 Node 对应位置
  • SOURCE-OAR-HOST 本地常驻宿主能串行读回真实健康和拒绝结果 对应位置

对主干的风险 / Risks

Desktop 原有的 nvm 排序仍用 22.22.3 作为合格线。只靠 nvm 的 Finder 启动环境里,默认别名仍指向 22.22.3 时,App 会把它放在已安装的 24.21.0 前面。同一排序在基线返回 ready,现头的 Core 返回 unsupported。把 24.21.0 放第一位后现头恢复 ready。此差异发生在未选择 OAR 的原有入口。 使用精确 Rust 排序函数和精确 Python 探针,nvm Node 用只实现 --version 的 fixture,未启动完整 Finder UI。真实 OAR 测试限源检出以及脚本化运行时。未向外部 Agent 服务发请求。PyPI wheel 试构建遇到本地 Chat bundle 缺失,安装态 OAR 未获独立验证。

语义与 CI 对齐

Core 明确拒绝不满足新版本下限的 Node,Desktop 需要使用同一资格标准排序。 将 App 的 nvm 排序、Core 最低版本、安装诊断与支持文档同步,并用默认 22.22.3、同时存在 24.21.0 的 Finder 等价 PATH 夹具覆盖启动及恢复。可将完整 Node 迁移作为单独边界先验证,再接入 OAR。

我的整体评价 / Verdict

请求修改。持久宿主基线和懒加载测试有价值。默认安装端发现仍破坏已有使用路径,且当前主干组合存在一处 tests/test_pi_goal_mode.py 冲突。先完成发布范围内的版本迁移。 将 App 的 nvm 排序、Core 最低版本、安装诊断与支持文档同步,并用默认 22.22.3、同时存在 24.21.0 的 Finder 等价 PATH 夹具覆盖启动及恢复。可将完整 Node 迁移作为单独边界先验证,再接入 OAR。 21 个 TS 用例和控制平面类型检查通过。真实源检出 Python 客户端可启动 Node 宿主,多次 health 读同一 PID,且有拒绝未知 runtime 和 shutdown 的回归。 本地 Node 24.21.0,21 个 TS 用例、控制平面类型检查、93 个 Python 入口与探针用例及 3 个真实 OAR 客户端测试通过。Git 精确组合确认一处测试冲突。已按独立新证据保留现头既有线程,未等待 CI。

English verdict: REQUEST_CHANGES at 1541c29. Raising the shared Node floor without updating native Desktop discovery leaves a supported installed Node hidden behind an older nvm default. The paired App-order and Core-probe check reproduces the default-path regression with OAR off.

loopx-agent and others added 8 commits December 3, 2026 22:42
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>
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>
…dentity

Signed-off-by: song <liusongstep@gmail.com>
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>
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>
@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
…licts

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 对话,界面等不到握手回执时会重试;先前的启动若迟到,后台应能回收无人接管的会话。当前受管工作台能把会话交给 Core,慢启动和长期写盘故障仍会让后台状态与调用者看到的结果分离。本轮验证覆盖源码和受控运行时,商业模型账户及已打包桌面应用的完整体验尚未验收。

改动思路 / Approach

从 CLI 启动的 Workbench 按执行机的 Core 环境打开受管 OAR 会话;独立节点保留本机适配器。Core 里的 Node 宿主统一持有原生会话,Python 客户端通过本地连接发送请求,Workbench 消费同一执行机上的结果。启动请求的握手和完成后的会话有不同的寿命。客户端在拿到句柄前断开时,可以复用有界 Turn 已有的握手取消机制;拿到句柄之后,持久会话仍可由其所有者恢复。握手处理

具体改动 / Changes

关键代码讲解

  • start_oar_codex_chat_session 将工作目录、权限方式、模型和恢复参数交给 Core。它等到服务端应答才拿到 key,并交给 Chat 会话对象。因此,只在拿到应答后做清理无法处理启动时超时的情况。普通 Chat 入口
  • OarSessionHub.sendPrompt 汇集实时事件,并在返回时附带本轮的持久化状态。底层追加 SQLite 记录失败会增加累计计数,保留的失败序号样本最多一千项。调用者同时能看见整个会话和当轮的字段,这两种范围需要分别准确。累计采样 · 响应构造
  • 合并范围还包括 Core 的运行时加载、Goal Worker、权限策略、Desktop 启停、打包与前端展示。受管 Workbench 对接的入口已在代码中接通。基线 docs/architecture/rfcs/capable-manager-semantic-handoff-v0.md(083d869a47c54612fa27512e5099f4b031facb83)中,runtime-ownership 要求实际执行与会话持久化由运行时拥有;当前 Core Hub 承担这两项职责。架构约定 · Workbench 桥接

对主干的风险 / Risks

P2 · 普通 OAR Codex Chat 启动超时会留下无人接管的活跃会话。 打开普通会话时,客户端没有预分配可清理的句柄,也没有传入现有的握手断连取消选项。从公开入口 CodexChatAgentSession.start 打开会话,保持真实的 30 秒超时,把测试执行器的原生握手延迟到 32 秒。客户端在 30.0 秒收到 TimeoutError,再等 5 秒后,daemon 的活跃会话从零变为一个。另用缩短时限的成对实验,默认请求留下一个活跃会话,启用取消标志的请求留下零个。旧调用者无法凭超时后未收到的 key 释放该会话,重复打开可以持续占用资源。启用已有的握手断连取消机制,或保存启动请求的会话标识并在失败时清理。回归应覆盖过期后再查会话列表,同时保留正常打开和恢复用例。已有取消入口

语义与 CI 对齐

P2 · 累计失败样本填满后,后续 Turn 不再报告当轮丢失的记录。 用两个 scripted Turn 驱动真实 Hub,向临时 SQLite 存储的追加操作注入失败。首轮后累计失败 1056 次,样本停在 1000 项。次轮累计增至 1060,但 turn_failed_record_seqs 为空。整个会话仍标记为 degraded;调用者缺失的是判断第二轮哪些记录未归档的证据。每轮独立计数并保留有界样本,显式说明样本是否截断。修复后应再次让首轮填满样本,再断言第二轮四次失败仍有当轮回执。按数组长度切片

我的整体评价 / Verdict

建议修复上述两个问题后复审。它们影响长时间运行下的资源回收和诊断可信度,均在本次提交上有独立反例。PASS:Core 类型检查、Workbench 六个工作区类型检查、Workbench/daemon/web 定向测试 47/47;其中通过受管 Core 桥接和 Grok 夹具验证了流式输出、状态查询、取消与原生恢复。另两组目标套件中,Python 123 项通过,TypeScript 66 项通过。Python 有 11 项跳过。另有 Python、TypeScript 各一项因环境拒绝创建 Unix 域套接字而失败,这两项行为仍未核实。两条新发现均使用本地运行时和夹具,未调用付费模型。本轮复核了会话的后台回读和 Workbench 桥接,没有验证完整的渲染界面。未在本轮检查打包桌面端及响应式页面。旧评审中提及的手工合并提交 b0b0aa 已不在这次基线到 head 的独有提交范围内。审查 head 为 433dc52。

English verdict: REQUEST_CHANGES — at 433dc52, a timed-out Codex Chat open leaves a live session and a saturated persistence sample hides later turn-local failures.

…ence failures

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

Signed-off-by: Codex <codex@openai.com>
Signed-off-by: song <liusongstep@gmail.com>
@songoow
songoow requested a review from loopx-agent December 6, 2026 07:15
@songoow
songoow merged commit 93be88d into main Dec 6, 2026
17 checks passed
@songoow
songoow deleted the codex/oar-deep-fusion-phase0-1 branch December 6, 2026 07:17
maxliux5 added a commit that referenced this pull request Dec 6, 2026
…kbench

- Resolve merge conflicts in oar.test.ts, oar.spec.mjs, runtime/workbench.ts, and runtime/workbench_service.ts while preserving all #9854 OAR fusion behavior.
- Align #9854 OAR Core bridge env vars to LOOPX_WORKBENCH_OAR_CORE_* (retaining LOOCHAT_OAR_CORE_* compat fallback and secret scrubbing in daemon, runtime_loader.ts, and oar_client.py).
- Update python-tests.yml Workbench OAR job workspace name from @loopx/loochat to @loopx/workbench-daemon.
- Fix CodexSession.onPeerClosed() collision with ThreadManager's session.onClosed(listener) hook and await in-flight sessionStarts during shutdown without breaking cancelled-turn semantics.

Signed-off-by: maxliux5 <5958865+maxliux5@users.noreply.github.com>
songoow pushed a commit that referenced this pull request 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>
loopx-agent added a commit that referenced this pull request Dec 6, 2026
…21.0 contracts (#10264)

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