Skip to content

[Bug] Inconsistent passing of local file context #24

Open
@garrmark

Description

@garrmark

Describe the bug
When I run the copilot-extensions/rag-extension example and capture the request coming from copilot chat running in vscode, it properly shows my current file and selection. When I switch my vscode to another repo (private in this case), if doesn't pass the current file or selection.

To Reproduce
Steps to reproduce the behavior:

  1. run the rag-extension go repo ( https://github.com/copilot-extensions/rag-extension ) locally
  2. open the repo in vscode, open chat, select my @cl-rag-extension extension and make sure a file shows in the context, send a test message
  3. dump the request that comes into the extension
  4. see that it works correctly
  5. switch vscode to a java repo, make sure a java source file is selected and send another test message
  6. see that no file is sent

Expected behavior
I'm expecting all source files to be sent to my extension.

I have the correct permissions set and there are no files excluded in github.

Desktop (please complete the following information):

  • OS: Ubuntu 22.04.5 LTS - running on wsl2 on windows 11
  • VSCode 1.96.4
  • github.copilot plugin 1.261.0
  • github.copilot-chat plugin 0.23.2

Additional context
Message payload for step 4 (file sent):

{
    "messages": [
        {
            "role": "user",
            "content": "test",
            "copilot_references": [
                {
                    "data": {
                        "content": "my setup.sh content",
                        "language": "shellscript"
                    },
                    "id": "setup.sh",
                    "is_implicit": true,
                    "metadata": {
                        "display_icon": "",
                        "display_name": "",
                        "display_url": ""
                    },
                    "type": "client.file"
                },
                {
                    "data": {
                        "content": "my selection",
                        "end": {
                            "col": 0,
                            "line": 8
                        },
                        "start": {
                            "col": 0,
                            "line": 7
                        }
                    },
                    "id": "setup.sh",
                    "is_implicit": true,
                    "metadata": {
                        "display_icon": "",
                        "display_name": "",
                        "display_url": ""
                    },
                    "type": "client.selection"
                },
                {
                    "data": {
                        "id": 846765777,
                        "name": "rag-extension",
                        "ownerLogin": "copilot-extensions",
                        "refInfo": {
                            "name": "",
                            "type": ""
                        },
                        "type": "repository"
                    },
                    "id": "copilot-extensions/rag-extension",
                    "is_implicit": false,
                    "metadata": {
                        "display_icon": "",
                        "display_name": "",
                        "display_url": ""
                    },
                    "type": "github.repository"
                }
            ]
        }
    ],
    "model": "gpt-3.5-turbo",
    "stream": true
}

Message payload for step 6 (no file sent):

{
    "messages": [
        {
            "role": "user",
            "content": "test",
            "copilot_references": [
                {
                    "data": {
                        "type": "github.repository"
                    },
                    "id": "9001220f-416b-46f3-a466-6a7db40f267c",
                    "is_implicit": false,
                    "metadata": {
                        "display_icon": "",
                        "display_name": "",
                        "display_url": ""
                    },
                    "type": "github.redacted"
                }
            ]
        }
    ],
    "model": "gpt-3.5-turbo",
    "stream": true
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggithub teamFeedback for the GitHub team for any issues across all extensions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions