Repository navigation
feat(agent): replace OAR with direct native CLI runtimes - #6639
Conversation
Bind invocation-scoped MCP tools to Host execution custody, original receipts and resource-only reads. Preserve cancellation settlement and archive access, and narrowly support Antigravity 1.5.0 HTTP MCP. Generated-by: Maka Generated-by: OpenAI Codex Generated-by: Antigravity Argon
… import Add an opt-in acceptance for the real Claude Code MCP probe transcript. Verify all three turns, resumed model provenance, tool/result correlation, read-only import and original receipt replay. Generated-by: Maka
Direct ACP, app-server and interactive PTY with native full-access permissions. Retain execution custody, original Host receipts and native conversation fences. Remove the OAR/Deno worker distribution and installer.\n\nValidation and integration are still in progress; this local checkpoint precedes synchronization with the updated rust-preview baseline. Generated-by: Maka Generated-by: OpenAI Codex
Preserve fatal discovery observations across cache eviction, revoke only unspawned provisional Claude identities, and settle correlated Claude API failures without replay. Strengthen real-runtime resume checks to require a fresh Host tool call on every invocation. Repair settings navigation after installer removal and record real NSH buffer evidence. Generated-by: Maka Generated-by: OpenAI Codex
Connect through the native WebSocket proxy after idempotent daemon start. Keep per-invocation MCP credentials in thread configuration, not shared process environment. Interrupt only the correlated turn and wait for its terminal; retain unknown and cleanup fences after proxy loss. Cover cancellation boundaries and the native WebSocket protocol without changing Host receipt or resource custody. Generated-by: Maka
Automate scoped native workspace trust, wait for the fresh Host catalog, paste multiple immutable images and stream text before one Enter. Preserve native JSONL admission and pre-submission cancellation custody. Expand byte/setup budgets, remove count cutoffs, follow Codex native model cursors and permit provider/feature defaults without changing full-access policy. Generated-by: Maka
Astro-Han
left a comment
There was a problem hiding this comment.
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 dependency/build follow-up at 4e0b1fd52e7a34d47753d6b965e286761af6ab83, not a completed review of the native runtime replacement.
P2: the changed Rust dependency graph has no matching dependency inventory. The new native dependencies and lockfile introduce packages such as [email protected], [email protected] and [email protected], while products/maka/cli/DEPENDENCIES.rust.tsv is unchanged from the parent and has no rows for these packages. The production checker rejects that inventory, failing both the Rust audit in job 127073226945 and tooling in job 127075400559. Regenerate and commit the inventory for this graph, then run its check.
I read the manifest/lockfile changes, the inventory and scripts/rust/dependencies.mjs, and the actual failed logs. The checker reaches licenses ok before rejecting the stale inventory; this is not a finding that a dependency's license is prohibited. The same checker passes on parent 390360d0 in job 127048365632.
The desktop-build and bridge jobs also fail to link the native rusty_v8 library. I have not established the cause and am not presenting that observation as a second confirmed PR defect. I did not run a local native build, independently repeat the documented CLI/Host tests, inspect the visual captures, or complete the configuration-upgrade and lifecycle review. Those checks remain necessary for the broader change.
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.
| publish.workspace = true | ||
|
|
||
| [dependencies] | ||
| axum = { version = "0.8", default-features = false, features = ["http1", "tokio"] } |
There was a problem hiding this comment.
[P2] Regenerate the native Rust inventory with the new dependencies
These additions change the shipped Rust graph (including the new axum/axum-core/matchit packages), but products/maka/cli/DEPENDENCIES.rust.tsv remains byte-identical to the parent and does not contain those rows. The actual Rust audit and tooling jobs both stop at scripts/rust/dependencies.mjs:80 with “Rust dependency inventory is stale”; the parent tooling check passes. Run the inventory generator and commit its output alongside the dependency change, then verify the check.
There was a problem hiding this comment.
Confirmed fixed at 8a2cecd846fc3962bca0004c4d7cc38e1c5cfafd. The missing dependency rows and rmcp version are synchronized, and the successful rust-licenses job 127179831048 actually ran node scripts/rust/dependencies.mjs check; I checked its raw log and completed result. The dependency-audit run 42008084825 also completed successfully.
This clears my stale dependency-inventory finding. It does not establish correctness of the native runtime, MCP lifetime, instruction updates or configuration migration, and it is not evidence that the full PR CI has passed.
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.
Preserve native system prompts with separate Maka instruction messages, reuse native identities and original Host receipts, and adapt agy image uploads through immutable paths. Generated-by: Maka
Preserve native interruption evidence and physical settlement before resuming queued input. Match the documented status and tool-error protocol and native MCP plugin namespace. Generated-by: Maka
Generated-by: Maka
Regenerate the SDK delivery contract and restore the atomic fixture state update used by the merged native CLI UI regression. Generated-by: Maka
M4n5ter
left a comment
There was a problem hiding this comment.
English
Reviewed 23608af46. Replacing the OAR/Deno sidecar stack with per-invocation local HTTP MCP bridges (127.0.0.1:0, 256-bit random Bearer tokens, Phase admission gates, lastDeliveredRun watermarks, and single-transaction deliver_steering validation) gives a much cleaner runtime boundary.
Here are the CI/release blockers, everyday-path runtime/platform bugs, and legacy compatibility remnants to address for a clean final implementation:
A. CI & Release Blockers
-
Regenerate Rust license manifests and third-party notices (
products/maka/cli/DEPENDENCIES.rust.tsv,notices.json,THIRD_PARTY_NOTICES.txt)-
plugins/agent/native/Cargo.toml:26-27, 82added non-devaxum = "0.8",rmcp(transport-streamable-http-server), andtokio-tungstenite, introducing 4 new shipped crates intomaka-cli(axum,axum-core,matchit,pastey). -
products/maka/cli/DEPENDENCIES.rust.tsvwas not updated (already failingDependency audit / rust-licenses),notices.json/THIRD_PARTY_NOTICES.txtwere hand-edited instead of regenerated, andscripts/rust/licenses/deno-2.9.6-source-notices.txtis now orphaned after removingdeno_core/v8. Runjust licenses-generateand remove unused license source files.
-
-
Include
target/**/gn_outin CI compiler caches sodesktop-buildandbridgedo not fail linkingrusty_v8(.github/actions/ci-setup/action.yml:122-129,.github/actions/ci-cache/action.yml:42-48)-
v8'sbuild.rsdownloadslibrusty_v8.aintotarget/debug/gn_out/obj/(three parents aboveOUT_DIR), outsidetarget/**/build. - Because
Cargo.lockchanged here,restore-keys: compiled_prefixrestores a fallback cache containingv8's freshbuild-script-buildfingerprint withoutgn_out; Cargo skips re-runningv8'sbuild.rsand fails when relinkingv8withcould not find native static library rusty_v8. - Add
target/**/gn_outto both cache actions, and inci-setuppurgetarget/**/build/v8-*+target/**/.fingerprint/v8-*wheneverv8fingerprints exist withoutgn_out/objso existing caches self-heal.
-
-
Exclude PR screenshots from
git archiveso ASF source-release validation passes (.gitattributes,docs/_pr/native-cli-runtimes/*.png)-
scripts/asf-source-release.mjs:623-664(validateNonTextInputs) rejects any binary file ingit archivenot listed indocs/code-origin-audit.md:287-313. Adding/docs/_pr export-ignoreto.gitattributeskeeps PR-only screenshots out of release archives (and fixes the same latent issue fordocs/_pr/6603/*.png).
-
B. Everyday Runtime & Cross-Platform Bugs
-
Do not re-inject
<maka_system_instructions>on every resumed turn, guard bootstrap turns against premature execution, and filter synthetic instructions insession-import- Locations:
plugins/agent/native/src/owner/queue.rs:1128-1131,plugins/agent/native/src/executor/external.rs:395-400,external/claude.rs:219-248,external/agy.rs:229-249,external/codex.rs:174-191, andplugins/agent/session-import/src/{claude/wire.rs:170-197, codex.rs:55-65, catalog/summary.rs:174-224}. -
Three concrete issues hit on normal multi-turn sessions:
-
Unconditional re-injection on every resumed turn (
$O(N)$ context bloat + 2x sequential LLM turns in Claude):request["instructions"]isSome(...)on every turn in Maka. None of the three drivers checkresume(or whether instructions changed):-
Claude:
claude/input.rs:212already awaitsbridge.listedat startup before any input is sent, yet every--resumeturn still pastes the full<maka_system_instructions>into the PTY and runs a complete extra LLM turn before submitting the user's message ($2N$ sequential LLM turns and$N$ full copies ofAGENTS.mdin~/.claude/projects/.../<uuid>.jsonl). -
Codex: Every
thread/resumeturn callsthread/inject_itemsagain, appending another full copy of<maka_system_instructions>into the persisted thread. -
Antigravity: While each fresh
agyprocess needs an initial message to trigger lazy MCP loading (bridge.listed), resumed--conversation <id>turns with unchanged instructions should use a minimal MCP readiness ping rather than resending multi-KB system instructions every turn.
-
Claude:
-
Missing "acknowledge only / do not act yet" directive while full access & Host MCP are already live:
runtime::instruction_messageonly wraps<maka_system_instructions>...</maka_system_instructions>. Inagy.rs:230-232,"Initialize the available MCP tool catalog ... Do not perform a user task yet."sits insideinstructions.unwrap_or(...), so it disappears wheneverinstructionsisSome(all real Maka sessions), andclaude.rsnever includes one. With--dangerously-skip-permissionsandbridge.admit()already open, imperative rules inAGENTS.mdor/skill:...prompts can trigger tool side effects during the hidden bootstrap turn. -
Leaks into Session Import titles, chat bubbles, and Recall: Because Claude and Codex persist
<maka_system_instructions>as the first ordinaryuserrow in their native JSONL transcripts, Session Import displays<maka_system_instructions> ...as the session title and imports every synthetic block (plus Claude's hidden bootstrap reply) as visible chat messages.
-
Unconditional re-injection on every resumed turn (
- Locations:
-
Update the 4 sibling
/skill:and steering paths missed when enabling"external"skills and live steering-
Owner::send(plugins/agent/native/src/owner.rs:1505-1510) andactive_delivery(owner.rs:1259-1270) were updated for"external", but four sibling entrypoints still enforce the old rules:-
Owner::skill_candidates(plugins/agent/native/src/owner/skills.rs:115-122): Returns emptySkillCandidates::default()forBackendPreference::Executor, so typing/skill:in Composer shows zero autocomplete candidates when Claude, Codex, or Antigravity is selected. -
Owner::steer_message(plugins/agent/native/src/owner/steering.rs:43-50): Validates/skill:againstself.selected_tools(...)(the full native Maka toolset such asBash/Edit) instead ofself.external_tools(...), falsely admitting skills whose required Host tools are not bridged to external runtimes. -
QueueAction::Update(plugins/agent/native/src/owner/queue/controls.rs:252-254): Hardcodesif basis.executor.is_some() { vec![] }, rejecting edits to queuedexternalmessages that reference valid Host-bridged skills withQueueRejection::InvalidEdit. -
QueueAction::Promote(plugins/agent/native/src/owner/queue/controls.rs:289-293): Unconditionally rejectscontrol.basis.executor.is_some()withQueueRejection::ExecutionChanged, breaking Promote / Steer-now on queued messages even during active Codex or Claude turns that supportActiveDelivery::Steer.
-
-
-
Fix Windows
.cmd/.batCLI spawning and Claude path/config resolution on Windows-
.cmd/.batshims fail withERROR_BAD_EXE_FORMAT (193):external/runtime.rs:155-157resolves["exe", "cmd", "bat"]on Windows (npm global installs produce%APPDATA%\npm\claude.cmdandcodex.cmd), then passes that path tomaka_process::Command->CreateProcessW(buffers.executable.as_ptr(), ...)(platform/process/src/command/windows.rs:122-134), which rejects batch files wheneverlpApplicationNameis non-null. -
Claude Windows verbatim paths &
USERPROFILE:-
external/claude.rs:124usestokio::fs::canonicalize(cwd), producing\\?\C:\...on Windows. That encodes as----C--Users-...intranscript()(316-327) instead of Claude'sC--Users-..., soCursorwatches a JSONL path Claude never writes; it also breaks workspace trust matchingpath != Some(cwd)(claude/input.rs:156). -
external/claude.rs:300-314only checksCLAUDE_CONFIG_DIRandHOME, missingUSERPROFILEon Windows.
-
-
-
Preserve explicit
Send.backendacrossInterruptResumeon busy Antigravity turns (plugins/agent/native/src/owner.rs:1271-1273, 1313-1324)- Primary Enter/Send in
Composer.tsx:356-358always sends{ backend, delivery: 'steer' }. When Antigravity is running,active_deliveryselectsInterruptResume(cancelling the current turn to start a newFollowupinvocation), andowner.rs:1313-1322unconditionally overwritesinput.backendwithcontrol.basis.executor.selection. Switching the model/backend picker while Antigravity is busy and pressing Enter interrupts Antigravity only to launch the new turn on the old Antigravity model instead of the user's newly selected backend.
- Primary Enter/Send in
-
Scope external discovery/validation per runtime where appropriate and fix catalog TTL / transient error caching (
plugins/agent/native/src/owner/models.rs:90-109, 283-297,external.rs:212-249)- Removing
runtimefrom theexternal_choicesquery forces single-model validation (Owner::model) for Claude (which needs zero subprocesses) or Antigravity to also spawnagy modelsandcodex app-serverdaemon + WebSocket proxy whenever Codex is enabled. - Stamping
started: Instant::now()beforediscoverruns (SETUP_TIMEOUT = 300s) gives any probe taking >=30s a 0ms TTL on completion, while memoizing fast transientErr(Error::Provider | Error::Invalid)results inside theSharedfuture for the full 30s window.
- Removing
C. Clean Removal of Legacy oar Shims, Redundant Schema Fields & Stale Prompts/Docs
-
Remove remaining
oarcompatibility shims, switch physical namespace to"maka.agent.external", and drop redundantexternal.enabled-
Broken half-retained
'oarSetup'shim:products/maka/client/src/journal.rs:38-42,products/maka/client/src/lib.rs:112-119, andplugins/settings/settings/ui.tsx:165-168still retain'oarSetup', whereasplugins/settings/settings/settingsOperations.tsalready removed its'oarSetup'handler (makingui.tsx:165dead code that throwsUnsupported settings receiptanyway). Delete all three remnants. -
Switch
"maka.agent.oar"->"maka.agent.external"and drop legacy decode shims: ReplaceNamespace::new("maka.agent.oar", Scope::Profile)inplugins/agent/native/src/executor/external.rs:125(and associated tests/READMEs) with"maka.agent.external", remove backward-compat#[serde(default)]on internaljournal::Record::last_delivered_run(external/journal.rs:29), and clean up stale"oar"fixture IDs inplatform/event-log/tests/integration/archive/mod.rs:595-625(if needed for local dev data, attach a one-off migration script gist in the PR body). -
Drop redundant
ExternalConfiguration.enabled:runtimes: { antigravity, codex, claude }already represents whether any runtime is enabled;externalAgentSettingsState.ts:176-180only writesenabled: trueas a holdover fromOarConfigurationwith no separate UI toggle. Removingexternal.enabledacrossconfigurations.ts,plugins/agent/api/src/{executor.rs, external.rs}, andexternalAgentSettingsState.tskeeps a single source of truth.
-
Broken half-retained
-
Update
SessionSendtool description andproducts/maka/bundle/README*to match current semantics-
products/maka/bundle/src/installation.ts:209still tells models"external executor turns always queue follow-ups", whereas omittingdelivery="queue"now steers active Codex/Claude turns and interrupts active Antigravity turns viaSIGINT. -
products/maka/bundle/README.md:68-74andREADME.zh-CN.md:70-76still describe the superseded64 KiB / 128 fragmentshistory cap, queue-only external follow-ups, and Claude PTY rejecting image attachments.
-
简体中文
看完了 23608af46。整体把 OAR/Deno 侧车栈替换成按调用隔离的本机 HTTP MCP 桥(127.0.0.1:0、256-bit 随机 Bearer token、Phase 准入门控、lastDeliveredRun 水位与单事务 deliver_steering 校验),主干边界清爽了很多。
下面整理出需要一并收敛的 CI / 发版必挂项、常规使用即可触发的运行时 / 跨平台缺陷,以及需彻底清理的旧命名与兼容残留:
一、CI 与发版必挂阻塞项
-
重新生成 Rust 依赖台账与第三方声明(
products/maka/cli/DEPENDENCIES.rust.tsv、notices.json、THIRD_PARTY_NOTICES.txt)-
plugins/agent/native/Cargo.toml:26-27, 82新增了运行期依赖axum = "0.8"、rmcp(transport-streamable-http-server)与tokio-tungstenite,为maka-cli引入了 4 个新发布 crate(axum、axum-core、matchit、pastey)。 -
products/maka/cli/DEPENDENCIES.rust.tsv未同步(当前 CIDependency audit / rust-licenses已挂),notices.json/THIRD_PARTY_NOTICES.txt系手工删改,且移除deno_core/v8后scripts/rust/licenses/deno-2.9.6-source-notices.txt已成孤儿文件。请执行just licenses-generate并清理不再引用的 license 源文件。
-
-
CI 编译器缓存补齐
target/**/gn_out,修复desktop-build与bridge链接rusty_v8失败(.github/actions/ci-setup/action.yml:122-129、.github/actions/ci-cache/action.yml:42-48)-
v8的build.rs会将预编译librusty_v8.a下载到target/debug/gn_out/obj/(OUT_DIR往上三层),不在target/**/build内。 - 本 PR 更新
Cargo.lock后通过compiled_prefix命中旧缓存,Cargo 看到v8的build-script-buildfingerprint 未变跳过下载,重编v8lib 时就会报could not find native static library rusty_v8。 - 建议两处缓存路径均加入
target/**/gn_out,并在ci-setup恢复缓存后检查:若存在v8-*fingerprint 但缺少gn_out/obj,主动清理target/**/build/v8-*与target/**/.fingerprint/v8-*实现旧缓存自愈。
-
-
将 PR 截图目录排除出
git archive,避免just source源码包检查失败(.gitattributes、docs/_pr/native-cli-runtimes/*.png)-
scripts/asf-source-release.mjs:623-664(validateNonTextInputs)要求归档包内所有二进制文件必须在docs/code-origin-audit.md:287-313登记。在.gitattributes增加/docs/_pr export-ignore即可避免发版源码包校验失败(同时修复docs/_pr/6603/*.png的同类隐患)。
-
二、常规路径可触发的运行时与跨平台缺陷
-
避免在每次续轮(resume)重复注入
<maka_system_instructions>,补齐 bootstrap 回合“勿提前执行”约束,并在session-import过滤合成指令消息- 位置:
plugins/agent/native/src/owner/queue.rs:1128-1131、plugins/agent/native/src/executor/external.rs:395-400、external/claude.rs:219-248、external/agy.rs:229-249、external/codex.rs:174-191,以及plugins/agent/session-import/src/{claude/wire.rs:170-197, codex.rs:55-65, catalog/summary.rs:174-224}。 -
多轮对话下必现的三个问题:
-
每轮重复注入导致
$O(N)$ 上下文膨胀 + Claude 2 倍串行回合耗时:真实 Maka 会话每轮request["instructions"]都是Some(...),三个驱动均未检查resume(及指令是否变化):-
Claude:
claude/input.rs:212在发消息前已等完bridge.listed,本不依赖 bootstrap 消息触发 MCP 加载;但每次--resume仍把整份<maka_system_instructions>粘贴进 PTY 跑完整整一轮额外 LLM 往返后再发用户消息($N$ 轮对话实际串行跑$2N$ 轮,且 JSONL 中堆积$N$ 份完整AGENTS.md)。 -
Codex:每次
thread/resume都再次thread/inject_items追加一份完整<maka_system_instructions>。 -
Antigravity:虽然每个新
agy进程需首条消息触发懒加载 MCP(bridge.listed),但--conversation <id>续轮且指令未变时只需发极简 MCP 就绪确认,不应每轮重发数 KB 的系统指令。
-
Claude:
-
真实会话丢失“仅确认、勿执行”约束,而此时最高权限与 Host MCP 已开启:
agy.rs:230-232把"Initialize the available MCP tool catalog ... Do not perform a user task yet."放在instructions.unwrap_or(...)里,只要instructions为Some(所有真实会话)该约束就消失;claude.rs则始终没有该约束。此时--dangerously-skip-permissions与bridge.admit()均已放行,AGENTS.md或/skill:中的行动式指令会在隐藏回合直接触发工具副作用。 -
污染 Session Import 标题与导入历史:Claude 和 Codex 将首条
<maka_system_instructions>作为普通user消息写入原生 JSONL,打开 Session Import 会直接显示<maka_system_instructions> ...作为会话标题,导入后所有注入块与 Claude 隐藏回复都会变成可见聊天气泡并进入 Recall 索引。
-
每轮重复注入导致
- 位置:
-
补齐
"external"启用/skill:与运行中 Steer 后漏改的 4 条同类路径-
Owner::send(plugins/agent/native/src/owner.rs:1505-1510)与active_delivery(owner.rs:1259-1270)已支持external,但以下 4 处同源路径仍停留在旧限制:-
Owner::skill_candidates(plugins/agent/native/src/owner/skills.rs:115-122):遇到BackendPreference::Executor直接返回空候选,选中 Claude / Codex / Antigravity 时在输入框敲/skill:没有任何补全。 -
Owner::steer_message(plugins/agent/native/src/owner/steering.rs:43-50):运行中对 Claude / Codex 走steer_message时用了self.selected_tools(...)(完整原生工具集,含Bash/Edit等)而非self.external_tools(...)校验技能,会错误放行依赖未桥接工具的技能。 -
QueueAction::Update(plugins/agent/native/src/owner/queue/controls.rs:252-254):仍写死if basis.executor.is_some() { vec![] },在队列中编辑带合法/skill:的外部消息会直接报QueueRejection::InvalidEdit。 -
QueueAction::Promote(plugins/agent/native/src/owner/queue/controls.rs:289-293):无条件拦截control.basis.executor.is_some()并返回QueueRejection::ExecutionChanged,导致即便在支持Steer的 Codex / Claude 运行期间点击队列插队也会失败。
-
-
-
修复 Windows 下
.cmd/.batCLI 启动失败及 Claude 的 Windows 路径与配置目录解析-
.cmd/.bat启动必报os error 193:external/runtime.rs:155-157在 Windows 查找["exe", "cmd", "bat"](npm 全局安装的claude/codex默认均为%APPDATA%\npm\*.cmd),随后传给CreateProcessW(buffers.executable.as_ptr(), ...)(platform/process/src/command/windows.rs:122-134);Win32CreateProcessW在lpApplicationName非空时不支持批处理脚本,必现ERROR_BAD_EXE_FORMAT (193)。 -
Claude Windows 路径与
USERPROFILE:-
external/claude.rs:124的tokio::fs::canonicalize(cwd)在 Windows 返回\\?\C:\...,导致transcript()(316-327)编码为----C--Users-...(与 Claude 实际写入的C--Users-...不一致)而永远等不到 JSONL;同时首次工作区信任弹窗path != Some(cwd)(claude/input.rs:156)也会因\\?前缀失配直接报错。 -
external/claude.rs:300-314查找.claude目录仅读取了CLAUDE_CONFIG_DIR与HOME,遗漏了 Windows 标准环境变量USERPROFILE。
-
-
-
Antigravity 运行中
InterruptResume不应丢弃调用方显式传入的Send.backend(plugins/agent/native/src/owner.rs:1271-1273, 1313-1324)-
Composer.tsx:356-358回车发送默认带{ backend, delivery: 'steer' }。Antigravity 运行时走InterruptResume取消当前轮并排入新Followup轮,但owner.rs:1313-1322用旧轮的control.basis.executor.selection无条件覆盖了input.backend(应优先保留显式传入的selection,仅缺省时回退)。否则用户在运行中切换模型或切到 Claude/Codex 后按回车中断重发,新轮仍会跑在旧的 Antigravity 模型上。
-
-
解耦单模型校验对无关 CLI 的探测,并修正目录缓存 TTL 与瞬时错误缓存(
plugins/agent/native/src/owner/models.rs:90-109, 283-297、external.rs:212-249)-
external_choices去掉runtime维度后,校验单个 Claude 选择(本无需任何子进程)或单个 Antigravity 选择时,只要同时启用了 Codex,就会连带拉起agy models与codex app-serverdaemon/proxy。 -
external.rs:218-220, 238在discover开始前记录started: Instant::now(),慢探测(>=30s)完成即过期;而快速瞬时失败(Err(Error::Provider | Error::Invalid))又会被Sharedfuture 缓存满 30s。
-
三、彻底清理 oar 兼容残留、冗余配置字段与过时工具提示 / 文档
-
移除
oar兼容残留,物理命名空间切为"maka.agent.external",并删掉冗余的external.enabled-
删除半截残留的
'oarSetup':products/maka/client/src/journal.rs:38-42、products/maka/client/src/lib.rs:112-119与plugins/settings/settings/ui.tsx:165-168保留了'oarSetup',但plugins/settings/settings/settingsOperations.ts已移除对应分支,导致ui.tsx:165成为死代码且遇到旧收据仍会抛异常,直接全部删净即可。 -
物理命名空间切为
"maka.agent.external"并清理旧兼容:将plugins/agent/native/src/executor/external.rs:125(及相关测试与 README)中的Namespace::new("maka.agent.oar", Scope::Profile)直接改为"maka.agent.external";去掉内部journal::Record::last_delivered_run(external/journal.rs:29)上的旧记录兼容#[serde(default)];顺带清理platform/event-log/tests/integration/archive/mod.rs:595-625残留的"oar"测试夹具 ID(本地旧开发数据如需迁移,在 PR body 附一份一次性迁移脚本 gist 即可)。 -
移除冗余的
ExternalConfiguration.enabled:runtimes: { antigravity, codex, claude }已经完整表达启用状态;externalAgentSettingsState.ts:176-180没有独立总开关 UI,只是沿用旧OarConfiguration在开启任意 runtime 时顺手写enabled: true。删掉configurations.ts、plugins/agent/api/src/{executor.rs, external.rs}与externalAgentSettingsState.ts中的external.enabled,保持单一事实源。
-
删除半截残留的
-
同步更新
SessionSend工具提示词与products/maka/bundle/README*-
products/maka/bundle/src/installation.ts:209的SessionSend描述仍写着"external executor turns always queue follow-ups",而当前默认不传delivery="queue"会直接 steer Codex/Claude,并通过SIGINT中断正在运行的 Antigravity。 -
products/maka/bundle/README.md:68-74与README.zh-CN.md:70-76仍残留已废弃的64 KiB / 128 fragments预算、外部运行期仅排队、以及 Claude PTY 拒绝图片附件等旧说明。
-
Automated review generated by Antigravity.
Keep conversation endpoints, native configuration paths and durable tool catalogs stable while binding each invocation to fresh credentials, isolated transport sessions and original operation receipts. Bootstrap native conversations only once and release their resources on session retirement. Generated-by: Maka
Include profile-level gn_out outputs in both compiler-cache actions and version fallback keys to exclude incomplete archives. Regenerate dependency notices from the shipped graph and exclude PR-only evidence from source distributions. Generated-by: Maka
Preserve explicit successor backends, apply the bridged tool ceiling consistently to skill candidates and queued steering, and scope native discovery without losing bounded caching. Keep setup dialogue out of imported histories, clarify Windows launch constraints, and update runtime documentation. Generated-by: Maka
There was a problem hiding this comment.
English
Reviewed the latest updates up to 8a2cecd84 (dfa6afc80 / f04452c37 / 8a2cecd84).
Most items from the previous round (license/dependency inventories, /docs/_pr archive exclusion, target/**/gn_out caching, unified skill_tool_names ceiling & Codex/Claude queue Promote, agy InterruptResume preserving explicit successor backend/model, runtime-scoped discovery without caching transient failures, Claude dunce::simplified + USERPROFILE, and session-import synthetic bootstrap filtering) are cleanly resolved. However, 4 blocking issues remain before this PR can be merged:
1. [Regression in dfa6afc80] Subsequent turns drop updated request["instructions"], and durable mcp_catalog equality bricks existing sessions across normal upgrades/tool toggles
- Per-turn
instructionsupdates are permanently dropped after Turn 1 (plugins/agent/native/src/executor/external/agy.rs:230,claude.rs:221,codex.rs:174):Owner::input(plugins/agent/native/src/owner/queue.rs:1027-1038, 1128-1131) dynamically computesrequest.instructionson every turn frombasis.behavior(Collaboration ModePlanvsBuildprompts, assistant behavior instructions, language) plusskills::prompt(which embeds the current skill catalogrevisionrequired bySkillLoad).- Gating
request["instructions"]behind a one-way booleanif !journal.bootstrap_completed()means that once Turn 1 setsbootstrap_completed = true, all subsequent updates torequest["instructions"]are silently discarded. If a user starts Turn 1 in Plan mode (injecting read-only planning instructions) and switches to Build mode on Turn 2 to implement the plan, the native CLI never receives the Build instructions and stays locked in Plan instructions for the rest of the conversation; similarly, if.maka/skillschanges between turns, the model never receives the updatedrevisionneeded to callSkillLoad, or if Turn 1 hadinstructions: None(codex.rs:193/agy.rs:248), later behavior/skill instructions are never delivered. - Fix: Instead of a boolean
bootstrap_completed, persist the digest of the last deliveredinstructions(still running the initialagysetup turn when no native session has been bootstrapped yet soagyconfirms MCP discovery), and re-inject<maka_system_instructions>whenever theinstructionsdigest changes on a subsequent turn. Add a multi-turn test coveringinstructionschanges (e.g.Plan->Buildor updated skill metadata) on Turn 2.
- Persisting full
mcp_catalogJSON injournal::Recordand enforcing exacttool == definitionequality bricks sessions on benign upgrades or tool changes (plugins/agent/native/src/executor/external/journal.rs:78-90,mcp.rs:132, 229-237):journal.bind_catalogpermanently writes full tool JSON (name,description,inputSchema) into CAS andvalidate_catalogfails with"Native MCP catalog changed; start a new conversation"whenever any current tool definition differs even by a single word indescription(such as theSessionSenddescription update in8a2cecd84!) or when a user enables an additional tool/plugin mid-session.- Keeping the catalog consistent for a live in-memory
Endpointis fine, or refreshing the endpoint catalog when definitions change across restarts/turns is fine, but durablejournalstate must not permanently brick existing conversations over tool description edits or newly enabled tools.
2. [Incomplete fix in 8a2cecd84] Windows .cmd / .bat detection is inconsistent between executable(), discovery::query(), and command()
- In
plugins/agent/native/src/executor/external/runtime.rs:161-199anddiscovery.rs:38-69:runtime::executable(runtime.rs:162) still matches["exe", "cmd", "bat"]inPATHorder and returnsSome(path), while onlyruntime::command(runtime.rs:193-199) rejects.cmd/.bat.- Consequently,
discovery::query(discovery.rs:38-42, 73-75) reports npm-installedclaude.cmdasinstallation: "available"in Settings and the model picker, failing only when the user sends a message; forcodex.cmd/agy.cmd,discovery.rs:67(Err(_) =>) swallowscommand()'s actionable.cmd/.batdiagnostic and reportsinstallation: "available"with generic"Native protocol model discovery failed". - If an older
.cmdshim appears earlier inPATHthan a native.exe,executable()stops at the.cmdshim and fails instead of resolving the native.exelater inPATH.
- Fix: Prefer native executables (
.exe) acrossPATHbefore considering.cmd/.bat, and surface an explicit unsupported-batch-shim installation diagnostic directly indiscovery::queryas well asruntime::commandwhen only.cmd/.batis present.
3. [Required cleanup] Remove remaining legacy oar shims, rename physical namespace to "maka.agent.external", drop intra-PR #[serde(default)] shims, and remove redundant ExternalConfiguration.enabled
Maka currently makes no backward-compatibility guarantees for internal schemas, uncommitted/pre-release formats, or superseded namespaces: we always converge directly on the cleanest target design rather than carrying compatibility branches or legacy names. In addition, the rationale given for keeping these shims does not hold in the code:
- Dead
'oarSetup'recovery branches:plugins/settings/settings/settingsOperations.tsalready removed'oarSetup'and throwsUnsupported settings receipt, so the leftover'oarSetup'branches inproducts/maka/client/src/journal.rs:41,products/maka/client/src/lib.rs:118, andplugins/settings/settings/ui.tsx:165are unreachable/broken dead code. Remove'oarSetup'completely. - Physical namespace
"maka.agent.oar"->"maka.agent.external": Rename the CAS namespace inplugins/agent/native/src/executor/external.rs:155, its tests (claude.rs:840,external_history.rs:93,external_persistence.rs:34-36,external_support.rs:148,platform/event-log/tests/integration/archive/mod.rs:595-625), andplugins/agent/native/README{.md,.zh-CN.md}:63/61. - Intra-PR
#[serde(default)]onjournal::Record(plugins/agent/native/src/executor/external/journal.rs:25-35):journal::Recordis a brand-new struct introduced in this PR and should not carry#[serde(default)]compatibility attributes (last_delivered_run,bootstrap_completed,mcp_catalog) for intermediate development snapshots. - Redundant
ExternalConfiguration.enabled: bool(plugins/agent/api/src/executor.rs:47-59,plugins/agent/api/src/external.rs:58-60,packages/plugin-sdk/src/configurations.ts, and Settings UI state):"external"is a new configuration block introduced in this PR; having both top-levelenabled: boolandruntimes: { antigravity, codex, claude }duplicates enablement state. Derive overall enablement directly from any runtime switch being enabled and remove top-levelenabled.
4. [CI cache naming in f04452c37] Avoid -v2 suffix in scripts/ci/setup.mjs
scripts/ci/setup.mjs:77(andscripts/ci.test.mjs:275) renamedrust-deps-torust-deps-v2-. Avoid versioned-v2key prefixes; instead, include.github/actions/ci-setup/action.yml(or the cached path specification) in thecompilerhash input right above line 77 socompiled_prefixnaturally invalidates incomplete fallback caches whenever cached paths change.
简体中文
已审阅更新至 8a2cecd84 的最新提交(dfa6afc80 / f04452c37 / 8a2cecd84)。
上一轮提出的大部分问题(依赖与许可证清单重算、/docs/_pr 归档排除、target/**/gn_out 缓存、统一 skill_tool_names 工具上限与 Codex/Claude 队列 Promote、agy InterruptResume 保留显式 backend/model、按 runtime 限缩探测且不再缓存瞬时失败、Claude dunce::simplified + USERPROFILE 回退、session-import 过滤合成初始化轮次)均已修好。但合并前仍需解决以下 4 个阻塞问题:
1. 【dfa6afc80 新引入回归】首轮之后永久丢弃 request["instructions"] 更新,且持久化 mcp_catalog 全等校验会在正常升级/开关工具后锁死已有会话
- 第 2 轮起完全丢弃
request["instructions"](plugins/agent/native/src/executor/external/agy.rs:230、claude.rs:221、codex.rs:174):Owner::input(plugins/agent/native/src/owner/queue.rs:1027-1038, 1128-1131)在每一轮都会根据当前basis.behavior(含 Plan / Build 协作模式提示词、assistant 行为指令、语言偏好)与skills::prompt(含SkillLoad所需的最新技能目录revision)动态生成request.instructions。- 当前实现用单向布尔值
if !journal.bootstrap_completed()把指令注入一次性锁死:一旦首轮置为true,后续所有轮次的request["instructions"]都会被静默丢弃。用户第 1 轮在 Plan 模式下规划(注入只读规划指令)、第 2 轮切到 Build 模式要求落地实现时,原生 CLI 永远收不到新的 Build 指令;工作区技能变更后的新revision(或首轮instructions: None后续新增的指令)同样无法送达。 - 修复建议:不要使用单向布尔值锁死,改为记录上次已投递的
instructions摘要(agy首次会话无指令时仍执行一次空 bootstrap 以确认 MCP 懒加载),后续轮次只要instructions摘要发生变化就补发更新后的<maka_system_instructions>,并补充第 2 轮切换指令/模式的回归测试。
- 持久化
mcp_catalog逐字 JSON 相等校验会在正常升级或开启工具后废掉存量会话(journal.rs:78-90、mcp.rs:132, 229-237):journal.bind_catalog将完整工具定义(含description、inputSchema)永久写入 CAS,而validate_catalog要求当前工具定义与历史记录逐字相等(tool == definition),否则直接报错"Native MCP catalog changed; start a new conversation"。这意味着只要升级 Maka 改了某个工具description的一两个字(例如本轮刚改了SessionSend的描述),或者用户在会话中途开启了新工具/插件,存量会话就会永久报错。不要在持久化 journal 中用历史description文案锁死跨重启/升级的会话。
2. 【8a2cecd84 未修完整】Windows .cmd / .bat 在 executable()、discovery::query() 与 command() 之间行为自相矛盾
- 见
plugins/agent/native/src/executor/external/runtime.rs:161-199与discovery.rs:38-69:runtime::executable仍按["exe", "cmd", "bat"]收集候选并返回Some(path),仅在runtime::command中拦截.cmd/.bat。- 这导致
discovery::query(discovery.rs:38)把 npm 安装的claude.cmd在设置页和模型选择器中误报为available,直到发消息才失败;而codex.cmd/agy.cmd在discovery.rs:67被Err(_) =>吞掉具体报错,对外仍显示installation: "available"+ 笼统的"Native protocol model discovery failed",用户看不到.cmd/.bat诊断提示。 - 若
PATH前面有旧.cmdshim、后面有原生.exe,executable()命中.cmd就提前返回报错,找不到后面的.exe。
- 修复建议:Windows 下在整条
PATH上优先解析原生.exe;仅当没有任何.exe而存在.cmd/.bat时,在discovery::query与runtime::command中统一暴露明确的.cmd/.bat不支持诊断。
3. 【必须清理的兼容残留】移除死代码 'oarSetup'、将物理命名空间改为 "maka.agent.external"、删除新建 journal::Record 上的 #[serde(default)]、去掉冗余的 ExternalConfiguration.enabled
当前项目不提供内部状态/未发布配置的向后兼容保证,所有协议、命名空间与配置结构一律直接收敛到最干净的最终模型,不保留兼容分支或历史命名;且保留理由在代码事实上也不成立:
'oarSetup'已是无法闭环的死代码:settingsOperations.ts已移除'oarSetup'并直接抛Unsupported settings receipt,因此products/maka/client/src/journal.rs:41、products/maka/client/src/lib.rs:118、plugins/settings/settings/ui.tsx:165中的'oarSetup'分支根本无法完成恢复,应彻底删除。- 物理存储命名空间改为
"maka.agent.external":同步更新plugins/agent/native/src/executor/external.rs:155、相关测试(claude.rs:840、external_history.rs:93、external_persistence.rs:34-36、external_support.rs:148、platform/event-log/tests/integration/archive/mod.rs:595-625)及plugins/agent/native/README{.md,.zh-CN.md}:63/61,不再保留"maka.agent.oar"与测试中的旧"oar"fixture。 - 去掉新建
journal::Record上的#[serde(default)](journal.rs:25-35):journal::Record是本 PR 新引入的结构体,不应为 PR 开发期的中间本地快照保留任何#[serde(default)]。 - 去掉冗余顶层开关
ExternalConfiguration.enabled: bool(plugins/agent/api/src/executor.rs:47-59、plugins/agent/api/src/external.rs:58-60、packages/plugin-sdk/src/configurations.ts及设置页状态):"external"是本 PR 新增配置块,直接由runtimes: { antigravity, codex, claude }任一开启表达启用状态即可,删去重复的顶层enabled。
4. 【f04452c37 缓存键命名】去掉 scripts/ci/setup.mjs 中的 -v2 后缀
scripts/ci/setup.mjs:77(及scripts/ci.test.mjs:275)把缓存前缀改成了rust-deps-v2-。不要引入-v2版本号后缀;直接把.github/actions/ci-setup/action.yml(或缓存目录配置)并入第 77 行上方的compiler哈希输入即可自然更新compiled_prefix,自动隔离缺少gn_out的旧 fallback 缓存。
Deliver changed instructions only after native confirmation, refresh settled MCP catalogs without resetting conversation identity, and reuse complete discovery catalogs for scoped validation. Align Windows discovery with launchable commands. Isolate browser fixtures from real user profiles, derive cache restore keys from actual actions, and validate Cargo outputs without relying on their directory layout. Generated-by: Maka
Generated-by: Maka
Summary
delivery: "queue"never interrupts. Follow-ups preserve an explicitly selected backend.maka.agent.external, with no old-format decoder or retired setup receipt route. Runtime opt-in is controlled only byexternal.runtimes; remove the redundant top-level gate and regenerate SDK/configuration schemas.Limits: agy busy soft interruption is Unix-only. Windows requires native
.exeor explicitnode.exeplus CLI script arguments, not.cmd/.batshims. Host restart rebinds the local MCP endpoint without discarding native conversation identity.Breaking storage/configuration change
There is no in-product compatibility reader, migration fallback, or retired
oarSetuprecovery branch. Before upgrading an existing installation, settle its original pending operations on the old build and back up the stopped Root/configuration/client journals. Update the deployment source toexternalwith per-runtime opt-in; removeexternal.enabled(if it was false, first set every runtime switch to false). Old worker configuration and queued admissions are not automatically reinterpreted as native calls.An optional standalone offline migration Gist prepares a new partitions directory for the complete
cd5f02535journal format, preserving native IDs, delivery watermarks, CAS revisions and unresolved-run fences. It moves the records to the correctly routed new namespace partition; it does not modify the input databases or install/activate the result. It rejects incomplete older formats and destination collisions rather than guessing. It is not shipped with Maka. Older OAR formats need a separately reviewed offline migration or new native conversations.Verification
On macOS, using the configured default Cargo:
just check: passed — 2234 workspace tests (30 skipped), 194 tooling tests, 5 product tests and 46 terminal tests (format, generated contracts/TypeScript, tooling/product, workspace tests, terminal checks and licenses/notices).Runtime selection and full-access consent
Existing real Host / NSH render-buffer captures (not desktop screenshots); the corresponding UI test was rerun after syncing rust-preview.
AI use
Maka / OpenAI Codex: implementation, tests and documentation. Material commits carry
Generated-by: Maka.Checklist