Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't pipe Copilot's category choosing question through the CLI #1205

Open
jhrozek opened this issue Mar 4, 2025 · 1 comment
Open

Don't pipe Copilot's category choosing question through the CLI #1205

jhrozek opened this issue Mar 4, 2025 · 1 comment
Labels

Comments

@jhrozek
Copy link
Contributor

jhrozek commented Mar 4, 2025

Before sending off the user question, copilot sends a request that looks like this:

{"messages":[{"role":"system","content":"You are a helpful AI programming assistant to a user who is a software engineer, acting on behalf of the Visual Studio Code editor. Your task is to choose one category from the Markdown table of categories below that matches the user's question. Carefully review the user's ques
tion, any previous messages, and any provided context such as code snippets. Respond with just the category name. Your chosen category will help Visual Studio Code provide the user with a higher-quality response, and choosing incorrectly will degrade the user's experience of using Visual Studio Code, so you must choos
e wisely. If you cannot choose just one category, or if none of the categories seem like they would provide the user with a better result, you must always respond with \"unknown\".\n\n| Category name | Category description | Example of matching question |\n| -- | -- | -- |\n| generate_code_sample | The user wants to g
enerate code snippets without referencing the contents of the current workspace. This category does not include generating entire projects. | \"Write an example of computing a SHA256 hash.\" |\n| add_feature_to_file | The user wants to change code in a file that is provided in their request, without referencing the co
ntents of the current workspace. This category does not include generating entire projects. | \"Add a refresh button to the table widget.\" |\n| question_about_specific_files | The user has a question about a specific file or code snippet that they have provided as part of their query, and the question does not requir
e additional workspace context to answer. | \"What does this file do?\" |\n| workspace_project_questions | The user wants to learn about or update the code or files in their current workspace. Questions in this category may be about understanding what the whole workspace does or locating the implementation of some cod
e. This does not include generating or updating tests. | \"What does this project do?\" |\n| find_code_in_workspace | The user wants to locate the implementation of some functionality in their current workspace. | \"Where is the tree widget implemented?\" |\n| generate_with_workspace_context | The user wants to genera
te code based on multiple files in the workspace and did not specify which files to reference. | \"Create a README for this project.\" |\n| create_tests | The user wants to generate unit tests. | \"Generate tests for my selection using pytest.\" |\n| create_new_workspace_or_extension | The user wants to create a compl
ete Visual Studio Code workspace from scratch, such as a new application or a Visual Studio Code extension. Use this category only if the question relates to generating or creating new workspaces in Visual Studio Code. Do not use this category for updating existing code or generating sample code snippets | \"Scaffold
a Node server.\", \"Create a sample project which uses the fileSystemProvider API.\", \"react application\" |\n| create_jupyter_notebook | The user wants to create a new Jupyter notebook in Visual Studio Code. | \"Create a notebook to analyze this CSV file.\" |\n| set_up_tests | The user wants to configure project tes
t setup, framework, or test runner. The user does not want to fix their existing tests. | \"Set up tests for this project.\" |\n| vscode_configuration_questions | The user wants to learn about, use, or configure the Visual Studio Code. Use this category if the users question is specifically about commands, settings, k
eybindings, extensions and other features available in Visual Studio Code. Do not use this category to answer questions about generating code or creating new projects including Visual Studio Code extensions. | \"Switch to light mode.\", \"Keyboard shortcut to toggle terminal visibility.\", \"Settings to enable minimap
.\", \"Whats new in the latest release?\" |\n| configure_python_environment | The user wants to set up their Python environment. | \"Create a virtual environment for my project.\" |\n| terminal_state_questions | The user wants to learn about specific state such as the selection, command, or failed command in the integ
rated terminal in Visual Studio Code. | \"Why did the latest terminal command fail?\" |\n| github_questions | The user is asking about an issue, pull request, branch, commit hash, diff, discussion, repository, or published release on GitHub.com.  This category does not include performing local Git operations using the
 CLI. | \"What has been changed in the pull request 1361 in browserify/browserify repo?\" |\n| web_questions | The user is asking a question that requires current knowledge from a web search engine. Such questions often reference time periods that exceed your knowledge cutoff. | \"What is the latest LTS version of Nod
e.js?\" |\n| unknown | The user's question does not fit exactly one of the categories above, is about a product other than Visual Studio Code or GitHub, or is a general question about code, code errors, or software engineering. | \"How do I center a div in CSS?\" |"},{"role":"user","content":"# FILE:PIPELINE.PY CONTEX
T\nUser's current visible code, this should be the main focus:\nExcerpt from pipeline.py, lines 1 to 67:\n```python\n# filepath: /Users/jakub/devel/codegate/src/codegate/providers/copilot/pipeline.py\nimport json\nimport time\nfrom abc import ABC, abstractmethod\nfrom typing import Dict, Tuple\n\nimport structlog\nfro
m litellm import ModelResponse\nfrom litellm.types.llms.openai import ChatCompletionRequest\nfrom

this is used to categorize the request and might trigger VSCode tools:

Image

We should not match those categorization requests through CLI or else we break the functionality.

@jhrozek
Copy link
Contributor Author

jhrozek commented Mar 4, 2025

actually this is probably a very low prio, for that to happen, the user would have to ask something that resembles the codegate CLI but was actually mean to VSCode. We might even want to close this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants