diff options
-rw-r--r-- | continuedev/src/continuedev/steps/chat.py | 8 | ||||
-rw-r--r-- | continuedev/src/continuedev/steps/core/core.py | 13 | ||||
-rw-r--r-- | extension/src/activation/activate.ts | 15 |
3 files changed, 30 insertions, 6 deletions
diff --git a/continuedev/src/continuedev/steps/chat.py b/continuedev/src/continuedev/steps/chat.py index 54d9c657..50e0f905 100644 --- a/continuedev/src/continuedev/steps/chat.py +++ b/continuedev/src/continuedev/steps/chat.py @@ -47,9 +47,13 @@ class AddFileStep(Step): except FileNotFoundError: self.description = f"File {self.filename} does not exist." return - currently_open_file = (await sdk.ide.getOpenFiles())[0] + await sdk.ide.setFileOpen(os.path.join(sdk.ide.workspace_directory, self.filename)) - await sdk.ide.setFileOpen(currently_open_file) + + open_files = await sdk.ide.getOpenFiles() + if len(open_files) > 0: + currently_open_file = (await sdk.ide.getOpenFiles())[0] + await sdk.ide.setFileOpen(currently_open_file) class DeleteFileStep(Step): diff --git a/continuedev/src/continuedev/steps/core/core.py b/continuedev/src/continuedev/steps/core/core.py index a487a1b5..9545e9c7 100644 --- a/continuedev/src/continuedev/steps/core/core.py +++ b/continuedev/src/continuedev/steps/core/core.py @@ -9,7 +9,7 @@ from ...libs.llm.prompt_utils import MarkdownStyleEncoderDecoder from ...models.filesystem_edit import EditDiff, FileEdit, FileEditWithFullContents, FileSystemEdit from ...models.filesystem import FileSystem, RangeInFile, RangeInFileWithContents from ...core.observation import Observation, TextObservation, TracebackObservation, UserInputObservation -from ...core.main import Step, SequentialStep +from ...core.main import ChatMessage, Step, SequentialStep from ...libs.util.count_tokens import MAX_TOKENS_FOR_MODEL, DEFAULT_MAX_TOKENS import difflib @@ -322,7 +322,13 @@ class DefaultModelEditCodeStep(Step): current_block_lines.append(line) - async for chunk in model_to_use.stream_chat(prompt, with_history=await sdk.get_chat_context(), temperature=0): + messages = await sdk.get_chat_context() + messages.append(ChatMessage( + role="user", + content=prompt, + summary=self.user_input + )) + async for chunk in model_to_use.stream_chat(messages, temperature=0): # Stop early if it is repeating the file_suffix or the step was deleted if repeating_file_suffix: break @@ -330,6 +336,9 @@ class DefaultModelEditCodeStep(Step): return # Accumulate lines + if "content" not in chunk: + continue + chunk = chunk["content"] chunk_lines = chunk.split("\n") chunk_lines[0] = unfinished_line + chunk_lines[0] if chunk.endswith("\n"): diff --git a/extension/src/activation/activate.ts b/extension/src/activation/activate.ts index 0c92f095..df8b6871 100644 --- a/extension/src/activation/activate.ts +++ b/extension/src/activation/activate.ts @@ -24,8 +24,19 @@ export async function activateExtension( registerAllCodeLensProviders(context); registerAllCommands(context); - // vscode.window.registerWebviewViewProvider("continue.continueGUIView", setupDebugPanel); - await startContinuePythonServer(); + await new Promise((resolve, reject) => { + vscode.window.withProgress( + { + location: vscode.ProgressLocation.Notification, + title: "Starting Continue Server...", + cancellable: false, + }, + async (progress, token) => { + await startContinuePythonServer(); + resolve(null); + } + ); + }); const serverUrl = getContinueServerUrl(); ideProtocolClient = new IdeProtocolClient( |