Add compiled-plugin host defaults and CLI hooks #201

Merged
weichen merged 5 commits from feature/svc-plugin-host-options into main 2026-10-15 03:54:16 +00:00
Owner

摘要

组合二进制需要基座接受插件声明的启动默认值、专属旗标和启动前准备,且不覆盖调用方显式参数。

  • InProc.HostOptions / CLIHook / Prepare,以及 MergeHostOptions、RegisterCLIFlags、RunCLIHooks、PrepareCompiled。
  • 表面版本升到 2.14.0-experimental,保留 2.13.0 的账户目录接口。
  • GET /api/registry 增加 compiled 插件 id 列表。

Review

作者审阅 origin/main...8c60ed0(5 个文件)。布尔默认值按“任一为 true 则 true”合并;ExecBackend 冲突时报错。已访问的 CLI 旗标优先于插件默认。Prepare 在合并之后运行,错误拒绝启动。CLI 钩子看到的是解析后的旗标值,早于配置文件合并;这与 RDM 自有 bootstrap-admin 使用旗标数据目录的既有行为一致。未发现应阻塞合入的问题。合入仍以本 PR 当前 HEAD 的 CI 为准。

证据

本地 go test ./pkg/extension/ ./cmd/agent-system/ -count=1 在合并 origin/main 之后通过(SELF)。权威结果是本 PR HEAD 的 CI。

## 摘要 组合二进制需要基座接受插件声明的启动默认值、专属旗标和启动前准备,且不覆盖调用方显式参数。 - `InProc.HostOptions` / `CLIHook` / `Prepare`,以及 `MergeHostOptions`、`RegisterCLIFlags`、`RunCLIHooks`、`PrepareCompiled`。 - 表面版本升到 `2.14.0-experimental`,保留 `2.13.0` 的账户目录接口。 - `GET /api/registry` 增加 `compiled` 插件 id 列表。 ## Review 作者审阅 `origin/main...8c60ed0`(5 个文件)。布尔默认值按“任一为 true 则 true”合并;`ExecBackend` 冲突时报错。已访问的 CLI 旗标优先于插件默认。`Prepare` 在合并之后运行,错误拒绝启动。CLI 钩子看到的是解析后的旗标值,早于配置文件合并;这与 RDM 自有 `bootstrap-admin` 使用旗标数据目录的既有行为一致。未发现应阻塞合入的问题。合入仍以本 PR 当前 HEAD 的 CI 为准。 ## 证据 本地 `go test ./pkg/extension/ ./cmd/agent-system/ -count=1` 在合并 `origin/main` 之后通过(SELF)。权威结果是本 PR HEAD 的 CI。
weichen added 3 commits 2026-10-15 02:06:21 +00:00
Why: a composed base binary must apply plugin startup defaults and plugin-owned flags without a downstream main.
Evidence: go test ./pkg/extension/ ./cmd/agent-system/ -count=1 (SELF, this commit's parent tree plus these files).
Impact: blank-imported plugins can set HostOptions and a CLI hook; GET /api/registry gains a compiled id list; explicit serve flags still win.
Refs: plugins/registry compose deploy
Co-authored-by: Cursor <cursoragent@cursor.com>
Why: RDM's sandbox policy must run after HostOptions are merged and be able to refuse startup when bwrap is missing.
Evidence: go test ./pkg/extension/ ./cmd/agent-system/ -count=1 passed on this tree (SELF).
Impact: InProc.Prepare and PrepareCompiled; serve applies plugin rewrites before app.Run.
Refs: feature/svc-plugin-host-options
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	pkg/extension/extension.go
weichen added 1 commit 2026-10-15 02:43:45 +00:00
weichen added 1 commit 2026-10-15 03:41:18 +00:00
Accept a late parent terminal event in the child process page
ci / vet-and-test (pull_request) Successful in 1m2s
80bb123c87
Why: waitRunTerminal can return before run.completed is stored, so that event may land between the appended tool output and the child events.
Evidence: CI run 3274 failed twice on TestRunProcessEventsAreOrderedAndBoundToConversation with run.completed ahead of the child progress and result. Local go test of that test passed after this assertion.
Impact: the test still rejects leaked child tool output and still requires child progress then result, in that order.
Refs: Agent-System-Backend pulls/201
Co-authored-by: Cursor <cursoragent@cursor.com>
weichen merged commit 9fd079388b into main 2026-10-15 03:54:16 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weichen/Agent-System-Backend#201