Repository navigation
refactor(managed-agent): Make runtime backends optional Maven modules - #16141
Conversation
本地验证与 E2E 待验收记录提交: 整合 main 后完成的检查
本地环境为 macOS arm64、Node.js 26.12.1、npm 11.20.0。Windows 和 Linux 本地未测。 保留的前期脚本证据
尚未执行,验收待完成共享 Java 预算已使用 599.048/600 秒,本次五后端扩展及 PR 整理没有重置预算,也没有追加 Java/javac/Maven 执行。前期 Local/External 版本的聚焦 Java 通过仅是历史记录;embedding-host 和 packaged-classpath 尝试曾超时,这些旧结果不构成本提交验收证据。 以下必须等待对应 CI 或真实环境结果:
本 PR 保持 Draft;没有发布、部署或真实基础设施验收声明。预热策略不在本次变更范围内。 |
|
PR 16141 round 1 verification — Verdict: findings — 25/32 scripted assertions passed, 7 failed. Verified head: 中文摘要结论:findings(不具备合并条件)。 25/32 条脚本化断言通过,7 条失败;失败全部归因于本 PR。中心主张本身成立:五个后端确实被拆成可独立选择的产物,七种真实成品都只发现所选 provider 并能启动;普通 server 依赖的 embedding host 不会创建任何托管资源,显式启用后才启动。问题在于工具链和测试/CI 门禁,而不是运行时拆分。 A/B 结论(实测): base 的 Findings:
未覆盖: 完整 Java reactor 在 169 个测试类后停止(改跑 16 个变更类的定向门禁);真实 MySQL/Hosted/fault、真实 SSH/Kubernetes、SpotBugs、跨平台矩阵未跑; What the PR claims and what was measuredThe PR's central claim is that Local, SSH, Kubernetes, External and Static runtimes become five independently selectable Maven artifacts; a selector builds seven distributions (five single-backend, Local+SSH, full) containing exactly the selected implementations; the ordinary server dependency carries none of them; and existing recovery, storage-ownership and maintenance behavior survives. This round drove the real Maven reactor, the real The claim holds at the artifact level. The seven variants were built one at a time with
The head already shows two red CI jobs at the verified commit: Findings1. Critical — the archive inspector looks for configuration metadata at a path Spring Boot does not write
Blast radius: every one of the seven variants fails $ node scripts/build-managed-agent-runtime.mjs --backends=external --verify
[ERROR] ManagedAgentPackagingIT.standaloneArtifactsIncludeConfigurationWhileLibraryDoesNot:39
Expecting actual not to be null
...
Maven exited with 1.
$ node scripts/package-managed-agent-reference.mjs --backends=full \
--version=0.1.0-alpha.verify --source-revision=$(git rev-parse HEAD) --output=/tmp/ref
Runtime archive is missing BOOT-INF/classes/META-INF/spring-configuration-metadata.json:
.../qwen-managed-agent-server-0.1.0-alpha-exec.jarSuggested fix (measured)Change the resource in both places to the root path: - 'BOOT-INF/classes/META-INF/spring-configuration-metadata.json',
+ 'META-INF/spring-configuration-metadata.json',- assertThat(executable.getEntry("BOOT-INF/classes/META-INF/spring-configuration-metadata.json")).isNotNull();
+ assertThat(executable.getEntry("META-INF/spring-configuration-metadata.json")).isNotNull();Measured in the scratch 2. Critical — Checkstyle rejects three new backend sourcesThe CI command fails in $ cd packages/managed-agent-server
$ mvn --batch-mode --no-transfer-progress checkstyle:check checkstyle:check@runtime-broker-checkstyle
[ERROR] src/main/java/com/alibaba/qwen/code/runtimebroker/host/RuntimeStateFiles.java:[45] (regexp) RegexpMultiline: Blank line before closing brace
[INFO] Qwen Managed Agent runtime-host .................... FAILURE
Suggested fix (measured)Remove the blank line between the last statement's closing brace and the type's closing brace in:
Measured: with all three removed, 3. Critical — the new
|
|
本次将 PR 收敛到 独立 Maven 后端、optional 依赖及必要装配。提交: 保留五个后端独立 JAR、隔离 classpath/嵌入测试、历史操作恢复、SSH 准入与连接生命周期保护。默认完整 PR 从 170 个文件、+4776/-660(净增4116) 收敛为 154 个文件、+3378/-596(净增2782),净新增减少1334行。本次没有修改生产 Java 逻辑。 本轮验证:
静态比对确认:server的build配置和参考打包器恢复为main原实现;CI与main的差异只剩新增模块的缓存路径,既有full Java、MySQL、Hosted/fault等gates未削弱。根目录build/typecheck/bundle复用 上一版CI失败已逐项核对:Lint & Static因工作流体积超过增长限制,本次收敛后门槛通过;参考分发因 共享Java预算仍为 599.048/600秒,本轮未运行Java/javac/Maven。当前Java回归、Checkstyle、SpotBugs、普通打包/embedding、真实SSH/Kubernetes、MySQL、Hosted/fault和完整跨平台验收仍待CI或真实环境;PR保持Draft。此前失败及超时仍保留为历史证据。本评论更新了前一验证评论中的交付范围:七种独立分发变体已后置,不再是本PR的待交付项。未发布、未部署,预热策略未变。 |
|
|
|
|
yiliang114
left a comment
There was a problem hiding this comment.
Scope & Linkage
154 files / +3,378 −596. This refactor splits the five runtime backends (Local, SSH, Kubernetes, External, Static) into independent Maven artifacts behind a new RuntimeProviderFactory SPI. The server POM declares all five backends as optional dependencies; the default standalone and operator assemblies retain the full set. CI workflows (sdk-java.yml, verify-maven-repo.yml) consistently list the seven new modules in every cache and write-back path. No issue is closed by this PR; it follows up on merged #15871.
Key observations
SPI design — clean. RuntimeProviderFactory.kinds() → validate(settings) → create(settings, transport, dependencies) is a well-gated, no-leak lifecycle: validation is configuration-only, resource creation happens only after validation passes, and partial creation is cleaned up on failure. RuntimeProviderRegistry uses ServiceLoader and correctly blocks the reserved kubernetes kind and duplicate registrations.
Validation gates before side effects. Every factory validates before creating resources. LocalRuntimeProviderFactory.validate() checks paths and rejects relative extension cache directories before opening any local state. SshRuntimeProviderFactory.validate() checks node IDs, isolation class, and configuration exclusivity without touching SSH. The Kubernetes factory validates HTTPS origin and file paths. Tests confirm absent directories are never created during validation.
Backend selection is explicit. RuntimeBackendSelection.from(settings) derives the needed backends from configuration alone — no classpath probing, no implicit fallback. SSH nodes with local-process provisioning correctly require both backends. SSH-only provisioning rejects local-only settings.
Spring lifecycle improved. ManagedAgentConfiguration now sets destroyMethod = "close" on the SSH connections bean (was empty string), so Spring properly calls SshConnectionManager.close() on shutdown. The bean is gated behind RuntimeBackendSelection.includes(SSH_PROCESS) and created through RuntimeProviderRegistry.
Preflight updated consistently. ManagedAgentPreflight.brokerChecks() delegates to the SPI's validate() and preflight() methods instead of hard-coding per-provisioner logic. toolPathCheck handles ssh-process specifically.
Maven modules are uniform. All six new pom.xml files share the same structure: parent reference, managed.module.root property, consistent dependency sets, and identical Checkstyle/SpotBugs/Surefire plugin configurations with failIfNoSpecifiedTests=false.
Design docs are bilingual and synchronized. Both 2026-10-31-managed-runtime-backend-modules.md and its .zh-CN counterpart document the module split, backend selection, recovery behavior, and migration notes. Obsolete source paths in older design docs are updated.
Verdict
No P0/P1 findings. The architecture is sound, the SPI contract is well-defined, and the factory implementations follow a consistent validate-then-create pattern. CI workflow changes are mechanical and complete. The PR author explicitly notes that acceptance testing is pending — this is not a code defect.
APPROVE the current head 08d6c1b.
qqqys
left a comment
There was a problem hiding this comment.
Review at 08d6c1b24b697d0ab245ddcc035962bab1b9aae2 — COMMENT (not approving)
Not approving, because a maintainer verification round concluded this PR was not mergeable and filed four Criticals plus two Highs, and at this head three of them cannot be confirmed either way. I want to separate clearly below what I verified as clean from what is simply unconfirmed, because the two are not the same thing.
Unconfirmed: the findings that depend on a lane that has never run here
The round at 13:39 UTC was written against the first commit 7ae49ce3; the second commit 08d6c1b2 narrowed the PR from 170 files to 154. Mapping each finding onto the CI that would settle it:
- Checkstyle rejects three new backend sources — enforced by
SDK Java (fast) / ubuntu-latest / Java 21, which is pending at this head. Unconfirmed. EmbeddedRuntimeBrokerTestreflects a field the refactor removed — same pending lane. Unconfirmed.StaticRuntimeProviderFactoryTestexpects an unnormalized URI — same pending lane, and that test file is present in this PR's changed set, so it is live. Unconfirmed.- The archive inspector reads configuration metadata at a path Spring Boot does not write — the author states the variant manifest, trimmed-archive and seven-product matrix work was withdrawn, which would make this moot, but I did not verify the inspector itself is gone. Unconfirmed.
Two do look settled, and I want to say so rather than leave them standing: the provider-options documentation and stale generated reference are covered by Build and verify reference distribution, which passed in 4m20s, and the sdk-java.yml workflow-size ratchet is covered by Lint & Static, which passed in 8m0s. Both green lanes are consistent with the author's item-by-item account of the previous failures.
The gap is that the Java side has no execution evidence at this head whatsoever. The author's own comment states that this round ran no Java, javac or Maven locally, with the shared Java budget at 599.048/600 seconds, and that Java regression, Checkstyle, SpotBugs, packaging and embedding, real SSH and Kubernetes, MySQL, Hosted/fault and cross-platform acceptance all remain pending. I am not treating pending CI as a defect, but I cannot certify findings fixed on a lane that has not run, and the maintainer's verdict was explicitly "not mergeable".
Verified clean: the two things that most often break in a split like this
SPI registration is complete, so no backend can silently vanish from discovery. This is the dominant failure mode when backends become optional modules loaded through ServiceLoader, so I censused it rather than sampling it. There are exactly five RuntimeProviderFactory implementations in the tree — ExternalRuntimeProviderFactory, KubernetesRuntimeProviderFactory, LocalRuntimeProviderFactory, SshRuntimeProviderFactory, StaticRuntimeProviderFactory — one per provider module, and each of those five modules carries a matching META-INF/services/com.alibaba.qwen.code.runtimebroker.spi.RuntimeProviderFactory resource.
The parent pom declares seven new modules, and the two without a registration are correctly without one: runtime-http contains only the moved HttpRuntimeTransport (a pure rename, zero added lines), and runtime-host contains HostCommandRunner, RuntimeStateFiles and two renamed classes. Neither holds a factory implementation, so 5 registrations against 7 modules is the right ratio, not a missing pair. This matches the maintainer's independent measurement of five selectable backends.
No CI gate is narrowed. For a module split, the second thing that breaks silently is a lane that stops building or testing one of the new modules. The sdk-java.yml change (+30/−2) is purely additive: the seven new qwen-managed-agent-runtime-* artifact paths are appended to the resolve lists and to the two find … -prune cache write-back exclusion lists, and they are added consistently in all four places. No module is removed from a reactor invocation, and no timeout, selector or tier condition is altered. That corroborates the author's claim that the only CI delta versus main is cache paths for the new modules. I did not read verify-maven-repo.yml (+7/−0), so I am not making a claim about it.
Scale
154 files, +3378/−596, seven new Maven modules and a new SPI surface across contracts. I could not complete a Critical-only scan of that in the window I have, and the two censuses above are the highest-value part of it rather than all of it. In particular I did not read the new SPI interfaces themselves, the optional dependency wiring in the consuming poms, or the behaviour of a deployment that omits a backend it later asks for — which is where a fail-open path would live if one exists.
One factual discrepancy worth resolving
The author's comment states the PR remains a Draft, but the API reports isDraft: false and the PR is open and mergeable. If it is not intended to be mergeable yet, marking it Draft would prevent it landing ahead of the pending Java lane.
Next step
Let SDK Java (fast) / ubuntu-latest / Java 21 finish at this head. If it is green, findings 2, 5 and 6 are settled by execution and the remaining question is only whether the archive inspector survived the scope cut. If it is red, the failure names will say which. I would re-review against a green Java lane.
|
Thanks for the PR — and for cutting round 2 down as aggressively as you did. Template looks good ✓ — every required section is present, and the design doc is linked in both languages with matching structure (seven headings each, same order). Problem: real and verifiable against
Direction: aligned. This follows merged #15871, the boundary is described in a bilingual design doc, and it moves toward what Size: the core-path globs don't match. Everything sits under
That clears the 1000-line advisory, so: this is large, and splitting is worth considering if a seam exists. In fairness to the diff, 45 of the 154 files are pure renames, so the genuinely new logic is considerably smaller than the raw count reads. Approach: the scope feels right now. Round 2 already withdrew the selective builder, variant manifests and classifiers, trimmed archives, six deployment examples, the systemd unit and the seven-variant CI matrix (170 files / +4776−660 → 154 / +3378−596), which is close to the answer I'd have given to "could you cut most of this?". What remains matches what I'd have written independently: one Maven module per backend, the SPI in
Risk: no elevated risk signals — none of the changed paths match the revert-correlated set. Moving on to code review. 🔍 中文说明感谢贡献,也感谢第二轮把范围收敛得这么干脆。 模板完整 ✓ —— 各必填章节齐全,设计文档中英双语均已链接且结构一致(各七个标题,顺序相同)。 问题: 真实存在,可以在
方向: 对齐。这是已合并 #15871 的后续工作,边界有双语设计文档描述,也符合 规模: 未命中核心路径通配。全部改动位于 已超过 1000 行提示线,所以:这个 PR 很大,如果存在可切分的接缝,值得考虑拆分。不过要公道地说,154 个文件里有 45 个是纯重命名,真正新增的逻辑比行数看起来小得多。 方案: 现在的范围是合理的。第二轮已经撤掉了选择性构建器、变体 manifest 与 classifier、精简归档、六份部署示例、systemd unit 和七变体 CI 矩阵(170 文件 / +4776−660 → 154 / +3378−596),这基本就是我会给出的"能不能砍掉大部分"的答案。剩下的部分与我独立设想的方案一致:每个后端一个 Maven 模块、SPI 放在
风险: 无升级风险信号——改动路径均未命中与回滚相关的那组文件。 进入代码审查 🔍 — Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
Code reviewI read the diff against the current head and re-checked each of round 1's six findings rather than trusting either the report or the reply. Three are genuinely fixed, one no longer applies, and two are still present and will redden the Java job that is currently in flight. Blockers1.
The narrow fix is to point the reflection at This is round-1 finding #5, unchanged. 2. Checkstyle rejects three new production sources.
I scanned the full diff for an added blank line immediately followed by an added column-0 Unresolved — I could not settle this one3.
I am not repeating that as a finding, because I could not verify it and the two accounts disagree: standard Spring Boot Not verified: the archive layout, for the reason above. Not verified: MySQL, Hosted/fault, real SSH and Kubernetes behaviour — those lanes are skipped on this run and the PR body already lists them as pending. Round-1 findings that are now closed
What I checked and think is right
Assembly path after the splitsequenceDiagram
participant P1 as ManagedAgentConfiguration
participant P2 as ManagedAgentProperties
participant P3 as RuntimeProviderRegistry
participant P4 as ServiceLoader
participant P5 as RuntimeProviderFactory
participant P6 as EmbeddedRuntimeBroker
P1->>P2: validateRuntimeProvider()
P2->>P3: validateSelected(settings)
P3->>P4: load RuntimeProviderFactory
P4-->>P3: installed factories, keyed by kind
P3->>P5: validate(settings) for each selected kind
P6->>P3: create(settings, transport, dependencies)
P3->>P5: validate then create
P5-->>P3: RuntimeProvisioner, caller owns close
P3-->>P6: provisioner, kind re-checked against config
Files changed (24 of 154 shown)
Test evidenceThis is an unattended CI run, so I did not build or execute anything from this PR. The evidence below is the PR's own check-runs on the reviewed commit, read through the API. Final CI results for
One row per check name (latest run); skipped checks omitted; failures sort first. / 每个检查名一行(取最新一次运行),省略 skipped,失败项排在最前。 Nothing is red yet, and nothing has gone green that settles the two blockers either. The job that matters — The skipped set is worth naming explicitly, because it is exactly the acceptance the PR body says is outstanding: Sandboxed verification would settle the two things neither this diff nor this CI run can: 中文说明代码审查我按当前 head 通读了 diff,并逐条复核了第一轮的六个 finding,既不采信报告本身,也不采信回复。三条确实已修,一条已不再适用,两条仍然存在,并且会把当前正在跑的 Java job 染红。 阻塞项1.
最小修法是把反射指向 对应第一轮 finding #5,未修。 2. Checkstyle 拒绝三个新增生产源文件。
我扫描了整个 diff,查找"新增空行紧跟新增的行首 未定论——这一条我无法判定3. 第 35 行断言 我不把它作为 finding 重复提出,因为我无法验证,而且两种说法互相矛盾:Spring Boot 未验证:归档布局,原因如上。未验证:MySQL、Hosted/fault、真实 SSH 与 Kubernetes 行为——本次运行这些 lane 被跳过,PR 正文也已列为待验收。 第一轮已关闭的 finding
我核对过并认为正确的部分
测试证据这是无人值守的 CI 运行,所以我没有构建或执行本 PR 的任何代码。下面的证据是通过 API 读取的、本 PR 自己在被审 commit 上的 check-run 结果。 目前没有任何一项为红,但也没有任何一项变绿到能判定上述两个阻塞项。 关键的那个 job—— 被跳过的部分值得点名,因为它恰好就是 PR 正文所说尚未完成的验收: 沙箱验证可以判定这个 diff 和本次 CI 都无法判定的两件事: — Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
|
Confidence: 2/5 — the architecture is sound and the risky part of it was done carefully, but two gates cannot pass at this head and both were already reported once. Stepping back: my independent proposal before reading the diff was one Maven module per backend, the SPI in The part I expected to be weakest turned out to be the strongest. Deleting What stops me is narrower than the architecture and, unfortunately, mechanical. So I am requesting changes rather than deferring. The fixes are two-line-each, and the module split itself deserves to land — but it should land on a head where One thing I want to be explicit about, since it cuts against my verdict: I could not verify finding 3 and I have not presented it as a defect. Round 1 measured the metadata file at the archive root; the standard Spring Boot layout says it belongs under @doudouOUC — the two blockers are in the Java reactor, which nothing in this round ran. Re-running
中文说明Confidence: 2/5 —— 架构是站得住的,其中最有风险的部分做得很仔细,但当前 head 上有两道门禁不可能通过,而这两条都已经被报过一次。 退一步看:我在读 diff 之前独立设想的方案是每个后端一个 Maven 模块、SPI 放在 我原以为最薄弱的地方反而是最强的。把 让我停下来的东西比架构狭窄得多,而且很不巧是机械性的。 所以我选择 request changes 而不是 defer。修法各自只有两行,模块拆分本身值得合入——但它应该合在一个 有一点我要讲明白,因为它与我的结论相反:finding 3 我无法验证,我也没有把它当作缺陷提出。第一轮实测元数据文件在归档根;Spring Boot 的标准布局说它应该在 @doudouOUC —— 两个阻塞项都在 Java reactor 里,而本轮没有任何东西跑过它。从
— Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
|
|
|
|
已在
失败依据:fast Java、Windows Java、Hosted/Checkstyle、Node 发布夹具。这些是代码或测试问题,已修复后推送,未用重跑掩盖。取消的 label 任务已输出 no-change,不做重试。 关于 round 1 的 metadata finding:这次下载并核对了 reference CI 41455245763 的 artifact 本地发布测试、ESLint、Prettier、差异检查和正常提交钩子通过;两次完整增量自审及独立静态复核已完成。共享 Java 预算保持 599.048/600 秒,本轮没有运行 Java/javac/Maven。新提交的 Java 编译、unit/H2、Checkstyle、SpotBugs、打包/embedding、MySQL、RocketMQ、Hosted/fault、真实 SSH/Kubernetes 和跨平台验收仍待对应 CI/环境证据。rebase 后重新执行根目录 build(151.506 秒)、typecheck(57.590 秒)和 bundle(3.066 秒),均通过;这些是 JS/TS 检查,不扩充或替代 Java 验证预算。 PR 当前为 Ready,已更正正文中旧的 Draft 描述,没有改变 PR 状态。人工 approval 后的普通建议处理继续暂停,本轮只修复已确认的 CI/gate 问题;独立 Maven 后端与必要装配的既定范围保持不变。当前 inline review threads 为 0 个(0 unresolved),本轮无须 resolve;此总结不代表完整验收通过。 已机械 rebase 到最新 main |
|
|
|
|
|
Extract five backend implementations behind the shared provider SPI and support selected-backend executable distributions. Preserve SQL ownership, defer unavailable historical work, and make Spring own SSH connection cleanup. Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Keep optional backend dependencies and safe assembly while deferring selective standalone distributions. Restore default packaging and document the provider configuration. Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Validate Kubernetes Pod paths independently of the control-plane OS and align regression fixtures with the split backend packages and packaged metadata. Remove the three Checkstyle violations without changing runtime behavior. Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
a3ac63c to
dbe853d
Compare
|
Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. 中文请勿对活跃的 PR 执行 rebase 或 force-push,因为这会使已有的评审评论失效。另外,供日后参考:作为集成流程的一部分,机器人始终会自动将所有改动压缩(squash)为单个提交。 |
|
|
qqqys
left a comment
There was a problem hiding this comment.
Review at dbe853da862ec033f234ea0009441593f6d60e84 — COMMENT (not approving)
The head moved since my previous round at 08d6c1b2 (rebased onto main 4dce337e, plus fix(managed-agent): Repair runtime backend CI gates). I re-verified every historical blocking finding against the current head. All of them are fixed or moot, with concrete code evidence below. I am still not approving, for two reasons stated at the end — neither is a new defect claim.
Historical blockers: all confirmed fixed at this head
1. Checkstyle rejected three new backend sources (blank line before the class closing brace) — FIXED.
ExternalRuntimeProviderFactory.java, RuntimeStateFiles.java and LocalRuntimeProviderFactory.java each drop exactly one trailing blank line. I censused rather than sampled: across every src/main/java/**/*.java file in all seven new modules (runtime-local, runtime-ssh, runtime-kubernetes, runtime-external, runtime-static, runtime-host, runtime-http) there are zero remaining instances of a blank line immediately preceding a top-level }. Caveat on this one: I inferred the violated rule from the three files the CI log named; I did not read the Checkstyle configuration to confirm the rule ID. So the census is complete against the pattern that actually failed, not against the full ruleset.
2. EmbeddedRuntimeBrokerTest reflected a field the refactor removed — FIXED.
provisionerOf(...) now reflects primaryProvisioner, and EmbeddedRuntimeBroker.java:67 declares private final RuntimeProvisioner primaryProvisioner; (assigned at :258, consumed at :340). The reflected name and the (RuntimeProvisioner) cast both match the declared field.
3. StaticRuntimeProviderFactoryTest expected an unnormalized URI — FIXED, and the fix is on the test, correctly.
RuntimeLease.java is not modified by this PR (git diff 4dce337e..dbe853da -- '*RuntimeLease.java' is empty). Its constructor routes the endpoint through BrokerValues.requireOrigin, which validates the origin and then returns value.resolve("/"). The test configures setStaticEndpoint("http://127.0.0.1:41270"), so http://127.0.0.1:41270/ is the only correct expectation. The old assertion was wrong; production behavior did not change.
4. Archive inspector reading configuration metadata at a path Spring Boot does not write — MOOT.
git grep "BOOT-INF/classes/META-INF" dbe853da returns nothing anywhere in the tree. The only remaining reader is ManagedAgentPackagingIT, now asserting the root-level META-INF/spring-configuration-metadata.json, which matches the artifact you downloaded from reference CI run 41455245763.
5. provider-options documentation and stale generated reference — still settled.
Build and verify reference distribution is green at this head (4m34s).
6. sdk-java.yml workflow-size ratchet — still settled.
Lint & Static (ubuntu-latest, Node 22.x) is green at this head (15m58s).
7. The second failing test the gate report named, which my previous round did not cover — FIXED, same root cause as #4 in your list.
ResidentWorkspaceProvisionerTest.logicalCloseIsAvailableOnlyForTheConfiguredResidentBinding sets provisioner("kubernetes-workspace") and workspaceCwd("/workspace"), then builds a broker through EmbeddedBrokerFixture. The old resolveWorkspaceCwd used Path.of(cwd).isAbsolute(), which is false for /workspace on Windows — hence the failure appearing only on the windows-latest / Java 21 lane. The replacement is host-independent string validation, and I traced the call chain to confirm the tests actually reach it: workspaceId(broker) → resolveWorkspaceId(broker, resolveWorkspaceCwd(broker)) (EmbeddedRuntimeBroker.java:509).
I also checked the new validator's own logic against its 15 parameterized cases rather than trusting the count. Precedence is A || B || C || (D && E), so the !configured.equals("/") guard correctly short-circuits the segment scan for the root path — without it "/" would self-reject, because "".split("/", -1) yields one empty part. /workspace/project with spaces is accepted; //workspace, /workspace/, /workspace//project, /workspace/., /workspace/../project, C:\workspace, \\server\workspace, the NUL case, null and empty are all rejected. Consistent with the assertions.
Optional-dependency wiring is as designed. All five backend artifacts are <scope>runtime</scope> + <optional>true</optional> in server/pom.xml, so an embedding consumer inherits none of them transitively.
Why this is a COMMENT and not an APPROVE
a) No Java execution evidence exists at this head, and every one of the seven findings above was originally revealed by execution, not by reading. The decisive lane SDK Java (fast) / ubuntu-latest / Java 21 is pending; Runtime Broker and Managed Agent MySQL, Hosted process fault gates, Hosted failover E2E, and both EventTransport gates are skipping, so the lanes that previously produced the Managed Agent gate failure list have not run against dbe853da at all. I am not treating pending CI as a defect and did not wait for it. But my confirmations above are static, and one of them (#1) rests on an inferred rule. Where a finding was proven by a failing test, a green run of that test is the matching evidence, and it does not exist yet.
b) The Critical-only scan of the current code is incomplete. 155 files, +3416/−603, seven new Maven modules and a new SPI surface. Within this round's budget I verified the fix commit end to end and re-checked the two censuses from last round (SPI registration completeness, no CI gate narrowed), but I have still not read: the RuntimeProviderFactory / RuntimeProviderRegistry interfaces themselves, the fail-open question of a deployment that omits a backend it later requests, the pending-state and storage-claim recovery path when a backend disappears mid-operation, and the SSH connection cleanup lifecycle now that Spring owns destroyMethod = "close". Those are exactly the places a module split would hide a correctness or data-loss defect. I am not reporting a finding in any of them — I am reporting that I did not look, which is not the same as clean.
Next step
Let SDK Java (fast) / ubuntu-latest / Java 21 finish at dbe853da. If it is green, findings 1–4 and 7 are settled by execution and item (a) above disappears; the remaining gap is only the unread SPI/recovery surface in (b), which I would close in a follow-up round rather than have you change anything. If it is red, the failure names will say which. Nothing in this round asks for a code change.
One non-blocking note: the pr-force-push-reminder fired on this push. The rebase preserved the three original commits and range-diff confirmed the first two are content-identical, so nothing was lost here — just be aware the bots squash on integration anyway.
yiliang114
left a comment
There was a problem hiding this comment.
Scope & Linkage
30 files / +451 −40. This narrowed PR establishes the RuntimeProviderFactory SPI and RuntimeBackendSelection contract, adds the new module cache paths to CI workflows, and gates existing integration points behind backend selection — without shipping the backend module implementations themselves. A clean contract-first landing. Follow-up to merged #15871. No issue is closed.
Key observations
SPI design — clean. RuntimeProviderFactory.kinds() → validate(settings) → create(settings, transport, dependencies) is a well-gated lifecycle. RuntimeProviderDependencies uses default IllegalStateException throws so providers only borrow the ports they need. RuntimeBackendSelection.from(settings) correctly derives the needed backend set from configuration alone: SSH-only with nodes → {ssh-process}, Local with nodes → {local-process, ssh-process}, nodes on non-Local/non-SSH primary → rejected, no nodes → {primary}.
Integration gating is correctly placed. SshWorkspaceService implements SshRuntimeAccess and gates SSH catalog population, list/admit/schedule/acceptance operations behind RuntimeBackendSelection.includes(SSH_PROCESS). ManagedRuntimeCoordinator blocks SSH-only Hosted Workspace execution and delegates context-change/capability checks. WorkspaceRuntimeResolver blocks local mount operations when the backend is not local. WorkspaceFileUploadStore derives the required backend from the target and blocks when unavailable. Every gate rejects before side effects.
No resource cleanup regression. SshWorkspaceService.close() removes the manual connections.close() call, which is now redundant — the managedSshConnections bean in ManagedAgentConfiguration carries destroyMethod = "close" and is gated behind RuntimeBackendSelection.includes(SSH_PROCESS).
CI workflow changes are mechanical and forward-looking. sdk-java.yml and verify-maven-repo.yml consistently add the seven new qwen-managed-agent-runtime-* artifact paths to cache resolve, write-back exclusion, and artifact verification lists. The paths are harmless when the corresponding modules don't exist yet — find -prune and cache restore both skip non-existent paths silently.
Documentation is bilingual and synchronized. Both 2026-10-31-managed-runtime-backend-modules.md and its .zh-CN counterpart document the module split, backend selection, recovery behavior, and migration notes. Older design docs have their source paths updated.
Previous reviews at superseded heads
My APPROVE at head 08d6c1b was push-dismissed; qqqys's COMMENT at that head flagged four findings pending the Java compile lane — all of which depended on backend module sources that were removed from scope in this narrowing.
Verdict
No P0/P1 findings. The SPI contract is well-defined, the selection logic is correct, and the integration gates reject before side effects. The Flyway migration uniqueness lane passed at this head, confirming compilation; the main SDK Java lane is still running but this does not block approval.
APPROVE the current head dbe853da.
qqqys
left a comment
There was a problem hiding this comment.
Review at dbe853da862ec033f234ea0009441593f6d60e84 — APPROVE
This is a corrected verdict on an unchanged head. My previous round here was a COMMENT for two stated reasons: no Java execution evidence at this head, and an unfinished scan of the new SPI surface. Both are now resolved, and I said in that round that I would re-review against a green Java lane. It is green, and so is everything above it.
Reason (a) resolved: the whole Java tier executed at this head
SDK Java (fast) / ubuntu-latest / Java 21 passed in 26m53s — the lane that was pending when I filed the COMMENT, and the one that settles the findings originally revealed by execution. Beyond it, all twelve SDK Java (full) lanes passed, which is stronger evidence than I asked for:
windows-latest / Java 21(8m32s) — settlesResidentWorkspaceProvisionerTest.logicalCloseIsAvailableOnlyForTheConfiguredResidentBinding, the failure that only reproduced on Windows because the oldPath.of("/workspace").isAbsolute()is false there. The host-independent POSIX validation now passes on the platform that broke.Runtime Broker and Managed Agent MySQL / Java 21(1h14m3s) andHosted process fault gates / MySQL 8.4 / Java 21(1h56m7s) — exercise the recovery, pending-state and storage-claim behaviour that a backend split could silently break, against real MySQL rather than H2.Hosted failover E2E(33m26s), bothEventTransportgates,macos-latest,ubuntu Java 11/17/21,Real daemon E2E / Java 11,Flyway migration version uniqueness,Managed Agent fast tierandManaged Agent gate.
Also green: Test (ubuntu-latest, Node 22.x) 36m44s, web-shell E2E Smoke 44m27s, Lint & Static, Integration Tests (no-AK), Build and verify reference distribution, TUI parity snapshots. No lane is failing or pending at this head. The seven findings I confirmed statically last round are now confirmed by execution too, including the Checkstyle census whose rule I had only inferred.
Reason (b) resolved: the fail-open question has a fail-closed answer
The item I most wanted to read was whether a deployment that omits a backend it later requests degrades silently. It does not. In RuntimeProviderRegistry:
require(kind)throwsIllegalStateException("Runtime provider is not installed: …; add its provider JAR (installed: …)")when the kind is absent from the discovered set, and separately refuses the reservedkuberneteskind. Both are hard refusals that name what is installed — diagnosable, not silent.- The constructor rejects a duplicate or reserved kind outright, so a second JAR claiming an existing kind cannot shadow it.
create(...)closes the provider and throws whenprovider.kind()disagrees with the configured kind, so a mis-registered factory leaks no resource.validateSelected(settings)walksRuntimeBackendSelection.from(settings).kinds()sorted and callsrequire(kind).validate(settings)— deterministic order, andrequirethrows beforevalidatecan run, so a missing backend fails during validation rather than during resource creation.
That ordering holds at every call site, which I censused rather than sampled: ManagedAgentConfiguration:107, ManagedAgentProperties:481, EmbeddedRuntimeBroker:180, and ManagedAgentPreflight:1077 and :1172. On the SSH path specifically, ManagedAgentConfiguration:100-109 validates and only then calls registry.ssh().createConnections(...), and the bean is @Bean(destroyMethod = "close") so Spring owns SshConnections cleanup on shutdown. The bean returns null when RuntimeBackendSelection does not include SSH_PROCESS, which is what keeps an SSH-only assembly from initializing Local and a Local-only assembly from touching SSH credentials.
Carried forward from last round and still verified: five RuntimeProviderFactory implementations against five matching META-INF/services resources, with runtime-http and runtime-host correctly holding none; all five backend artifacts <scope>runtime</scope> + <optional>true</optional> in server/pom.xml, so an embedding consumer inherits none transitively; and sdk-java.yml purely additive across all four cache paths, with no module dropped from a reactor invocation and no timeout, selector or tier condition altered.
Scope of this approval
I read the SPI registry and its call sites, the SSH bean lifecycle, the whole CI-gate fix commit, the POSIX workspace-path validator and its call chain, and the two censuses above. I did not read all 155 files line by line — the moved-class renames, the design documentation and the bulk of the relocated test bodies I assessed by diff shape and by the green tier rather than by close reading. Nothing I did read is provably defective, and the lanes that would catch a defect in the parts I skimmed all ran and passed. Approving on that basis.
|
Released in v0.26.7. |
|
|


