Skip to content

Tracking: ACP client support in Maka Desktop, with Antigravity as the first integration (follow-up to #3132) #5103

Description

@Sun-GLiang
English

Problem

This is a follow-up tracking issue for #3132, specifically the ACP client / Antigravity use case.

The two directions are distinct:

Users need to select an external execution agent, authenticate it, and use it through Maka's existing conversation interface. Adding each agent as a bespoke chat integration would duplicate session, interaction, history, and UI logic. Treating a complete external agent as an AI SDK model provider would also conflate agent-owned execution with Maka-owned model/tool execution.

This work does not expand the server scope of #3132 or restore the retired gemini-cli / Antigravity account-provider preview from #3054. The new integration uses Google's official ACP agent as a separate execution backend.

Desired outcome

User-visible result

A user can configure a locally installed official Antigravity ACP executable, sign in with Google, select Antigravity and a model in the Maka Desktop composer, and complete a coding task through Maka. The existing conversation surface shows streamed replies, tool activity, output, file diffs, permission choices, and agent questions. The user can stop execution and, after restarting, resume the same external session.

The Antigravity process runs behind Maka; this does not embed the Antigravity IDE.

Desktop design: a unified executor and model picker

Follow the interaction structure of T3 Code's ProviderModelPicker and ModelPickerSidebar, using Maka's existing UI primitives and styling.

Extend the existing composer model entry instead of adding a separate “Maka vs. external agent” toggle. The trigger shows the selected executor icon and model. Its popover has an executor rail on the left and that executor's model choices on the right:

[Executor icon · Model name v]  [Supported mode v]

+--------------------+--------------------------------+
| Execution agent    | Search models                  |
|                    |                                |
| * Maka             | Models for this executor       |
|   Antigravity      |   Model A                      |
|                    | * Model B                      |
|                    |   Model C                      |
|                    |                                |
| Manage agents      | Connection state / setup       |
+--------------------+--------------------------------+
  • Selecting the left rail browses an executor; selecting a model commits the complete executor/model choice and closes the popover.
  • The Maka branch retains its existing connection groups and model choices. The Antigravity branch uses models returned by its account/session configuration, without inventing an LLM connection.
  • An unconfigured or unauthenticated Antigravity entry can show setup/login actions, but cannot be committed as an executable selection.
  • Initially, Maka does not override the model or mode: use the current values returned when the ACP agent creates a session. Show the concrete values when available and an honest “Agent default” label otherwise. This does not promise to inherit the user's Antigravity IDE model selection. Verify that omission is supported; if the agent requires explicit configuration, include the necessary selection and application in PR 2 rather than deferring them to PR 4.
  • New drafts retain Maka's existing defaults. Do not add new global remembered-selection or project-precedence rules in this scope.
  • Switching executors preserves draft text and attachments. Unsupported attachments remain visible with an actionable validation message; they are not silently removed or sent.
  • Once a task exists, its executor is fixed. Model changes are allowed only while idle and when supported. Other executors explain that switching requires a new task.
  • Do not copy T3's favorites, multi-account management, or entire advanced-settings surface.
Desktop surface Change
Settings Add External Agents for official installation or existing-program selection, connection checks, Google sign-in, and diagnostics.
Composer Extend the existing model entry with the unified picker; show only supported mode controls.
Conversation Reuse existing message, tool-output, and diff presentation.
Interaction area Reuse forms for external permission options and agent questions.
Task/history surface Identify the executor and show interrupted, restoring, and restore-failed states.

Task Entry continues to supply the Host/project target. Executor selection and submission belong to the existing composer/task-creation flow, not a new responsibility inside Task Entry.

Architecture: Plugin-backed ACP executors

PR #5283 changed the extension seam after this issue was written. External execution is selected by Session.executorId and routed through the generic Plugin executor authority. ACP is now a Plugin-owned runtime behind that seam, not a second Host backend registry.

flowchart LR
  Desktop["Maka Desktop"] -->|"executorId + executor config"| Session["Maka Session"]
  Session --> Backend["PluginExecutorBackend"]
  Backend --> Registry["PluginExecutorService"]
  Registry --> Runtime["ACP Runtime Plugin / ctx.acp"]
  Runtime --> Adapter["Antigravity adapter Plugin"]
  Adapter --> Agent["Official Antigravity ACP process"]
  Runtime -->|"generic output events"| Backend
  Backend --> Events["Canonical Session events"]
  Runtime -->|"permission / question"| Forms["Hosted interaction authority"]
Loading
flowchart TB
  Profile["Profile Plugin root"] --> AcpEntry["acp-runtime Entry"]
  AcpEntry --> Service["AcpRuntimeService provides ctx.acp"]
  AcpEntry --> AdapterEntry["antigravity-acp child Entry"]
  AdapterEntry -->|"ctx.acp.register(adapter, config)"| Service
  Service -->|"ctx.executors.register(provider)"| Executor["generation-pinned executor"]
Loading
Layer Responsibility
Maka Runtime Executor routing, scoped/generation-pinned registration, task/run admission, canonical persistence, subscriptions, and Hosted interactions.
ACP Runtime Plugin ACP SDK/stdio, process ownership, ACP Session lifecycle, file callbacks, cancellation, common configuration, and event projection.
Agent adapter Plugin Executor identity, executable/helper, environment, authentication/model quirks, and provider-specific event interpretation.
Desktop Generic executor/model presentation and task-creation intent; no Antigravity-specific conversation state.

PR #5164 remains the merged installation/authentication bootstrap. Until Plugin configuration and authorization have a complete Desktop contribution surface, PR 2 bridges its RuntimePolicy facts into a system-managed Antigravity adapter Entry. This bridge must not become a parallel execution path.

The official ACP SDK is used rather than reimplementing JSON-RPC. Future ACP Agents implement the adapter contract and reuse the runtime; non-ACP Agents can register another generic Plugin executor. Every production contract must ship with its real producer and consumer in the same PR.

Protocol, interaction, and lifecycle rules

  • Use a local stdio connection and one external process per active task, owned by the Host. In PR 2, an active task includes a live session waiting for its next turn: retain its process while idle. Closing the UI does not implicitly stop a task. Retirement and Host shutdown clean up owned processes, including owned helpers. PR 2 must handle crashes, cancellation races, and cleanup itself; process loss leaves readable history with continuation explicitly unavailable until restoration is delivered.
  • Convert text, tool activity, output, diffs, and completion into existing backend events. Merge partial updates by tool-call ID and preserve arrival order. Add shared event fields only with a same-PR producer and consumer.
  • External tool notifications are observations, not instructions for Maka to execute the same tool. Do not fabricate Maka tool-dispatch journal entries.
  • Use HostedInteractionBridge.admitFormRequest for external option-based interactions. Map the ACP option ID to the form's single_select.value and its display text to label; return the original ID through the existing settlement path.
  • Clearly identify external permission requests and preserve the agent's allow/deny choices. Do not reinterpret them as Maka sandbox grants or route them through legacy permission events. Antigravity-specific question detection stays in its adaptation code.
  • Implement the verified, necessary ACP text-file callbacks with workspace/path/symlink checks. Do not advertise terminal capability. Do not claim that agent-owned tools run inside Maka's built-in sandbox.
  • Cancellation settles outstanding interactions, sends ACP cancel, and continues consuming updates until the prompt finishes. A bounded timeout terminates the owned process and records interruption rather than false successful cancellation. Preserve the actual stop reason.
  • Maka stores visible history; the external agent owns its execution context. A crash does not automatically resend a prompt.
  • Restore through negotiated resume/load support. Load replay is handled as restoration, not appended as a new turn. Define replay deduplication and reconciliation when the agent has progressed beyond Maka's last durable event; do not blindly discard or append all replay. If history cannot be reliably aligned, show an explicit history-gap/restoration status instead of claiming intact history. Failure keeps history readable and offers retry/new task without silently replacing the external session or resending a prompt.
  • Use a Maka-managed or user-installed official Antigravity ACP distribution, including its matching helper. The official process owns credentials. Do not assume IDE login is reusable.

PR1 setup behavior has now been exercised with official ACP 1.1.1 on macOS arm64; see #5164. Task execution, model/mode and restoration behavior are not established by these setup checks. Record and verify the actual version/platform, authentication, event shapes, cancellation, and restoration before relying on them. T3's Antigravity adapter is an implementation reference, not a substitute for real-agent acceptance.

Pre-implementation verification

Verify the official binary before implementing the behavior that depends on it; record the actual version/platform and sanitized evidence. Reference code and negotiated protocol support do not replace real-agent checks.

  • Before PR 1 authentication: verify official server/helper layout, initialization, authentication methods, authorization-link output, authentication completion and process exit. Connection checks must not log in, create a session or send a prompt. PR1 setup evidence is recorded in feat(desktop): install and configure Antigravity ACP #5164.
  • Before PR 2 execution: verify session creation, omitted model/mode initialization, required file callbacks, text/tool/diff/permission/question events, multi-turn prompting and cancellation. Probe cross-process resume/load feasibility here as well, so the task binding does not assume unverified restoration behavior.
  • Before PR 3 restoration: verify restoration of the same session across process restarts, replay shape, deduplication and crash-window reconciliation before implementing persistence/restoration behavior.
  • Before PR 4 configuration: verify actual model/mode discovery, selection/application and failure behavior. Configuration required to execute belongs in PR2 and must be verified there.

If required behavior is unavailable, revise that PR's scope and acceptance criteria before implementation. Do not record credentials or private project content. Completing PR1 setup checks does not mark task, model or restoration behavior as verified.

Incremental PR plan

The roadmap remains four PRs: PR 1 setup/authentication → PR 2 complete Plugin-backed execution and usable model selection → PR 3 restoration → PR 4 modes and catalog lifecycle. PR 2 stays one vertical PR. Its work is grouped into four reviewable producer-to-consumer sets; no group is complete until its producer, contract, consumer, and acceptance test are all present.

  • PR 1 — Install, configure, connect, and authenticate from Settings — merged in feat(desktop): install and configure Antigravity ACP #5164.

    • Install or select the official Antigravity ACP distribution, verify it, and persist executable facts through RuntimePolicy.
    • Check connectivity and complete Google authentication without creating a task or sending a prompt.
    • Clean up temporary server/helper processes and cover integrity, persistence, stale-result protection, localization, diagnostics, and real macOS arm64 setup evidence.
    • Transition boundary: PR 1 produces setup/authentication facts; PR 2 consumes them to materialize Plugin configuration. PR 1 never executes a task.
  • PR 2 — Plugin-backed external-Agent execution and usable model selection — merged in feat(desktop): complete Antigravity ACP plugin execution #5224 on 2026-09-23 (0cb4fc32bdff3587bd5cc609fbe0eb28efa4233f).

    Set A — setup facts → active Plugin executor

    • Rebuild on feat(runtime): add plugin-backed Session executors #5283 using executorId, PluginExecutorService, and PluginExecutorBackend without ACP-specific Session/Core/Storage/backend-registry branches.
    • Add the shared ACP Runtime Plugin and thin Antigravity adapter contract.
    • Ship both production Plugin bundles with Runtime Host/Desktop and project the PR 1 executable/helper path into content-addressed, system-managed packages and an adapter Entry without exposing RuntimePolicy authority to either Plugin.
    • Verify production-bundle install, idempotent reconcile/restart, config replacement, setting clear, package removal, and executor registration/inspection.
    • Project unavailable and authentication-required readiness through the generic executor catalog/inspection consumed by Desktop before Session creation (owned by Set B).

    Set B — provider catalog → Desktop choice → first ACP prompt

    • Add a generic executor catalog/configuration contract with an Antigravity producer and Desktop consumer. Discovery may use a bounded short-lived ACP probe but must not create a Maka task or retain a preview Session/process.
    • Extend the existing upstream/main model menu with generic executor browsing and model selection; preserve draft text, attachments, and Maka model state.
    • Atomically persist executor plus selected model at task creation and consume that exact value when creating the ACP Session before its first prompt. Existing tasks keep a fixed executor and confirmed model; unavailable values are never silently replaced.
    • Connect unconfigured, unavailable, and login-required catalog states to PR 1 setup before Maka Session creation.

    Set C — ACP updates/interactions → canonical conversation → ACP settlement

    • Implement retained per-conversation ACP processes/Sessions, initialize/new/prompt, multi-turn text/thought/tool projection, canonical file diffs, file callbacks, permission choices, failure mapping, cancellation, retirement, and process-tree cleanup.
    • Add generic Agent-question interaction support; keep provider-specific detection in the adapter and round-trip original option identity through Hosted Forms.
    • Ensure unsupported attachments/native-only operations remain visible with actionable validation and do not delete draft content.
    • Verify ordered partial updates, tools/diffs, permission/question settlement, follow-up, cancellation races, crashes, cleanup, and existing conversation rendering.

    Set D — process continuity facts → safe task readiness

    • Persist a continuity marker and refuse silent replacement after Host/Plugin restart or process loss.

    • Project history-only/process-lost readiness through generic Session/Desktop state with retry/new-task guidance; loading history must not launch an Agent.

    • Repeat sanitized controlled-process and official Antigravity acceptance on the rebuilt Plugin path, including authentication, model application, task isolation, follow-up, interactions, cancellation, and process loss.

    • Complete full CI, final review, and merge feat(desktop): complete Antigravity ACP plugin execution #5224.

    • End-to-end producer → consumer: PR 1 setup facts → system-managed adapter Entry → provider catalog/configuration → generic Desktop executor/model choice → Session executorId and config → Plugin executor → canonical events/Hosted Forms → follow-up, model change, stop, or history-only readiness.

    • Acceptance: the official Agent completes the Desktop flow through follow-up and cancellation; multiple tasks reuse catalog data but own independent Sessions; restart remains explicit history-only until PR 3.

    • Merge evidence: feat(desktop): complete Antigravity ACP plugin execution #5224 is merged; its reported checks have no failures (CLI Eval was skipped). Acceptance record. PR 2 execution reused an existing Google login; expired-auth recovery and complete cross-process restoration remain unverified. Bounded idle-process retention is tracked separately in Define bounded retention for ACP client processes #5620.

  • PR 3 — Restore the same external Session and reconstruct its process — planning started on 2026-09-24; implementation begins with the real-Agent restoration verification gate.

    • Verify cross-process resume/load and replay behavior against the supported official Antigravity version.
    • Extend the ACP Runtime/adapter contract with durable external-session identity and explicit create-versus-restore paths; restoration never falls back to session/new.
    • Restore lazily on continuation, reconcile replay with canonical history, handle crash windows, and expose restoration/history-gap states without resending an interrupted prompt.
    • Complete controlled-process tests, real-Agent verification, Desktop readiness states, documentation, and troubleshooting.
    • Acceptance: restart and continue the same real external Session with intact context and no duplicate history; failure remains readable and never creates a replacement Session.
  • PR 4 — Supported modes and model-catalog lifecycle

    • Reuse PR 2's generic executor catalog/configuration contract for modes; do not add another discovery path or Agent-specific picker.
    • Add provider-owned catalog scope, account/catalog invalidation, refresh reconciliation, and confirmed idle-only mode/model changes.
    • Revalidate selected values without silent substitution and keep live task configuration independent from draft refresh.
    • Cover keyboard navigation, focus return, narrow windows, localization, caching, and invalidation.
    • Acceptance: selected model/mode affects execution, cached catalogs appear immediately, invalid choices are explicit, and refresh scope is correct.

Final acceptance criteria

  • With a recorded official Antigravity version, complete the Desktop path: configure → Google sign-in → select Antigravity/model → create task → edit and test → inspect tools/diffs → answer interactions → follow up → cancel → restart and continue the same external session.
  • Maka and every external Agent provide candidates through provider-owned catalog/configuration logic and render them through the same upstream/main-style model menu; adding another provider does not duplicate Composer or Host orchestration.
  • Selecting an external Agent exposes cached candidates immediately. Concurrent or subsequent new tasks reuse catalog data while keeping independent external sessions and selected configurations.
  • Existing tasks cannot switch executor. Model/mode changes are idle-only, Agent-confirmed, and never silently substituted after account/catalog changes.
  • Unsupported attachments and operations remain visible with actionable validation and never lose draft content.
  • Controlled ACP-process tests cover event ordering, partial updates, option identity, first-prompt configuration, cancellation races, crashes, cleanup, catalog caching/invalidation, and restoration.
  • Real-agent checks cover authentication, actual tools/session behavior, model/mode application, and cross-process restoration; fixtures contain no tokens or private project content.
  • Existing Maka execution remains functional, and shared ACP dependency changes preserve the maka --acp server path.
  • Every new production interface, field, or capability has a real same-PR consumer; shared behavior stays behind the provider/backend seams instead of spreading into Agent-specific UI branches.

Initial scope

Local Maka Desktop on macOS arm64, local Runtime Host, and an official Antigravity ACP process installed through an explicit Install action or selected by the user. Out of scope: automatic discovery/upgrades, remote execution/OAuth forwarding, multi-account management, external subagent orchestration, steering, rewind, and cross-agent continuation. TUI product work is deferred while the Host implementation remains reusable.

Alternatives or workarounds

  • Use Antigravity separately: possible today, but does not provide the unified Maka task/history/interaction experience.
  • Wrap Antigravity as an AI SDK model provider: rejected because a complete agent owns session state and tools, unlike a model call. Use a sibling AgentBackend implementation instead.
  • Build a separate external-agent chat stack: rejected because Maka already has execution, interaction, persistence, and presentation seams.
  • Embed the IDE or wrap the ordinary CLI: unnecessary for this scope because an official ACP distribution exists.
  • Implement infrastructure-only PRs before wiring UI consumers: rejected; the PRs above deliver vertical production slices.

This proposal was prepared with AI assistance from the design discussion. Real-binary verification remains an explicit implementation and acceptance requirement.

中文

问题

这是 #3132 的后续追踪 issue,对应其中提出的 ACP client / Antigravity 使用案例。

两个方向需要区分:

用户需要选择外部执行者、完成认证,并通过 Maka 现有聊天界面使用它。如果每接入一个 Agent 都单独实现聊天集成,就会重复建设会话、交互、历史和 UI。如果将完整外部 Agent 当作 AI SDK 模型 provider,则会混淆外部 Agent 自己管理的执行循环与 Maka 管理的模型调用和工具执行。

本方案不扩大 #3132 的服务端范围,也不恢复 #3054 已退役的 gemini-cli / Antigravity 账户 provider 预览。新的接入方式是将 Google 官方 ACP Agent 作为独立执行 backend。

期望结果

用户最终看到的效果

用户配置本地安装的官方 Antigravity ACP 程序,完成 Google 登录,在 Maka Desktop 输入框中选择 Antigravity 和模型,然后通过 Maka 完成编码任务。现有聊天界面展示流式回复、工具活动、输出、文件 diff、权限选项和 Agent 提问。用户可以停止执行,并在重启后恢复同一个外部会话。

Antigravity 进程在 Maka 后台运行,不嵌入 Antigravity IDE。

Desktop 设计:统一的执行者与模型选择器

参考 T3 Code 的 ProviderModelPicker 与 ModelPickerSidebar 的交互结构,使用 Maka 已有 UI 基础组件与样式实现。

扩展现有 Composer 模型入口,不增加独立的“Maka / 外部 Agent”开关。按钮显示当前执行者图标和模型,展开后左侧切换执行者,右侧显示其模型:

[执行者图标 · 模型名称 ▾]  [支持的模式 ▾]

┌──────────────────┬────────────────────────────┐
│ 执行者           │ 搜索模型                   │
│                  │                            │
│ ● Maka           │ 当前执行者的模型列表       │
│   Antigravity    │ ○ 模型 A                   │
│                  │ ● 模型 B                   │
│                  │ ○ 模型 C                   │
│                  │                            │
│ 管理外部 Agents  │ 连接状态 / 设置入口        │
└──────────────────┴────────────────────────────┘
  • 点击左侧只切换浏览的执行者;选择模型才提交完整的“执行者 + 模型”选择并关闭浮层。
  • Maka 分支保留现有连接分组和模型选择。Antigravity 分支使用其账户或会话配置返回的模型,不伪造 LLM connection。
  • 未配置或未登录的 Antigravity 可以展示设置、登录入口,但不能提交为可执行选择。
  • 首版不主动覆盖模型或模式,使用 ACP Agent 新建会话时返回的当前值;返回具体值时展示实际值,否则准确显示“Agent 默认”。不承诺继承用户本地 Antigravity IDE 的模型选择。必须验证是否允许省略配置;若 Agent 要求显式配置,必要的选择与应用必须纳入 PR 2,不能推迟到 PR 4。
  • 新草稿继续使用 Maka 现有默认配置,首期不新增全局选择记忆或项目优先级规则。
  • 切换执行者保留草稿文本和附件。不支持的附件继续显示,并提供可操作的校验提示,不静默删除或发送。
  • 任务创建后执行者固定。仅在空闲且支持时允许修改模型;选择其他执行者时提示需要新建任务。
  • 不复制 T3 的收藏、多账户管理或完整高级设置界面。
Desktop 界面 改动
设置 新增「外部 Agents」,安装官方程序或选择已有程序、检查连接、Google 登录与诊断。
Composer 扩展现有模型入口为统一选择器,仅展示支持的模式控制。
聊天 复用现有消息、工具输出和 diff 展示。
交互区域 复用表单展示外部权限选项和 Agent 提问。
任务与历史 标识执行者,展示中断、恢复中和恢复失败状态。

Task Entry 继续提供 Host 与项目目标。执行者选择及提交属于现有 Composer / 任务创建流程,不向 Task Entry 加入新的会话创建职责。

架构:基于 Plugin executor 接入 ACP

本 issue 编写后,PR #5283 已提供新的通用外部执行 seam:由 Session.executorId 选择执行者,并统一经过 Plugin executor 权威链路。ACP 现在位于该 seam 后方,由 Plugin 管理,不再向 Host 增加第二套 backend registry。

flowchart LR
  Desktop["Maka Desktop"] -->|"executorId + executor config"| Session["Maka Session"]
  Session --> Backend["PluginExecutorBackend"]
  Backend --> Registry["PluginExecutorService"]
  Registry --> Runtime["ACP Runtime Plugin / ctx.acp"]
  Runtime --> Adapter["Antigravity adapter Plugin"]
  Adapter --> Agent["官方 Antigravity ACP 进程"]
  Runtime -->|"通用输出事件"| Backend
  Backend --> Events["权威 Session 事件"]
  Runtime -->|"权限 / Agent 提问"| Forms["Hosted interaction 权威"]
Loading
flowchart TB
  Profile["Profile Plugin root"] --> AcpEntry["acp-runtime Entry"]
  AcpEntry --> Service["AcpRuntimeService 提供 ctx.acp"]
  AcpEntry --> AdapterEntry["antigravity-acp 子 Entry"]
  AdapterEntry -->|"ctx.acp.register(adapter, config)"| Service
  Service -->|"ctx.executors.register(provider)"| Executor["按 generation 绑定的 executor"]
Loading
层级 职责
Maka Runtime 执行者路由、作用域/generation 绑定、任务与 run 准入、权威持久化、订阅及 Hosted interaction。
ACP Runtime Plugin ACP SDK/stdio、进程所有权、ACP Session 生命周期、文件回调、取消、通用配置及事件投影。
Agent adapter Plugin 执行者身份、程序/helper、环境、认证/模型差异及 provider 特有事件解释。
Desktop 通用执行者/模型展示和任务创建意图;不保存 Antigravity 专属聊天状态。

已合入的 PR #5164 继续作为安装与认证 bootstrap。在 Plugin 配置和授权尚无完整 Desktop contribution surface 期间,PR 2 将其 RuntimePolicy 事实桥接为系统管理的 Antigravity adapter Entry;该桥接不能形成并行执行路径。

使用官方 ACP SDK,不重新实现 JSON-RPC。后续 ACP Agent 只实现 adapter contract 并复用共享 runtime;非 ACP Agent 可以注册其他通用 Plugin executor。每个生产契约必须在同一 PR 中交付真实生产者和消费者。

协议、交互与生命周期规则

  • 使用本地 stdio,每个活动任务独占一个由 Host 管理的外部进程。PR 2 中活动任务包括等待下一轮输入的存活会话,空闲时保留进程。关闭 UI 不隐式停止任务;任务退休及 Host 退出时清理所属进程及其 helper。PR 2 自己完成崩溃、取消竞态和清理处理;恢复能力交付前,进程丢失后保留可读历史并明确禁止继续。
  • 文本、工具活动、输出、diff 和完成状态转为现有 backend 事件。按 tool-call ID 合并局部更新,保留接收顺序。新增公共事件字段时,生产者和消费者必须同 PR 交付。
  • 外部工具通知表示发生的活动,不要求 Maka 再执行同一工具。不伪造 Maka 工具调度日志。
  • 外部选项交互使用 HostedInteractionBridge.admitFormRequest。ACP option ID 映射为表单 single_select.value,显示文本映射为 label,通过现有结算路径回传原始 ID。
  • 外部权限请求明确标识来源,保留 Agent 的允许、拒绝选项。不将其解释为 Maka sandbox 授权,不经过旧 permission 事件。Antigravity 特有提问识别留在厂商适配中。
  • 实现验证过且必需的 ACP 文本文件回调,检查工作目录、路径与符号链接。不声明 terminal 能力,也不宣称 Agent 自己执行的工具受 Maka 内置 sandbox 管理。
  • 取消时结算待处理交互,发送 ACP cancel,继续消费更新直至 prompt 结束。超过有限等待时间则结束所属进程并记录中断,不能错误显示正常取消。保留实际 stop reason。
  • Maka 保存可见历史,外部 Agent 管理执行上下文。进程崩溃不自动重发 prompt。
  • 依据协商能力使用 resume/load 恢复。load 历史重放作为恢复处理,不追加为新 turn。明确重放去重与历史对齐策略,覆盖 Agent 已推进、Maka 最后事件尚未持久化的崩溃窗口,不能简单全部丢弃或追加 replay。无法可靠对齐时明确展示历史缺口或恢复状态,不宣称历史完整。失败时保留可读历史,提供重试或新建任务,不能静默替换外部会话或重发 prompt。
  • 使用 Maka 托管安装或用户自行安装的官方 Antigravity ACP 发行包及匹配 helper。官方进程管理凭据,不假定可以复用 IDE 登录。

PR1 设置流程已使用 macOS arm64 官方 ACP 1.1.1 实测,见 #5164;这些设置验证不代表任务执行、模型/模式及恢复行为已验证。实施时必须记录并验证实际版本、平台、认证、事件结构、取消和恢复行为。T3 的 Antigravity 适配是实现参考,不能替代真实 Agent 验收。

实施前真实能力验证

在实现依赖某项能力的功能前验证官方程序,记录实际版本、平台和脱敏证据。参考代码及协议能力声明不能代替真实 Agent 验证。

  • PR1 认证实施前: 验证官方 server/helper 布局、初始化、认证方法、授权链接输出、认证完成响应与进程退出。连接检查不触发登录、不创建 session、不发送 prompt。PR1 设置流程证据见 feat(desktop): install and configure Antigravity ACP #5164。
  • PR2 执行实施前: 验证会话创建、省略模型/模式时的初始化、必需文件回调、文本/工具/diff/权限/问答事件、多轮 prompt 与取消;同时探测跨进程 resume/load 可行性,避免任务绑定依赖未经验证的恢复假设。
  • PR3 恢复实施前: 验证进程重启后恢复同一会话、历史重放结构、去重与崩溃窗口对齐,再实现持久化及恢复行为。
  • PR4 配置实施前: 验证实际模型/模式发现、选择应用及失败行为;执行必需的配置属于 PR2,必须在 PR2 验证。

必要能力不可用时,先修改对应 PR 的范围和验收标准再实施。记录中不得包含凭据或私有项目内容。PR1 设置检查完成不代表任务、模型或恢复能力已验证。

PR 拆分实施计划

路线仍保持四个 PR:PR 1 设置/认证 → PR 2 完整 Plugin 执行闭环与可用模型选择 → PR 3 恢复 → PR 4 modes 与目录生命周期。PR 2 保持一个纵向 PR,不再拆分;其工作分为四组可审查的“生产者到消费者”最小集合。生产者、契约、消费者和验收测试未同时出现时,该组不得标记完成。

  • PR 1 — 在设置中安装、配置、连接与认证 — 已通过 feat(desktop): install and configure Antigravity ACP #5164 合并。

    • 安装或选择官方 Antigravity ACP,完成校验并通过 RuntimePolicy 持久化 executable 事实。
    • 检查连接并完成 Google 认证;不创建任务、不发送 prompt。
    • 清理临时 server/helper,并覆盖完整性、持久化、迟到结果保护、本地化、诊断及 macOS arm64 真实设置证据。
    • 过渡边界: PR 1 生产设置/认证事实;PR 2 消费这些事实来物化 Plugin 配置。PR 1 不执行任务。
  • PR 2 — 基于 Plugin 的外部 Agent 执行闭环与可用模型选择 — 已于 2026-09-23 通过 feat(desktop): complete Antigravity ACP plugin execution #5224 合并(0cb4fc32bdff3587bd5cc609fbe0eb28efa4233f)。

    集合 A — 设置事实 → 可用 Plugin executor

    • 基于 feat(runtime): add plugin-backed Session executors #5283 的 executorId、PluginExecutorService 和 PluginExecutorBackend 重建,不增加 ACP 专属 Session/Core/Storage/backend-registry 分支。
    • 新增共享 ACP Runtime Plugin 和 Antigravity 薄适配器 contract。
    • 将两个生产 Plugin bundle 随 Runtime Host/Desktop 交付,并把 PR 1 的 executable/helper 路径投影为内容寻址的系统管理包和 adapter Entry,不向任一 Plugin 暴露 RuntimePolicy 权限。
    • 验证生产 bundle 安装、重复 reconcile/重启幂等、配置替换、设置清除、包卸载及 executor 注册/inspection。
    • 在创建 Session 前,通过 Desktop 消费的通用 executor 目录/inspection 投影不可用与需认证状态(归属集合 B)。

    集合 B — provider 目录 → Desktop 选择 → 首条 ACP prompt

    • 增加通用 executor 目录/配置契约,并同时交付 Antigravity 生产者和 Desktop 消费者。发现可以使用有界的短期 ACP probe,但不能创建 Maka task,也不能保留预览 Session/进程。
    • 在 upstream/main 现有模型菜单中实现通用 executor 浏览与模型选择,保留草稿文本、附件和 Maka 模型状态。
    • 创建任务时原子持久化 executor 与所选模型,并在首条 prompt 前创建 ACP Session 时消费该精确值;已有任务固定 executor 并显示已确认模型,失效值不得静默替换。
    • 在 Maka Session 创建前,将未配置、不可用和需登录目录状态连接到 PR 1 设置流程。

    集合 C — ACP 更新/交互 → 权威聊天 → ACP 结算

    • 实现按 conversation 保留的 ACP 进程/Session、initialize/new/prompt、多轮文本/思考/工具投影、权威 file diff、文件回调、权限选项、故障映射、取消、退休和进程树清理。
    • 增加通用 Agent question 交互;provider 特有识别留在 adapter,并通过 Hosted Forms 往返保留原始 option identity。
    • 不支持的附件/原生操作保持可见并提供可操作校验,不删除草稿内容。
    • 验证有序局部更新、工具/diff、权限/问题结算、追问、取消竞态、崩溃、清理及现有聊天渲染。

    集合 D — 进程连续性事实 → 安全的任务就绪状态

    • 持久化连续性标记,在 Host/Plugin 重启或进程丢失后拒绝静默替换。

    • 通过通用 Session/Desktop 状态投影 history-only/process-lost,并提供重试/新任务引导;加载历史不得启动 Agent。

    • 在重建后的 Plugin 路径重新执行脱敏受控进程和官方 Antigravity 验收,覆盖认证、模型应用、任务隔离、追问、交互、取消及进程丢失。

    • 完成完整 CI、最终 review 并合并 feat(desktop): complete Antigravity ACP plugin execution #5224。

    • 端到端生产者 → 消费者: PR 1 设置事实 → 系统管理的 adapter Entry → provider 目录/配置 → 通用 Desktop executor/model 选择 → Session executorId 与配置 → Plugin executor → 权威事件/Hosted Forms → 追问、改模型、停止或 history-only 就绪状态。

    • 验收: 使用官方 Agent 完成 Desktop 全链路、追问和取消;多个任务复用目录数据但各自拥有独立 Session;在 PR 3 前,重启后保持明确 history-only。

    • 合并证据: feat(desktop): complete Antigravity ACP plugin execution #5224 已合并,已报告的检查无失败项(CLI Eval 跳过)。验收记录。PR 2 执行验收复用了已有 Google 登录;认证过期恢复与完整跨进程恢复仍未验证。空闲进程保留上限单独跟踪于 Define bounded retention for ACP client processes #5620。

  • PR 3 — 恢复同一个外部 Session 并重建进程 — 2026-09-24 开始规划;实现首先通过真实 Agent 恢复验证前置门槛。

    • 使用受支持的官方 Antigravity 版本验证跨进程 resume/load 和 replay 行为。
    • 扩展 ACP Runtime/adapter contract,持久化 external-session identity 并提供明确 create/restore 路径;恢复绝不回退到 session/new。
    • 仅在用户继续时惰性恢复,将 replay 与权威历史对齐,处理崩溃窗口并展示恢复/历史缺口状态,不重发中断 prompt。
    • 补齐受控进程测试、真实 Agent 验证、Desktop 就绪状态、文档及排障说明。
    • 验收: 重启后继续同一个真实外部 Session,上下文完整且历史不重复;失败时历史可读且不新建替代 Session。
  • PR 4 — 支持的 modes 与模型目录生命周期

    • 复用 PR 2 的通用 executor 目录/配置契约支持 modes,不增加第二套发现路径或 Agent 专属 picker。
    • 增加 provider-owned 目录作用域、账号/目录失效、刷新协调及由 Agent 确认的空闲期 model/mode 修改。
    • 重新校验所选值且不静默替换,已有任务实时配置不受草稿刷新影响。
    • 覆盖键盘导航、焦点返回、窄窗口、本地化、缓存及失效。
    • 验收: 所选 model/mode 影响执行,缓存目录立即出现,失效选择明确可见,刷新作用域正确。

最终验收标准

  • 使用已记录版本的官方 Antigravity 完成完整 Desktop 流程:配置 → Google 登录 → 选择 Antigravity/模型 → 创建任务 → 修改与测试 → 查看工具/diff → 回答交互 → 追问 → 取消 → 重启并继续同一个外部 session。
  • Maka 与每个外部 Agent 都通过 provider 自己的目录/配置逻辑提供候选项,并交给 upstream/main 风格的同一个模型菜单展示;新增 provider 不复制 Composer 或 Host 编排。
  • 选择外部 Agent 后立即展示缓存候选项;并发或后续新任务复用目录数据,但保持独立外部 session 和选择配置。
  • 已有任务不能切换执行者;模型/模式只在空闲时修改,由 Agent 确认,账号/目录变化后不得静默替换。
  • 不支持的附件和操作保持可见并给出可操作校验,不丢失草稿内容。
  • 受控 ACP 进程测试覆盖事件顺序、局部更新、选项身份、首条 prompt 配置、取消竞态、崩溃、清理、目录缓存/失效及恢复。
  • 真实 Agent 检查覆盖认证、实际工具/session 行为、模型/模式应用和跨进程恢复;fixtures 不包含 token 或私有项目内容。
  • Maka 现有执行保持正常,共享 ACP 依赖修改不破坏 maka --acp 服务端路径。
  • 每个新增生产接口、字段或能力在同一 PR 内都有真实消费者;共享行为保留在 provider/backend seam 后面,不扩散为 Agent 专属 UI 分支。

首期范围

本地 macOS arm64 Maka Desktop、本地 Runtime Host,以及用户点击安装或手动选择的官方 Antigravity ACP 进程。不包含自动发现或自动升级、远程执行/OAuth 转发、多账户管理、外部子 Agent 编排、steering、会话回退或跨 Agent 续接。TUI 产品入口后续再做,Host 实现保持可复用。

备选方案或临时做法

  • 单独使用 Antigravity: 当前可以使用,但无法获得统一的 Maka 任务、历史与交互体验。
  • 将 Antigravity 包装为 AI SDK 模型 provider: 不采用。完整 Agent 管理会话和工具,与模型调用不同,应实现并列的 AgentBackend。
  • 单独建设外部 Agent 聊天系统: 不采用。Maka 已有执行、交互、持久化和展示 seam。
  • 嵌入 IDE 或包装普通 CLI: 首期无需这样做,官方已提供 ACP 发行包。
  • 先提交纯基础设施 PR,再接 UI 消费者: 不采用。上述 PR 按真实生产功能纵向交付。

本提案依据设计讨论,由 AI 辅助整理。官方二进制实测仍是明确的实施与验收要求。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

trackingTracking or umbrella issue

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions