diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 09ba634d..e4849069 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,6 +31,8 @@ jobs: host: blacksmith-4vcpu-ubuntu-2404 - name: windows host: blacksmith-4vcpu-windows-2025 + - name: macos + host: macos-14 runs-on: ${{ matrix.settings.host }} defaults: run: diff --git a/CHANGELOG.md b/CHANGELOG.md index adb2d32a..80f9eb79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## Desktop 1.4.3 / DeepAgent Core V4.0.4_r8 - Production reliability release + +- Persist the complete TaskRun lifecycle, including exact-retry admission, generation, owner/lease fencing, phase changes, terminal compare-and-set, result references, and a leased notification outbox. +- Split structured subagent work into a normal research phase and a bounded single-turn finalizer with an isolated tool surface, per-turn reasoning policy, strict schema validation, and no empty-success fallback. +- Preserve distinct recoverable terminal reasons for provider, schema, permission, interruption, timeout, takeover, and doom-loop failures; reject invalid tool input before execution. +- Detect semantic no-progress from tool results, workspace snapshots, and plan state instead of relying on identical command text. +- Contain subagent supervision failures with valid sibling controls, real terminal-state rendering, a local ErrorBoundary, persisted-mode validation, same-build quarantine, Electron cold-start coverage, and production source-map verification. +- Regenerate the JavaScript SDK for the durable task status and delivery contracts. + ## V4.0.4 - Contract-gap closure (engine-decoupled) - Fix Plan Gate deadlock: stale-plan latch now warns (never hard-blocks) on tool execution, aligned with codex exec-policy philosophy. A mutating tool on a stale plan receives a reminder but always runs. diff --git a/README.md b/README.md index fb0e6be3..3db9fba3 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Enterprise
-Desktop 1.4.2 · DeepAgent Core V4.0.4
+Desktop 1.4.3 · DeepAgent Core V4.0.4_r8
--- @@ -91,16 +91,18 @@ For high-risk decisions, convene an **Expert Panel**. Correctness, security, per Project IM brings people and agents into the same thread. Mention an agent to start a scoped run with project context, stream its progress, inspect its artifacts, and keep the answer attached to the conversation that requested it. -## DeepAgent Core V4.0.4 +## DeepAgent Core V4.0.4_r8 -V4.0.4 closes production contract gaps while keeping the current turn engine stable: +Desktop 1.4.3 ships the eighth reliability revision of the V4.0.4 contract. This release hardens the boundaries where long-running and delegated work previously risked duplicate execution, ambiguous completion, or renderer-wide failure: -- **Single durable truth:** DocumentStore uses atomic, recoverable writes for documents, plans, learning candidates, governance state, and version conflicts. -- **Isolated subagents:** write-capable subagents use dedicated worktrees by default and return their changes to the parent workspace through a bounded, conflict-aware path. -- **Reliable event delivery:** the Event Bus has a transport seam, durable consumer offsets, offline catch-up, real priority ordering, and observable queue depth. -- **Governed learning and goals:** knowledge promotion is tied to review evidence and ship-gate snapshots; event-driven goal ticks remain idempotent and respect quiet hours. -- **Secure integrations:** MCP credentials use environment references or native OS secret storage on macOS, Linux, and Windows; capability and source checks fail closed. -- **Publishing truth:** installation, CLI examples, release metadata, public domains, and supported-version documentation match the product that is actually shipped. +- **Durable subagent execution:** TaskRun admission, generation, ownership, leases, settlement, and parent delivery are persisted. Exact retries reconcile to the original run, terminal state uses transactional compare-and-set, and a leased outbox makes completion delivery recoverable without re-running provider work. +- **Two-stage structured finalization:** research and structured output are separate phases. The finalizer is a bounded single turn with thinking disabled when supported, only the `StructuredOutput` tool visible, no historical task or compaction payload, and no empty-success path. +- **Fail-closed model and tool boundaries:** provider capability decisions no longer silently relax required tool choice, invalid tool input is rejected before execution, and provider, schema, permission, interruption, timeout, and doom-loop failures keep distinct recoverable terminal reasons. +- **Semantic no-progress protection:** shell activity uses semantic fingerprints, while the no-progress budget compares bounded results, workspace state, and plan progress so cosmetic command changes cannot evade loop detection. +- **Contained supervision UI:** subagent controls use valid sibling interactions, display real terminal state, and run behind a local ErrorBoundary with retry, close, persisted-mode validation, same-build quarantine, and recovery after build changes. +- **Release-grade verification:** the affected Core, runtime, app, and desktop paths are covered by exact-retry, failure-injection, production Chromium, Electron cold-start, and source-map smoke tests. + +V4.0.4_r8 retains the durable documents, event delivery, governed learning, isolated worktrees, and secure credential boundaries introduced across the earlier V4.0.4 revisions. ## Installation diff --git a/README.zh.md b/README.zh.md index e6dde70a..4b1b3c38 100644 --- a/README.zh.md +++ b/README.zh.md @@ -14,7 +14,7 @@ Enterprise 版本 -桌面版 1.4.2 · DeepAgent Core V4.0.4
+桌面版 1.4.3 · DeepAgent Core V4.0.4_r8
--- @@ -91,16 +91,18 @@ DeepAgent 可以把独立工作拆分给数量有界、相互隔离的 Worker。 项目 IM 把团队成员和智能体放进同一条讨论。@ 某个智能体即可启动有明确作用域的运行,使用项目上下文、流式展示进度、关联执行工件,并把答案留在发起任务的对话里。 -## DeepAgent Core V4.0.4 +## DeepAgent Core V4.0.4_r8 -V4.0.4 在保持当前 turn 引擎稳定的前提下,关闭生产合同缺口: +桌面版 1.4.3 搭载 V4.0.4 合同的第八次可靠性修订。本次发布重点加固长任务和委派任务的关键边界,避免重复执行、模糊终态或局部界面故障演变为整页崩溃: -- **单一持久真相:** DocumentStore 通过原子、可恢复写入统一管理文档、计划、学习候选、治理状态和版本冲突。 -- **隔离子智能体:** 具备写权限的子智能体默认使用独立 worktree,并通过有界、可感知冲突的路径把改动回传到父工作区。 -- **可靠事件投递:** Event Bus 提供可替换 transport、持久 consumer offset、离线补投、真实优先级排序和可观测队列深度。 -- **受治理的学习与目标:** 知识晋升关联审阅证据与 ship-gate snapshot;事件驱动 goal tick 保持幂等并遵守 quiet hours。 -- **安全集成:** MCP 凭据使用环境变量引用或 macOS、Linux、Windows 原生 secret storage;capability 与来源检查逐层失败关闭。 -- **发布真实性:** 安装方式、CLI 示例、发布元数据、公开域名和支持版本文档与实际交付产品一致。 +- **持久化子智能体执行:** TaskRun 的准入、generation、owner、lease、结算与父会话投递均持久化。exact retry 会归并到原始运行,终态通过事务 CAS 结算,租约式 outbox 可在不重复执行 provider work 的前提下恢复完成通知。 +- **两阶段结构化终结:** 研究和结构化输出分为独立阶段。finalizer 是次数有界的单轮执行;在 provider 支持时关闭 thinking,只暴露 `StructuredOutput`,不混入历史 task 或 compaction 内容,也不存在空结果成功路径。 +- **失败关闭的模型与工具边界:** provider capability 决策不再静默放宽 required tool choice;无效工具输入在执行前被拒绝;provider、schema、permission、interruption、timeout 与 doom-loop 保留不同且可恢复的终态原因。 +- **语义级无进展保护:** shell 使用语义 fingerprint;无进展预算同时比较有界结果、工作区状态与计划进度,不能再靠改写命令描述绕过循环检测。 +- **故障隔离的监督面板:** 子智能体控件使用合法的 sibling interaction,展示真实终态,并由局部 ErrorBoundary、重试/关闭、持久 mode 校验、同 build quarantine 与 build 变化后的恢复机制保护。 +- **发布级验证:** 受影响的 Core、运行时、App 与 Desktop 路径已覆盖 exact retry、故障注入、production Chromium、Electron 冷启动和 source-map smoke。 + +V4.0.4_r8 同时保留此前 V4.0.4 各修订建立的持久文档、可靠事件投递、知识治理、worktree 隔离与安全凭据边界。 ## 安装 diff --git a/bun.lock b/bun.lock index 78ae30c8..eec42051 100644 --- a/bun.lock +++ b/bun.lock @@ -29,7 +29,7 @@ }, "packages/app": { "name": "@deepagent-code/app", - "version": "1.4.0", + "version": "1.4.3", "dependencies": { "@codemirror/autocomplete": "6", "@codemirror/commands": "6", @@ -129,7 +129,7 @@ }, "packages/core": { "name": "@deepagent-code/core", - "version": "1.0.0-beta", + "version": "4.0.4-r8", "bin": { "deepagent-code": "./bin/deepagent-code", }, @@ -281,6 +281,7 @@ "@zip.js/zip.js": "2.7.62", "ai": "catalog:", "ai-gateway-provider": "3.1.2", + "ajv": "8.20.0", "bonjour-service": "1.3.0", "chokidar": "4.0.3", "cross-spawn": "catalog:", @@ -344,7 +345,7 @@ }, "packages/desktop": { "name": "@deepagent-code/desktop", - "version": "1.4.2", + "version": "1.4.3", "dependencies": { "@zip.js/zip.js": "2.7.62", "effect": "catalog:", @@ -359,7 +360,9 @@ "@actions/artifact": "4.0.0", "@deepagent-code/app": "workspace:*", "@deepagent-code/ui": "workspace:*", + "@jridgewell/trace-mapping": "0.3.31", "@lydell/node-pty": "catalog:", + "@playwright/test": "catalog:", "@sentry/solid": "catalog:", "@sentry/vite-plugin": "catalog:", "@solid-primitives/i18n": "2.2.1", diff --git a/design/README.md b/design/README.md index 384f9236..07baa4b9 100644 --- a/design/README.md +++ b/design/README.md @@ -1,6 +1,6 @@ # DeepAgent Code Architecture & Design -> **Public design overview for DeepAgent Core V4.0.4 / Desktop 1.4.2.** Internal implementation details and roadmap documents live in the private `docs/` tree and are intentionally not version-controlled. +> **Public design overview for DeepAgent Core V4.0.4_r8 / Desktop 1.4.3.** Internal implementation details and roadmap documents live in the private `docs/` tree and are intentionally not version-controlled. DeepAgent Code is a document-centered, event-driven AI coding system. It combines a coding-agent runtime with a durable control plane that owns context, planning, learning, collaboration, safety, and human oversight. @@ -22,7 +22,13 @@ Sessions, inputs, plans, documents, goals, events, approvals, and learning decis A user instruction is durably admitted before execution is scheduled. A successful API response therefore means the instruction is recorded, not merely present in a process-local queue. -DeepAgent is built **on top of** the opencode agent/runtime/session/tool/MCP stack. V4.0.4 strengthens the control plane without replacing the current turn engine, tool system, or provider layer. +DeepAgent is built **on top of** the opencode agent/runtime/session/tool/MCP stack. V4.0.4_r8 strengthens the control plane without replacing the current turn engine, tool system, or provider layer. + +### Durable delegated execution + +A delegated task is admitted before provider work begins and is identified independently from the tool-call attempt that submitted it. Exact retries reconcile to the same TaskRun; conflicting reuse fails closed. Generation, execution owner, lease, phase, terminal state, result reference, and parent-notification delivery are durable records. Active mutations and terminal settlement require the expected generation, owner, and live lease, while notification delivery uses an attempt-fenced outbox so crash recovery cannot repeat provider work or acknowledge another claimant's delivery. + +Structured work uses two explicit stages. The research stage retains the child Agent's normal tools and transcript. The finalizer is a bounded, single provider turn with a narrow ephemeral tool registry, no task or compaction history, no ordinary steering, and a per-turn reasoning/tool-choice decision derived from provider capability. Completion is valid only after schema-validated structured output is persisted; provider, schema, permission, timeout, interruption, and no-progress failures remain distinct recoverable states. ### 2. One durable authority per concern diff --git a/packages/app/README.md b/packages/app/README.md index 1bf37cbd..43e278ff 100644 --- a/packages/app/README.md +++ b/packages/app/README.md @@ -2,6 +2,8 @@ SolidJS front-end shell for the DeepAgent Code desktop app (Electron/Tauri). +Current release: Desktop 1.4.3, powered by DeepAgent Core V4.0.4_r8. + ## Stack - **UI:** SolidJS + Vite (Bun) diff --git a/packages/app/e2e/regression/subagents-panel.spec.ts b/packages/app/e2e/regression/subagents-panel.spec.ts new file mode 100644 index 00000000..59259158 --- /dev/null +++ b/packages/app/e2e/regression/subagents-panel.spec.ts @@ -0,0 +1,191 @@ +import { expect, test, type Page } from "@playwright/test" +import { base64Encode } from "@deepagent-code/core/util/encode" +import { mockDeepAgentCodeServer } from "../utils/mock-server" +import { expectAppVisible } from "../utils/waits" + +const directory = "C:/DeepAgent Code/SubagentPanel" +const projectID = "proj_subagent_panel" +const parentID = "ses_subagent_parent" +const slug = base64Encode(directory) +const sessionKey = `local\u0000${slug}/${parentID}` + +const parent = { + id: parentID, + slug: "subagent-parent", + projectID, + directory, + title: "Subagent parent", + version: "dev", + time: { created: 1_700_000_000_000, updated: 1_700_000_000_000 }, +} + +const child = (id: string, title: string, updated: number, state: string, reason: string) => ({ + id, + slug: id, + projectID, + directory, + parentID, + title, + version: "dev", + metadata: { + deepagent: { + subagent: { finished: state !== "researching", state, reason, run_id: `run_${id}`, generation: 1 }, + }, + }, + time: { created: updated - 1, updated }, +}) + +async function openPersistedPanel(page: Page, children: ReturnType{entry.hash.slice(0, 8)}
+