What this PR does
Splits Local, SSH, Kubernetes, External and Static Runtime implementations into independent Maven artifacts. Services embedding the ordinary server library explicitly add only the same-version backends they need; all five backend dependencies are optional. The default standalone executable and operator artifacts remain complete, with their existing classifiers and reference packaging.
Selected backends are validated before resources are created. SSH-only assembly no longer initializes Local, and Spring owns shared SSH connection cleanup. Historical operations retain pending state and storage claims while their backend is unavailable, then resume when it returns. Maintenance requests the capability needed by each action while retaining SQL-only branches. Kubernetes workspace paths are validated as remote Pod paths independently of the control-plane operating system. The design and configuration reference are synchronized in English and Chinese.
Why it's needed
The existing adapter bundle combines unrelated backend implementations, and SSH assembly requires a Local provider. An embedding service cannot choose its backend dependencies independently. This change establishes that boundary while preserving recovery, storage ownership and resource cleanup when available backends change.
Reviewer Test Plan
Acceptance remains pending. Local checks cover scripts, workflow contracts, documentation and static boundaries; the complete release-script test file passes all 56 cases after repairing its source-move fixture. The Java verification budget shared with the earlier Local/External work is closed at 599.048/600 seconds; the current Java module graph and runtime regressions require CI evidence.
How to verify
execclassifier, application configuration and metadata, five backend JARs and service registrations, Lombok exclusion and maintenance launchers remain compatible. The ordinary library should contain no standalone application YAML./workspacemust be accepted on Linux, macOS and Windows control planes while relative, dot-component and non-normalized paths remain rejected.Evidence (Before & After)
N/A — backend modularization has no UI changes. A separate verification comment records local results, prior CI failures, their corrections and remaining acceptance work.
Tested on
Environment (optional)
macOS arm64, Node.js 26.12.1 and npm 11.20.0. Java acceptance requires JDK 21. Based on main
4dce337ea28d6b8718934b40b8a358cd362f1578, preserving its Store constructor injection and configuration metadata support. Root build/typecheck/bundle and the 110 affected script tests passed again after rebasing onto this main revision; the profile-owned specialist test configuration is preserved.Risk & Scope
The complete synchronized design is available in English and Chinese.
Linked Issues
Follow-up to merged PR #15871. No issue is closed by this PR.
中文说明
本 PR 的改动
将 Local、SSH、Kubernetes、External 和 Static Runtime 实现拆为独立 Maven 产物。嵌入普通 server library 的服务只显式添加所需的同版本后端,五个后端依赖均为 optional。默认独立可执行包及运维产物保持完整,沿用既有 classifier 和参考打包方式。
选中后端在创建资源前完成校验。SSH-only 装配不再初始化 Local,共享 SSH 连接由 Spring 负责清理。历史操作在所属后端不可用时保留 pending 状态和存储占用,恢复后端后继续。运维按 action 获取所需能力,同时保留纯 SQL 分支。Kubernetes Workspace 路径按远端 Pod 路径校验,不依赖控制平面操作系统。设计及配置参考同步提供中英文版本。
为什么需要
现有 adapter 包混合了彼此独立的后端实现,SSH 装配还要求 Local provider,嵌入服务无法独立选择后端依赖。本次建立这一边界,同时保留可用后端变化时的恢复、存储所有权和资源清理行为。
Reviewer 测试计划
验收仍待完成。本地检查覆盖脚本、工作流契约、文档和静态边界;修复源码迁移后的夹具路径后,发布脚本测试文件的全部 56 个用例通过。与前期 Local/External 工作共享的 Java 验证预算已在 599.048/600 秒关闭;当前 Java 模块图及 runtime 回归需要 CI 证据。
如何验证
execclassifier、应用配置及元数据、五个后端 JAR 和服务注册、Lombok 排除及运维启动器保持兼容。普通 library 不应包含独立应用 YAML。/workspace这样的 Kubernetes Pod 路径,同时继续拒绝相对路径、点分量及未规范化路径。证据(Before & After)
N/A — 后端模块化没有 UI 改动。独立验证评论记录本地结果、上一版 CI 失败及其修正,以及剩余验收工作。
测试平台
环境(可选)
macOS arm64、Node.js 26.12.1、npm 11.20.0。Java 验收要求 JDK 21。基于 main
4dce337ea28d6b8718934b40b8a358cd362f1578,保留其中的 Store 构造注入和配置元数据支持。rebase 到此 main 版本后,根目录 build/typecheck/bundle 和 110 项相关脚本测试再次通过;保留专项 profile 负责测试启用的配置。风险与范围
完整且同步的设计提供英文版和中文版。
关联事项
作为已合并 PR #15871 的后续工作。本 PR 不自动关闭任何 issue。