Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

docs(external-agent): design optional delegation through Collaboration - #2476

Merged
eric8810 merged 2 commits into
mainfrom
dimagent/external-agent-design
Dec 2, 2026
Merged

eric8810 merged 2 commits into
mainfrom
dimagent/external-agent-design

Conversation

@zerob13

@zerob13 zerob13 commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator

Fixes #1898

Summary

A Session delegates a coding task through Collaboration’s existing agent tool. The optional ExternalAgent package owns the external conversation and its protocol. The workspace host runs the process. Collaboration delivers the outcome to the requesting branch even after the desktop client disconnects. English design · 中文设计

Review focus

  1. Does one collaborationMembers.register(kind, dispatch) face cover routing, cancellation and expiry of a provider’s pending approval asks?
  2. Is the delivery boundary precise enough for Codex and ACP? ACP has no early prompt acknowledgement. If the prompt may have reached the agent, retrying could repeat a file-changing task.
  3. Does the cleanup scenario cover a package runtime dying after spawn but before receiving the task handle, while the App Server survives?

Design rule checklist

  • Scope. One optional process row owns the external bindings and adapter state. The workspace host runs processes.
  • Commands and results. Collaboration owns the leader’s request, delivery, terminal result and report.
  • Handover. Section 3.1 defines delivery for each protocol and the outcome when acknowledgement is lost.
  • Timeline callbacks. No before callback. Provider callbacks run outside file leases and Timeline commit locks.
  • Infrastructure. Section 9 identifies the process-lifetime guarantee and its owner.
  • Core handling. Collaboration routes by registered member kind. Vendor protocols stay in the package.
  • Batch. Existing Collaboration batches and terminal ordering apply.
  • Context. The requesting branch receives tool results, adopted approval inputs and the report.
  • Ownership. The plugin uses public owner operations and checks member addresses against the leader.
  • Data faces. Sections 2 and 6 specify dependencies, operation payloads, outcomes and scoped callbacks.
  • Configuration. PluginManager owns installation. Settings owns enabled integrations. The contract is language-neutral.
  • Mechanism requirements. Section 9 covers member registration, provider approvals, process cleanup and optional activity notices.
  • Durability. Collaboration owns durable outcomes. The plugin stores native conversation bindings. Activity is transient.

Documentation

  • Accepted ADRs are untouched.
  • Cross-module requirements are raised with their owners. The overview, catalog and registration references point to the proposal.
  • Delivery status stays in the issue. Both language editions link to public protocol references.

Verification

  • node scripts/adr-check.mjs --base origin/main
  • git diff --check origin/main
  • Checked 68 repository links, including 38 incoming references to the design.

The change is documentation only. Section 7 defines runtime acceptance scenarios for implementation.

@yyhhyyyyyy yyhhyyyyyy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

APPROVE

This redesigns ExternalAgent onto the current plugin model: one optional process row registers a Collaboration member kind, the per-node bridge rows and their loader plumbing are gone, and delegation, approval delivery and settlement stay with Collaboration. The Codex, ACP and Claude Code adapter requirements, the delivery boundary and the process cleanup requirement are stated as testable design, and the overview, catalog and registration references point at the proposal. The English and Chinese editions are both 151 lines and structurally identical.

Verification of the claims against the tree:

  • Collaboration still addresses Dim members through its directory, and a sessionId that is not a Session is rejected (crates/dim-app-server/src/collaboration.rs, e.g. the error text at :3544 and :3548 and the check at :1646), so the proposal in §9.2 that a registration face is needed is accurate.
  • hostPlatform serves spawn, wait, kill, settle, readOutput, stderrTail and write (docs/design/resource-faces.md:3), matching §2; pluginFiles withLock is the lease §2 describes (docs/typescript-plugin-authoring.md, Process storage).
  • Every referenced target exists: resource faces §3, settings-service §1.2, rutis usage R6, the TypeScript authoring page's Process owners and Process storage sections, subagent-tool-approval, ADR 003, clients, session notices and service faces.
  • Every inbound anchor from the touched and related pages resolves to an existing heading: overview and clients to §3.2, overview to §3.4 and §3.5, background-task-list to §6, overview and plugin-contract and rutis-usage to §9 and §9.2, clients to A.1. No page still references the removed bridge rows, externalAgentNodes or the old section numbers.
  • Link scan over the ten changed files found no broken target introduced; the one miss, docs/zh/design/rutis-usage.md:245 linking service-faces.md, predates this change.
  • node scripts/adr-check.mjs --base e950a5ea passes and git diff --check is clean. CI at the head: changes, ci-ok, evaluate-pr and issue-gate pass; the rest are skipped for a documentation-only change.

On the review focus questions: (1) the single registration face plus the typed run, cancel, close and answer operations cover routing, cancellation and ask expiry (§2, §3.2, §6), and §9.3 records the approval-route extension it needs; (2) §3.1 defines the handoff per protocol, states that ACP acknowledges local delivery only, and forbids resending once the prompt may have reached the agent; (3) the cleanup case is a named requirement with an owner in §3.4 and §9, and acceptance §7 repeats it with a killed runtime.

Optional P3 (inline): the Chinese edition links English documents where Chinese counterparts exist. This row and the approval scope, session notices and Appendix A.1 rows point at docs/design/appserver/settings-service.md, session-notices.md, clients.md, docs/design/rutis-usage.md and docs/adr/003-approval-scope.md, while docs/zh/ has each of them. The previous Chinese page linked the Chinese files, as docs/zh/design/plugins/PluginManager.md does. Repointing those five targets keeps the Chinese edition self-contained; the TypeScript authoring and resource-faces pages have no Chinese copy, so their English links are correct.

Cross-PR: documentation only. It touches no file of #2449, #2455, #2465, #2469 or #2475, so there is no conflict.

Verdict: APPROVE. The proposal is internally consistent and every cross-reference checked out. The link routing is the only note, and it does not affect the design.

Comment thread docs/zh/design/plugins/ExternalAgent.md Outdated
| --- | --- |
| `collaborationMembers.register(kind, dispatch)`(提案) | Collaboration 提供注册操作。插件登记一个受行生命周期约束的处理函数,按 §6 的数据协议受理调用。成员类型仅用于路由。[rutis 贡献注册](../../../design/rutis-usage.md#r6-contributions-register-with-their-owner) |
| `hostPlatform` | 使用工作区所在执行宿主提供的程序名与 argv、宿主隔离、标准输入输出管道和独立的有界 stderr。复用 write、readOutput、wait、kill、settle。[进程任务服务](../../../design/resource-faces.md#3-process-and-task-services) |
| `settings`、`managementMethods` | 登记用户作用域的配置源和附录 A.1 的本机管理方法。revision 检查归 Settings。[Settings](../../../design/appserver/settings-service.md) · [管理方法](../../../typescript-plugin-authoring.md#process-owners-and-management-methods) |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This link and the ones at lines 32, 56, 131, 133 and 151 point at English documents although Chinese counterparts exist: docs/zh/design/appserver/settings-service.md, session-notices.md, clients.md, docs/zh/design/rutis-usage.md and docs/zh/adr/003-approval-scope.md. The previous Chinese page linked the Chinese files (for example it used ../appserver/settings-service.md#12-决定密钥归其所有者), and docs/zh/design/plugins/PluginManager.md follows the same rule. Repoint these links to the zh copies so the Chinese edition stays self-contained. The TypeScript authoring and resource-faces pages have no Chinese copy, so their English links are correct.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Updated six links in the Chinese ExternalAgent design to use the existing translations for rutis, Settings, approval scope, Session notices, and the client contract. All 14 distinct relative links on the page resolve, including the translated R6 and Settings §1.2 heading anchors. The TypeScript authoring and resource-faces links still lead to the English pages, which are the available editions. Commit

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Fixed in 645d1aa. The links now point at the Chinese copies: rutis-usage with the translated R6 anchor, settings-service in the table and in Appendix A.1 with the translated anchor, the approval-scope ADR, session-notices and clients. The pages without a Chinese copy stay on English, headings are unchanged so the referrer anchors still resolve, and adr-check passes.

@zerob13
zerob13 requested a review from yyhhyyyyyy December 2, 2026 11:14

@yyhhyyyyyy yyhhyyyyyy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

APPROVE

Round 2 fixes exactly the links called out in the round-1 inline, and nothing else changed. docs/zh/design/plugins/ExternalAgent.md remains 151 lines and structurally identical to the English edition.

Verification:

  • The Chinese page now points at docs/zh/design/rutis-usage.md#r6-贡献向所有者登记, docs/zh/design/appserver/settings-service.md (the table link) and #12-决定密钥归其所有者 (Appendix A.1), docs/zh/adr/003-approval-scope.md, docs/zh/design/appserver/session-notices.md, and docs/zh/design/clients.md. Each target file exists and both anchors match the heading text (### R6. 贡献向所有者登记, ### 1.2 决定:密钥归其所有者).
  • The pages without a Chinese copy keep their English links: typescript-plugin-authoring (two anchors), resource-faces, execution-environments, and the service-faces and subagent-tool-approval pages, which also have no zh edition. The language switch at the top points at the English page, and the English page points back at the Chinese one.
  • Every referrer anchor into this page still resolves in both editions (#32-权限询问, #34-执行位置, #35-重载或重启后的恢复, #a1-管理方法, and their English counterparts), since the headings did not change.
  • node scripts/adr-check.mjs --base e950a5ea passes (10 changed files), git diff --check is clean, and CI at the head passes changes, ci-ok, evaluate-pr and issue-gate; the remaining jobs are skipped as documentation-only.
  • The round-1 inline about linking the Chinese edition to English documents is resolved and withdrawn. No new findings.

Cross-PR: documentation-only change in one file; no overlap with the other open PRs.

@eric8810
eric8810 merged commit 570f7f9 into main Dec 2, 2026
@eric8810 eric8810 added this to the v0.1.0-alpha.31 milestone Dec 2, 2026
soulmachine pushed a commit to soulmachine/dim that referenced this pull request Dec 3, 2026
Prepare v0.1.0-alpha.32, the next alpha after v0.1.0-alpha.31.

User-visible changes since v0.1.0-alpha.31:

- App Server runtimes: prefer system runtimes by default, keep installed
  runtime downloads across an upgrade and their download source when
  runtime pins change, and explain recovery from system runtime failures
  (arcships#2475).
- Workflow: reject a relative management cwd before canonicalizing it at
  the RPC boundary (arcships#2477).
- Skills: give installations persistent identities and conditional
  update/remove (arcships#2451).
- Runtime input: read pending inputs through InputQueue (arcships#2447).
- Scheduler: remove retired wakeup remnants (arcships#2469).
- Docs: specify negotiated mobile protocol exchanges and checkpoint
  recovery (arcships#2465), and optional external-agent delegation through
  Collaboration (arcships#2476).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Redesign ExternalAgent using the current rutis plugin model

3 participants