Repository navigation
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
oss-maintainer
left a comment
There was a problem hiding this comment.
Summary
Converts the Redisson 3.x/4.x RScript.ReturnType.LONG linkage failure into an actionable IllegalStateException raised at construction time, resolved once into a final field and reused by both production eval callers, plus regression tests and EN/ZH docs. The approach is sound — capability detection via valueOf("LONG") instead of version-string parsing is the right call, and the "no Redis interaction before the check" assertions are valuable coverage. No blocking correctness issue found; my comments are about keeping the diagnostic and the guidance from drifting.
Findings
- [Warning]
RedissonClientAdapter.java:128—getPackage()may benullandgetImplementationVersion()is usuallynullfor library jars, so the failure path can either NPE or printunknown; suggested a code-source fallback. - [Warning]
RedissonClientAdapter.java:133—4.2.0is hard-coded in a runtime message with nothing tying it toagentscope-dependencies-bom, so the guidance goes stale silently on the next bump. - [Warning]
RedissonAgentStateStore.java:79-91— the whole block including the message text is duplicated verbatim from the adapter; hoisting just the string constant respects the "no new helper" constraint while removing the drift risk. - [Info]
RedissonClientAdapterTest.java:72— theIllegalStateExceptionsurfaces fromBuilder.redissonClient(...), notbuild(); the new failure mode should be documented with@throwson the two public entry points. - [Info]
docs/.../redis.md:27— the same two paragraphs now live in four files, one of which is marked superseded.
Strengths
constructsWithoutContactingRedis/constructsAdapterAndUnifiedStoreWithoutContactingRedispin the "fail before touching the network" contract, which is the part users actually care about.validatesPrefixBeforeResolvingReturnTypeandvalidatesClientBeforeResolvingReturnTypecorrectly lock the validation-before-capability-detection ordering, so argument errors stayIllegalArgumentException.customAdapterDoesNotResolveRedissonReturnTypeguards against the check leaking into non-Redisson adapters, andsaveIfVersionPreservesVersionAndConflictResultsverifies the constant is resolved once at construction rather than per call.- Both call sites are covered and no remaining
RScript.ReturnType.LONGreference exists in main sources, so the fix is complete for the reported stack trace.
Questions
- Is a
String-code-source fallback acceptable for the "loaded Redisson API implementation version" field when the manifest omitsImplementation-Version, or would you prefer it stayunknownand drop the code-source detail? - Do you want the
@throws IllegalStateExceptionJavadoc in this PR, or tracked separately?
Automated review by github-manager-bot
|
Thanks, that is a much better diagnostic. All five addressed:
|
oss-maintainer
left a comment
There was a problem hiding this comment.
Summary
Re-review of 8dcda477 → 7ac7282. All five points from the previous round are addressed: getPackage() is null-guarded with a code-source fallback, the hard-coded 4.2.0 is replaced by a BOM reference, the duplicated message is hoisted into RedissonClientAdapter.INCOMPATIBLE_REDISSON_API, @throws IllegalStateException documents the early-failure boundary on redissonClient(...), and the redundant Redisson paragraphs are collapsed into a link from the superseded session pages to distributed/redis.md. The tests now assert the exact composed message instead of a substring, which is the stronger form of the same guarantee. No blocking issue found — approving; the three items below are optional cleanups.
Findings
- [Info]
RedissonClientAdapter.java:139— code-source fallback printsnull/ aCodeSourceblob where a version is expected. - [Info]
RedissonAgentStateStore.java:86— the version-resolution fallback is duplicated verbatim in the adapter and in both test helpers.
Strengths
- Replacing the version-string literal with a BOM pointer removes the silent-staleness failure mode, and
validatesPrefixBeforeResolvingReturnType/customAdapterDoesNotResolveRedissonReturnTypekeep the ordering and containment guarantees pinned. - The docs collapse is the right direction: one canonical compatibility page instead of four copies that drift independently.
Automated review by github-manager-bot
Additional notes (not anchored to a changed line)
- [INFO]
agentscope-extensions/agentscope-extensions-redis/src/main/java/io/agentscope/extensions/redis/state/redisson/RedissonAgentStateStore.java:416— [Info]@throws IllegalStateExceptionwas added toRedisAgentStateStore.Builder.redissonClient(...)andRedissonClientAdapter.of(...), which is the right pair of entry points.RedissonAgentStateStore.Builder.build()throws the same way and its Javadoc is still silent — one line there would close the loop. (line outside diff)
- Null-check RScript.class.getPackage() and fall back to the code source when the manifest declares no Implementation-Version, so the failure path cannot NPE or print "unknown". - Replace the hard-coded 4.2.0 literal with a pointer to the version managed by agentscope-dependencies-bom. - Extract the message into a single package-private RedissonClientAdapter.INCOMPATIBLE_REDISSON_API constant used by both constructors and asserted by both tests. - Document @throws IllegalStateException on RedissonClientAdapter.of and RedisAgentStateStore.Builder.redissonClient, noting the check fires from the setter rather than from build(). - Keep the Redisson 4.x guidance only on the EN/ZH distributed pages and leave a pointer on the superseded session pages.
Both optional cleanups from the review. The code-source fallback interpolated String.valueOf(codeSource) into a sentence promising a version, so it rendered either the literal "null" or a "(file:/...jar <no signers>)" blob. It now degrades to omitting the version clause rather than printing a meaningless one. The package -> Implementation-Version -> code-source fallback was duplicated verbatim in RedissonClientAdapter and RedissonAgentStateStore and repeated again in both test classes. It lives in one place now and the callers and tests use it. No behavior change to the compatibility guard itself. Signed-off-by: Matt Van Horn <[email protected]>
7ac7282 to
c19b7bc
Compare
|
Both Info items done in c19b7bc, since they were quick. The code-source fallback no longer interpolates a CodeSource blob or the literal "null" into a sentence promising a version; it drops the version clause when it cannot determine one. And the package to Implementation-Version to code-source fallback now lives in one place instead of being duplicated across the adapter, the store and both test classes. No change to the compatibility guard itself, so your approval should still hold. |
oss-maintainer
left a comment
There was a problem hiding this comment.
Summary
Re-reviewed the delta since my previous approval (7ac72824 → c19b7bc0, "refactor: hoist Redisson version resolution and fix its fallback message"). It is exactly the two follow-ups I asked for, done well: the 4-line package/Implementation-Version/code-source fallback is hoisted into RedissonClientAdapter.loadedRedissonApiVersion() + incompatibleRedissonApiMessage(String) so the deprecated RedissonAgentStateStore no longer keeps a verbatim copy, and the diagnostic no longer interpolates a CodeSource blob or the literal "null" into a sentence — the version clause is simply omitted when the version is unknown. INCOMPATIBLE_REDISSON_API no longer ends in a dangling " ... version: ", which also removes the coupling of the user-facing text to a hard-coded 4.2.0. The stale BOM sentence in the docs is gone and the "this check reports the incompatibility, it does not repair dependency resolution" caveat is present in both the EN and ZH pages.
Tests: the duplicated private loadedRedissonApiVersion() helpers were removed from both test classes and replaced with direct coverage of the new contract — blank/whitespace/null all collapse to the base message, a known version is appended verbatim, and loadedApiVersionIsNeverACodeSourceLocation pins the regression (no <no signers>, no version: null, and a file: location can never be returned) while staying tolerant of whatever version the test classpath actually carries. assertFalse(...) on the construction-boundary tests guards against the old formatting silently coming back.
One optional, non-blocking thought left as an inline note at RedissonClientAdapter.java:190: the blank-version case is also the case where the classpath is most ambiguous, so a separately labelled code-source field could restore the "which jar won" signal without putting a location in the version slot. Fine to skip.
Verified on this head: license/cla = signed, Check License / Check Module Sync / build (ubuntu-latest) / build (windows-latest) / validate / codecov/patch all passing, mergeable=MERGEABLE, mergeStateStatus=CLEAN. Approving on c19b7bc0; merging is left to a maintainer.
Automated review by github-manager-bot
|
Thanks for the re-review. I'm going to leave the optional code-source field at |
AgentScope-Java Version
In each existing Redisson constructor, resolve
RScript.ReturnType.valueOf("LONG")into a final instance field and translate a missing constant into an actionableIllegalStateExceptionexplaining that this state-store integration requires the Redisson 4.x API, that 3.x is incompatible, and that the project currently manages 4.2.0. Preserve existing argument validation in the deprecated store, resolve the constant before any Redis operations, retain the original exception as the cause, and include the loaded Redisson API package implementation version when available with an explicit unknown fallback; capability detection, rather than parsing a nullable version string, decides compatibility. Use that stored return type inRedissonClientAdapter.evalScriptandRedissonAgentStateStore.evalSave, covering both production script callers without a new helper, injectable resolver, static initializer, or INTEGER fallback.The reporter encounters
NoSuchFieldError: RScript$ReturnType.LONGwhen persisting agent state with AgentScope 2.0.3 and Redisson starter 3.52.0. The September 11 COLLABORATOR evaluation confirms the failure but corrects its cause: Redisson 3.x exposes INTEGER, while AgentScope's code targets the LONG constant introduced in 4.x; the evaluation reports no embeddedorg/redisson/**classes in the published aggregate. The local clone corroborates both LONG references and the BOM's Redisson 4.2.0 baseline, and its Redis extension already declares Redisson as a dependency. The thread proposes a construction-time guard and version documentation separately from an aggregate packaging decision, which remains pending.Fixes #3063
Description
In each existing Redisson constructor, resolve
RScript.ReturnType.valueOf("LONG")into a final instance field and translate a missing constant into an actionableIllegalStateExceptionexplaining that this state-store integration requires the Redisson 4.x API, that 3.x is incompatible, and that the project currently manages 4.2.0. Preserve existing argument validation in the deprecated store, resolve the constant before any Redis operations, retain the original exception as the cause, and include the loaded Redisson API package implementation version when available with an explicit unknown fallback; capability detection, rather than parsing a nullable version string, decides compatibility. Use that stored return type inRedissonClientAdapter.evalScriptandRedissonAgentStateStore.evalSave, covering both production script callers without a new helper, injectable resolver, static initializer, or INTEGER fallback.Checklist
Please check the following items before code is ready to be reviewed.
mvn spotless:applyNot run: no test command resolved in this workspace, so nothing was executed to pass.
mvn test)Not run: no test command resolved in this workspace, so nothing was executed to pass.