The file src/deepagents/middleware/filesystem.py contains duplicate/unused imports and a variable name that shadows the tool decorator.
Issues:
TYPE_CHECKING, Runtime, and typing imports are duplicated or scattered
- Some imports can be moved under
if TYPE_CHECKING to reduce runtime overhead
- Loop variable
tool in _get_filesystem_tools shadows the imported tool decorator
Proposed cleanup:
- Consolidate imports at the top (PEP8-friendly)
- Move
Runtime inside TYPE_CHECKING
- Rename loop variable to
built_tool (avoid shadowing)
This is a small refactor-only change with no functional impact. I can open a PR if approved.