You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(storage): avoid overflow in search page bounds - #4413
The in-memory, OSS and COS BaseStore implementations calculate start + limit before clamping it to the result count. A large positive limit can therefore overflow to a negative page end, causing subList to throw even for a two-item result set.
Each affected implementation now caps the page length at the remaining count before adding it to the start. The production change is one line per backend; existing listing, sorting, offset behavior, storage format and APIs stay unchanged. Matching EN/ZH documentation explains that this is safe page arithmetic, not a reduction in OSS/COS listing work.
Regressions cover a limit of Integer.MAX_VALUE with a nonzero offset, an offset beyond the result set, ordinary one-item pages and zero-length pages. OSS/COS use mocked SDK fixtures with no cloud credentials or live cloud calls. Negative-argument behavior is outside this fix.
Verification
The three overflow regressions fail on the unchanged base with fromIndex(1) > toIndex(-2147483648). After the fix, the existing BaseStore contract, OSS and COS suites pass 35 cases with no failures/errors/skips.
On Java 17:
mvn -o -B -T1C clean verify
The complete 114-module clean verification passed in 9:29: 13,493 tests, zero failures/errors, 221 skipped. These are local reactor results, not a claim that skipped provider/platform tests ran. No live OSS/COS service was used.
Documentation checks passed from docs/: npm test, npm run validate, npm run broken-links.
Linux passed on a0ea87cb5f489416615cff2ede9b18f1efd63e1b. The Windows run has one assertion failure in the unchanged DashScopeMultiModalEmbeddingTest.synchronousSdkCallRunsOffNonBlockingSubscriberThread: its loopback server did not observe the SDK request within five seconds (job log). The three pagination regression suites pass there; the failure is in agentscope-extensions-rag-simple, which this PR does not change.
The same 114-module local clean verification passed (13,493 tests; zero failures/errors; 221 skips), but that does not establish the cause of this Windows-only failure. I attempted a failed-jobs-only rerun and GitHub rejected it with Must have admin rights to Repository. Could a maintainer rerun the failed Windows job? No source, CI configuration or assertion changes were made to bypass it.
This branch has not been deployed
No deployments
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
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.
AgentScope-Java Version
2.1.0-SNAPSHOT (
main@5a315a9af)Description
Fixes #4412.
The in-memory, OSS and COS BaseStore implementations calculate
start + limitbefore clamping it to the result count. A large positive limit can therefore overflow to a negative page end, causingsubListto throw even for a two-item result set.Each affected implementation now caps the page length at the remaining count before adding it to the start. The production change is one line per backend; existing listing, sorting, offset behavior, storage format and APIs stay unchanged. Matching EN/ZH documentation explains that this is safe page arithmetic, not a reduction in OSS/COS listing work.
Regressions cover a limit of
Integer.MAX_VALUEwith a nonzero offset, an offset beyond the result set, ordinary one-item pages and zero-length pages. OSS/COS use mocked SDK fixtures with no cloud credentials or live cloud calls. Negative-argument behavior is outside this fix.Verification
The three overflow regressions fail on the unchanged base with
fromIndex(1) > toIndex(-2147483648). After the fix, the existing BaseStore contract, OSS and COS suites pass 35 cases with no failures/errors/skips.On Java 17:
The complete 114-module clean verification passed in 9:29: 13,493 tests, zero failures/errors, 221 skipped. These are local reactor results, not a claim that skipped provider/platform tests ran. No live OSS/COS service was used.
Documentation checks passed from
docs/:npm test,npm run validate,npm run broken-links.Checklist