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

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

Closed
3 tasks done
ycrc5 opened this issue Nov 19, 2024 · 16 comments
Closed
3 tasks done

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

ycrc5 opened this issue Nov 19, 2024 · 16 comments
Assignees
Labels
area:context-providers Relates to context providers ide:vscode Relates specifically to VS Code extension kind:bug Indicates an unexpected problem or unintended behavior priority:high Indicates high priority

Comments

@ycrc5
Copy link

ycrc5 commented Nov 19, 2024

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.

  1. 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:
temperature: 0.5
maxTokens: 4096
---
<system>
You will be acting as a senior software engineer performing a code review for a colleague.
</system>

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

/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
@dosubot dosubot bot added area:context-providers Relates to context providers ide:vscode Relates specifically to VS Code extension kind:bug Indicates an unexpected problem or unintended behavior labels Nov 19, 2024
@ycrc5
Copy link
Author

ycrc5 commented Nov 19, 2024

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
Copy link
Collaborator

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
Copy link
Collaborator

Created a main issue to track all reports of this here: #2996

@ycrc5
Copy link
Author

ycrc5 commented Nov 20, 2024

@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
Copy link

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
Copy link
Author

ycrc5 commented Nov 21, 2024

@jb19901234 Are you refering to this comment - #2990 (comment) ? 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 #2996

@Patrick-Erichsen Patrick-Erichsen added priority:high Indicates high priority and removed "needs-triage" labels Nov 25, 2024
@Patrick-Erichsen
Copy link
Collaborator

Patrick-Erichsen commented Nov 25, 2024

+1, please follow along in #2996. Lot of folks reporting the same thing so we will be digging into this this week, thanks for your patience.

@ycrc5 , can you confirm if on latest pre-release that prompt files aren't showing up in a .continue/prompts at the root of your workspace? https://docs.continue.dev/customize/deep-dives/prompt-files#quick-start

@ycrc5
Copy link
Author

ycrc5 commented Nov 25, 2024

+1, please follow along in #2996. Lot of folks reporting the same thing so we will be digging into this this week, thanks for your patience.

@ycrc5 , can you confirm if on latest pre-release that prompt files aren't showing up in a .continue/prompts at the root of your workspace? https://docs.continue.dev/customize/deep-dives/prompt-files#quick-start

@Patrick-Erichsen Can confirm the prompt files are now showing from this location.

@Patrick-Erichsen
Copy link
Collaborator

Hi folks, the issue with @ mentions should be fixed here: #3086

Will be available in pre-release v0.9.236 by end of day. Please let us know if you're still having issues!

@Patrick-Erichsen
Copy link
Collaborator

@ycrc5 curious if you have an opinion on this: #3085

@RomneyDa
Copy link
Collaborator

@ycrc5
I believe if you just add version: 1 to your prompt file header it should be able to find them.
Let me know if that works

@ycrc5
Copy link
Author

ycrc5 commented Nov 27, 2024

#3085

@Patrick-Erichsen For me I want to be able to easily manage and distribute Continue config and prompt files to our engineers without the engineers needing to do anything. From what I can see, this is mostly done with the global continue config and the Continue dev console. There might also be reasons to override config on a workspace level, which I believe continue already supports?

As for the suggestion from #3085, I do think it is a good idea to group all continue related files into one directory, if there are no specific reasons to not include the file mentioned in the .continue folder.

Hope this helps.

@ycrc5
Copy link
Author

ycrc5 commented Nov 27, 2024

@ycrc5 I believe if you just add version: 1 to your prompt file header it should be able to find them. Let me know if that works

@RomneyDa Thank you for the suggestion. The latest update of Continue has resolved the issue for me where it wasn't able to locate the prompt files. Will keep this suggestion in mind for any other challenges.

@Patrick-Erichsen
Copy link
Collaborator

Got it, that makes sense - this is more/less what we are trying to solve with our Teams product (https://www.continue.dev/enterprise)

As for the config override, we do support that on a per workspace basis with .continuerc.json

@masda70
Copy link

masda70 commented Dec 8, 2024

Hi folks, the issue with @ mentions should be fixed here: #3086

Will be available in pre-release v0.9.236 by end of day. Please let us know if you're still having issues!

On Windows, continue v0.0.83 (released last week), which presumably integrates the @ mention bug #3086 (?), I am able to reference prompt files in .continue/prompts but the content of context files referenced within a prompt file (e.g., @package.json) are not being pulled (the model was given the string @package.json but the contents).

@Patrick-Erichsen
Copy link
Collaborator

@masda70 thanks for the heads up here! I reproduced this and made an issue: #3264

@ycrc5 ycrc5 closed this as completed Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:context-providers Relates to context providers ide:vscode Relates specifically to VS Code extension kind:bug Indicates an unexpected problem or unintended behavior priority:high Indicates high priority
Projects
None yet
Development

No branches or pull requests

5 participants