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
Commit 07e4d62
Browse filesBrowse the repository at this point in the historyBrowse files
Addresses mesutoezdil's review findings on PR #2267. Six were real bugs;
all are regression-tested (each new test verified to fail against the
pre-fix code).
Go:
- ListDirContent reported a symlink's own size -- the byte length of its
stored target path -- because entry.Info() is Lstat-based. It now stats
the target, so a symlinked file reports the file's size and a broken
link is listed bare, matching Python's pathlib behavior. The needed
os.Stat result was already being computed and discarded.
- ReadFileContent had no regular-file guard, so read_file on a FIFO with
no writer blocked forever with no timeout on the path. It now rejects
non-regular files, as GrepContent already did.
- Line truncation sliced bytes, not runes. Beyond emitting invalid UTF-8
from a split sequence, it cut CJK text at ~668 characters rather than
the 2000 the tool descriptions promise. Both sites now share a
truncateRunes helper that cuts on a rune boundary, matching Python's
per-code-point slicing.
- Wrap the bare errors in GrepContent and ReadFileContent with %w.
Python:
- grep_content dropped broken symlinks silently. A dangling link is a
genuine read failure, so it now counts toward the "N entries could not
be read" annotation, matching Go's walkEntryUnreadable. FIFOs and
sockets stay silent, matching walkEntrySkip.
- Entries were validated only against allowed_root, which in production
is the whole session dir plus the skills dir -- wider than the
directory being searched. A symlink could therefore pull in a sibling
the caller never asked about, contradicting both the tool description
and the README. Entries are now also bounded by the search root, as Go
already does.
Also corrects comments in five places that described list_files/grep_file
as opt-in "alongside bash". Upstream removed bash's gating entirely in
#2498, so bash is now unconditional in both runtimes and that comparison
was false.
Adds a test pinning the KAGENT_ENABLE_FILE_SEARCH_TOOLS literal in
go/adk/pkg/tools to the `kagent env` registry entry in go/core/pkg/env so
the two cannot drift. The import is test-only and does not add a
dependency from the agent runtime onto the control-plane module.
Signed-off-by: brandonkeung <[email protected]>
0 commit comments