Skip to content

feat(agent): integrate source-aware OAR execution - #6617

Merged
M4n5ter merged 5 commits into
rust-previewfrom
feat/oar-execution-sources
Nov 4, 2026
Merged

M4n5ter merged 5 commits into
rust-previewfrom
feat/oar-execution-sources

Conversation

@M4n5ter

@M4n5ter M4n5ter commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Summary

Add a complete OAR execution backend, rather than a model-catalog-only adapter.

  • Use tagged backend preferences across session creation/sending, model discovery, WorkHub/child conversations, SDK contracts and the workbench model/effort picker. Native thinking levels remain typed; external effort values are runtime-provided strings. Migrate the actual callers and remove the duplicate public execute path.
  • Run pinned OAR 0.86.0 in a sibling worker using Deno 2.9.6. Production uses a controlled denort linked with Maka's V8 build with optional LGPL math disabled; it never falls back to the official template. Node is not a user runtime dependency.
  • Keep canonical output persistence, task/queue ownership, cancellation and settlement in Maka. External active-turn follow-ups remain in Maka's editable queue. Cleanup requires OAR disposal and worker-root exit; unknown cleanup does not authorize prompt replay.
  • Add immutable-upload text/image handling, bounded readable-history handoff and native agent-session continuation. Setup only delegates OAR's own probe/plan/install APIs.
  • Package and validate the worker with native distributions, track non-Cargo inputs in CI, and retain the actual target-specific runtime license document.

Verification

Passed locally for the review follow-up:

Check Result
Targeted CI/notices/runtime-cache/worker JS tests (--test-skip-pattern='real Cargo build') 40 passed
Native regression batch: Bot delegation/wake, OAR, skills and canonical-turn projection 23 passed, including the three former Bot timeouts
Final OAR / attachment / bounded-history / persistence / escaped-pipe behavior tests after the bounded-drain fix 18 passed
Real CLI/ACP/source-picker/keyboard/resume/crash paths 9 passed
Real workspace MCP trust refusal and exact-message retry, including zero model dispatch before approval 1 passed separately after fixing the consent button's accessible name
Model-selection and pending-recovery workbench tests 17 passed
Rust-ABI SDK declaration generation and TypeScript acceptance 5 outputs generated; acceptance passed
Product UI TypeScript Passed
node scripts/ci.mjs check notices with latest product inputs Passed; all five main Cargo target closures plus reviewed runtime coverage
Actual-runtime notices check --target aarch64-apple-darwin --oar-runtime-notices ... Passed against the actual cached runtime document
node scripts/ci.mjs check format Passed: Rust and repository Biome formatting
node scripts/ci.mjs check licenses Passed: ASF source headers and Rust dependency license inventory

The new cleanup regressions use a real SQLite trigger failure and a real detached process holding inherited stdout, not mocked success receipts. Without a valid terminal, cleanup remains unconfirmed; a Unix process-group exit alone does not prove native disposal. git diff --check passes.

Earlier feature validation is retained, not rerun for this review follow-up: controlled-worker real Host -> Codex gpt-6-astra / high, two turns resuming the same Codex session plus the missing-runtime preference boundary (2 passed, original job exit 0); CLI distribution behavior (4 passed).

No desktop UI screenshot was captured. The live provider validation above is Codex; Antigravity prompt execution was not exercised. Other-platform OAR runtime builds/reviews remain outside this follow-up. Remote CI and independent human review are not replaced by these local checks.

API migration and execution boundaries

SessionCreate / SessionSend now use the tagged backend; ModelList returns choices whose selection can be passed directly. WorkHub, bundled tools, fixtures and SDK consumers are migrated in the same change. Persisted admitted-operation receipts retain their original recovery identity. SessionResume remains the native-model continuation contract; OAR continuation happens through subsequent sends to its saved backend.

OAR is explicitly enabled with agent.oar: {}; it is disabled when absent/null. Its external agents retain their default permissions. This does not broaden ordinary plugin, Code Mode or Computer Use permissions, and an external executor cannot enforce an explicitly narrowed Host tool list.

