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

@ not triggering context Provider in chat #2808

Closed
3 tasks done
RomneyDa opened this issue Nov 4, 2024 · 30 comments
Closed
3 tasks done

@ not triggering context Provider in chat #2808

RomneyDa opened this issue Nov 4, 2024 · 30 comments
Assignees
Labels
area:context-providers Relates to context providers kind:bug Indicates an unexpected problem or unintended behavior priority:high Indicates high priority

Comments

@RomneyDa
Copy link
Collaborator

RomneyDa commented Nov 4, 2024

Before submitting your bug report

Relevant environment info

- OS: Windows
- Continue version: 0.0.80
- IDE version: ?
- Model: NA
- config: NA

Description

https://discord.com/channels/1108621136150929458/1302434456686170138
typing @ does not always trigger context provider menu, especially on new window
seems to be linked to the new Cmd + I edit feature

To reproduce

image

Log output

No response

@dosubot dosubot bot added area:context-providers Relates to context providers kind:bug Indicates an unexpected problem or unintended behavior labels Nov 4, 2024
@PRANJALRANA11
Copy link
Contributor

Screen.Recording.2024-11-05.221817.mp4

It's working on windows for my system 11 @RomneyDa @sestinj

@FallDownTheSystem
Copy link
Contributor

It starts to work after navigating, doesn't have to be the edit page (ctrl + i), going to history and back also makes it work.

@LymanBE
Copy link

LymanBE commented Nov 7, 2024

Can confirm that navigating to the history and back works as a workaround.

A maybe related issue: The Jetbrains plugin also won't show the context window but only for the last message. If you edit a previous prompt, it will. Tricky UI issues, it seems.

@Sillocan
Copy link

This isn't working on macos for me as well. I've even tried reloading the window. The history trick did work though

@alanwilter
Copy link

Yet, same issue with Mac, and the history did the trick as well.

@Joilence
Copy link

Joilence commented Nov 13, 2024

Yet, same issue with Mac, and the history did the trick as well.

+1 on macOS

@RomneyDa RomneyDa changed the title @ not triggering context Provider in chat - Windows @ not triggering context Provider in chat Nov 14, 2024
@RomneyDa
Copy link
Collaborator Author

Seems to be happening to many people. I haven't been able to duplicate. Anyone seeing errors in the console at the same time?

@PretzelVector
Copy link

Hello,

I am reliably reproducing this on linux by reloading the window. (VSCode v1.95.1 + Continue v0.9.230)

Setup

  1. Create a new VSCode profile
  2. Install Continue
  3. Reload Window: Use command palette (Ctrl+Shift+P) to issue reload window
  4. Upgrade to pre-release
  5. Reload Window

Reproduction

  1. ctrl+L to open Continue
  2. Type @, context menu will not appear
  3. Switch to History and back to chat
  4. Type @, context menu does appear
  5. Reload Window
  6. Continue window will still be open, ctrl+L to focus Continue chat
  7. Type @, context menu will not appear

There are no logs in Continue during that cycle. The "Extension Host" log contains an error with continue in the backtrace during VSCode startup (during reload), but seems unrelated.

2024-11-14 17:07:07.589 [error] RangeError: path should be a `path.relative()`d string, but got "../../../exthost"
    at throwError (/home/pv/.vscode/extensions/continue.continue-0.9.226-linux-x64/out/extension.js:71768:13)
    at checkPath (/home/pv/.vscode/extensions/continue.continue-0.9.226-linux-x64/out/extension.js:71782:16)
    at Ignore2._test (/home/pv/.vscode/extensions/continue.continue-0.9.226-linux-x64/out/extension.js:71870:9)
    at Ignore2.ignores (/home/pv/.vscode/extensions/continue.continue-0.9.226-linux-x64/out/extension.js:71897:21)
    at /home/pv/.vscode/extensions/continue.continue-0.9.226-linux-x64/out/extension.js:548630:31

Please let me know if there are other logs I can provide.

Thank you all for your contributions,
~PV

@joewinke
Copy link

+1 mac os. It was working fine and then @ context stopped working. I installed 3 prior versions back as I thought it might be an auto update, but that didn't work. Came here and found the history fix and that works.

However it still is limited - when I start a new session and press / normally I get everything in my .prompts but now I get a neutered version offering /share /cmd /test
Screenshot 2024-11-17 at 12 11 09 AM

@sestinj sestinj added the priority:high Indicates high priority label Nov 17, 2024
@jsade
Copy link

jsade commented Nov 17, 2024

+1 for @ not triggering context provider, macOS, pre-release version of Continue. I get rid of the issue for a while by running "Codebase Force Re-index."

The developer log is filled with

mainThreadExtensionService.ts:78 [Continue.continue]path should be a `path.relative()`d string, but got "../../../.continue/config.json"
$onExtensionRuntimeError	@	mainThreadExtensionService.ts:78

The extension's Features page > Runtime Status shows:

Uncaught Errors (3)
 path should be a path.relative()d string, but got "../../../../../extension-output-Continue.continue-#1-Continue"
 path should be a path.relative()d string, but got "../../../../../main"
 path should be a path.relative()d string, but got "../../../.continue/config.json"

@huy-trn
Copy link
Contributor

huy-trn commented Nov 22, 2024

+1 in Ubuntu - VSCode - Continue v0.8.57 and v0.8.56, rolling back to v0.8.55 works for me

@RomneyDa
Copy link
Collaborator Author

RomneyDa commented Nov 25, 2024

Is anyone still experiencing this on most recent prerelease?
@PretzelVector have followed your steps, can't reproduce on macOS

@Joilence
Copy link

Is anyone still experiencing this on most recent prerelease?

I still have this. macOS 15.1.1 / VSCode 1.95.3 / Continue v0.8.58

@joewinke
Copy link

Yes just updated and relaunched. Still don't have my slash / shortcuts (prompts) and had to go to history to reactivate @ wasn't working upon relaunch.

@stefan-detter-m
Copy link

+1 in Windows 11 / VSCode 1.94.2 / Continue v0.8.58

@kaylynb
Copy link

kaylynb commented Nov 26, 2024

Bluefin/Fedora 41 / VSCode 1.59.3 / Continue v0.9.233 (pre-release) & v0.8.59. 0.8.55 is the last version that works for me.
Also happens on Windows 11. Same VSCode/Continue version behavior.

@kaylynb
Copy link

kaylynb commented Nov 26, 2024

I think this is related to telemetry somehow? I ran vscode in an isolated environment and it worked until I added my usual settings.json. As soon as I remove "telemetry.telemetryLevel": "off" the "@" menu works again, even in my regular vscode install. I can add it back and restart and it fails consistently.

I bisected the code and it appears to be introduced in 3d5d43e. I replaced TipTapEditor.tsx from the previous commit and it worked even with telemetry turned off.

@RomneyDa
Copy link
Collaborator Author

@joewinke you may need to add version: 1 to your prompt files since prompt files v2 is out
https://docs.continue.dev/customize/deep-dives/prompt-files

@RomneyDa
Copy link
Collaborator Author

@kaylynb awesome, thanks for looking into this. I'll take a closer look at that commit

@alanwilter
Copy link

@kaylynb I tried what you mentioned. To start with, I never had telemetry entry in my setting.json. I couldn't reproduce your solution.

I'm using Mac Sequoia with Vscode 1.95.3 and for both Continue v0.8.59 and v0.9.235.

I still need to do the re-index trick to get the prompts and then I can use @ to access even my prompts.

BTW, what's the difference between prompts v1 x v2?

I have this prompt:

<system>
You are an expert programmer
</system>

{{{ input }}}

You will follow the guidelines to understand what unit testing is, and how to generate useful unit tests:
{{{ url "https://aws.amazon.com/what-is/unit-testing/" }}}

Write unit tests for the above selected code, following each of these instructions:
- Use pytest
- Properly set up and tear down if needed
- Include important edge cases
- The tests should be complete and sophisticated
- Give the tests just as chat output, don't edit any file
- Don't explain how to set up pytest
- Add typings according to python 3.9 convention, so no need to use `from typing import` etc.
- Add one line docstring explaining what the test does

What do I need to change to make it complies with prompts version 2?

@qinlinwang
Copy link

@kaylynb awesome, thanks for looking into this. I'll take a closer look at that commit

I found out the reason why this happens, because Mension extension is not registered in tiptab at first.
but I don't know how to contribute the code.

@joewinke
Copy link

@joewinke you may need to add version: 1 to your prompt files since prompt files v2 is out https://docs.continue.dev/customize/deep-dives/prompt-files

OK so the whole architecture has changed? Before i had prompts in .prompts/ now they need to be in .continue/prompts ... and before I did /[promptName] now the flow is @prompts > [promptName]? What is slash / denoting now? Thanks @RomneyDa

@lendle
Copy link

lendle commented Nov 26, 2024

This is happening for me as well on mac/vscode whenever I start vscode. I just updated to the newest pre-release, 0.9.235, but this has been happening consistently for at least a couple months on a couple of machines with various levels of custom configs.

Going to history and back to chat gets it to work. So does going to ... and clicking re-index.

I don't see anything in the dev console or continue output.

@kaylynb
Copy link

kaylynb commented Nov 26, 2024

Screencast.From.2024-11-26.08-16-56.webm

Just tried in a clean VM and am able to repro. Also repros on MacOS.

@Patrick-Erichsen
Copy link
Collaborator

Hi folks, this 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

@qinlinwang you were correct, the issue was the Mentions not being configured properly when the editor first loads.

@kaylynb
Copy link

kaylynb commented Nov 26, 2024

@qinlinwang yeah I just looked over it and it looks like there is a race condition with the availableContextProviders prop. With telemetry enabled it has a different initial state. The useEditor call doesn't have it in the dependency array, so the first render it's disabled as the effect isn't called again until the component is mounted again (for example, by going to history view and back).

Looks like it's already been fixed in the last hour though.

@PretzelVector
Copy link

Hi folks, this 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!

The v0.9.236 pre-release fixes this issue for me. The context menu now works both at first launch and after window reload.

@RomneyDa
Copy link
Collaborator Author

RomneyDa commented Nov 27, 2024

@kaylynb the useEditor hook can't react to changes in state variables, it only injects the config once on mount, so the useUpdatingRef paradigm is used for stuff like availableContextProviders -> availableContextProvidersRef so that values accessed will always be up to date

@RomneyDa
Copy link
Collaborator Author

Thank you all for the help on this bug!

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 kind:bug Indicates an unexpected problem or unintended behavior priority:high Indicates high priority
Projects
None yet
Development

No branches or pull requests