Skip to content

fix: Expose FileTools directory parameter - #9078

Merged
harshsinha03 merged 3 commits into
agno-agi:mainfrom
giri256:fix/filetools-list-files-schema
Jul 21, 2026
Merged

fix: Expose FileTools directory parameter#9078
harshsinha03 merged 3 commits into
agno-agi:mainfrom
giri256:fix/filetools-list-files-schema

Conversation

@giri256

@giri256 giri256 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • make FileTools.list_files declare directory as an explicit optional parameter
  • expose directory in the generated LLM tool schema instead of a required empty kwargs object
  • add a regression test covering the schema shape

Fixes #9075.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Improvement
  • Model update
  • Other:

Checklist

  • Code complies with style guidelines
  • Ran format/validation scripts (libs/agno/scripts/format.bat and libs/agno/scripts/validate.bat)
  • Self-review completed
  • Documentation updated (the existing parameter docstring remains accurate)
  • Examples and guides: not applicable for this focused bug fix
  • Tested in a clean local virtual environment
  • Tests added/updated

Duplicate and AI-Generated PR Check

  • I have searched existing open pull requests and confirmed that no other PR already addresses this issue
  • If a similar PR exists, I have explained below why this PR is a better approach
  • This PR was developed with AI assistance. I reviewed the implementation, diff, and verification results and take responsibility for the change.

Verification

  • libs\agno\.venv\Scripts\python.exe -m pytest libs/agno/tests/unit/tools/test_filetools.py -q — 21 passed, 2 platform-specific skips
  • libs\agno\scripts\format.bat — 1954 files already formatted; import checks passed
  • call libs\agno\.venv\Scripts\activate.bat && call libs\agno\scripts\validate.bat — Ruff passed; mypy found no issues in 937 source files
  • git diff --check

Additional Notes

Before the fix, the generated schema was a required empty kwargs object. It now contains an optional string directory property, while direct calls such as list_files(directory="sub") retain their existing behavior.

@giri256
giri256 requested a review from a team as a code owner July 20, 2026 20:32

@harshsinha03 harshsinha03 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for contributing

@harshsinha03 harshsinha03 changed the title [fix] Expose FileTools directory parameter fix: Expose FileTools directory parameter Jul 21, 2026
@harshsinha03
harshsinha03 merged commit a5a2a38 into agno-agi:main Jul 21, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

2 participants