Skip to content

fix: make drop match only the named path#5350

Open
rodboev wants to merge 3 commits into
Aider-AI:mainfrom
rodboev:pr/drop-exact-paths
Open

fix: make drop match only the named path#5350
rodboev wants to merge 3 commits into
Aider-AI:mainfrom
rodboev:pr/drop-exact-paths

Conversation

@rodboev

@rodboev rodboev commented Jun 29, 2026

Copy link
Copy Markdown

/drop was using substring matching for non-glob paths. That made a command like /drop api\chat\route.ts remove both api\chat\route.ts and app\api\chat\route.ts when both files were in chat.

This keeps bare /drop and explicit glob behavior intact, but makes non-glob editable and read-only drops use exact path identity instead of substring containment.

Closes #4176

The duplicate-path reproduction from emincangencer's comment shaped the editable and read-only regression tests.

Validation:

  • rtk python -m pytest tests/basic/test_commands.py -k cmd_drop -v
    • 6 passed, 67 deselected (run with TEMP/TMP/TMPDIR=D:\Repos\tmp)
  • rtk python -m pytest tests/basic/test_commands.py::TestCommands::test_cmd_add_drop_directory tests/basic/test_commands.py::TestCommands::test_cmd_read_only_with_square_brackets -v
    • 2 passed
  • rtk pre-commit run --all-files
    • isort, black, flake8, and codespell all passed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/drop deletes unspecified files.

1 participant