continuedev / continue

⏩ Continue is the leading open-source AI code assistant. You can connect any models and any context to build custom autocomplete and chat experiences inside VS Code and JetBrains
https://docs.continue.dev/
Apache License 2.0
19.43k stars 1.69k forks source link

Prompt files and context not working as expected in latest release #2990

Open ycrc5 opened 2 days ago

ycrc5 commented 2 days ago

Before submitting your bug report

Relevant environment info

- OS: Mac OS 15.1
- Continue version: v0.8.57
- IDE version: 1.95.3
- Model: Claude 3.5 Sonnet Bedrock
- config.json:

{
  "models": [
    {
      "title": "Llama 3.1 8B",
      "provider": "ollama",
      "model": "llama3.1:8b"
    },
    {
      "title": "Claude 3.5 Sonnet Bedrock",
      "provider": "bedrock",
      "model": "anthropic.claude-3-5-sonnet-20241022-v2:0",
      "region": "us-west-2",
      "profile": "default"
    },
    {
      "title": "Llama3.1 8B - network",
      "provider": "ollama",
      "model": "llama3.1:8b"
    }
  ],
  "embeddingsProvider": {
    "title": "Embeddings Model",
    "provider": "bedrock",
    "model": "amazon.titan-embed-text-v2:0",
    "region": "us-west-2",
    "profile": "default"
  },
  "tabAutocompleteModel": {
    "title": "Starcoder 3b",
    "provider": "ollama",
    "model": "starcoder2:3b"
  },
  "customCommands": [
    {
      "name": "test",
      "prompt": "{{{ input }}}\n\nWrite a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.",
      "description": "Write unit tests for highlighted code"
    }
  ],
  "contextProviders": [
    {
      "name": "code",
      "params": {}
    },
    {
      "name": "docs",
      "params": {}
    },
    { "name": "open", "params": { "onlyPinned": true } },
    { "name": "search" },
    { "name": "url" },
    { "name": "tree" },
    {
      "name": "diff",
      "params": {}
    },
    {
      "name": "terminal",
      "params": {}
    },
    {
      "name": "problems",
      "params": {}
    },
    {
      "name": "folder",
      "params": {
        "nRetrieve": 100,
        "nFinal": 25,
        "useReranking": true
      }
    },
    {
      "name": "codebase",
      "params": {
        "nRetrieve": 100,
        "nFinal": 25,
        "useReranking": true
      }
    }
  ],
  "slashCommands": [
    {
      "name": "edit",
      "description": "Edit selected code"
    },
    {
      "name": "comment",
      "description": "Write comments for the selected code"
    },
    {
      "name": "share",
      "description": "Export the current chat session to markdown",
      "params": { "outputDir": "~/.continue/session-transcripts" }
    },
    {
      "name": "cmd",
      "description": "Generate a shell command"
    },
    {
      "name": "commit",
      "description": "Generate a git commit message"
    }
  ]
}

Description

Having a couple of issues with the latest version of Continue. They are as follow:

  1. The @ context menu functionality has an initialization issue. When first opening VS Code or reloading the window, the @ context menu doesn't appear immediately. To make it work, you need to either:

Send a test message to any chat model first, or Open a new chat window using the plus icon (but only after having interacted with a model) For example, after sending a message using the Ollama model, the @ context menu becomes available and continues working even when switching to other models like Bedrock.

  1. There appears to be a discrepancy between the documented and actual prompt file locations. According to the latest version's documentation, prompt files should be loaded from either:

~/.continue/prompts (user directory)

