Repository navigation
feat(agent): add durable execution and interruption recovery - #6713
Conversation
Replace physical invocation recovery with durable Agent execution, independent Host outcome and cleanup reconciliation, and original-effect recovery. Migrate CodeMode, external executors, Goal/Scheduler and product consumers; remove the superseded WorkHub/Graph domain. Generated-by: Maka
Integrate original-effect recovery, atomic Root mutations, Cell cleanup sources, and exact external-job reconciliation across native and product consumers. Replace legacy fixture-dependent tests with owned Root, SDK journal, isolated-process, and Desktop acceptance coverage and archive routing. Intermediate checkpoint: the latest macOS execution replay has 5 passing and 4 failing tests; remaining cold-recovery failures and the native wait fault-test gap are still being addressed. Desktop acceptance replay is in progress. This commit does not claim completion of the durable-execution Goal. Generated-by: Maka
Recover original native model readers with source-bound descriptors and fresh process cleanup evidence. Keep cleanup independent from known business results and preserve whole-Run cancellation across bounded frontiers, Cell obligations and late provider-executed tool observations. Wake blocked Runs only for genuine capability and custody changes, and preserve shared Root ownership and atomic project result publication. Regenerate the blocker contracts and UI consumers, complete owned-Root and cross-process acceptance cases, reject empty product test discovery, and refresh the required third-party attribution. Validation was performed in separate targeted runs with the original workspace feature union and independent archive replay: final affected Engine/State/Native packages 39 passed; earlier five-package Root replay 70 passed; original Goal/Scheduler cross-process acceptance 3 passed. Official SDK/UI contracts, native builds, product tests (2), tooling tests (169), ASF headers and license checks passed. Final Gemini adversarial review reported no P0, P1 or P2 findings. No full-platform rerun is claimed. Generated-by: Maka
Describe original-Run recovery, result and cleanup boundaries, Stop and risk handling, plus API observation and terminal-Run continuation. Generated-by: Maka (Gemini 4 Argon High)
Delete docs/_pr evidence files and the unused export-ignore rule. Generated-by: Maka
Use English for the default guide, preserve the Chinese counterpart and link both language versions. Generated-by: Maka (Gemini 4 Argon High)
|
Merge-blocking validation gap: this PR currently has no GitHub CI status, while the change spans about 1,589 files and replaces several execution/state paths. In particular, migration
Until these checks run successfully, the migration and recovery behavior cannot be assessed well enough for merge. |
Generated-by: Maka
|
Code-level review follow-up: I traced the durable recovery path through The code still needs merge-gating evidence for the failure cases it introduces:
This is a code-level validation gap in addition to the fact that the PR currently has no CI status; it is not a claim that the inspected code is already known to be incorrect. |
Generated-by: Maka
|
Update (2026-11-10): The two original source-reference regressions were corrected by merged #6732 in The Rust has advanced through #6737, #6739 and #6738 to merged #6740 at Two confirmed P2 build regressions in final commit
I read both original job logs and compared the four relevant source files with parent This is a targeted build follow-up, not a complete review of the 1,541-file change. Durable execution, recovery and migration correctness, real pre-change database upgrades, and runtime platform acceptance remain outside this completed check. The author's local compilation results do not establish that these hosted builds passed.
|
…ents on read Review of the menu redesign found two gaps. - A new draft's approval setting is null until the user picks one: it inherits the Host's setting when the conversation is created. The switch drew that as Off while the conversation would still ask for approval. It now reads Default until a value is chosen. - The ten-folder cap ran only on writes, so a list stored before it kept every folder until the next selection. Reading now caps too. The client's tests/workspaces.rs has not been compiled since #6713 removed `mod tests;` from lib.rs, so it never ran; a test beside `workspaces::set` replaces it and fails without the cap. Completion rows also keep the name whole and truncate the description first. Co-Authored-By: Claude Opus 5.5 <[email protected]> Generated-by: Claude Code (Claude Opus 5.5)
Use the standard ASF block header in the two #6737 agent-state files so the license audit recognizes them. Keep a single "plugin VM:" prefix on terminal VM failures. #6713 turned the error into an enum and formatted it with Display, nesting the prefix. Treat an interrupted model attempt with confirmed cleanup as settled when validating a history/fork cut, matching the store's own pending index. A cooperatively stopped Run no longer makes publishCheckpoint unavailable. Run the computer-use native nextest suite only on macOS. #6713 removed every Windows test its filter selected, so the Windows suite was empty and failed before any desktop verification ran; Windows keeps its compile check. Generated-by: Antigravity
Restore CI gates for VM diagnostics, settled model-attempt checkpoints, ASF headers, and native platform test selection. Keep archive initialization state out of nested cursor read futures so restored history works with the default debug Host stack. Exercise encrypted replay and rate-limit retries through the Responses WebSocket fixture. Generated-by: Antigravity Generated-by: Codex
Reconcile discovery jobs, feedback and bounded records with the durable Run and queue contracts introduced by apache#6713. Port the Host regressions to the current fixture and preserve unknown-effect cleanup semantics. Generated-by: OpenAI Codex
Turn timing describes the whole Turn at the page's fence, not a text offset, but `fragment_metadata` cleared it on every fragment after the first. The Workbench takes each fragment's timing as the row's, so a long answer read from its tail, or extended by later fragments, still lost its duration. Every fragment now keeps it, as before #6713. A snapshot found a Run's termination by decoding each of its step-less facts, which include every executor output delta, so a page could decode a long Run's whole output. Every readable snapshot has passed `ensure_metrics_metadata`, so `fact_kind` is always set; the lookup now seeks `run_terminated` through the existing per-attempt index and decodes one fact. The completed and failed Turn test now also freezes a snapshot after termination and expects the same timing as live history. Generated-by: Claude Code (Claude Opus 5.5)
#6713 removed the event-log transcript index that supplied each history row's Turn timing, left the new projection writing `timing: None`, and cleared timing on every fragment after the first. The Workbench lost every Turn duration: a running Turn read "Working…" forever and a finished one showed only its activity counts, without "Worked for", "Stopped after" or "Failed after". Timing is now derived from canonical facts both history sources hold: a Turn starts at its Run's admission and ends at its RunTerminated fact, whose Terminal gives the outcome. Live history finds that fact through the run/kind index and snapshots through the per-attempt fact_kind index, so a page costs one lookup per Run. Every fragment keeps its Turn's timing again. The history service tests assert timing for running, completed and failed Turns, and that snapshots frozen before and after termination report the same timing as live history. Generated-by: Claude Code (Claude Opus 5.5)
|
@M4n5ter I hit a startup failure while trying AGY on macOS with Full access. Sending “介绍下你自己。” never reached AGY: private workspace preparation failed four times with: The workspace contains external symlinks, including Python virtualenv interpreter links and links in local experiment directories. The Run stays in I traced this to the
I’d like to settle those constraints first, then fix the startup path and make preparation failures report the actual cause rather than appearing to wait for permissions. |
Reconcile streamed ACP output with committed history and share the desktop Host defaults. Accept Claude Code lifecycle frames before initialization and reuse the signed-in Antigravity profile for isolated native invocations. Capture Antigravity command titles through a task-scoped hook and preserve them in the original execution log for live activity and replay. Refs #6713 Generated-by: OpenAI Codex
4d4a450 (#6974) merged the per-source ignore matchers into one GitignoreBuilder and added them as .rgignore, .ignore, .gitignore. The ignore crate lets the last matching rule win, so the priority was reversed: .gitignore overrode .rgignore, and `!keep.cache` in .rgignore no longer rescued a file excluded by `*.cache` in .gitignore. Add the sources weakest first: .git/info/exclude, .gitignore, .ignore, .rgignore. The regression went unnoticed because files/tests.rs had been unreferenced since #6713. Re-attach it; the test that covers this now passes and fails without the fix. Also restore the test-only template()/flat() helpers that #6713 removed together with baseline/tests.rs, and re-attach that module. Co-Authored-By: Claude Opus 5.5 <[email protected]> Generated-by: Claude Code
…nreferenced since #6713 (#6994) Reattach the orphaned Rust test modules and restore file candidate search precedence across ignore sources. Within each source, the nearest matching directory wins. Cover a root .rgignore exception for a file ignored by a nested .gitignore. Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Wang <[email protected]> Generated-by: Claude Code Generated-by: Maka
…7082) Restore the five Codex inventory and discovery integration tests removed in #7069 (originally orphaned when #6713 deleted codex/mod.rs) and mount them from tests/integration/main.rs with a minimal DiscoveryTransport harness. Covers serverSideCompaction opt-in, comp_hash preservation/validation, ChatGPT-Account-ID mismatch rejection during discovery, and Responses wire encoding. Generated-by: Maka
English
Summary
Execution and recovery guide
InvocationIdhandoff chains and ad-hoc approval/retry checkpoints with stableRunId/StepId/ModelAttemptidentities driven by a single typed durable reconciler over a concurrent obligation frontier.maka-event-logdomain-agnostic on one exclusiveRootStoreSQLite database and introduce the one-way Agent crate boundary (facts/api/ports->state->engine->authority/native), wheremaka-agent-statefolds canonical facts and deterministic transactional indexes without owning scheduling or live grants.CallerIntentrecords (locking the originalRecoveryRefand opaque recovery descriptor) from provider receipts with independently monotonicOutcome(NotExecuted,Returned,Unknown) and physicalCleanup(Unconfirmed,Confirmed,Failed) states, atomic same-Root state/receipt commits, late authoritative settlement (OperationResolvedLate) without rewriting consumed history cuts, and per-owner content/receipt pinning.Celllifecycles, nested child-effect reconciliation, discovered tools and atomicSessionDatapublication without snapshotting VM heaps or replaying scripts on recovery.acp-executor) under privateTaskOwnercustody and scoped callback gates so caller cancellation, stream EOF or Root retirement detaches observation without fabricating task completion or assuming unconfirmed OS process exit.Goal,Scheduler,Assistant, parent/child Session contracts,@maka-agent/plugin-sdk, workbench consumers and rewritten bilingual architecture documentation (ARCHITECTURE.md,ARCHITECTURE.zh-CN.md); removeWorkHub,GraphandSwarmas requested.Breaking changes and review focus
WorkHub/Graph/Swarmcrates and public contracts without compatibility shims or dual-track recovery paths (Root migrations follow the integrated target; Agent domain schema is defined inmaka-agent-statemigrations0002–0030).CallerIntentown-journal lookup, liveOperationDispatchScopeproof,RunSpecopening bounds intersected with live workspace permissions, and single-driver claim fencing).Outcomevs.Cleanupmonotonicity,Unknowntyped blockers and human risk adjudication, same-transaction local/state publication, and independent evidence retention pins.cargo nextestarchive helper relocation (CARGO_BIN_EXE_*) across direct and extracted replay runs.Verification
The integration candidate is
feccc4c16bec41847fa7acf101ea662591d26817, includingrust-previewthrough853052bec. Prior implementation acceptance results are not counted as acceptance of this integration.cargo check --all-targets --features maka-cli/desktop-tests --locked --offline --keep-going: passed (22.18s), including the new replay-origin regressions and the real HTTP retry / same-Root reopen test sources.root-buildfailed on the retiredmaka_agent_facts::terminal::TerminalSizetest path; Windows failed on the retiredroot::windows::account_homeimport. Dependentroot-testswere skipped, not passed. Local Cargo-forkrusty_v8artifact failure was not worked around. Runtime/OS acceptance remains follow-up work.Thinkingseparated fromToolCall/output), accepted for focused follow-up rather than reported as resolved. Static review is not runtime acceptance or human review.Migration and review disposition
Merged into
rust-previewat maintainer direction asa75113d8b7d0cccf181a4d4214dab962e9124ac2, without waiting for full CI and without admin/protection bypass.TerminalSizeuses), and preserving one assistant message for reasoning + tool calls from the same attempt. No compatibility re-export shims.AI use
Select exactly one:
Tool(s) and scope: Maka using OpenAI models for implementation, migration and tests, and Google Gemini for independent adversarial static review and documentation authoring. AI review does not replace independent human review. Material AI-authored commits carry a
Generated-by: Makatrailer.Checklist
Does this PR entail a change in behavior?
简体中文
摘要
Agent 执行与恢复
RunId/StepId/ModelAttempt身份与基于并发义务前沿的单一强类型持久收敛器,取代物理InvocationId接力链及分裂的审批/重试检查点恢复路径。RootStoreSQLite 数据库上的maka-event-log领域无关,建立单向 Agent 模块分层(facts/api/ports->state->engine->authority/native);由maka-agent-state在同一写事务内追加规范事实并折叠确定性派生索引,不承载调度决策或实时权限签发。CallerIntent(锁定原始RecoveryRef与不透明恢复描述符)与提供方回执解耦,使业务结果Outcome(NotExecuted、Returned、Unknown)与物理资源清理Cleanup(Unconfirmed、Confirmed、Failed)独立单调推进;支持同 Root 纯状态变更与回执同事务原子提交、迟到权威结算(OperationResolvedLate)不改写已消费历史截点,以及按独立所有者结算的内容与回执钉住(pin)。Cell生命周期、嵌套子效果对账、动态发现工具集及同事务原子发布的SessionData,恢复时无需对 VM 堆做快照,也不重放任意脚本。acp-executor)置于私有TaskOwner物理隔离托管与受限回调门禁下;调用方取消、流 EOF 或 Root 退役仅分离观察并取消在途回调,不伪造任务完成,也不假定未确认的外部子进程已退出。Goal、Scheduler、Assistant、父子 Session 契约、@maka-agent/plugin-sdk、工作台消费端,并重写中英双语架构文档(ARCHITECTURE.md、ARCHITECTURE.zh-CN.md);按要求完整移除WorkHub、Graph与Swarm。破坏性变更与评审重点
WorkHub/Graph/Swarm相关 crate 与公共契约,不保留双轨恢复或旧格式兼容层(Root migrations 沿用整合后的目标分支,Agent 领域 schema 由maka-agent-state的0002–0030migration 管理)。CallerIntent自身账本反查、实时OperationDispatchScope派发证明、RunSpec开局上限与实时工作区权限求交集、单驱动认领栅栏)。Outcome与Cleanup独立单调推进、Unknown强类型阻塞与人工风险裁决、同事务本地/状态发布,以及独立所有者的证据保留 pin。cargo nextest归档提取重放下的跨包辅助可执行文件重定位(CARGO_BIN_EXE_*)。验证情况
本轮整合候选为
feccc4c16bec41847fa7acf101ea662591d26817,已接入rust-preview至853052bec。前一轮实现的验收结果不计作本轮整合验收。cargo check --all-targets --features maka-cli/desktop-tests --locked --offline --keep-going:通过(22.18 秒),包括新增 origin 回归及真实 HTTP 重试 / 同 Root 重开测试源码。root-build因测试仍使用旧maka_agent_facts::terminal::TerminalSize路径失败;Windows 因旧root::windows::account_home导入失败。依赖的root-tests被跳过,不能算通过。本地 Cargo fork 的rusty_v8产物问题未加兜底绕过;运行 / 平台验收留待 follow-up。Thinking与ToolCall/ 输出被拆成两条 assistant 消息的问题,接受为聚焦 follow-up,未虚报解决。静态复核不替代运行验收或人类评审。迁移与 review 裁决
已按维护者决定直接合并到
rust-preview,squash commit 为a75113d8b7d0cccf181a4d4214dab962e9124ac2;未等待整轮 CI,未使用 admin 或保护绕过。TerminalSize路径),以及同一 attempt 下 reasoning + tool call 保持为一条 assistant 消息;不增加兼容重导出垫片。AI 工具披露
仅勾选一项:
工具与范围:使用 Maka(调用 OpenAI 模型完成实现、迁移与测试,调用 Google Gemini 完成独立对抗性静态评审与文档撰写)。AI 评审不替代独立的人类评审。包含实质性 AI 编写内容的提交均附带
Generated-by: Makatrailer。检查清单
本 PR 是否包含行为变更?