Repository navigation
Conversation
This branch has not been deployed
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.
Description
Fixes #4889. When a knowledge base's configured storage provider differs from a persisted file path, the old mismatch fallback could send an S3 path to the process-wide local file service, producing a local
ENOENTsuch as/data/files/s3:/.... I resolve the provider inferred from the path using tenant storage configuration and normalize legacy single-slash provider URIs before routing; the local service now rejects remote provider paths rather than treating them as disk paths (internal/application/service/knowledge_util.go:444,internal/types/knowledgebase.go:533,internal/application/service/file/local.go:326).Change
filepath.Clean.Scope note
No unrelated packages or independent Go modules were changed.
Type of Change
Related Issue
Testing
go test -count=1 ./internal/types -run '^(TestParseProviderScheme|TestInferStorageFromFilePath)$'— passgo test -count=1 ./internal/application/service/file -run '^(TestStorageBackendInnerPath|TestParseS3FilePathAcceptsCanonicalBackendPath|TestLocalGetFileRejectsNonLocalProviderSchemes)$'— passgo test -count=1 ./internal/application/service -run '^TestResolveFileServiceForPathUsesPathProviderOnConfigMismatch$'— passgo build ./internal/types ./internal/application/service/file ./internal/application/service— passgo vet ./internal/types ./internal/application/service/file ./internal/application/service— cleangofmt -lon changed Go files — no output;git diff --check origin/main...HEAD— cleangolangci-lintwas unavailable locally; GitHub CI will run the repository checks.Checklist
git diff --check origin/main...HEADpassesgolangci-lint) was not run locally; see TestingScreenshots / Recordings
Not applicable (no user-visible UI changes).