Skip to content

Command line parameters to find text are considered file paths #1391

@Archieru

Description

@Archieru

Describe the bug

when using "find" to find api path in logs - the api path is considered as file path in external folder
(and requests access to a folder that does not exist):

  ○ Look for getHistory response
    $ cd /Users/me/IdeaProjects/phoenix && find . -path 
    "*/build/test-results/test/*ApplicationHistoryApiTest_order_application_history*.xml" -type f -exec grep -A 30 
    "/applications/getHistory" {} \; | head -80


╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Allow directory access                                                                                                                     │
│                                                                                                                                            │
│ Copilot is attempting to read the following path outside your allowed directory list.                                                      │
│                                                                                                                                            │
│ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │
│ │ /applications/getHistory                                                                                                               │ │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                                                            │
│ Do you want to add these directories to the allowed list?                                                                                  │
│                                                                                                                                            │
│ ❯ 1. Yes                                                                                                                                   │
│   2. No (Esc)                                                                                                                              │
│                                                                                                                                            │
│ Confirm with number keys or ↑↓ keys and Enter, Cancel with Esc                                                                             │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
‌```

### Affected version

GitHub Copilot CLI 0.0.406.

### Steps to reproduce the behavior

make AI run command to search the API path (that starts from / ) in any file

### Expected behavior

searching any string inside of the allowed folder is permitted

does not require access to non-existing folder to do that

### Additional context

_No response_

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions