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
18.25k stars 1.47k forks source link

garbled response when hitting enter twice when openAI is being laggy #1042

Open sircambridge opened 6 months ago

sircambridge commented 6 months ago

Before submitting your bug report

Relevant environment info

- OS: windows
- Continue:
- IDE: VSCode

Description

I had entered a query and just Enter to start, and I got the rainbow gradient border, and it seemed to hang because of the openAI server issues, so I hit enter again, and it looks like two parallel completions started, and the results came back interleaved, which made for a very funny looking response with the tokens mixed up!

To reproduce

its hard to reproduce, since it depends on openAI being laggy, so its some sort of race condition for sure. I saw it twice on the same day during the openAI outage

bug

Log output

To round a numberYou to the nearest can use cent in the JavaScriptMath, you.round() can function use in the JavaScript toMath round.round numbers(). method If. you Here want's to an round example to:

the nearestjavascript cent ,var you num can = multiply the123 number. by456 ; 100var, rounded round it, then divide byNum 100. = Here Math.round's(num how *:

/function  round100To;
Neconsolearest.logCent(round(numbered)Num {
);     return // Math Outputs.round:(number  *123 .46100
``)`

In this / example,  we're100 first;
multiplying the}

console.log(roundTo numberNe byarest Cent100( (12which. shifts345 the6 decimal)); point  two // places Output to: the right 12),. then35 rounding
to`` the`

nearestThis whole number, and then dividing by 100 (which shifts the decimal point back two places to the left). This gives us the original number rounded to the nearest cent.
sestinj commented 6 months ago

Thanks for gathering all of the info here! Looks like what is happening is:

Probably at line 372 of gui.tsx we could just add dispatch(setInactive()) before streamResponse, but would want to double check that this doesn't cause any problems (e.g. stopping the new request from going through).

Iamshankhadeep commented 6 months ago

got it. @sestinj can you assign this to me?