From dbbcfe0945febb047dcfbcafa56bb9b6e29f919a Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 14 Jan 2025 09:50:05 -0800 Subject: [PATCH 1/7] include signatures by default in repo map context provider --- docs/docs/customize/context-providers.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/docs/customize/context-providers.md b/docs/docs/customize/context-providers.md index 23d8c2253..d49b38c93 100644 --- a/docs/docs/customize/context-providers.md +++ b/docs/docs/customize/context-providers.md @@ -261,9 +261,9 @@ Uses the top _n_ levels (defaulting to 3) of the call stack for that thread. ### `@Repository Map` -Reference the outline of your codebase. +Reference the outline of your codebase. By default, signatures are included along with file in the repo map. -`includeSignatures` params can be used to include signatures for all files in the repo. Use with caution as will increase context size significantly. `includeSignatures` will not work if indexing is disabled. +`includeSignatures` params can be set to false to exclude signatures. This could be necessary for large codebases and/or to reduce context size significantly. Signatures will not be included if indexing is disabled. ```json title="config.json" { @@ -271,7 +271,7 @@ Reference the outline of your codebase. { "name": "repo-map", "params": { - "includeSignatures": false + "includeSignatures": false // default true } } ] From 4034e06133713a3bf7538959a4adaeea70859591 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 14 Jan 2025 09:52:29 -0800 Subject: [PATCH 2/7] repo map context provider include signatures: --- core/context/providers/RepoMapContextProvider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/context/providers/RepoMapContextProvider.ts b/core/context/providers/RepoMapContextProvider.ts index 0805d341e..deabfe590 100644 --- a/core/context/providers/RepoMapContextProvider.ts +++ b/core/context/providers/RepoMapContextProvider.ts @@ -41,7 +41,7 @@ class RepoMapContextProvider extends BaseContextProvider { // Doesn't ALWAYS depend on indexing, so not setting dependsOnIndexing = true, just checking for it includeSignatures: extras.config.disableIndexing ? false - : (this.options?.includeSignatures ?? false), + : (this.options?.includeSignatures ?? true), }), }, ]; From 2456f9fcb27e01da45f064bf2279b13875d28213 Mon Sep 17 00:00:00 2001 From: Test Date: Tue, 14 Jan 2025 11:33:42 -0800 Subject: [PATCH 3/7] bugfix: disable streaming for o1 --- core/llm/index.ts | 28 +++++++++++++++++++++------- gui/src/hooks/useSetup.ts | 1 - 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/core/llm/index.ts b/core/llm/index.ts index 0b48d867c..0e02d550c 100644 --- a/core/llm/index.ts +++ b/core/llm/index.ts @@ -25,6 +25,7 @@ import { logDevData } from "../util/devdata.js"; import { DevDataSqliteDb } from "../util/devdataSqlite.js"; import mergeJson from "../util/merge.js"; import { renderChatMessage } from "../util/messageContent.js"; +import { isOllamaInstalled } from "../util/ollamaHelper.js"; import { Telemetry } from "../util/posthog.js"; import { withExponentialBackoff } from "../util/withExponentialBackoff.js"; @@ -55,7 +56,6 @@ import { toCompleteBody, toFimBody, } from "./openaiTypeConverters.js"; -import { isOllamaInstalled } from "../util/ollamaHelper.js"; export abstract class BaseLLM implements ILLM { static providerName: string; @@ -415,10 +415,9 @@ export abstract class BaseLLM implements ILLM { e.code === "ECONNREFUSED" && e.message.includes("http://127.0.0.1:11434") ) { - const message = (await isOllamaInstalled()) ? - "Unable to connect to local Ollama instance. Ollama may not be running." : - "Unable to connect to local Ollama instance. Ollama may not be installed or may not running." - ; + const message = (await isOllamaInstalled()) + ? "Unable to connect to local Ollama instance. Ollama may not be running." + : "Unable to connect to local Ollama instance. Ollama may not be installed or may not running."; throw new Error(message); } } @@ -693,13 +692,28 @@ export abstract class BaseLLM implements ILLM { return body; } + private _modifyCompletionOptions( + completionOptions: CompletionOptions, + ): CompletionOptions { + // As of 01/14/25 streaming is currently not available with o1 + // See these threads: + // - https://github.com/continuedev/continue/issues/3698 + // - https://community.openai.com/t/streaming-support-for-o1-o1-2024-12-17-resulting-in-400-unsupported-value/1085043 + if (completionOptions.model.startsWith("o1")) { + completionOptions.stream = false; + } + + return completionOptions; + } + async *streamChat( _messages: ChatMessage[], signal: AbortSignal, options: LLMFullCompletionOptions = {}, ): AsyncGenerator { - const { completionOptions, log, raw } = - this._parseCompletionOptions(options); + let { completionOptions, log } = this._parseCompletionOptions(options); + + completionOptions = this._modifyCompletionOptions(completionOptions); const messages = this._compileChatMessages(completionOptions, _messages); diff --git a/gui/src/hooks/useSetup.ts b/gui/src/hooks/useSetup.ts index ee8ced33f..a545aedaf 100644 --- a/gui/src/hooks/useSetup.ts +++ b/gui/src/hooks/useSetup.ts @@ -65,7 +65,6 @@ function useSetup() { if (result.status === "error") { return; } - console.log("Config loaded", result.content); await handleConfigUpdate(initial, result.content); }, [ideMessenger, handleConfigUpdate], From 27a2967128d22394f61602a5b8dcb752dfbeed36 Mon Sep 17 00:00:00 2001 From: Test Date: Tue, 14 Jan 2025 14:00:12 -0800 Subject: [PATCH 4/7] Update AutocompleteService.kt --- .../autocomplete/AutocompleteService.kt | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteService.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteService.kt index b2650b8f4..343778332 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteService.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteService.kt @@ -297,13 +297,12 @@ class AutocompleteService(private val project: Project) { } private fun isInjectedFile(editor: Editor): Boolean { - return ApplicationManager.getApplication().executeOnPooledThread { - ApplicationManager.getApplication().runReadAction { - val psiFile = - PsiDocumentManager.getInstance(project).getPsiFile(editor.document) ?: return@runReadAction false - return@runReadAction psiFile.isInjectedText() - } - }.get() + val psiFile = runReadAction { PsiDocumentManager.getInstance(project).getPsiFile(editor.document) } + if (psiFile == null) { + return false + } + val response = runReadAction { psiFile.isInjectedText() } + return response } fun hideCompletions(editor: Editor) { From 1db4b10bc1df22e3f2ecabfbfa5522cefba9ba46 Mon Sep 17 00:00:00 2001 From: "Jake A. Smith" Date: Tue, 14 Jan 2025 15:35:31 -0800 Subject: [PATCH 5/7] Update ollama.md Small json syntax fix --- docs/docs/customize/model-providers/top-level/ollama.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/customize/model-providers/top-level/ollama.md b/docs/docs/customize/model-providers/top-level/ollama.md index d2a4749c0..611c3dad8 100644 --- a/docs/docs/customize/model-providers/top-level/ollama.md +++ b/docs/docs/customize/model-providers/top-level/ollama.md @@ -64,7 +64,7 @@ To configure a remote instance of Ollama, add the `"apiBase"` property to your m { "title": "Llama3.1 8B", "provider": "ollama", - "model": "llama3.1:8b" + "model": "llama3.1:8b", "apiBase": "http://:11434" } ] From ae5928357171df0f9b1fa4a9a1d79732cc7a2dc8 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 14 Jan 2025 18:40:37 -0800 Subject: [PATCH 6/7] fix missing docs subaction item --- gui/src/components/mainInput/MentionList.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gui/src/components/mainInput/MentionList.tsx b/gui/src/components/mainInput/MentionList.tsx index aae963779..815a12f00 100644 --- a/gui/src/components/mainInput/MentionList.tsx +++ b/gui/src/components/mainInput/MentionList.tsx @@ -81,6 +81,7 @@ const ICONS_FOR_DROPDOWN: { [key: string]: any } = { google: GoogleIcon, "gitlab-mr": GitlabIcon, http: GlobeAltIcon, + trash: TrashIcon, }; export function getIconFromDropdownItem( @@ -451,7 +452,10 @@ const MentionList = forwardRef((props: MentionListProps, ref) => { /> )} {item.subActions?.map((subAction) => { - const Icon = ICONS_FOR_DROPDOWN[subAction.icon]; + const Icon = getIconFromDropdownItem( + subAction.icon, + "action", + ); return ( { From 3fb3c16917e37567b5575fd07f7d0fd3b2965bba Mon Sep 17 00:00:00 2001 From: Nate Date: Wed, 15 Jan 2025 09:19:43 -0800 Subject: [PATCH 7/7] don't disable streaming for o1-mini and -preview --- core/llm/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/llm/index.ts b/core/llm/index.ts index 0e02d550c..11b66ce8d 100644 --- a/core/llm/index.ts +++ b/core/llm/index.ts @@ -699,7 +699,7 @@ export abstract class BaseLLM implements ILLM { // See these threads: // - https://github.com/continuedev/continue/issues/3698 // - https://community.openai.com/t/streaming-support-for-o1-o1-2024-12-17-resulting-in-400-unsupported-value/1085043 - if (completionOptions.model.startsWith("o1")) { + if (completionOptions.model === "o1") { completionOptions.stream = false; }