History handoff is bounded to 64 KiB / 128 fragments and labels gaps; it is not lossless provider-state transfer. Historical attachment payloads and thinking are not replayed. Runtime model discovery uses the Agent's first trusted workspace root, not a per-session directory. An empty workspace-root set does not hide native models. Native model detail never starts OAR; external detail probes only its selected runtime. Full discovery shares one bounded, short-lived snapshot across search/pagination, independent of any one search cancellation, and installation invalidates it.

Release notice coverage

PR CI uses a separate reviewed-input coverage check. The main Maka Cargo dependency closure is always checked across all five distribution targets, independently of which OAR runtime targets have been reviewed. The 192 platform-specific Cargo records omitted by single-runtime generation are restored; the snapshot now contains 1,376 components (1,360 Cargo and 16 other inputs). Runtime coverage derives its reviewed set from both the snapshot and supplement entries and verifies full-text digests without silently dropping review records. It does not claim to validate a newly built or unreviewed runtime.

Release verification still requires the actual build's runtime notice document and compares its full text with the reviewed local document for the exact target. Missing targets or differences fail before Cargo metadata. Default generate still requires all five targets; no release gate is skipped to make PR CI pass.

Only [email protected]/aarch64-apple-darwin is registered here. Its full local document covers a conservative 760-package closure (704 external packages), plus actual V8 and exact Rust-toolchain notices. The other four distribution targets are preserved but their runtime builds/reviews are not approved by this PR; their release gates remain closed. No signing, upload or distribution publication was performed.

Most of the large diff is retained third-party notice text, not hand-written implementation code. Available original copyright headers and checksum-pinned published-package declarations are preserved; missing upstream files are not fabricated.

AI use

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Maka (OpenAI) implemented and tested the backend/API/UI/build/notice changes, with a GPT-6-Astra high advisor for independent design feedback. The commit includes a Generated-by: Maka trailer. Human review and ownership remain required.

Checklist

  • Tests cover the change and fail without it
  • Format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary and API migration above
  • No

Unify backend selection across Agent APIs, WorkHub, SDK and workbench. Run pinned OAR through a controlled Deno/V8 worker while keeping persistence, queueing and execution settlement in Maka.

Package the worker and target-specific runtime notices. Separate PR reviewed-input coverage from actual release-runtime verification without relaxing release gates.

Generated-by: Maka

@M4n5ter M4n5ter left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Code & Test Review (English) — 6 blocking bugs / CI regressions, 4 architecture & hot-path issues, 2 test cleanups

Summary

The core architectural direction—unifying send/execute behind a single send(..., backend: Option<BackendPreference>) contract, fencing external promptAndWait behind durable opened acknowledgement (plugins/agent/oar-executor/worker/execution.mjs:46-57), verifying user attachments in a single streaming snapshot (plugins/agent/native/src/executor/oar/attachments.rs:95-179), and building denort from pinned source archives with binary header verification—is solid.

However, the migration and lifecycle boundaries have 6 blocking regressions (several already failing root-tests in CI), along with arbitrary truncation limits, hot-path subprocess storms, and test fixture duplication that should be cleaned up before merging.