/.continue/prompts (workspace directory) However, the system is still reading prompts from the legacy location /.prompts instead of the new paths. 3. The prompts don't seem to work anymore, IE, it seems like its not pulling in the context. For example, here is a prompt that was provided from the continue docs: ```yaml temperature: 0.5 maxTokens: 4096 --- You will be acting as a senior software engineer performing a code review for a colleague. As part of your code review, you will be identifying "code smells". Here is an overview of what a code smell is: {{{ url "https://martinfowler.com/bliki/CodeSmell.html"}}} You will provide the 5 most important pieces of feedback on the code smells you have identified. For each piece of feedback, you will provide a short explanation of the issue and suggest a solution. If there are no code smells, you will write "No code smells were identified in the provided code." Here is the proposed code changes you will be reviewing: {{{ diff }}} ``` When executing this prompt, I received the below message. Examining the context revealed that the system only included the prompt file itself, without any of the expected surrounding context. ``` I apologize, but I don't see any actual code diff provided for me to review. The placeholder "{{{ diff }}}" appears to be empty or not properly formatted. To perform a meaningful code review and identify code smells, I would need to see the actual code changes that are being proposed. This could include: Added lines (usually prefixed with +) Removed lines (usually prefixed with -) Context lines File names and paths that are being modified Please provide the actual code changes you'd like me to review, and I'll be happy to analyze them for code smells and provide specific, actionable feedback. ``` For additional context: I have maintained the above settings in my config.json file and haven't modified any prompts. The only changes present are those introduced by plugin updates. I've already attempted troubleshooting by: Uninstalling the plugin Deleting the ~/.continue folder Performing a fresh installation of the plugin None of these steps resolved the issue. ### To reproduce 1. Open brand new version of VSCode with the above continue config and setup 2. Try typing `@` and see if a window pops up. 3. Try running the code-smalls prompt after making a minor change and staging. ### Log output ```Shell /Users/xxx/.vscode/extensions/continue.continue-0.8.57-darwin-arm64/prompt-file-language-configuration.json' (Error: Unable to resolve nonexistent file '/Users/xxx/.vscode/extensions/continue.continue-0.8.57-darwin-arm64/prompt-file-language-configuration.json' ... other logs ... [Continue.continue]path should be a `path.relative()`d string, but got "../../../.continue/config.json" RangeError: path should be a `path.relative()`d string, but got "../../../.continue/config.json" at throwError (vscode-file://vscode-app/Users/xxx/.vscode/extensions/continue.continue-0.8.57-darwin-arm64/out/extension.js:71775:13) at checkPath (vscode-file://vscode-app/Users/xxx/.vscode/extensions/continue.continue-0.8.57-darwin-arm64/out/extension.js:71789:16) at Ignore2._test (vscode-file://vscode-app/Users/xxx/.vscode/extensions/continue.continue-0.8.57-darwin-arm64/out/extension.js:71877:9) at Ignore2.ignores (vscode-file://vscode-app/Users/xxx/.vscode/extensions/continue.continue-0.8.57-darwin-arm64/out/extension.js:71904:21) at vscode-file://vscode-app/Users/xxx/.vscode/extensions/continue.continue-0.8.57-darwin-arm64/out/extension.js:541296:31 ```
ycrc5 commented 2 days ago

On a side note, I have reverted back to version v0.8.56 and everything seems to work. I see this issue is also mentioned on the following discord thread - https://discord.com/channels/1108621136150929458/1306627295967973387

Patrick-Erichsen commented 2 days ago

Thanks for the detailed writeup! We recently released a v2 of our prompt files format. The docs have been updated in GitHub, but the workflow to release the updated docs to docs.continue.dev is currently broken. Fixing that ASAP, but in the meantime, here are the updated prompt file docs: https://github.com/continuedev/continue/blob/main/docs/docs/customize/deep-dives/prompt-files.md

In the new schema we are no longer using handlebars syntax, e.g. {{{ provider }}} - you can just use @ like in the regular input.

Appreciate the repro instructions on the context provider selection issue as well, and the bump in Discord. Will be looking into this shortly.

Patrick-Erichsen commented 2 days ago

Created a main issue to track all reports of this here: https://github.com/continuedev/continue/issues/2996

ycrc5 commented 2 days ago

@Patrick-Erichsen Thank you for the update. One thing for me still is the location of the prompt files. From what I see it should be picking them up and storing them in .continue/prompts. For me, it still reads and stores them in .prompts .

jb19901234 commented 23 hours ago

I am not sure if I understand the proposed solution, but the context menu is still not appearing (working on version 0.8.57) So for me, typing @ in the chat menu does not result in a menu appearing where I can select a file, a picture, etc. etc. like it did previously.

Screencast from 2024-11-21 14-07-10.webm

ycrc5 commented 23 hours ago

@jb19901234 Are you refering to this comment - https://github.com/continuedev/continue/issues/2990#issuecomment-2486448314 ? This one specifically is on how to write custom prompt files using the new syntax for context reference in the prompt file.

I believe the context menu not popping up is still an issue and is being tracked with https://github.com/continuedev/continue/issues/2996