fix(local): populate IsDir, Size and ModifiedAt in LsInfo results - #958
Open
GerardGao wants to merge 1 commit into
Open
fix(local): populate IsDir, Size and ModifiedAt in LsInfo results#958GerardGao wants to merge 1 commit into
GerardGao wants to merge 1 commit into
Conversation
GerardGao
force-pushed
the
fix/ls-entry-details
branch
from
August 24, 2026 12:11
f11e762 to
a13c16e
Compare
Local.LsInfo filled only FileInfo.Path, so models using the ls tool could not tell files from directories and had no size information to avoid reading large or binary files. Fill the same fields the in-memory backend already returns. Fixes cloudwego/eino#1100
GerardGao
force-pushed
the
fix/ls-entry-details
branch
from
August 25, 2026 13:34
a13c16e to
84734a3
Compare
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.
What is the purpose of the change
Fixes cloudwego/eino#1100.
Local.LsInfofilled onlyFileInfo.Path, so models using the ls tool could not tell files from directories and kept descending into files, and had no size information to avoid reading large/binary files. The in-memory backend already returnsIsDir/Size/ModifiedAt; the local backend now fills the same fields.Brief changelog
adk/backend/local: useos.DirEntry.Info()to fillIsDir,SizeandModifiedAt(RFC3339Nano, same format as the in-memory backend) per entry.local_test.go: extendTestLsInfowith field assertions and a symlink subtest; symlink entries report the link itself (lstat semantics, consistent withos.ReadDir), skipped on Windows.Notes for reviewers:
entry.Info()error path returns an error, matching the existing behavior ofReadwhenfile.Stat()fails.is_dir; addingsize/mtimethere could be a follow-up.Verifying this change
Size0 vs expected 5,IsDirfalse for a directory) and pass after the change.go test ./...inadk/backend/local: all 25 tests PASS.go vet ./...andgofmt -l: clean.