Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Copilot replying the workspace already exists for new workspaces #732

@aponcedeleonch

Description

@aponcedeleonch

Describe the issue

Copilot replying a new workspace already exists. See image below.

Image

We indeed get >2 requests. For example, if we add a workspace with codegate workspace add foobar in the first request we add correctly the workspace and reply appropriately but for some reason the client doesn't get the answer. Then on the second request the workspace is already created and we answer with Workspace foobar already exists (which is true since it was created by the first request).

Steps to Reproduce

Go into copilot and add a new workspace

codegate workspace add foobar

Operating System

MacOS (Intel)

IDE and Version

1.96.3

Extension and Version

Copilot 1.257.0

Provider

GitHub Copilot

Model

GPT-4

Codegate version

v0.1.13

Logs

No response

Additional Context

Request number 1. We create the Workspace and respond appropriately:

{
  "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 question, 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 choose 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 generate 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| 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 require 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 code. This does not include generating or updating tests. | \"What does this project do?\" |\n| generate_with_workspace_context | The user wants to generate 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 complete workspace from scratch in Visual Studio Code, such as a new application or Visual Studio Code extension. The user may have specified individual files that you should refer to. The user may have also provided previously used requests, which you can ignore if they are not relevant to the latest user request. Do not use this category to update an existing project or generate individual methods or files. | \"Scaffold a Node server.\", \"Create a sample project which uses the fileSystemProvider API.\", \"New 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 test setup, framework, or test runner. | \"Set up tests for this project.\" |\n| vscode_configuration_questions | The user wants to learn about, use, or configure the Visual Studio Code editor, terminal, debugger, source control, tasks, extensions, commands, or settings. This category does not include creating VS Code extensions or generating and explaining code. | \"Switch to light mode.\" |\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 integrated 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 Node.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": "codegate workspace add foobar"
    }
  ],
  "model": "gpt-4o-mini",
  "temperature": 0.1,
  "top_p": 1,
  "max_tokens": 4096,
  "stop": [
    ";"
  ],
  "n": 1,
  "stream": true
}

Request number 2. We reply with Workspace testing already exists and it's shown in the client

{
  "messages": [
    {
      "role": "system",
      "content": "You are an AI programming assistant.\nWhen asked for your name, you must respond with \"GitHub Copilot\".\nFollow the user's requirements carefully & to the letter.\nFollow Microsoft content policies.\nAvoid content that violates copyrights.\nIf you are asked to generate content that is harmful, hateful, racist, sexist, lewd, violent, or completely irrelevant to software engineering, only respond with \"Sorry, I can't assist with that.\"\nKeep your answers short and impersonal.\nYou can answer general programming questions and perform the following tasks: \n* Ask a question about the files in your current workspace\n* Explain how the code in your active editor works\n* Make changes to existing code\n* Review the selected code in your active editor\n* Generate unit tests for the selected code\n* Propose a fix for the problems in the selected code\n* Scaffold code for a new file or project in a workspace\n* Create a new Jupyter Notebook\n* Find relevant code to your query\n* Propose a fix for the a test failure\n* Ask questions about VS Code\n* Generate query parameters for workspace search\n* Ask how to do something in the terminal\n* Explain what just happened in the terminal\n* Propose a fix for the problems in the selected code\n* Explain how the code in your active editor works\n* Review the selected code in your active editor\n* Generate unit tests for the selected code\n* Propose a fix for the a test failure\nYou use the GPT 4o large language model.\nFirst think step-by-step - describe your plan for what to build, then output the code.\nMinimize any other prose.\nUse Markdown formatting in your answers.\nWhen suggesting code changes, use Markdown code blocks.\nInclude the programming language name at the start of the Markdown code block.\nOn the first line of the code block, you can add a comment with 'filepath:' and the path to which the change applies.\nIn the code block, use '...existing code...' to indicate code that is already present in the file.\n```languageId\n// filepath: /path/to/file\n// ...existing code...\n{ changed code }\n// ...existing code...\n{ changed code }\n// ...existing code...\n```\nMake sure to include the programming language name at the start of the Markdown code blocks.\nAvoid wrapping the whole response in triple backticks.\nThe user works in an IDE called Visual Studio Code which has a concept for editors with open files, integrated unit test support, an output pane that shows the output of running the code as well as an integrated terminal.\nThe user is working on a Mac machine. Please respond with system specific commands if applicable.\nThe active document is the source code the user is looking at right now.\nYou can only give one reply for each conversation turn."
    },
    {
      "role": "user",
      "content": "codegate workspace add foobar"
    }
  ],
  "model": "gpt-4o",
  "temperature": 0.1,
  "top_p": 1,
  "max_tokens": 4096,
  "n": 1,
  "stream": true
}

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions