continue icon indicating copy to clipboard operation
continue copied to clipboard

OpenFiles context provider does not work when folder is opened over Remote-SSH

Open johansigfrids opened this issue 1 year ago • 1 comments

Before submitting your bug report

Relevant environment info

- OS: Windwos 11 => Ubuntu 22.04.5 LTS
- Continue: v0.9.214 (pre-release)
- IDE: Visual Studio Code 1.93.1
- Model: Same with GPT-4o and Clause 3.5 Sonnet
- config.json:
  
{
  "models": [
    {
      "title": "OpenAI GPT-4o",
      "provider": "openai",
      "model": "gpt-4o",
      "apiKey": "<REDACTER>",
      "contextLength": 128000,
      "maxTokens": 4095
    },
    {
      "model": "claude-3-5-sonnet-20240620",
      "provider": "anthropic",
      "cacheSystemMessage": true,
      "apiKey": "<REDACTER>",
      "title": "Claude 3.5 Sonnet",
      "contextLength": 128000,
      "maxTokens": 4095
    }
  ],
  "slashCommands": [
    {
      "name": "edit",
      "description": "Edit selected code"
    },
    {
      "name": "comment",
      "description": "Write comments for the selected code"
    },
    {
      "name": "share",
      "description": "Export this session as markdown"
    },
    {
      "name": "cmd",
      "description": "Generate a shell command"
    }
  ],
  "contextProviders": [
    {
      "name": "code",
      "params": {}
    },
    {
      "name": "docs",
      "params": {}
    },
    {
      "name": "diff",
      "params": {}
    },
    {
      "name": "open",
      "params": {
        "onlyPinned": false
      }
    },
    {
      "name": "url"
    },
    {
      "name": "terminal",
      "params": {}
    },
    {
      "name": "problems",
      "params": {}
    },
    {
      "name": "folder",
      "params": {
        "nRetrieve": 150,
        "nFinal": 20,
        "useReranking": true
      }
    },
    {
      "name": "codebase",
      "params": {
        "nRetrieve": 150,
        "nFinal": 20,
        "useReranking": true
      }
    },
    {
      "name": "repo-map"
    },
    {
      "name": "tree"
    }
  ],
  "completionOptions": {
    "maxTokens": 4095
  },
  "tabAutocompleteModel": {
    "title": "Codestral",
    "provider": "mistral",
    "model": "codestral-latest",
    "apiKey": "<REDACTER>",
    "contextLength": 32000
  },
  "tabAutocompleteOptions": {
    "useCopyBuffer": true,
    "useFileSuffix": true,
    "multilineCompletions": "auto",
    "useOtherFiles": true,
    "useCache": true
  },
  "allowAnonymousTelemetry": true,
  "embeddingsProvider": {
    "provider": "openai",
    "model": "voyage-code-2",
    "apiBase": "https://api.voyageai.com/v1/",
    "apiKey": "<REDACTER>"
  },
  "reranker": {
    "name": "voyage",
    "params": {
      "apiKey": "<REDACTER>"
    }
  },
  "docs": []
}

Description

When using the Remote-SSH feature to edit a repo on a Ubuntu machine from my Windows machine, the OpenFiles context provider does not include any of the open files in the prompt. Manually including the same files using Files provider works fine. I have verified this by looking at the output in Output > Continue - LLM Prompt/Completion. When using Files the file shows up in prompt. When opening the file and using OpenFiles the file does not.

I've included the log output for both a prompt using Files and a prompt using OpenFiles.

To reproduce

  1. Use Remote-SSH to open a folder on a remote computer
  2. Open a file on the remote computer
  3. Use the OpenFiles context provider to ask an AI model something
  4. Check the output logs and see that the files contents were not included in the prompt

Log output

==========================================================================
==========================================================================
##### Completion options #####
{
  "contextLength": 128000,
  "maxTokens": 4095,
  "model": "gpt-4o"
}

##### Request options #####
{}

##### Prompt #####
<user>
\home\johan\ai-assist-dm\test.js
function foo() {
  console.log("Hello World")
}

test.js What does the function foo log?

==========================================================================

Completion:

The function foo logs the string "Hello World" to the console. When the function is called, it will execute the console.log statement, displaying the text "Hello World" in the console.

==========================================================================

Completion options

{ "contextLength": 128000, "maxTokens": 4095, "model": "gpt-4o" }

Request options

{}

Prompt
What does the function foo log?

==========================================================================

Completion:

To determine what the function foo logs, we first need to see the implementation or at least a description of the foo function. Please provide the code or description, and I'll help explain what it logs.

johansigfrids avatar Oct 03 '24 17:10 johansigfrids

@johansigfrids it looks like this has been solved by the PR linked above—can you verify that this is working in 0.9.215?

sestinj avatar Oct 09 '24 21:10 sestinj

Yes this is fixed in v0.9.215 (pre-release) 🎉

johansigfrids avatar Oct 10 '24 09:10 johansigfrids

@sestinj Hello, when is this fix expected to be in the release version? I use v0.8.54 and the problem still occurs there. I do not want to switch to pre-release though

pf-tjung avatar Oct 21 '24 05:10 pf-tjung

@tobiajung We released 0.8.55 on Friday, so this should now be ready

sestinj avatar Oct 27 '24 08:10 sestinj

@sestinj Yes it works, thanks a lot!

pf-tjung avatar Oct 28 '24 05:10 pf-tjung