Skip to content

chore(sdk-java): align fastjson2 version to 2.0.65 - #12836

Merged
wenshao merged 1 commit into
mainfrom
codex/align-fastjson2-version
Sep 27, 2026
Merged

wenshao merged 1 commit into
mainfrom
codex/align-fastjson2-version

Conversation

@wenshao

@wenshao wenshao commented Sep 27, 2026

Copy link
Copy Markdown
Collaborator

What this PR does

Aligns the Managed Runtime Broker's fastjson2 dependency from 2.0.60 to 2.0.65, matching the ACP client and Qwen Code Java SDK. Updates the dependency documentation in English and Chinese to match.

Why it's needed

The Java modules currently declare different fastjson2 versions. Aligning them keeps the broker's standalone dependency consistent with the other Java SDK modules.

Reviewer Test Plan

How to verify

  • Confirm all three Java modules declare fastjson2 2.0.65 and the broker's dependency documentation agrees.
  • Confirm the broker still passes its existing JSON transport, managed-context, and JDBC repository tests with fastjson2 2.0.65.

Evidence (Before & After)

N/A — dependency and documentation alignment; no UI changes.

Local validation:

  • Broker Maven tests: 365 total, 364 passed, 1 skipped, 0 failures or errors. The optional real-worker test was skipped because no worker bundle was supplied.
  • Full workspace build: passed.
  • Full workspace typecheck: passed.
  • Diff whitespace check: passed.

Tested on

OS Status
🍏 macOS ✅ tested
🪟 Windows ⚠️ not tested
🐧 Linux ⚠️ not tested

Environment (optional)

macOS arm64, JDK 21, Node.js 22.22.2.

Risk & Scope

  • Main risk or tradeoff: the broker now uses a newer JSON codec; existing broker tests passed against 2.0.65.
  • Not validated / out of scope: optional real-worker and MySQL integration tests; Windows and Linux execution.
  • Breaking changes / migration notes: none expected; no application logic or schema changes.

The English design and Chinese design contain the same version update; the existing design content remains synchronized.

Linked Issues

None.

中文说明

本 PR 的变更

将 Managed Runtime Broker 的 fastjson2 依赖从 2.0.60 对齐到 2.0.65,与 ACP client 和 Qwen Code Java SDK 保持一致。同步更新英文和中文依赖文档。

变更原因

Java 模块当前声明的 fastjson2 版本不一致。统一版本可使 Broker 独立使用时的依赖与其他 Java SDK 模块保持一致。

审阅者测试计划

如何验证

  • 确认三个 Java 模块均声明 fastjson2 2.0.65,且 Broker 依赖文档与之保持一致。
  • 确认 Broker 使用 fastjson2 2.0.65 后,现有 JSON 传输、托管上下文及 JDBC Repository 测试仍通过。

变更前后证据

不适用——仅对齐依赖和文档,无 UI 变更。

本地验证:

  • Broker Maven 测试:共 365 项,364 项通过、1 项跳过,无失败或错误。由于未提供 Worker bundle,可选的真实 Worker 测试被跳过。
  • 全仓构建:通过。
  • 全仓类型检查:通过。
  • Diff 空白检查:通过。

测试平台

操作系统 状态
🍏 macOS ✅ 已测试
🪟 Windows ⚠️ 未测试
🐧 Linux ⚠️ 未测试

环境(可选)

macOS arm64、JDK 21、Node.js 22.22.2。

风险与范围

  • 主要风险或取舍:Broker 改用更新的 JSON 编解码器;现有 Broker 测试已在 2.0.65 下通过。
  • 未验证或范围外:可选的真实 Worker 和 MySQL 集成测试;Windows 和 Linux 执行。
  • 破坏性变更与迁移说明:预计无;未更改应用逻辑或 Schema。

英文设计与中文设计已同步更新相同版本号;现有设计内容保持一致。

关联 Issue

无。

@wenshao
wenshao enabled auto-merge September 27, 2026 08:49

@qqqys qqqys 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.

Independent Critical-only review — head de965367

A patch-level codec bump and the three places that name the version: runtime-broker/pom.xml 2.0.60 → 2.0.65, one sentence each in the JDBC design note (EN and zh-CN) and in the module README. 4 files, +4/-4, no code.

No historical blocker

The bot approved at this head, there are no inline comments and therefore no review threads, and nothing has ever been filed against this PR.

The alignment claim is true, and it removes a real resolution split

I checked every Java module's declaration at this head rather than trusting the description:

Module fastjson2.version
runtime-broker 2.0.65 (this PR)
qwencode 2.0.65
client 2.0.65
managed-agent-server declares none — consumes the broker transitively

That last row is what makes this more than cosmetics. managed-agent-server embeds the broker but does not pin fastjson2, so before this change the version the broker actually ran against inside the server was whatever Maven's nearest-wins mediation picked from the surrounding modules — 2.0.65 from client/qwencode — while the broker's own build and tests ran 2.0.60. The module was therefore tested against one codec and shipped against another. Aligning the declaration removes that split; it does not introduce a new version anywhere.

The codec's documented invariants do not depend on the version being bumped

The broker's JSON use is narrow and its guarantees are structural rather than version-dependent, which is what I wanted to confirm before treating a codec bump as inert:

  • Opaque Tool payloads disable fastjson2 reference detection explicitly, so $ref and @type stay data. That is a feature flag the code sets, not a default it inherits, so a default changing between 2.0.60 and 2.0.65 cannot reopen it.
  • Finite BigDecimal values are written without exponent notation so a reader cannot narrow or overflow them as doubles, and scales above 2048 are rejected before persistence because the same codec cannot read them back. Both are writer- and guard-side, so nothing already stored depends on new reader behaviour, and a newer reader within the same 2.0.x line reading older output is the compatible direction.
  • The exactNumber allow-list in HttpRuntimeTransport accepts only Integer, Long, BigInteger and BigDecimal and rejects everything else, then uses longValueExact(). Its fail-closed behaviour is a property of that allow-list, not of the codec, so no attestation path changes meaning with the bump.

The evidence that the round trips still hold is the strongest available here and it is green at this head: Runtime Broker and Managed Agent MariaDB / Java 21, Hosted no-tool processes / MySQL 8.4 / Java 21, Real daemon E2E / Java 11 and the whole Java matrix (ubuntu 11/17/21, windows, macos) all pass, which is the broker's repository contract and its JDBC paths running against real databases on the new codec. The author's local run reports 365 broker tests with 0 failures and 1 skipped (the optional real-worker test, which needs a bundle that was not supplied).

One stale version reference, explicitly not a finding

HttpRuntimeTransport.java:766 still justifies the allow-list's narrowness with "fastjson2 2.0.60 then reads 0.020000000000000000000E1 as 2" — a version this module no longer declares. This PR updates the three documentation sites and leaves that comment alone. It is a comment-accuracy item, so it is outside Critical-only scope and I am not filing it: no behaviour reads it, the allow-list fails closed whatever the codec does, and the sentence it appears in explains why an alternative (enabling exact-decimal reader features) was rejected, which stays a valid historical reason. Worth sweeping whenever that file is next touched, since a reader on 2.0.65 who re-tests the claim could otherwise conclude the allow-list is unnecessary.

CI

Every check passes at this head — the full Java matrix, both real-database lanes, Real daemon E2E, Test (ubuntu-latest, Node 22.x), Lint & Static, Integration Tests (no-AK, No Sandbox), web-shell E2E Smoke, both Desktop Shell lanes, triage, Classify PR, route, assign, label, authorize. Nothing is pending and nothing has failed.

Scope

I read the whole diff, verified the declared version in all four Java module poms at this head, and re-read the codec invariants the design note states against the code that implements them. I did not fetch the upstream 2.0.65 changelog or audit fastjson2 itself; my confidence that the round trips hold rests on the green real-database lanes, not on an independent reading of the codec.

Verdict: APPROVE — No Critical found and none was ever filed. All three modules that declare fastjson2 now declare the same version, which removes a mediation split where the broker was tested against 2.0.60 and embedded against 2.0.65; the codec's guarantees here come from explicit feature flags, writer-side formatting, a pre-persistence scale guard and a fail-closed allow-list rather than from version-specific behaviour; and every lane that round-trips JSON through a real database is green.

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.

2 participants