1. Blocking Bugs & CI Regressions

  1. Same-task RwLock read/write self-deadlock in Owner::send (causes 3 bot_tests 90s CI timeouts)

    • Owner::send (plugins/agent/native/src/owner.rs:1102) acquires let admission = self.runs.session(&id).await; (OwnedRwLockReadGuard in plugins/agent/native/src/owner/runs.rs:63-72), and while still holding that read guard calls self.use_bot_model(parent, &mut selection).await (owner.rs:1193).
    • use_bot_model (plugins/agent/native/src/owner/bot/wake.rs:141) calls self.return_route(source).await (plugins/agent/native/src/owner/notifications.rs:51-52), which calls self.runs.lock().await (OwnedRwLockWriteGuard on the same tokio::sync::RwLock). Every Bot worker delegation via SessionSend deterministically deadlocks.
    • Fix: Resolve use_bot_model outside admission (as service.rs previously did), and avoid taking the write lock in read-only return_route.
  2. Incomplete caller migration breaks production maka acp and all 6 cli CI test shards

    • SendInput (plugins/agent/api/src/contract.rs:265-282) uses #[serde(deny_unknown_fields)] and replaced model + thinkingLevel with backend: Option<BackendPreference>. Several callers outside plugins/agent/native were left unmigrated:
      • Production maka acp broken: products/maka/acp/src/foreground/admission.rs:46 still sends "model" and "thinkingLevel" to agent/send, failing every ACP prompt at runtime (and breaking products/maka/cli/src/acp/tests.rs:143-307).
      • All 6 cli integration shards broken: products/maka/terminal-shell/tests/real_host/support.rs:443, catalog_association.rs:128, resumable.rs:161-172, and products/maka/cli/tests/integration/candidate/crash.rs:100, 121 still send "model".
      • Unmigrated ModelSelect UI tests & dead locale keys: products/maka/workbench/app/ModelSelect.tsx:627-725 removed connection filtering and changed search copy, leaving products/maka/terminal-shell/tests/real_host/keyboard.rs:30-39, 273-345, real_host/mod.rs:129, products/maka/workbench/README*.md:45, and dead keys in products/maka/workbench/app/locale-conversation.ts:179-183 behind.
  3. Silent bypass of workspace MCP trust gate (projectMcp.check()) in Conversation.tsx

    • FrozenSend.selection (plugins/agent/conversations/ui/Conversation.tsx:413) is typed as Record<string, unknown> instead of ReturnType<typeof sendSelection>.
    • sendSelection (Conversation.tsx:1840-1844) now returns { delivery, expectedInvocationId, backend: selected }, yet confirmFrozen (Conversation.tsx:1888) still checks if (frozen.selection.model !== undefined && !(await projectMcp.check())). frozen.selection.model is always undefined, silently skipping workspace MCP trust approval on every send.
    • In addition, if (delivery === 'steer' && expectedInvocationId !== undefined) return { delivery, expectedInvocationId }; (Conversation.tsx:1829-1830) returns without backend even when an active OAR turn is running (where steering.rs actually queues a new follow-up turn rather than steering in-place), skipping model readiness checks and backend selection changes.
  4. Blanket Error::CleanupUnconfirmed misclassification poisons Host retirement and bricks sessions

    • In plugins/agent/native/src/executor/oar/worker.rs:190-197, even after status? confirms the child process group / Windows Job Object has exited, supervise rewrites every protocol, cancellation, validation, or storage error into Err(Error::CleanupUnconfirmed):
      • Permanent Resources poisoning on cancelled models / oarSetup queries: Typing quickly in ModelSelect or closing the popover cancels worker::query (worker.rs:218-227), which Oar::query (oar.rs:143-147) and oar_setup.rs:60-69 record as an unconfirmed cleanup failure on Resources (platform/capabilities/src/call/resources.rs:79-82), permanently poisoning Oar::finish() even though no external session was opened and the subprocess already exited.
      • Permanent conversation bricking & temp-file leak: If an error occurs before opened or while persisting journal.opened (worker.rs:107-110, 294), CleanupUnconfirmed skips journal.ready(storage) and lease.finish() (oar.rs:257-264), leaking materialized user image temp directories and leaving journal.record.running = Some(...) stuck permanently in storage across restarts (journal.rs:61-63).
  5. Single-target third-party notices overwrite, CI blind spot & broken non-macOS-ARM64 releases

    • Regenerating products/maka/cli/notices.json and THIRD_PARTY_NOTICES.txt with --target aarch64-apple-darwin wiped ~200 Linux and Windows Cargo crates (ashpd, accesskit_unix, accesskit_windows, zvariant, zed-scap, etc.) from the canonical notice files.
    • Switching scripts/ci/run.mjs:94 to notices.mjs check-reviewed restricts cargo metadata --filter-platform in verifyReviewedNotices (scripts/rust/notices.mjs:245, 348-357) to only aarch64-apple-darwin, leaving Linux/Windows/x86_64-apple-darwin Cargo dependencies unchecked on PRs while guaranteeing releaseNativeCli (verifyNotices) will fail on the other 4 release targets.
    • oarInputs was added to root and native-build (scripts/ci/suites.mjs:78, 116), but omitted from product.extraInputs (suites.mjs:126), which is the suite that actually runs check('notices').
  6. Empty workspace_roots breaks native model discovery (agent/models & agent/model)

    • Owner::model_choices (plugins/agent/native/src/owner/models.rs:79-91) unconditionally calls self.oar_cwd().await? whenever self.executors.contains("oar"). When workspace_roots() is empty (models.rs:465-476), oar_cwd() returns Err("agent_workspace_unavailable"), failing model discovery even for already-collected native OpenAI/Anthropic connections.

2. Design Cleanliness & Hot-Path Discipline

  • Avoid arbitrary 64 KiB / 128 fragments history truncation (plugins/agent/native/src/executor/oar/history.rs:76-80): Reading a single Position::Tail page clips messages >64 KiB mid-content and silently drops earlier missed turns when switching to OAR mid-session. SessionStore::history_text (platform/event-log/src/transcript/history.rs:79-118) already supports ascending cursor pagination via Position::After(...); paginate forward across the missed [delivered, through] range instead of truncating user content.
  • Eliminate hot-path subprocess storms in models / model (plugins/agent/native/src/owner/models.rs:27-159): Every search keystroke, every pagination cursor, and even Owner::model(ModelRead) for a single native model spawns a fresh maka-oar-worker process that probes all 9 external OAR CLIs (worker/main.mjs:51-55), serializes the entire catalog for SHA-256, and discards all but 16 entries. Resolve native BackendPreference::Model without spawning OAR, pass single runtime (worker/main.mjs:68-69) when resolving a single BackendPreference::Executor, and avoid re-probing all 9 CLIs on pagination/filter strokes.
  • Remove leftover compatibility shims and parallel wire enums:
    • DeliveryMethod::Execute (plugins/agent/native/src/workhub/tasks.rs:173-186) is dead compatibility code ("execute" was removed from plugins/agent/api/src/contract.rs, so observe_original at tasks.rs:929-933 cannot match it anyway). Use "send" directly.
    • SkillCandidatesBackend (plugins/agent/api/src/contract.rs:513-530) duplicates BackendPreference and forces adapter glue in SessionSurface.tsx:398-405.
  • Cache unchanged maka-oar-worker dev builds (scripts/rust/build-cli.mjs:110-131, scripts/oar/build.mjs:61-101): build-cli.mjs currently re-bundles and runs deno compile (~80–100 MB binary) on every invocation even when worker inputs and runtime receipts are unchanged.

3. Test Cleanliness

  • Deduplicate ~250 lines of copy-pasted OAR test scaffolding: plugins/agent/native/src/owner/tests/executor/{oar.rs, oar_attachments.rs, oar_history.rs} have strong behavioral coverage over real piped workers, but copy-paste node(), worker_script(), oar_backend(), setup(), wait_for_path(), release(), and packet() verbatim across 3 files, spawn synchronous node -p process.execPath on every test instead of OnceLock<PathBuf>, and poll exists() in a 10ms tokio::time::sleep loop. Extract a shared oar_support module, cache the Node path, and add behavioral tests for cancelling models before fixture.finish() and calling models with empty workspace_roots.
  • Replace implementation-mirroring / bug-codifying JS tests:
    • scripts/rust/notices.test.mjs:275-305 codifies the partial-platform bug by asserting verifyReviewedNotices passes when only aarch64-apple-darwin is present.
    • scripts/ci.test.mjs:301-319 monkey-patches childProcess.spawn + syncBuiltinESMExports() just to assert a 1-line CLI argument array (and conflicts with #6619's dependency-injected executor(root, worker, { env, run }) helper).

4. Rebase & Cross-PR Notes

  • Rebasing onto rust-preview (#6619) has a small conflict in scripts/ci.test.mjs (import { executor }).
  • If merged alongside #6618: resolve conflicts in products/maka/bundle/src/installation.ts and packages/plugin-sdk/src/contracts.ts, migrate #6618's new "model": fixture.selection calls in products/maka/desktop/tests/desktop_new_session.rs, and preserve #6618's MessageOrigin attribution when formatting prior turns in plugins/agent/native/src/executor/oar/history.rs.
代码与测试评审(简体中文) — 6 项阻塞级问题(含 CI 挂点根因)、4 项架构与热路径问题、2 项测试整洁度问题

总体评价

核心架构方向是正确的:将分散的 send/execute 统一为单一 send(..., backend: Option<BackendPreference>) 契约,在产生外部副作用前通过 opened + host.committed() 建立持久化栅栏(plugins/agent/oar-executor/worker/execution.mjs:46-57),单次流式快照完成附件白名单与 SHA-256 校验(plugins/agent/native/src/executor/oar/attachments.rs:95-179),以及基于固定源码哈希构建并校验 denort 二进制头。

但收尾与边界处理目前不够干净,存在 6 项阻塞级回归(其中多项已直接导致远端 CI root-tests 挂掉),以及硬编码内容截断、热路径子进程风暴和测试脚手架重复粘贴等问题,建议修复后再合入。


1. 阻塞级 Bug 与 CI 挂点根因

  1. Owner::send 同任务 RwLock 读写自死锁(导致 CI 3 个 bot_tests 90s 超时)

    • Owner::send(plugins/agent/native/src/owner.rs:1102)先获取 let admission = self.runs.session(&id).await;(内部持有 OwnedRwLockReadGuard,见 plugins/agent/native/src/owner/runs.rs:63-72),随后在持读锁期间调用 self.use_bot_model(parent, &mut selection).await(owner.rs:1193)。
    • use_bot_model(plugins/agent/native/src/owner/bot/wake.rs:141)调用 self.return_route(source).await(plugins/agent/native/src/owner/notifications.rs:51-52),进而执行 self.runs.lock().await 申请同一把 tokio::sync::RwLock 的写锁。Bot 只要调用 SessionSend 委派子会话必 100% 死锁。
    • 建议:将 use_bot_model 移回获取 admission 之前执行,同时避免只读的 return_route 获取写锁。
  2. 调用方迁移残缺,打坏生产 maka acp 与全部 6 个 cli 集成测试分片

    • SendInput(plugins/agent/api/src/contract.rs:265-282)开启了 #[serde(deny_unknown_fields)],将 model + thinkingLevel 替换为 backend 后漏迁了多处外部调用方:
      • 生产 maka acp 损坏:products/maka/acp/src/foreground/admission.rs:46 仍在传 "model" 和 "thinkingLevel",导致所有 ACP 发消息请求运行时直接报错(并打挂 products/maka/cli/src/acp/tests.rs:143-307)。
      • 6 个 cli 分片全挂:products/maka/terminal-shell/tests/real_host/support.rs:443、catalog_association.rs:128、resumable.rs:161-172 以及 products/maka/cli/tests/integration/candidate/crash.rs:100, 121 仍在发送 "model"。
      • ModelSelect 删改后漏同步测试与词条:products/maka/workbench/app/ModelSelect.tsx:627-725 移除了按连接过滤并修改了搜索文案,但漏更新 products/maka/terminal-shell/tests/real_host/keyboard.rs:30-39, 273-345、real_host/mod.rs:129、products/maka/workbench/README*.md:45,并在 products/maka/workbench/app/locale-conversation.ts:179-183 留下了死词条。
  3. Conversation.tsx 用宽泛类型掩盖字段变更,静默绕过工作区 MCP 信任门禁

    • FrozenSend.selection(plugins/agent/conversations/ui/Conversation.tsx:413)被写成 Record<string, unknown> 而非 ReturnType<typeof sendSelection>。
    • sendSelection(Conversation.tsx:1840-1844)已改为返回 { delivery, expectedInvocationId, backend: selected },但 confirmFrozen(Conversation.tsx:1888)仍在判断 if (frozen.selection.model !== undefined && !(await projectMcp.check()))——frozen.selection.model 恒为 undefined,导致每次发送都直接跳过了 projectMcp.check() 工作区连接信任审批。
    • 此外 Conversation.tsx:1829-1830 在 delivery === 'steer' 时直接提前返回不带 backend,而当前轮次为 OAR 时后端实为入队新轮次(steering.rs),会跳过模型就绪检查与后端切换。
  4. 一刀切改写 Error::CleanupUnconfirmed 污染 Host 退场并永久锁死会话

    • plugins/agent/native/src/executor/oar/worker.rs:190-197 在 status? 已确认子进程组 / Windows Job Object 退出后,仍把所有协议、取消、校验或存储错误一律改写成 Err(Error::CleanupUnconfirmed):
      • 取消一次 models 查询就会永久污染 Resources:用户在模型选择器打字取消正在执行的 worker::query(worker.rs:218-227),会被 Oar::query(oar.rs:143-147)和 oar_setup.rs:60-69 作为未确认清理失败写入 Resources(platform/capabilities/src/call/resources.rs:79-82),导致 Oar::finish() 在整个进程生命周期内永久失败。
      • 前置/存储错误会永久砖化会话并泄露临时文件:若在外部会话 opened 前或 journal.opened 落盘时出错(worker.rs:107-110, 294),CleanupUnconfirmed 会跳过 journal.ready(storage) 和 lease.finish()(oar.rs:257-264),不仅泄露物化的用户图片临时目录,还会让 journal.record.running = Some(...) 永久残留在存储中,重启后每次发消息都报 Error::Unknown(journal.rs:61-63)。
  5. 单平台覆盖第三方许可证声明,制造 PR CI 盲区并导致其余 4 个发版平台必挂

    • 仅用 --target aarch64-apple-darwin 重新生成覆盖了 products/maka/cli/notices.json 与 THIRD_PARTY_NOTICES.txt,把约 200 个 Linux/Windows Cargo 依赖从声明文件里清空了。
    • scripts/ci/run.mjs:94 切为 notices.mjs check-reviewed 后,verifyReviewedNotices(scripts/rust/notices.mjs:245, 348-357)只对 aarch64-apple-darwin 过滤检查 Cargo 依赖,导致 PR CI 不再检查 Linux/Windows/x86_64-apple-darwin 的许可证合规性,而正式发版流水线在其余 4 个平台执行 verifyNotices 时会直接失败。
    • oarInputs 只加到了 root 和 native-build(scripts/ci/suites.mjs:78, 116),漏加到真正执行 check('notices') 的 product.extraInputs(suites.mjs:126)。
  6. 无工作区根目录时连原生模型列表都会挂掉

    • Owner::model_choices(plugins/agent/native/src/owner/models.rs:79-91)在存在 oar 执行器时无条件调用 self.oar_cwd().await?。当 workspace_roots() 为空时直接抛 agent_workspace_unavailable,把前面已收集好的 OpenAI/Anthropic 原生模型也一并打挂。

2. 设计干净度与热路径成本

  • 移除 64 KiB / 128 fragments 历史硬截断(plugins/agent/native/src/executor/oar/history.rs:76-80):单次 Position::Tail 读取会把超过 64 KiB 的消息从中间截断,并在中途切换到 OAR 时静默丢弃较早轮次。SessionStore::history_text(platform/event-log/src/transcript/history.rs:79-118)本身支持 Position::After(...) 正向游标翻页,应完整拼接 [delivered, through] 区间而非截断用户内容。
  • 消除模型查询热路径的子进程风暴(plugins/agent/native/src/owner/models.rs:27-159):每次搜索按键、每次翻页游标、甚至 Owner::model(ModelRead) 查询单个原生模型时,都会拉起新的 maka-oar-worker 进程并发探测全部 9 个外部 CLI(worker/main.mjs:51-55),全量序列化算 SHA-256 后只取 16 条。查原生 BackendPreference::Model 不应启动 OAR;查单个 BackendPreference::Executor 应透传 worker 已支持的单个 runtime 参数(worker/main.mjs:68-69)。
  • 清理残留兼容分支与重复协议枚举:
    • DeliveryMethod::Execute(plugins/agent/native/src/workhub/tasks.rs:173-186)属于失效兼容代码(契约已移除 "execute",tasks.rs:929-933 匹配必败),应直接删除并统一用 "send"。
    • SkillCandidatesBackend(plugins/agent/api/src/contract.rs:513-530)与 BackendPreference 平行重复,导致 SessionSurface.tsx:398-405 需要手写转换胶水。
  • 为 maka-oar-worker 补充输入摘要缓存(scripts/rust/build-cli.mjs:110-131):避免每次调用 build-cli.mjs / just run 在输入未变时重复打包并执行 deno compile(~80–100 MB)。

3. 测试整洁度

  • 消除约 250 行重复粘贴的测试脚手架:plugins/agent/native/src/owner/tests/executor/{oar.rs, oar_attachments.rs, oar_history.rs} 的行为覆盖很扎实,但把 node()、worker_script()、oar_backend()、setup()、wait_for_path()、release()、packet() 原样粘贴了三遍;每个测试同步拉起 node -p process.execPath(建议用 OnceLock<PathBuf> 缓存),且 wait_for_path 使用 10ms sleep 轮询文件。建议提取公共 oar_support,并补齐“取消 models 查询后调用 fixture.finish()”与“空 workspace_roots 下查询原生模型”的行为回归测试。
  • 清理固化 Bug 与镜像实现的 JS 测试:
    • scripts/rust/notices.test.mjs:275-305 把“仅有 aarch64-apple-darwin 也能通过检查”的单平台盲区固化成了断言,应改为验证多目标平台声明完整性。
    • scripts/ci.test.mjs:301-319 通过 monkey-patch childProcess.spawn + syncBuiltinESMExports() 测一行参数数组透传,且与 #6619 已合入的依赖注入版 executor(root, worker, { env, run }) 产生冲突。

4. Rebase 与跨 PR 联动提醒

  • 基于最新 rust-preview(含 #6619)变基时需处理 scripts/ci.test.mjs 的 executor 导入冲突。
  • 与 #6618 合入联动时:除 products/maka/bundle/src/installation.ts 和 packages/plugin-sdk/src/contracts.ts 的冲突外,需迁移 #6618 在 products/maka/desktop/tests/desktop_new_session.rs 中新增的 "model": fixture.selection 调用,并在 plugins/agent/native/src/executor/oar/history.rs 拼接历史轮次时保留 #6618 的 MessageOrigin 发送者溯源。

Automated review generated by Antigravity.

Preserve the upstream CI executor injection and use it for notices routing coverage.

Generated-by: Maka
Freeze observed backend identity, restore MCP trust checks and migrate remaining consumers. Share model discovery without transferring query custody to cancellable waiters, and preserve cleanup evidence across persistence and pipe failures.

Generated-by: Maka
Check the main product Cargo closure across every distribution target independently of reviewed OAR runtimes. Restore platform-specific notices, keep actual-runtime release gates, track product inputs and reuse verified unchanged worker outputs.

Generated-by: Maka
@M4n5ter

M4n5ter commented Nov 4, 2026

Copy link
Copy Markdown
Member Author

Automated follow-up by Maka to the review above.

The confirmed regressions are fixed in cc426f6a6 and e1cc7a209, and the branch includes the rust-preview updates from #6616 / #6619.

  • Bot delegation: return_route now takes the read-only run-state guard, eliminating the same-task read/write lock deadlock without moving preference freezing outside admission.
  • Actual consumers: migrated production ACP and the remaining terminal/crash fixtures to tagged backend; updated source-search copy and real keyboard selection coverage. Native-only resume contracts are unchanged.
  • MCP trust: frozen sends use the typed selection; native sends require workspace MCP approval. Only an actually native active run uses in-place steering. observe.run.backend comes from the same canonical opening's frozen configuration, not the mutable next-turn preference. Unknown run kinds fail closed. The real UI test also caught and fixed the unnamed MCP Cancel button.
  • Settlement: protocol errors and physical cleanup evidence are separate. Cancellation/ACK-write failures continue draining; a valid terminal is not erased by a later pipe-close race. Opened-persistence failure is never acknowledged: the worker cancels, disposes, reports terminal and exits before custody/files are released, while the original persistence error remains visible. An exited worker with an escaped stdout holder now has a bounded final drain and still reports cleanup unconfirmed. Missing terminal is not treated as disposal merely because a Unix process group disappeared.
  • Discovery/build hot paths: native detail starts no OAR worker; external detail probes only its selected runtime. Full discovery shares one bounded cached result across search/pagination, continues independently of a cancelled waiter, is owned by normal stop/settlement, and is invalidated by installation. Empty roots retain native discovery. Unchanged dev worker builds reuse input/output-verified receipts; release still verifies controlled runtime bytes.
  • Licenses/CI: main Maka Cargo coverage is now independently checked across all five targets. All 192 omitted platform-specific records are restored (1,376 total components). Only the reviewed Mac ARM OAR runtime remains registered. The actual-target runtime-document gate and default five-runtime generation gate remain intact. Product input routing includes OAR; CI tests use the existing injected executor.
  • Removed the duplicated skill-candidate wire enum and extracted shared OAR test support with one async Node-path lookup.

Two review suggestions deliberately remain unchanged:

  1. Bounded history: the agreed 64 KiB / 128-fragment handoff explicitly labels gaps and partial fragments and is not a lossless provider-state transfer. Existing behavior tests exercise those labels. This does not remove canonical Maka history; changing it to an unbounded scan would change the agreed contract.
  2. Legacy DeliveryMethod::Execute: the base (8fd3a365c) really produced durable execute assignments. dispatch recovers the original application intent/receipt before deciding whether any new dispatch is allowed. The current public contract lacking execute does not eliminate that receipt recovery path. New assignments only use send; old execute values remain readable rather than being reinterpreted or redispatched as send.

Final local verification is listed in the updated PR body. No new controlled-runtime build, live provider smoke test, desktop screenshot or other-platform OAR runtime build/review was performed for this follow-up.

Resolve merge conflicts with #6566 and #6618 across installation tool
descriptions, generated SDK contracts and multi-platform notice digests,
and migrate newly merged delegation and queue authorship tests to
BackendPreference.

Generated-by: Antigravity
@M4n5ter
M4n5ter merged commit a868822 into rust-preview Nov 4, 2026
19 checks passed
@M4n5ter
M4n5ter deleted the feat/oar-execution-sources branch November 4, 2026 08:50

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Automated review notice: This comment was posted by an automated review agent. It is not an independent human review and does not replace one.

This is a focused follow-up at final 0aa3f72c0cb2a49fa162d2a60d7a3ceea3799c63, not a complete review of the 138 changed files or a claim that all earlier findings are resolved.

P2: the tagged backend migration still leaves CompletionComposer in products/maka/terminal-shell/tests/fixtures/components.tsx supplying the previous untagged model objects. The changed comparator interprets them as executor backends and throws before the native completion scenarios can run. Details are inline.

This is confirmed in the final-head CI 41800872954 and current merged-branch CI 41805348622: composer_slash_command_and_workspace_reference_edit_the_native_draft and skill_completion_is_inserted_and_backspace_deletes_the_whole_native_chip fail with cannot read property 'executor' of undefined through routeKey → sameRoute. I read both failed jobs in each run. I also called the actual comparator under Node 24.18.1 with the fixture's two model objects: the current code throws, the actual pre-OAR comparator accepts them, and adding kind: 'model' to both current objects removes the error. Only the locale import used an identity adapter in that small probe.

Please migrate the fixture's backend and model-choice contracts and rerun these native scenarios. This is a PR-caused test failure, not evidence that ordinary valid production model selections crash. The final implementation remains in need of its broader review; I have not independently validated its live OAR execution, cleanup, packaging or license closure.


Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.

: JSON.stringify([
'executor',
backend.selection.executor,
backend.selection.settings.runtime ?? null,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: Update the native composer fixture along with this tagged comparator.

CompletionComposer at products/maka/terminal-shell/tests/fixtures/components.tsx:151–190 still returns backend: () => ({ connectionId, modelId, thinkingLevel: null }) and an untagged modelDetails().choice.selection. Neither has kind, so sameRoute takes this executor branch and reads backend.selection.executor from undefined. Both final-head CLI shards 4/6 and 6/6 fail their composer completion tests with precisely this stack; the merged target does too. The actual previous comparator accepts these same objects, and the current comparator accepts them after both are tagged as model backends. Migrate the complete fixture contract, including the renamed model-choice fields, and retain these behavioral tests.


Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.

@M4n5ter M4n5ter mentioned this pull request Nov 4, 2026
4 of 6 tasks
M4n5ter added a commit that referenced this pull request Nov 4, 2026
Move document-local JSON Pointer `$ref` inlining from the Anthropic wire
adapter to `maka-tool-catalog` admission (`ToolCatalog::new`,
`BoundTool::Input`, and `ToolSearch::definition`):

- Cover every wire protocol (`anthropic-messages`, `chat-completions`, and
  `responses`) once at catalog admission without per-step re-expansion, and
  keep context compaction token estimates aligned with the wire schema.
- Preserve JSON Schema validation semantics across sibling `allOf` arrays,
  `unevaluatedProperties` / `unevaluatedItems`, embedded `$id` subresources,
  `Projection::project` request envelopes, RFC 6901 percent-encoded fragments,
  and recursive / anchor / dynamic references while bounding only
  `$ref`-materialized DAG expansion.
- Update the terminal composer completion test fixture to match the structured
  `AgentBackendPreference` and `skills({ query, backend })` contract from #6617.

Generated-by: Antigravity
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