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(rag): construct valid local image file URIs - #4637
ImageReader builds local image references by concatenating file:// and the input.
For path/to/image.jpg, that makes path the URI authority instead of part of the local
path. Spaces and reserved filename characters are not escaped either.
Use Path.toAbsolutePath().toUri().toASCIIString() for plain local paths. HTTP(S) URLs and
existing file:// references still pass through unchanged. Document IDs continue to be
derived from the original input, not the resolved URI. No file-existence requirement,
public API, dependency or OCR behavior changes.
The regression tests cover relative and absolute paths, spaces, +, #, % and Chinese
filename characters. They read back the original bytes through both Files and the existing MediaUtils.urlToInputStream path. The fixture stays under target/ so relative paths do
not depend on the Windows temp directory using the same drive. Existing URL passthrough
and deterministic document-ID behavior are also checked. English and Chinese dev guides
describe the input and local-file consumer requirements.
Verification
On the unmodified reader, the 15-case ImageReader suite has one failure and two errors in
the path regression cases. After the fix, all 52 focused ImageReader/ReaderInput/MediaUtils
cases pass without skips.
The final eight-module dependency reactor verify passes on JDK 17: 4,860 cases, zero
failures/errors, 49 skips. This includes Core, DashScope, Ollama and RAG Simple. Spotless
and git diff --check pass. Documentation tests (20 cases), strict build validation and
broken-link checks pass.
mvn -B -T1C -pl :agentscope-extensions-rag-simple -am verify
cd docs
npm test
npm run validate
npm run broken-links
An earlier clean reactor run failed in the unchanged EmbeddingUtilsTest.testBatchTimeout
(expected a timeout error, received an empty list). The final reactor run after the test-fixture
portability correction passes, including that unchanged test. No timeout, assertion or test
selection was weakened; the first failure's cause has not been established.
This validates reader-generated URI round trips and existing local media reads, not every
provider's file-URI handling. Generic downloader/converter changes such as #3319 are outside
this patch. Live model/cloud calls and the full repository reactor were not run. Native
Windows validation remains for CI.
Checklist
Code formatted with mvn spotless:apply
Affected module and dependency reactor verified
Relevant Javadoc updated
Matching English and Chinese documentation updated and validated
CI update on unchanged head dbd543b2c06196a9f9b56caeace8f5533e2f161e: Windows, documentation, license, module-sync and CLA checks pass. The Linux job failed in RemoteSubagentAdapterTest.separateParentProcessesRecoverRemoteWorkAndReportWithoutAnotherUserTurn at line 265: Timed out waiting for durable state while waiting for the first parent process to create the remote session/turn.
That job ran all 15 ImageReader cases successfully, with no skips, and the RAG Simple module completed successfully. The failing test is in agentscope-extensions-durable-http; this patch does not change that module. I have not reproduced the failure on the base revision or established its cause, so I am not treating it as a proven flaky test or claiming the full CI run passed.
I attempted one rerun of the failed Linux job; the CLI returned job 145580896306 cannot be rerun. Could a maintainer rerun that job on this head? No test, deadline, assertion or workflow was changed to work around the failure.
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, based on current main2d208c57f.Description
Fixes #4631.
ImageReaderbuilds local image references by concatenatingfile://and the input.For
path/to/image.jpg, that makespaththe URI authority instead of part of the localpath. Spaces and reserved filename characters are not escaped either.
Use
Path.toAbsolutePath().toUri().toASCIIString()for plain local paths. HTTP(S) URLs andexisting
file://references still pass through unchanged. Document IDs continue to bederived from the original input, not the resolved URI. No file-existence requirement,
public API, dependency or OCR behavior changes.
The regression tests cover relative and absolute paths, spaces,
+,#,%and Chinesefilename characters. They read back the original bytes through both
Filesand the existingMediaUtils.urlToInputStreampath. The fixture stays undertarget/so relative paths donot depend on the Windows temp directory using the same drive. Existing URL passthrough
and deterministic document-ID behavior are also checked. English and Chinese dev guides
describe the input and local-file consumer requirements.
Verification
On the unmodified reader, the 15-case ImageReader suite has one failure and two errors in
the path regression cases. After the fix, all 52 focused ImageReader/ReaderInput/MediaUtils
cases pass without skips.
The final eight-module dependency reactor
verifypasses on JDK 17: 4,860 cases, zerofailures/errors, 49 skips. This includes Core, DashScope, Ollama and RAG Simple. Spotless
and
git diff --checkpass. Documentation tests (20 cases), strict build validation andbroken-link checks pass.
An earlier clean reactor run failed in the unchanged
EmbeddingUtilsTest.testBatchTimeout(expected a timeout error, received an empty list). The final reactor run after the test-fixture
portability correction passes, including that unchanged test. No timeout, assertion or test
selection was weakened; the first failure's cause has not been established.
This validates reader-generated URI round trips and existing local media reads, not every
provider's file-URI handling. Generic downloader/converter changes such as #3319 are outside
this patch. Live model/cloud calls and the full repository reactor were not run. Native
Windows validation remains for CI.
Checklist
mvn spotless:apply