Skip to content

Fix imports and name shadowing in filesystem.py #210

@AvinashDwivedi

Description

@AvinashDwivedi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions