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
17.57k stars 1.36k forks source link

[CON-267] On an unsaved file, Continue sends an empty query, resulting in bad completions #1293

Open coder543 opened 4 months ago

coder543 commented 4 months ago

Before submitting your bug report

Relevant environment info

- OS: Linux
- Continue: latest published version
- IDE: VS Code

Description

I am editing a new, unsaved file. It has TypeScript code in it, and VS Code is in TypeScript mode. However, the completions are very bad and always the same. I checked the Continue "output" window, and I can see why.

It's not even trying to send content from the current file. As soon as I saved the file to disk, it seemed to start working normally.

I'm not sure if it is relevant, but I'm using VS Code over a "Remote - SSH" session.

To reproduce

No response

Log output

==========================================================================
==========================================================================
Settings:
contextLength: 4096
model: codegemma:7b-code-q8_0
maxTokens: 1024
stop: <|fim_prefix|>,<|fim_suffix|>,<|fim_middle|>,<|file_separator|>,<|fim_prefix|>,<|fim_suffix|>,<|fim_middle|>,<|file_separator|>,<end_of_turn>,<eos>,

,

,/src/,#- coding: utf-8,```,
function,
class,
module,
export,
import
temperature: 0.01
raw: true

############################################

<|fim_prefix|><|fim_suffix|><|fim_middle|>==========================================================================
==========================================================================
Settings:
contextLength: 4096
model: codegemma:7b-code-q8_0
maxTokens: 1024
stop: <|fim_prefix|>,<|fim_suffix|>,<|fim_middle|>,<|file_separator|>,<|fim_prefix|>,<|fim_suffix|>,<|fim_middle|>,<|file_separator|>,<end_of_turn>,<eos>,

,

,/src/,#- coding: utf-8,```,
function,
class,
module,
export,
import
temperature: 0.01
raw: true

############################################

<|fim_prefix|>
<|fim_suffix|>
<|fim_middle|>==========================================================================
==========================================================================
Completion:

import { Component, OnInit } from '@angular/core';

CON-267

sestinj commented 4 months ago

Ah yes the remote part seems like the important one, thanks for mentioning that detail. I know i'd fixed a similar bug recently for non-remote, but I'll take a second look at this. Were you on the latest pre-release version of the extension?

coder543 commented 4 months ago

I was just using whatever is in the VS Code extension store. I don't think it was a pre-release version.

knilink commented 2 months ago

same issue when editing a file outside of the working dir

AndrewRocky commented 1 month ago

Similar issue, but instead it puts in prompt the first suggestion from language server's suggestions. (when editing an unsaved untitled file with Ctrl+N. Checked in both 'Python' and 'Shell Script' Language Modes.) For example, when writing import pan it will get 'pandas' from code suggestions and create prompt <|fim▁begin|>pandas<|fim▁hole|><|fim▁end|>

BTW, I've also seen this prompt on the server - looks suspiciously like a file (tab?) name. Maybe it will help you to debug this issue:

<|fim▁begin|>// Untitled-1
<|fim▁hole|><|fim▁end|>

IDE: VSCode 1.92.2 Environment: Windows 11 remoted into WSL2 Continue: latest published version