Skip to content

fix(list_files): report when directory entries are truncated #17

Open

Description

@ashishsinghbora

Problem

"tool_list_files()" limits directory results to 200 entries:

for entry in entries[:200]:

but does not indicate that additional entries were omitted.

This can cause the model to incorrectly treat a partial directory listing as a complete repository view.

Expected behavior

When the result contains more than 200 entries, the tool should explicitly report that the output was truncated and provide enough information for the agent to continue exploring.

For example:

... 200 entries shown; 137 additional entries omitted.

Alternatively, the tool could support pagination.

Acceptance criteria

  • The existing output limit remains bounded.
  • Truncation is explicitly reported.
  • The agent can discover omitted entries through subsequent calls.
  • Add a regression test for directories containing more than 200 entries.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions