Repository navigation
Conversation
HttpRuntimeTransport now implements RuntimeTransport. Status and cancel answers keep only state and a settled result, and session verbs that the v2 tool contract does not define fail closed. Co-authored-by: jinye <doudouOUC@users.noreply.github.com>
This was referenced Sep 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Makes the Java HTTP client for the Managed Runtime a
RuntimeTransport. Execute still returns the settled result. Status and cancel answers are projected to the Broker's closed shape: onlystate, plusresultwhen the state issettled.protocolVersionandlastSequencestay on the wire, where they are still validated, and are not handed to the Broker. Acquire, control, and release fail closed withruntime_session_verb_unsupported, because those session verbs are not part of the merged v2 tool contract.Why it's needed
The Broker already calls
RuntimeTransportfor dispatch, cancellation, and original-execution lookup. The HTTP client had the three tool operations, but it was not that interface, and a status reply still carried wire-only fields that the reconciler rejects. This is the adapter slice between the merged client and a future caller that passes this transport into the Broker. It does not mount the worker or change session lifecycle.Reviewer Test Plan
How to verify
From
packages/sdk-java/runtime-brokeron JDK 21:mvn -Dtest=HttpRuntimeTransportTest test mvn checkstyle:checkA status or cancel reply that includes
protocolVersionandlastSequencecomes back as onlystateand, when settled,result. Invalid sequences still fail before that projection.acquirecompletes with HTTP 501runtime_session_verb_unsupportedand is not retryable.Evidence (Before & After)
N/A
Local result:
HttpRuntimeTransportTest42 tests passed, and Checkstyle reported no violations.Tested on
Environment (optional)
JDK 21, Maven 3.8.7, Linux.
Risk & Scope
lastSequencefrom the status map no longer sees it. The Broker contract already required that field to be stripped.RuntimeTransportbefore this change.Related to QwenLM#12380. Split from the preview in QwenLM#12358.
中文说明
这个 PR 做了什么
Java 的 Managed Runtime HTTP 客户端现在实现
RuntimeTransport。execute 仍返回已结算结果。status 和 cancel 的应答被投影成 Broker 的封闭形态:只有state,并且仅在settled时带result。protocolVersion和lastSequence仍在线上校验,不再交给 Broker。acquire、control 和 release 以runtime_session_verb_unsupported失败关闭,因为这些会话动词不在已合入的 v2 工具契约里。为什么需要
Broker 已经通过
RuntimeTransport做 dispatch、取消和按原执行查询。HTTP 客户端有这三个工具操作,但实现的不是这个接口,status 应答还带着对账器会拒绝的线上字段。这一笔是已合入客户端和未来调用方之间的适配切片,不挂载 worker,也不改会话生命周期。评审测试计划
在
packages/sdk-java/runtime-broker上运行mvn -Dtest=HttpRuntimeTransportTest test和mvn checkstyle:check。带protocolVersion和lastSequence的 status/cancel 应答只回state,settled 时还回result。非法序号仍在投影前失败。acquire以 HTTP 501runtime_session_verb_unsupported结束,且不可重试。本地:42 个测试通过,Checkstyle 无违规。Linux 已测,macOS 和 Windows 未测。
风险与范围
以前从 status map 读
lastSequence的调用方不再看到该字段。Broker 契约本来就要求剥掉它。不包含 Broker 服务接线、worker 处理器,以及 acquire/control/release。这些路由不在 v2 工具契约中,因此本传输直接拒绝,而不去调一条不存在的路径。关联 QwenLM#12380,从预览 QwenLM#12358 拆出。