From 717e11321b9ece0781b9b531a3a2b329ae339b42 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Wed, 16 Jul 2025 17:26:01 -0700 Subject: [PATCH 01/41] Update bug_report.yml --- .github/ISSUE_TEMPLATE/bug_report.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 4a0595a38..4ff2b89da 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -11,6 +11,7 @@ body: attributes: label: Before submitting your bug report options: + - label: I've tried using the "Ask AI" feature on the [Continue docs site](https://docs.continue.dev/) to see if the docs have an answer - label: I believe this is a bug. I'll try to join the [Continue Discord](https://discord.gg/NWtdYexhMs) for questions required: false - label: I'm not able to find an [open issue](https://github.com/continuedev/continue/issues?q=is%3Aopen+is%3Aissue) that reports the same bug From a69900c1462110a991ece8f5857de6abc3e1cc77 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Wed, 16 Jul 2025 17:27:44 -0700 Subject: [PATCH 02/41] Update bug_report.yml --- .github/ISSUE_TEMPLATE/bug_report.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 4ff2b89da..cc85d0d0a 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -12,6 +12,7 @@ body: label: Before submitting your bug report options: - label: I've tried using the "Ask AI" feature on the [Continue docs site](https://docs.continue.dev/) to see if the docs have an answer + required: false - label: I believe this is a bug. I'll try to join the [Continue Discord](https://discord.gg/NWtdYexhMs) for questions required: false - label: I'm not able to find an [open issue](https://github.com/continuedev/continue/issues?q=is%3Aopen+is%3Aissue) that reports the same bug From 194b802ed3b1c67afeb6abfa7153401acecd51b6 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Sat, 19 Jul 2025 19:39:09 +0200 Subject: [PATCH 03/41] fix: set high default pruning length, let server throw error unless context length known --- core/llm/constants.ts | 2 ++ core/llm/countTokens.ts | 10 ++++++---- core/llm/index.ts | 13 ++++++++----- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/core/llm/constants.ts b/core/llm/constants.ts index 90de5c64d..b6759663d 100644 --- a/core/llm/constants.ts +++ b/core/llm/constants.ts @@ -1,6 +1,7 @@ const DEFAULT_MAX_TOKENS = 4096; const DEFAULT_CONTEXT_LENGTH = 32_768; const DEFAULT_TEMPERATURE = 0.5; +const DEFAULT_PRUNING_LENGTH = 128000; const DEFAULT_ARGS = { maxTokens: DEFAULT_MAX_TOKENS, @@ -24,5 +25,6 @@ export { DEFAULT_MAX_BATCH_SIZE, DEFAULT_MAX_CHUNK_SIZE, DEFAULT_MAX_TOKENS, + DEFAULT_PRUNING_LENGTH, PROXY_URL, }; diff --git a/core/llm/countTokens.ts b/core/llm/countTokens.ts index 852638d1c..03a106144 100644 --- a/core/llm/countTokens.ts +++ b/core/llm/countTokens.ts @@ -17,6 +17,7 @@ import { import { renderChatMessage } from "../util/messageContent.js"; import { AsyncEncoder, LlamaAsyncEncoder } from "./asyncEncoder.js"; +import { DEFAULT_PRUNING_LENGTH } from "./constants.js"; import llamaTokenizer from "./llamaTokenizer.js"; interface Encoding { encode: Tiktoken["encode"]; @@ -409,14 +410,14 @@ function pruneRawPromptFromTop( function compileChatMessages({ modelName, msgs, - contextLength, + knownContextLength, maxTokens, supportsImages, tools, }: { modelName: string; msgs: ChatMessage[]; - contextLength: number; + knownContextLength: number | undefined; maxTokens: number; supportsImages: boolean; tools?: Tool[]; @@ -465,6 +466,7 @@ function compileChatMessages({ toolTokens = countToolsTokens(tools, modelName); } + const contextLength = knownContextLength ?? DEFAULT_PRUNING_LENGTH; const countingSafetyBuffer = getTokenCountingBufferSafety(contextLength); const minOutputTokens = Math.min(MIN_RESPONSE_TOKENS, maxTokens); @@ -480,12 +482,12 @@ function compileChatMessages({ inputTokensAvailable -= lastMessagesTokens; // Make sure there's enough context for the non-excludable items - if (inputTokensAvailable < 0) { + if (knownContextLength !== undefined && inputTokensAvailable < 0) { throw new Error( `Not enough context available to include the system message, last user message, and tools. There must be at least ${minOutputTokens} tokens remaining for output. Request had the following token counts: - - contextLength: ${contextLength} + - contextLength: ${knownContextLength} - counting safety buffer: ${countingSafetyBuffer} - tools: ~${toolTokens} - system message: ~${systemMsgTokens} diff --git a/core/llm/index.ts b/core/llm/index.ts index fa16b8591..4d31e0902 100644 --- a/core/llm/index.ts +++ b/core/llm/index.ts @@ -145,7 +145,7 @@ export abstract class BaseLLM implements ILLM { baseChatSystemMessage?: string; basePlanSystemMessage?: string; baseAgentSystemMessage?: string; - contextLength: number; + _contextLength: number | undefined; maxStopWords?: number | undefined; completionOptions: CompletionOptions; requestOptions?: RequestOptions; @@ -217,8 +217,7 @@ export abstract class BaseLLM implements ILLM { this.baseAgentSystemMessage = options.baseAgentSystemMessage; this.basePlanSystemMessage = options.basePlanSystemMessage; this.baseChatSystemMessage = options.baseChatSystemMessage; - this.contextLength = - options.contextLength ?? llmInfo?.contextLength ?? DEFAULT_CONTEXT_LENGTH; + this._contextLength = options.contextLength ?? llmInfo?.contextLength; this.maxStopWords = options.maxStopWords ?? this.maxStopWords; this.completionOptions = { ...options.completionOptions, @@ -292,6 +291,10 @@ export abstract class BaseLLM implements ILLM { this.autocompleteOptions = options.autocompleteOptions; } + get contextLength() { + return this._contextLength ?? DEFAULT_CONTEXT_LENGTH; + } + getConfigurationStatus() { return LLMConfigurationStatuses.VALID; } @@ -895,7 +898,7 @@ export abstract class BaseLLM implements ILLM { return compileChatMessages({ modelName: completionOptions.model, msgs: message, - contextLength: this.contextLength, + knownContextLength: this._contextLength, maxTokens: completionOptions.maxTokens ?? DEFAULT_MAX_TOKENS, supportsImages: this.supportsImages(), tools: options.tools, @@ -944,7 +947,7 @@ export abstract class BaseLLM implements ILLM { const { compiledChatMessages } = compileChatMessages({ modelName: completionOptions.model, msgs: _messages, - contextLength: this.contextLength, + knownContextLength: this._contextLength, maxTokens: completionOptions.maxTokens ?? DEFAULT_MAX_TOKENS, supportsImages: this.supportsImages(), tools: options.tools, From 32911c07790b0cf2f7e2d9ff67ad5081184dbb67 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Sat, 19 Jul 2025 19:47:01 +0200 Subject: [PATCH 04/41] fix: assign to contextLength basellm getter --- core/llm/llms/HuggingFaceTGI.ts | 2 +- core/llm/llms/Ollama.ts | 2 +- core/llm/llms/Vllm.ts | 2 +- core/util/generateRepoMap.test.ts | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/llm/llms/HuggingFaceTGI.ts b/core/llm/llms/HuggingFaceTGI.ts index 8a86634c8..ca4acc6d9 100644 --- a/core/llm/llms/HuggingFaceTGI.ts +++ b/core/llm/llms/HuggingFaceTGI.ts @@ -25,7 +25,7 @@ class HuggingFaceTGI extends BaseLLM { } const json = await response.json(); this.model = json.model_id; - this.contextLength = Number.parseInt(json.max_input_length); + this._contextLength = Number.parseInt(json.max_input_length); }) .catch((e) => { console.log(`Failed to list models for HuggingFace TGI: ${e.message}`); diff --git a/core/llm/llms/Ollama.ts b/core/llm/llms/Ollama.ts index 106f99e1b..a944f90f9 100644 --- a/core/llm/llms/Ollama.ts +++ b/core/llm/llms/Ollama.ts @@ -184,7 +184,7 @@ class Ollama extends BaseLLM implements ModelInstaller { let value = parts[2]; switch (key) { case "num_ctx": - this.contextLength = + this._contextLength = options.contextLength ?? Number.parseInt(value); break; case "stop": diff --git a/core/llm/llms/Vllm.ts b/core/llm/llms/Vllm.ts index ac550f153..97bd936cb 100644 --- a/core/llm/llms/Vllm.ts +++ b/core/llm/llms/Vllm.ts @@ -72,7 +72,7 @@ class Vllm extends OpenAI { const json = await response.json(); const data = json.data[0]; this.model = data.id; - this.contextLength = Number.parseInt(data.max_model_len); + this._contextLength = Number.parseInt(data.max_model_len); }) .catch((e) => { console.log(`Failed to list models for vLLM: ${e.message}`); diff --git a/core/util/generateRepoMap.test.ts b/core/util/generateRepoMap.test.ts index 78f879f63..67c58c6fd 100644 --- a/core/util/generateRepoMap.test.ts +++ b/core/util/generateRepoMap.test.ts @@ -55,7 +55,7 @@ describe.skip("generateRepoMap", () => { }); // Set testLLM properties - testLLM.contextLength = 2048; + testLLM._contextLength = 2048; testLLM.countTokens = jest.fn().mockReturnValue(10); // Act @@ -115,7 +115,7 @@ describe.skip("generateRepoMap", () => { }); // Set testLLM properties - testLLM.contextLength = 2048; + testLLM._contextLength = 2048; testLLM.countTokens = jest.fn().mockReturnValue(10); // Act @@ -184,7 +184,7 @@ describe.skip("generateRepoMap", () => { .mockImplementation(() => {}); // Set testLLM properties - testLLM.contextLength = 2048; + testLLM._contextLength = 2048; testLLM.countTokens = jest.fn().mockReturnValue(10); // Act From 5c46a1e90b506319d71bca4db95fd37a16d02784 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Mon, 21 Jul 2025 11:00:54 -0700 Subject: [PATCH 05/41] feat: clarify mode alert in tools section --- .../tool-policies/ToolPoliciesSection.tsx | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/gui/src/components/mainInput/Lump/sections/tool-policies/ToolPoliciesSection.tsx b/gui/src/components/mainInput/Lump/sections/tool-policies/ToolPoliciesSection.tsx index 8adfa75d2..5aee1466f 100644 --- a/gui/src/components/mainInput/Lump/sections/tool-policies/ToolPoliciesSection.tsx +++ b/gui/src/components/mainInput/Lump/sections/tool-policies/ToolPoliciesSection.tsx @@ -1,4 +1,4 @@ -import { Tool } from "core"; +import { MessageModes, Tool } from "core"; import { useMemo } from "react"; import { useAppDispatch, useAppSelector } from "../../../../../redux/hooks"; import { toggleToolGroupSetting } from "../../../../../redux/slices/uiSlice"; @@ -43,20 +43,28 @@ export const ToolPoliciesSection = () => { const allToolsOff = mode === "chat"; - const message = - mode === "chat" - ? "All tools disabled (Chat)" - : mode === "plan" - ? "Read-only/MCP tools available (Plan)" - : "All tools available (Agent)"; + const getMessage = (mode: MessageModes) => { + switch (mode) { + case "chat": + return "All tools disabled in Chat, switch to Plan or Agent mode to use tools"; + case "plan": + return "Read-only/MCP tools available in Plan mode"; + default: + return ""; + } + }; + + const message = getMessage(mode); return ( <> -
- - {message} - -
+ {(mode === "chat" || mode === "plan") && ( +
+ + {message} + +
+ )} {toolsByGroup.map(([groupName, tools]) => { const isGroupEnabled = !allToolsOff && toolGroupSettings[groupName] !== "exclude"; From 24574d354437539d2d80501e1bb631f26c37c713 Mon Sep 17 00:00:00 2001 From: Ting-Wai To <40179554+tingwai@users.noreply.github.com> Date: Tue, 22 Jul 2025 11:16:39 -0700 Subject: [PATCH 06/41] test: verify chunkDocument filters out chunks exceeding maxChunkSize --- core/indexing/chunk/chunk.test.ts | 60 ++++++++++++++++++++++++++++++- core/llm/countTokens.test.ts | 8 ++++- core/llm/countTokens.ts | 7 ++++ 3 files changed, 73 insertions(+), 2 deletions(-) diff --git a/core/indexing/chunk/chunk.test.ts b/core/indexing/chunk/chunk.test.ts index 7a8ce6f76..16bcdd2d9 100644 --- a/core/indexing/chunk/chunk.test.ts +++ b/core/indexing/chunk/chunk.test.ts @@ -1,6 +1,8 @@ import path from "path"; -import { shouldChunk } from "./chunk"; +import { Chunk } from "../../index.js"; +import { cleanupAsyncEncoders } from "../../llm/countTokens.js"; +import { chunkDocument, shouldChunk } from "./chunk"; describe("shouldChunk", () => { test("should chunk a typescript file", () => { @@ -28,6 +30,62 @@ describe("shouldChunk", () => { }); }); +describe("chunkDocument", () => { + afterAll(async () => { + // Clean up the global async encoders to prevent Jest from hanging + await cleanupAsyncEncoders(); + }); + + test("should return multiple chunks for large content with small maxChunkSize", async () => { + const filepath = "/test/file.txt"; + const maxChunkSize = 10; // small limit + const digest = "test-digest"; + + // Create content with multiple short lines - each line should fit within maxChunkSize + const lines = ["short line", "another line", "third line"]; + const contents = lines.join("\n"); + + const chunks: Chunk[] = []; + for await (const chunk of chunkDocument({ + filepath, + contents, + maxChunkSize, + digest, + })) { + chunks.push(chunk); + } + + // Verify chunks have valid content + chunks.forEach((chunk) => { + expect(chunk.content.length).toBeGreaterThan(0); + }); + }); + + test("should filter out chunks that exceed maxChunkSize in tokens", async () => { + const filepath = "/test/large.txt"; + const maxChunkSize = 10; // small limit + const digest = "test-digest-2"; + + const contents = + "This is a much longer line with many words that will likely exceed the maxChunkSize token limit and should be filtered out by the chunkDocument function. This is a much longer line with many words that will likely exceed the maxChunkSize token limit and should be filtered out by the chunkDocument function."; + + const chunks: Chunk[] = []; + for await (const chunk of chunkDocument({ + filepath, + contents, + maxChunkSize, + digest, + })) { + chunks.push(chunk); + } + + // Verify that no chunks were created since the content exceeds maxChunkSize + chunks.forEach((chunk) => { + expect(chunk.content.length).toBe(0); + }); + }); +}); + function generateString(length: number) { return "a".repeat(length); } diff --git a/core/llm/countTokens.test.ts b/core/llm/countTokens.test.ts index 9b08dca21..4cbe13a5b 100644 --- a/core/llm/countTokens.test.ts +++ b/core/llm/countTokens.test.ts @@ -2,6 +2,7 @@ // Generated by continue import { ChatMessage, MessagePart, ToolCall } from "../index.js"; import { + cleanupAsyncEncoders, compileChatMessages, countTokens, countTokensAsync, @@ -27,7 +28,12 @@ describe.skip("countTokens", () => { }); }); -describe.skip("countTokensAsync", () => { +describe("countTokensAsync", () => { + afterAll(async () => { + // Clean up the global async encoders to prevent Jest from hanging + await cleanupAsyncEncoders(); + }); + it("should count tokens asynchronously for a simple string", async () => { const content = "Hello world!"; const tokenCount = await countTokensAsync(content, "gpt-4"); diff --git a/core/llm/countTokens.ts b/core/llm/countTokens.ts index 852638d1c..8120c9167 100644 --- a/core/llm/countTokens.ts +++ b/core/llm/countTokens.ts @@ -536,7 +536,14 @@ function compileChatMessages({ }; } +async function cleanupAsyncEncoders(): Promise { + try { + await llamaAsyncEncoder.close(); + } catch (e) {} +} + export { + cleanupAsyncEncoders, compileChatMessages, countTokens, countTokensAsync, From 6bdae841d83c0c8fc129765acff1a0a9201f2894 Mon Sep 17 00:00:00 2001 From: Ting-Wai To <40179554+tingwai@users.noreply.github.com> Date: Wed, 23 Jul 2025 17:44:17 -0700 Subject: [PATCH 07/41] test: chunkDocumentWithoutId --- core/indexing/chunk/chunk.test.ts | 68 ++++++++++++++++++++++++++++++- core/indexing/chunk/chunk.ts | 2 +- 2 files changed, 67 insertions(+), 3 deletions(-) diff --git a/core/indexing/chunk/chunk.test.ts b/core/indexing/chunk/chunk.test.ts index 16bcdd2d9..90febfa73 100644 --- a/core/indexing/chunk/chunk.test.ts +++ b/core/indexing/chunk/chunk.test.ts @@ -1,8 +1,8 @@ import path from "path"; -import { Chunk } from "../../index.js"; +import { Chunk, ChunkWithoutID } from "../../index.js"; import { cleanupAsyncEncoders } from "../../llm/countTokens.js"; -import { chunkDocument, shouldChunk } from "./chunk"; +import { chunkDocument, chunkDocumentWithoutId, shouldChunk } from "./chunk"; describe("shouldChunk", () => { test("should chunk a typescript file", () => { @@ -86,6 +86,70 @@ describe("chunkDocument", () => { }); }); +describe("chunkDocumentWithoutId", () => { + afterAll(async () => { + await cleanupAsyncEncoders(); + }); + + test("should return no chunks for empty content", async () => { + const contents = ""; + const chunks: ChunkWithoutID[] = []; + for await (const chunk of chunkDocumentWithoutId( + "file.txt", + contents, + 100, + )) { + chunks.push(chunk); + } + expect(chunks).toHaveLength(0); + }); + + test("should chunk text files", async () => { + const contents = "Line 1\nLine 2\nLine 3"; + const chunks: ChunkWithoutID[] = []; + for await (const chunk of chunkDocumentWithoutId( + "file.txt", + contents, + 100, + )) { + chunks.push(chunk); + } + expect(chunks.length).toBeGreaterThan(0); + expect(chunks[0].content).toContain("Line 1"); + }); + + test("should chunk for code files", async () => { + const contents = "function test() {\n return 42;\n}"; + const chunks: ChunkWithoutID[] = []; + for await (const chunk of chunkDocumentWithoutId( + "file.js", + contents, + 100, + )) { + chunks.push(chunk); + } + expect(chunks.length).toBeGreaterThan(0); + expect(chunks[0].content).toContain("function test"); + }); + + test("should chunk large content", async () => { + const contents = Array(100).fill("short line").join("\n"); // Large content with many lines + const maxChunkSize = 50; + const chunks: ChunkWithoutID[] = []; + for await (const chunk of chunkDocumentWithoutId( + "file.txt", + contents, + maxChunkSize, + )) { + chunks.push(chunk); + } + expect(chunks.length).toBeGreaterThan(1); // Should create multiple chunks + chunks.forEach((chunk) => { + expect(chunk.content.length).toBeGreaterThan(0); // Each chunk should have content + }); + }); +}); + function generateString(length: number) { return "a".repeat(length); } diff --git a/core/indexing/chunk/chunk.ts b/core/indexing/chunk/chunk.ts index d46dd2e3b..de9a33f9c 100644 --- a/core/indexing/chunk/chunk.ts +++ b/core/indexing/chunk/chunk.ts @@ -13,7 +13,7 @@ export type ChunkDocumentParam = { digest: string; }; -async function* chunkDocumentWithoutId( +export async function* chunkDocumentWithoutId( fileUri: string, contents: string, maxChunkSize: number, From 4d4423485526822b133e1109fcf4ca14adf9492d Mon Sep 17 00:00:00 2001 From: Ting-Wai To <40179554+tingwai@users.noreply.github.com> Date: Thu, 24 Jul 2025 06:39:56 -0700 Subject: [PATCH 08/41] feat: add editOutcome logging for Agent Mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Add editOutcome.jsonl logging for Agent Mode accept / rejects • Capture original file content before applying changes to enable proper diff tracking • Fix newline handling in IntelliJ and VS Code to prevent line count discrepancies, was causing lineChange count to be off by one --- core/config/types.ts | 1 + core/index.d.ts | 1 + .../continue/ApplyToFileHandler.kt | 4 + .../continue/IntelliJIde.kt | 7 +- .../continueintellijextension/types.kt | 1 + extensions/vscode/src/apply/ApplyManager.ts | 18 +- .../vscode/src/diff/vertical/handler.ts | 24 +- gui/src/hooks/ParallelListeners.tsx | 46 +++- gui/src/redux/slices/sessionSlice.ts | 3 + gui/src/util/editOutcomeLogger.ts | 206 ++++++++++++++++++ 10 files changed, 282 insertions(+), 29 deletions(-) create mode 100644 gui/src/util/editOutcomeLogger.ts diff --git a/core/config/types.ts b/core/config/types.ts index 406f40ddd..5cbe28b1b 100644 --- a/core/config/types.ts +++ b/core/config/types.ts @@ -1057,6 +1057,7 @@ declare global { numDiffs?: number; filepath?: string; fileContent?: string; + originalFileContent?: string; } export interface RangeInFileWithContents { diff --git a/core/index.d.ts b/core/index.d.ts index f9fdc34cf..13e231b87 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -1360,6 +1360,7 @@ export interface ApplyState { numDiffs?: number; filepath?: string; fileContent?: string; + originalFileContent?: string; toolCallId?: string; } diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/ApplyToFileHandler.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/ApplyToFileHandler.kt index 28b648d4a..856215be2 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/ApplyToFileHandler.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/ApplyToFileHandler.kt @@ -29,6 +29,9 @@ class ApplyToFileHandler( private val diffStreamService: DiffStreamService ) { + // Store the original file content before applying changes + private val originalFileContent: String? = editorUtils?.getDocumentText() + suspend fun handleApplyToFile() { // Notify webview that we're starting to stream notifyStreamStarted() @@ -111,6 +114,7 @@ class ApplyToFileHandler( numDiffs = numDiffs, filepath = params.filepath, fileContent = params.text, + originalFileContent = originalFileContent, toolCallId = params.toolCallId.toString() ) diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IntelliJIde.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IntelliJIde.kt index 2f1889fb4..dc308d7de 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IntelliJIde.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IntelliJIde.kt @@ -342,9 +342,10 @@ class IntelliJIDE( val buffer = ByteArray(sizeToRead) val bytesRead = fis.read(buffer, 0, sizeToRead) if (bytesRead <= 0) return@use "" - String(buffer, 0, bytesRead, Charset.forName("UTF-8")) - // `\r` takes up unnecessary tokens - .lineSequence().joinToString("\n") + val content = String(buffer, 0, bytesRead, Charset.forName("UTF-8")) + // Remove `\r` characters but preserve trailing newlines to prevent line count discrepancies + val contentWithoutCR = content.replace("\r\n", "\n").replace("\r", "\n") + contentWithoutCR } } } diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/types.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/types.kt index 133c80e63..32c7802ad 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/types.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/types.kt @@ -290,6 +290,7 @@ data class ApplyState( val numDiffs: Int? = null, val filepath: String? = null, val fileContent: String? = null, + val originalFileContent: String? = null, val toolCallId: String? = null ) diff --git a/extensions/vscode/src/apply/ApplyManager.ts b/extensions/vscode/src/apply/ApplyManager.ts index 1ac84c368..c12d6323a 100644 --- a/extensions/vscode/src/apply/ApplyManager.ts +++ b/extensions/vscode/src/apply/ApplyManager.ts @@ -29,13 +29,6 @@ export class ApplyManager { toolCallId, isSearchAndReplace, }: ApplyToFilePayload) { - await this.webviewProtocol.request("updateApplyState", { - streamId, - status: "streaming", - fileContent: text, - toolCallId, - }); - if (filepath) { await this.ensureFileOpen(filepath); } @@ -46,6 +39,17 @@ export class ApplyManager { return; } + // Capture the original file content before applying changes + const originalFileContent = activeTextEditor.document.getText(); + + await this.webviewProtocol.request("updateApplyState", { + streamId, + status: "streaming", + fileContent: text, + originalFileContent, + toolCallId, + }); + const hasExistingDocument = !!activeTextEditor.document.getText().trim(); if (hasExistingDocument) { diff --git a/extensions/vscode/src/diff/vertical/handler.ts b/extensions/vscode/src/diff/vertical/handler.ts index 339f9e84b..869e5962d 100644 --- a/extensions/vscode/src/diff/vertical/handler.ts +++ b/extensions/vscode/src/diff/vertical/handler.ts @@ -315,11 +315,12 @@ export class VerticalDiffHandler implements vscode.Disposable { // newline separated, because myersDiff() would consider // ["A"] => "A" and ["A", ""] => "A\n" to be the same single line. // "A\n" and "A\n\n" are unambiguous. - const oldFileContent = - diffLines - .filter((line) => line.type === "same" || line.type === "old") - .map((line) => line.line) - .join("\n") + "\n"; + const oldContentWithoutTrailingNewline = diffLines + .filter((line) => line.type === "same" || line.type === "old") + .map((line) => line.line) + .join("\n"); + + const oldFileContent = oldContentWithoutTrailingNewline + "\n"; const newFileContent = diffLines @@ -329,9 +330,16 @@ export class VerticalDiffHandler implements vscode.Disposable { const myersDiffs = myersDiff(oldFileContent, newFileContent); - const replaceContent = myersDiffs - .map((diff) => (diff.type === "old" ? "" : diff.line)) - .join("\n"); + // Preserve the trailing newline behavior by checking the original document content + const originalDocumentContent = this.editor.document.getText(this.range); + const originalContentEndsWithNewline = + originalDocumentContent.endsWith("\n"); + + // Add trailing newline only if the original file had one to prevent line count discrepancies + const replaceContent = + myersDiffs + .map((diff) => (diff.type === "old" ? "" : diff.line)) + .join("\n") + (originalContentEndsWithNewline ? "\n" : ""); // Then, we insert our diff lines await this.editor.edit((editBuilder) => { diff --git a/gui/src/hooks/ParallelListeners.tsx b/gui/src/hooks/ParallelListeners.tsx index 6118d2213..342a1ad8d 100644 --- a/gui/src/hooks/ParallelListeners.tsx +++ b/gui/src/hooks/ParallelListeners.tsx @@ -38,6 +38,7 @@ import { setDocumentStylesFromTheme, } from "../styles/theme"; import { isJetBrains } from "../util"; +import { logAgentModeEditOutcome } from "../util/editOutcomeLogger"; import { setLocalStorage } from "../util/localStorage"; import { migrateLocalStorage } from "../util/migrateLocalStorage"; import { useWebviewListener } from "./useWebviewListener"; @@ -276,17 +277,40 @@ function ParallelListeners() { store.getState().session.history, state.toolCallId, ); - if (toolCallState && toolCallState.status !== "canceled") { - dispatch( - acceptToolCall({ - toolCallId: state.toolCallId, - }), - ); - void dispatch( - streamResponseAfterToolCall({ - toolCallId: state.toolCallId, - }), - ); + + if (toolCallState) { + const accepted = toolCallState.status !== "canceled"; + + logToolUsage(toolCallState, accepted, true, ideMessenger); + + // Log edit outcome for Agent Mode + const applyState = store + .getState() + .session.codeBlockApplyStates.states.find( + (s) => s.streamId === state.streamId, + ); + + if (applyState) { + void logAgentModeEditOutcome( + toolCallState, + applyState, + accepted, + ideMessenger, + ); + } + + if (accepted) { + dispatch( + acceptToolCall({ + toolCallId: state.toolCallId, + }), + ); + void dispatch( + streamResponseAfterToolCall({ + toolCallId: state.toolCallId, + }), + ); + } } // const output: ContextItem = { // name: "Edit tool output", diff --git a/gui/src/redux/slices/sessionSlice.ts b/gui/src/redux/slices/sessionSlice.ts index 7f13b87fe..3ec2fe27b 100644 --- a/gui/src/redux/slices/sessionSlice.ts +++ b/gui/src/redux/slices/sessionSlice.ts @@ -784,6 +784,9 @@ export const sessionSlice = createSlice({ applyState.status = payload.status ?? applyState.status; applyState.numDiffs = payload.numDiffs ?? applyState.numDiffs; applyState.filepath = payload.filepath ?? applyState.filepath; + applyState.fileContent = payload.fileContent ?? applyState.fileContent; + applyState.originalFileContent = + payload.originalFileContent ?? applyState.originalFileContent; } if (payload.status === "done") { diff --git a/gui/src/util/editOutcomeLogger.ts b/gui/src/util/editOutcomeLogger.ts new file mode 100644 index 000000000..eed722d29 --- /dev/null +++ b/gui/src/util/editOutcomeLogger.ts @@ -0,0 +1,206 @@ +import { ApplyState, ToolCallState } from "core"; +import { IIdeMessenger } from "../context/IdeMessenger"; +import { store } from "../redux/store"; + +interface EditOutcomeData { + streamId: string; + timestamp: string; + modelProvider: string; + modelTitle: string; + prompt: string; + completion: string; + previousCode: string; + newCode: string; + filepath: string; + previousCodeLines: number; + newCodeLines: number; + lineChange: number; + accepted: boolean; +} + +/** + * Extract model information from tool call state + */ +function extractModelInfo(toolCallState: ToolCallState): { + modelProvider: string; + modelTitle: string; +} { + // Get the conversation history to find the model info + const history = store.getState().session.history; + + // Find the assistant message that contains this tool call + const assistantMessage = history.find( + (item) => + item.message.role === "assistant" && + item.message.toolCalls?.some((tc) => tc.id === toolCallState.toolCallId), + ); + + if ( + assistantMessage?.message.role === "assistant" && + "model" in assistantMessage.message && + assistantMessage.message.model + ) { + // Extract provider from model string (e.g., "anthropic::claude-3-5-sonnet" -> "anthropic") + const modelParts = String(assistantMessage.message.model).split("::"); + return { + modelProvider: modelParts[0] || "unknown", + modelTitle: modelParts[1] || String(assistantMessage.message.model), + }; + } + + // Fallback to config if not found in message + const config = store.getState().config.config; + const chatModel = config?.selectedModelByRole?.chat; + + return { + modelProvider: chatModel?.provider || "unknown", + modelTitle: chatModel?.model || "unknown", + }; +} + +/** + * Extract prompt and completion from tool call state + */ +function extractPromptAndCompletion(toolCallState: ToolCallState): { + prompt: string; + completion: string; +} { + const history = store.getState().session.history; + + // Find the assistant message with this tool call + const assistantMessageIndex = history.findIndex( + (item) => + item.message.role === "assistant" && + item.message.toolCalls?.some((tc) => tc.id === toolCallState.toolCallId), + ); + + if (assistantMessageIndex >= 0) { + const assistantMessage = history[assistantMessageIndex]; + + // Look for the most recent user message before this assistant message + let userMessage = null; + for (let i = assistantMessageIndex - 1; i >= 0; i--) { + if (history[i].message.role === "user") { + userMessage = history[i]; + break; + } + } + + const promptContent = userMessage + ? Array.isArray(userMessage.message.content) + ? userMessage.message.content + .map((part) => + typeof part === "string" + ? part + : part.type === "text" + ? part.text || "" + : "", + ) + .join("") + : userMessage.message.content || "" + : ""; + + const completionContent = Array.isArray(assistantMessage.message.content) + ? assistantMessage.message.content + .map((part) => + typeof part === "string" + ? part + : part.type === "text" + ? part.text || "" + : "", + ) + .join("") + : assistantMessage.message.content || ""; + + return { + prompt: promptContent, + completion: completionContent, + }; + } + + return { + prompt: "Unknown prompt", + completion: "Unknown completion", + }; +} + +/** + * Extract code changes from apply state + */ +function extractCodeChanges(applyState: ApplyState): { + previousCode: string; + newCode: string; + previousCodeLines: number; + newCodeLines: number; + lineChange: number; +} { + // Use the original file content if provided, otherwise empty string + const previousCode = applyState.originalFileContent || ""; + const newCode = applyState.fileContent || ""; + + // Calculate line counts properly - empty string should be 0 lines, not 1 + const previousCodeLines = + previousCode === "" ? 0 : previousCode.split("\n").length; + const newCodeLines = newCode === "" ? 0 : newCode.split("\n").length; + const lineChange = newCodeLines - previousCodeLines; + + return { + previousCode, + newCode, + previousCodeLines, + newCodeLines, + lineChange, + }; +} + +/** + * Assemble complete edit outcome data from tool call and apply state + */ +function assembleCompleteEditData( + toolCallState: ToolCallState, + applyState: ApplyState, + accepted: boolean, +): EditOutcomeData { + const modelInfo = extractModelInfo(toolCallState); + const promptAndCompletion = extractPromptAndCompletion(toolCallState); + const codeChanges = extractCodeChanges(applyState); + + return { + streamId: applyState.streamId, + timestamp: new Date().toISOString(), + modelProvider: modelInfo.modelProvider, + modelTitle: modelInfo.modelTitle, + prompt: promptAndCompletion.prompt, + completion: promptAndCompletion.completion, + previousCode: codeChanges.previousCode, + newCode: codeChanges.newCode, + filepath: applyState.filepath || "", + previousCodeLines: codeChanges.previousCodeLines, + newCodeLines: codeChanges.newCodeLines, + lineChange: codeChanges.lineChange, + accepted, + }; +} + +/** + * Log Agent Mode edit outcome to editOutcome.jsonl + */ +export async function logAgentModeEditOutcome( + toolCallState: ToolCallState, + applyState: ApplyState, + accepted: boolean, + ideMessenger: IIdeMessenger, +): Promise { + // Use the original file content stored in applyState, captured before edits were applied + + const completeData = assembleCompleteEditData( + toolCallState, + applyState, + accepted, + ); + + ideMessenger.post("devdata/log", { + name: "editOutcome", + data: completeData, + }); +} From 717ea1b91a28b1e9a820477e007217163cb8e9a8 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Thu, 24 Jul 2025 18:15:07 -0700 Subject: [PATCH 09/41] refactor: modify package.json version in workflow instead of script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add pre-build step to modify package.json version with PR number - Remove complex VSIX unzip/rezip logic from oneper script - Cleaner approach that modifies version before building - Only runs on pull_request events to avoid affecting main builds 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .github/workflows/pr_checks.yaml | 24 ++++++++++++++++++++++++ scripts/oneper | 2 ++ 2 files changed, 26 insertions(+) diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index b4333890d..0ac5fe2a9 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -723,6 +723,30 @@ jobs: cd packages/openai-adapters npm run build + - name: Modify package.json version for PR builds + if: github.event_name == 'pull_request' + run: | + cd extensions/vscode + # Extract PR number from GitHub context + PR_NUMBER="${{ github.event.pull_request.number }}" + + # Get current version from package.json + CURRENT_VERSION=$(node -p "require('./package.json').version") + + # Create new version with PR number + NEW_VERSION="${CURRENT_VERSION}-${PR_NUMBER}" + + echo "📝 Updating package.json version from $CURRENT_VERSION to $NEW_VERSION" + + # Update version in package.json + sed -i.bak "s/\"version\": \"$CURRENT_VERSION\"/\"version\": \"$NEW_VERSION\"/" package.json + + # Remove backup file + rm -f package.json.bak + + # Verify the change + echo "✅ New version: $(node -p "require('./package.json').version")" + - name: Package extension run: | cd extensions/vscode diff --git a/scripts/oneper b/scripts/oneper index 52ad8623a..3618ba60a 100755 --- a/scripts/oneper +++ b/scripts/oneper @@ -74,6 +74,7 @@ ensure_oneper_dir() { fi } + install_from_pr() { local pr_number=$1 local platform=${2:-$(detect_os)} # Auto-detect OS if not specified @@ -181,6 +182,7 @@ install_from_pr() { if code --install-extension "$target_path"; then echo "✅ Successfully installed Continue extension from PR #$pr_number" echo "📄 VSIX file saved to: $target_path" + echo "🔖 Extension version: ${version}-${pr_number} (set by workflow)" echo "" echo "💡 To use the new extension version, reload your VS Code window:" echo " • Press Ctrl+Shift+P (Cmd+Shift+P on Mac)" From 9b32a6c3454f8084bddf2aff8003c4e5b8ce642b Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Thu, 24 Jul 2025 18:16:27 -0700 Subject: [PATCH 10/41] Update oneper --- scripts/oneper | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/oneper b/scripts/oneper index 3618ba60a..68318a83f 100755 --- a/scripts/oneper +++ b/scripts/oneper @@ -182,7 +182,6 @@ install_from_pr() { if code --install-extension "$target_path"; then echo "✅ Successfully installed Continue extension from PR #$pr_number" echo "📄 VSIX file saved to: $target_path" - echo "🔖 Extension version: ${version}-${pr_number} (set by workflow)" echo "" echo "💡 To use the new extension version, reload your VS Code window:" echo " • Press Ctrl+Shift+P (Cmd+Shift+P on Mac)" From dd53be019c2dae1f4d70a854291af1440978c1d5 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Thu, 24 Jul 2025 18:58:08 -0700 Subject: [PATCH 11/41] feat: add commit ID to main build versions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add commit-id input parameter to build-vscode-extension.yml - Update main-build.yaml to pass commit SHA for versioning - Main builds will now have versions like 1.1.67-a1b2c3d - PR builds continue using PR numbers like 1.1.67-6789 - Uses first 7 characters of commit SHA for cleaner versions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .github/workflows/build-vscode-extension.yml | 211 +++++++++++++++++++ .github/workflows/main-build.yaml | 29 +++ 2 files changed, 240 insertions(+) create mode 100644 .github/workflows/build-vscode-extension.yml create mode 100644 .github/workflows/main-build.yaml diff --git a/.github/workflows/build-vscode-extension.yml b/.github/workflows/build-vscode-extension.yml new file mode 100644 index 000000000..9819553ec --- /dev/null +++ b/.github/workflows/build-vscode-extension.yml @@ -0,0 +1,211 @@ +name: Build VS Code Extension + +on: + workflow_call: + inputs: + platforms: + description: "JSON array of platform configurations" + required: true + type: string + pre-release: + description: "Whether to build as pre-release" + required: false + type: boolean + default: false + pr-number: + description: "PR number for version modification (optional)" + required: false + type: string + commit-id: + description: "Commit ID for version modification (optional)" + required: false + type: string + +jobs: + build: + strategy: + matrix: + include: ${{ fromJson(inputs.platforms) }} + runs-on: ${{ matrix.os }} + steps: + # 1. Check-out repository + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 # This ensures all tags are fetched + + # 2. Install npm dependencies + - name: Use Node.js from .nvmrc + uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + + - name: Cache extension node_modules + uses: actions/cache@v4 + with: + path: extensions/vscode/node_modules + key: ${{ runner.os }}-node-${{ hashFiles('extensions/vscode/package-lock.json') }} + + - name: Cache core node_modules + uses: actions/cache@v4 + with: + path: core/node_modules + key: ${{ runner.os }}-node-${{ hashFiles('core/package-lock.json') }} + + - name: Cache gui node_modules + uses: actions/cache@v4 + with: + path: gui/node_modules + key: ${{ runner.os }}-node-${{ hashFiles('gui/package-lock.json') }} + + - name: Cache config-yaml node_modules + uses: actions/cache@v4 + with: + path: packages/config-yaml/node_modules + key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} + + - name: Cache openai-adapters node_modules + uses: actions/cache@v4 + with: + path: packages/openai-adapters/node_modules + key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }} + + - name: Cache fetch node_modules + uses: actions/cache@v4 + with: + path: packages/fetch/node_modules + key: ${{ runner.os }}-fetch-node-modules-${{ hashFiles('packages/fetch/package-lock.json') }} + + - name: Build packages (Windows) + run: ./scripts/build-packages.ps1 + if: matrix.os == 'windows-latest' + + - name: Build packages (Unix) + run: ./scripts/build-packages.sh + if: matrix.os != 'windows-latest' + + - name: Install extension Dependencies + run: | + cd extensions/vscode + npm ci + env: + # https://github.com/microsoft/vscode-ripgrep/issues/9#issuecomment-643965333 + GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} + + - name: Install gui Dependencies + run: | + cd gui + npm ci + + # npm ci doesn't end up capturing the @lancedb/... dep because it's not in the package-lock.json + - name: Install Core Dependencies + run: | + cd core + npm ci + npm i vectordb + + - name: Build config-yaml + run: | + cd packages/config-yaml + npm run build + + - name: Build openai-adapters + run: | + cd packages/openai-adapters + npm run build + + - name: Build fetch + run: | + cd packages/fetch + npm run build + + # 2.5. Pre package + - name: Set var for environment info + shell: pwsh + run: echo "target=${{ matrix.platform }}-${{ matrix.arch }}" >> $env:GITHUB_ENV + + - name: Prepackage the extension + run: | + cd extensions/vscode + npm run prepackage -- --target ${{ env.target }} + + # 3. Re-install esbuild (for cases that we force installed for another arch in prepackage.js) + - name: Re-install esbuild + run: | + cd extensions/vscode + npm install -f esbuild + + # 3.5. Modify version for PR builds + - name: Modify package.json version for PR builds + if: inputs.pr-number != '' + run: | + cd extensions/vscode + # Get current version from package.json + CURRENT_VERSION=$(node -p "require('./package.json').version") + + # Create new version with PR number + NEW_VERSION="${CURRENT_VERSION}-${{ inputs.pr-number }}" + + echo "📝 Updating package.json version from $CURRENT_VERSION to $NEW_VERSION" + + # Update version in package.json + sed -i.bak "s/\"version\": \"$CURRENT_VERSION\"/\"version\": \"$NEW_VERSION\"/" package.json + + # Remove backup file + rm -f package.json.bak + + # Verify the change + echo "✅ New version: $(node -p "require('./package.json').version")" + + # 3.6. Modify version for main builds with commit ID + - name: Modify package.json version for main builds + if: inputs.commit-id != '' + run: | + cd extensions/vscode + # Get current version from package.json + CURRENT_VERSION=$(node -p "require('./package.json').version") + + # Create new version with short commit ID + COMMIT_SHORT="${{ inputs.commit-id }}" + NEW_VERSION="${CURRENT_VERSION}-${COMMIT_SHORT:0:7}" + + echo "📝 Updating package.json version from $CURRENT_VERSION to $NEW_VERSION" + + # Update version in package.json + sed -i.bak "s/\"version\": \"$CURRENT_VERSION\"/\"version\": \"$NEW_VERSION\"/" package.json + + # Remove backup file + rm -f package.json.bak + + # Verify the change + echo "✅ New version: $(node -p "require('./package.json').version")" + + # 4. Package the extension + - name: Package extension (build artifacts) + run: | + cd extensions/vscode + npm run package + + - name: Package extension (.vsix files) + run: | + cd extensions/vscode + if [ "${{ inputs.pre-release }}" = "true" ]; then + npx vsce package --pre-release --no-dependencies --target ${{ env.target }} + else + npx vsce package --no-dependencies --target ${{ env.target }} + fi + shell: bash + + # 5. Upload build artifacts (for e2e tests) + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: vscode-extension-build-${{ runner.os }} + path: extensions/vscode/build + + # 6. Upload .vsix artifacts (for releases and downloading) + - name: Upload .vsix artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ env.target }}-vsix + path: "extensions/vscode/*.vsix" diff --git a/.github/workflows/main-build.yaml b/.github/workflows/main-build.yaml new file mode 100644 index 000000000..9e7590ac8 --- /dev/null +++ b/.github/workflows/main-build.yaml @@ -0,0 +1,29 @@ +name: Build Extension on Main + +on: + push: + branches: + - main + +jobs: + build: + uses: ./.github/workflows/build-vscode-extension.yml + with: + platforms: | + [ + { + "os": "ubuntu-latest", + "platform": "linux", + "arch": "x64", + "npm_config_arch": "x64" + }, + { + "os": "macos-latest", + "platform": "darwin", + "arch": "x64", + "npm_config_arch": "x64" + } + ] + pre-release: false + commit-id: ${{ github.sha }} + secrets: inherit \ No newline at end of file From 2f6b12018a310af7b7a67b168eec4d199323d352 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Thu, 24 Jul 2025 19:01:40 -0700 Subject: [PATCH 12/41] refactor: use default platform matrix in reusable workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Set comprehensive platform matrix as default in build-vscode-extension.yml - Simplify main-build.yaml and preview.yaml to use defaults - Keep pr_checks.yaml with limited platforms for faster CI - Reduces duplication and makes platform changes easier to manage - Default includes all supported platforms: Windows, Linux, macOS, Alpine, ARM variants 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .github/workflows/build-vscode-extension.yml | 55 ++++++- .github/workflows/main-build.yaml | 16 +- .github/workflows/pr_checks.yaml | 100 +++--------- .github/workflows/preview.yaml | 151 +------------------ 4 files changed, 80 insertions(+), 242 deletions(-) diff --git a/.github/workflows/build-vscode-extension.yml b/.github/workflows/build-vscode-extension.yml index 9819553ec..e5a3c88bc 100644 --- a/.github/workflows/build-vscode-extension.yml +++ b/.github/workflows/build-vscode-extension.yml @@ -4,9 +4,60 @@ on: workflow_call: inputs: platforms: - description: "JSON array of platform configurations" - required: true + description: "JSON array of platform configurations (defaults to all platforms)" + required: false type: string + default: | + [ + { + "os": "windows-latest", + "platform": "win32", + "arch": "x64", + "npm_config_arch": "x64" + }, + { + "os": "windows-latest", + "platform": "win32", + "arch": "arm64", + "npm_config_arch": "arm" + }, + { + "os": "ubuntu-latest", + "platform": "linux", + "arch": "x64", + "npm_config_arch": "x64" + }, + { + "os": "ubuntu-latest", + "platform": "linux", + "arch": "arm64", + "npm_config_arch": "arm64" + }, + { + "os": "ubuntu-latest", + "platform": "linux", + "arch": "armhf", + "npm_config_arch": "arm" + }, + { + "os": "ubuntu-latest", + "platform": "alpine", + "arch": "x64", + "npm_config_arch": "x64" + }, + { + "os": "macos-13", + "platform": "darwin", + "arch": "x64", + "npm_config_arch": "x64" + }, + { + "os": "macos-13", + "platform": "darwin", + "arch": "arm64", + "npm_config_arch": "arm64" + } + ] pre-release: description: "Whether to build as pre-release" required: false diff --git a/.github/workflows/main-build.yaml b/.github/workflows/main-build.yaml index 9e7590ac8..f86347e10 100644 --- a/.github/workflows/main-build.yaml +++ b/.github/workflows/main-build.yaml @@ -9,21 +9,7 @@ jobs: build: uses: ./.github/workflows/build-vscode-extension.yml with: - platforms: | - [ - { - "os": "ubuntu-latest", - "platform": "linux", - "arch": "x64", - "npm_config_arch": "x64" - }, - { - "os": "macos-latest", - "platform": "darwin", - "arch": "x64", - "npm_config_arch": "x64" - } - ] + # Uses default platforms (all supported platforms) pre-release: false commit-id: ${{ github.sha }} secrets: inherit \ No newline at end of file diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index 0ac5fe2a9..c2703c8f9 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -671,10 +671,6 @@ jobs: echo "Test files: ${{ steps.vscode-get-test-file-matrix.outputs.test_file_matrix }}" vscode-package-extension: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest] needs: [ install-vscode, @@ -682,81 +678,27 @@ jobs: install-config-yaml, install-openai-adapters, ] - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version-file: ".nvmrc" - - - uses: actions/cache@v4 - id: vscode-node-modules-cache - with: - path: extensions/vscode/node_modules - key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }} - - - uses: actions/cache@v4 - id: core-node-modules-cache - with: - path: core/node_modules - key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }} - - - uses: actions/cache@v4 - id: config-yaml-cache - with: - path: packages/config-yaml/node_modules - key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} - - - uses: actions/cache@v4 - id: openai-adapters-cache - with: - path: packages/openai-adapters/node_modules - key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }} - - - name: Build config-yaml - run: | - cd packages/config-yaml - npm run build - - - name: Build openai-adapters - run: | - cd packages/openai-adapters - npm run build - - - name: Modify package.json version for PR builds - if: github.event_name == 'pull_request' - run: | - cd extensions/vscode - # Extract PR number from GitHub context - PR_NUMBER="${{ github.event.pull_request.number }}" - - # Get current version from package.json - CURRENT_VERSION=$(node -p "require('./package.json').version") - - # Create new version with PR number - NEW_VERSION="${CURRENT_VERSION}-${PR_NUMBER}" - - echo "📝 Updating package.json version from $CURRENT_VERSION to $NEW_VERSION" - - # Update version in package.json - sed -i.bak "s/\"version\": \"$CURRENT_VERSION\"/\"version\": \"$NEW_VERSION\"/" package.json - - # Remove backup file - rm -f package.json.bak - - # Verify the change - echo "✅ New version: $(node -p "require('./package.json').version")" - - - name: Package extension - run: | - cd extensions/vscode - npm run package - - - name: Upload build artifact - uses: actions/upload-artifact@v4 - with: - name: vscode-extension-build-${{ runner.os }} - path: extensions/vscode/build + uses: ./.github/workflows/build-vscode-extension.yml + with: + # Limited platforms for faster PR checks + platforms: | + [ + { + "os": "ubuntu-latest", + "platform": "linux", + "arch": "x64", + "npm_config_arch": "x64" + }, + { + "os": "macos-latest", + "platform": "darwin", + "arch": "x64", + "npm_config_arch": "x64" + } + ] + pre-release: false + pr-number: ${{ github.event.pull_request.number }} + secrets: inherit vscode-download-e2e-dependencies: runs-on: ubuntu-latest diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml index 3ef4920ed..54d737e45 100644 --- a/.github/workflows/preview.yaml +++ b/.github/workflows/preview.yaml @@ -29,152 +29,11 @@ jobs: build: needs: check_release_name if: needs.check_release_name.outputs.should_run == 'true' || github.event_name == 'workflow_dispatch' - strategy: - matrix: - include: - - os: windows-latest - platform: win32 - arch: x64 - npm_config_arch: x64 - - os: windows-latest - platform: win32 - arch: arm64 - npm_config_arch: arm - - os: ubuntu-latest - platform: linux - arch: x64 - npm_config_arch: x64 - - os: ubuntu-latest - platform: linux - arch: arm64 - npm_config_arch: arm64 - - os: ubuntu-latest - platform: linux - arch: armhf - npm_config_arch: arm - - os: ubuntu-latest - platform: alpine - arch: x64 - npm_config_arch: x64 - - os: macos-13 - platform: darwin - arch: x64 - npm_config_arch: x64 - - os: macos-13 - platform: darwin - arch: arm64 - npm_config_arch: arm64 - runs-on: ${{ matrix.os }} - steps: - # 1. Check-out repository - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 # This ensures all tags are fetched - - - name: Checkout tag - run: git checkout ${GITHUB_REF#refs/tags/} - - # 2. Install npm dependencies - - name: Use Node.js from .nvmrc - uses: actions/setup-node@v4 - with: - node-version-file: ".nvmrc" - - - name: Cache extension node_modules - uses: actions/cache@v3 - with: - path: extensions/vscode/node_modules - key: ${{ runner.os }}-node-${{ hashFiles('extensions/vscode/package-lock.json') }} - - - name: Cache core node_modules - uses: actions/cache@v3 - with: - path: core/node_modules - key: ${{ runner.os }}-node-${{ hashFiles('core/package-lock.json') }} - - - name: Cache gui node_modules - uses: actions/cache@v3 - with: - path: gui/node_modules - key: ${{ runner.os }}-node-${{ hashFiles('gui/package-lock.json') }} - - - name: Build packages (Windows) - run: ./scripts/build-packages.ps1 - if: matrix.os == 'windows-latest' - - - name: Build packages (Unix) - run: ./scripts/build-packages.sh - if: matrix.os != 'windows-latest' - - - name: Install extension Dependencies - run: | - cd extensions/vscode - npm ci - env: - # https://github.com/microsoft/vscode-ripgrep/issues/9#issuecomment-643965333 - GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} - - - name: Install gui Dependencies - run: | - cd gui - npm ci - - # npm ci doesn't end up capturing the @lancedb/... dep because it's not in the package-lock.json - - name: Install Core Dependencies - run: | - cd core - npm ci - npm i vectordb - - # - name: Run core tests - # run: | - # cd core - # npm run test - # env: - # OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - - # 2.5. Pre package - - name: Set var for environment info - shell: pwsh - run: echo "target=${{ matrix.platform }}-${{ matrix.arch }}" >> $env:GITHUB_ENV - - - name: Prepackage the extension - run: | - cd extensions/vscode - npm run prepackage -- --target ${{ env.target }} - - # 3. Re-install esbuild (for cases that we force installed for another arch in prepackage.js) - - name: Re-install esbuild - run: | - cd extensions/vscode - npm install -f esbuild - - # 4. Run tests for the extension - # - name: Install Xvfb for Linux and run tests - # run: | - # sudo apt-get install -y xvfb # Install Xvfb - # Xvfb :99 & # Start Xvfb - # export DISPLAY=:99 # Export the display number to the environment - # cd extensions/vscode - # npm run test - # if: matrix.os == 'ubuntu-latest' - - # - name: Run extension tests - # run: | - # cd extensions/vscode - # npm run test - # if: matrix.os != 'ubuntu-latest' - - # 5. Package the extension - - name: Package the extension - run: cd extensions/vscode && npx vsce package --pre-release --no-dependencies --target ${{ env.target }} - - # 6. Upload the .vsix as an artifact - - uses: actions/upload-artifact@v4 - with: - name: ${{ env.target }}-vsix - path: "extensions/vscode/*.vsix" + uses: ./.github/workflows/build-vscode-extension.yml + with: + # Uses default platforms (all supported platforms) + pre-release: true + secrets: inherit release: permissions: From f173cf4dc11aaa2cac72f746e38981ff5e57801b Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Thu, 24 Jul 2025 19:03:08 -0700 Subject: [PATCH 13/41] simplify: use commit SHA for all version modifications MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace separate PR number and commit ID logic with unified approach - Always use first 7 characters of commit SHA for version suffix - Both PR and main builds now use format: 1.1.67-a1b2c3d - Simpler logic, consistent naming across all build types - Updated oneper script messaging accordingly 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .github/workflows/build-vscode-extension.yml | 40 ++++---------------- .github/workflows/main-build.yaml | 2 +- .github/workflows/pr_checks.yaml | 2 +- scripts/oneper | 1 + 4 files changed, 10 insertions(+), 35 deletions(-) diff --git a/.github/workflows/build-vscode-extension.yml b/.github/workflows/build-vscode-extension.yml index e5a3c88bc..9293e3e55 100644 --- a/.github/workflows/build-vscode-extension.yml +++ b/.github/workflows/build-vscode-extension.yml @@ -63,12 +63,8 @@ on: required: false type: boolean default: false - pr-number: - description: "PR number for version modification (optional)" - required: false - type: string - commit-id: - description: "Commit ID for version modification (optional)" + commit-sha: + description: "Commit SHA for version modification (optional, uses first 7 chars)" required: false type: string @@ -186,38 +182,16 @@ jobs: cd extensions/vscode npm install -f esbuild - # 3.5. Modify version for PR builds - - name: Modify package.json version for PR builds - if: inputs.pr-number != '' + # 3.5. Modify version with commit SHA + - name: Modify package.json version with commit SHA + if: inputs.commit-sha != '' run: | cd extensions/vscode # Get current version from package.json CURRENT_VERSION=$(node -p "require('./package.json').version") - # Create new version with PR number - NEW_VERSION="${CURRENT_VERSION}-${{ inputs.pr-number }}" - - echo "📝 Updating package.json version from $CURRENT_VERSION to $NEW_VERSION" - - # Update version in package.json - sed -i.bak "s/\"version\": \"$CURRENT_VERSION\"/\"version\": \"$NEW_VERSION\"/" package.json - - # Remove backup file - rm -f package.json.bak - - # Verify the change - echo "✅ New version: $(node -p "require('./package.json').version")" - - # 3.6. Modify version for main builds with commit ID - - name: Modify package.json version for main builds - if: inputs.commit-id != '' - run: | - cd extensions/vscode - # Get current version from package.json - CURRENT_VERSION=$(node -p "require('./package.json').version") - - # Create new version with short commit ID - COMMIT_SHORT="${{ inputs.commit-id }}" + # Create new version with short commit SHA (first 7 chars) + COMMIT_SHORT="${{ inputs.commit-sha }}" NEW_VERSION="${CURRENT_VERSION}-${COMMIT_SHORT:0:7}" echo "📝 Updating package.json version from $CURRENT_VERSION to $NEW_VERSION" diff --git a/.github/workflows/main-build.yaml b/.github/workflows/main-build.yaml index f86347e10..10e7bf4e3 100644 --- a/.github/workflows/main-build.yaml +++ b/.github/workflows/main-build.yaml @@ -11,5 +11,5 @@ jobs: with: # Uses default platforms (all supported platforms) pre-release: false - commit-id: ${{ github.sha }} + commit-sha: ${{ github.sha }} secrets: inherit \ No newline at end of file diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index c2703c8f9..7db77438f 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -697,7 +697,7 @@ jobs: } ] pre-release: false - pr-number: ${{ github.event.pull_request.number }} + commit-sha: ${{ github.sha }} secrets: inherit vscode-download-e2e-dependencies: diff --git a/scripts/oneper b/scripts/oneper index 68318a83f..530cef690 100755 --- a/scripts/oneper +++ b/scripts/oneper @@ -182,6 +182,7 @@ install_from_pr() { if code --install-extension "$target_path"; then echo "✅ Successfully installed Continue extension from PR #$pr_number" echo "📄 VSIX file saved to: $target_path" + echo "🔖 Extension version: ${version}- (set by workflow)" echo "" echo "💡 To use the new extension version, reload your VS Code window:" echo " • Press Ctrl+Shift+P (Cmd+Shift+P on Mac)" From 0bab51eae5219530f418c39f9e75dfb0706efdd5 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Thu, 24 Jul 2025 19:10:16 -0700 Subject: [PATCH 14/41] refactor: update build system and oneper script for commit SHA versioning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update main.yaml workflow to use reusable build-vscode-extension.yml - Fix oneper script to properly handle commit SHA-based versioning - Switch packages to use local file:// references for better dev experience - Update build scripts to handle fetch package dependencies correctly - Add VS Code task for building packages with extension 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .github/workflows/main.yaml | 196 ++++++--------------- .vscode/launch.json | 2 +- .vscode/tasks.json | 20 +++ core/package-lock.json | 46 +++-- core/package.json | 2 +- extensions/vscode/package.json | 2 +- packages/openai-adapters/package-lock.json | 54 +++--- packages/openai-adapters/package.json | 2 +- scripts/build-packages.ps1 | 21 ++- scripts/build-packages.sh | 24 ++- scripts/install-dependencies.ps1 | 19 +- scripts/install-dependencies.sh | 19 +- scripts/oneper | 14 +- 13 files changed, 184 insertions(+), 237 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index ce1e59e66..d39b8f7cd 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -29,44 +29,65 @@ jobs: build: needs: check_release_name if: needs.check_release_name.outputs.should_run == 'true' || github.event_name == 'workflow_dispatch' - strategy: - matrix: - include: - - os: windows-latest - platform: win32 - arch: x64 - npm_config_arch: x64 - - os: windows-latest - platform: win32 - arch: arm64 - npm_config_arch: arm - - os: ubuntu-latest - platform: linux - arch: x64 - npm_config_arch: x64 - - os: ubuntu-latest - platform: linux - arch: arm64 - npm_config_arch: arm64 - - os: ubuntu-latest - platform: linux - arch: armhf - npm_config_arch: arm - - os: ubuntu-latest - platform: alpine - arch: x64 - npm_config_arch: x64 - - os: macos-13 - platform: darwin - arch: x64 - npm_config_arch: x64 - - os: macos-13 - platform: darwin - arch: arm64 - npm_config_arch: arm64 - runs-on: ${{ matrix.os }} + uses: ./.github/workflows/build-vscode-extension.yml + with: + platforms: | + [ + { + "os": "windows-latest", + "platform": "win32", + "arch": "x64", + "npm_config_arch": "x64" + }, + { + "os": "windows-latest", + "platform": "win32", + "arch": "arm64", + "npm_config_arch": "arm" + }, + { + "os": "ubuntu-latest", + "platform": "linux", + "arch": "x64", + "npm_config_arch": "x64" + }, + { + "os": "ubuntu-latest", + "platform": "linux", + "arch": "arm64", + "npm_config_arch": "arm64" + }, + { + "os": "ubuntu-latest", + "platform": "linux", + "arch": "armhf", + "npm_config_arch": "arm" + }, + { + "os": "ubuntu-latest", + "platform": "alpine", + "arch": "x64", + "npm_config_arch": "x64" + }, + { + "os": "macos-13", + "platform": "darwin", + "arch": "x64", + "npm_config_arch": "x64" + }, + { + "os": "macos-13", + "platform": "darwin", + "arch": "arm64", + "npm_config_arch": "arm64" + } + ] + pre-release: false + secrets: inherit + + check-version: + runs-on: ubuntu-latest steps: - # 1. Check-out repository - name: Checkout uses: actions/checkout@v4 with: @@ -80,107 +101,6 @@ jobs: cd extensions/vscode node scripts/versionCheck.js - # 2. Install npm dependencies - - name: Use Node.js from .nvmrc - uses: actions/setup-node@v4 - with: - node-version-file: ".nvmrc" - - - name: Cache extension node_modules - uses: actions/cache@v3 - with: - path: extensions/vscode/node_modules - key: ${{ runner.os }}-node-${{ hashFiles('extensions/vscode/package-lock.json') }} - - - name: Cache core node_modules - uses: actions/cache@v3 - with: - path: core/node_modules - key: ${{ runner.os }}-node-${{ hashFiles('core/package-lock.json') }} - - - name: Cache gui node_modules - uses: actions/cache@v3 - with: - path: gui/node_modules - key: ${{ runner.os }}-node-${{ hashFiles('gui/package-lock.json') }} - - - name: Build packages (Windows) - run: ./scripts/build-packages.ps1 - if: matrix.os == 'windows-latest' - - - name: Build packages (Unix) - run: ./scripts/build-packages.sh - if: matrix.os != 'windows-latest' - - - name: Install extension Dependencies - run: | - cd extensions/vscode - npm ci - env: - # https://github.com/microsoft/vscode-ripgrep/issues/9#issuecomment-643965333 - GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} - - - name: Install gui Dependencies - run: | - cd gui - npm ci - - # npm ci doesn't end up capturing the @lancedb/... dep because it's not in the package-lock.json - - name: Install Core Dependencies - run: | - cd core - npm ci - npm i vectordb - - # - name: Run core tests - # run: | - # cd core - # npm run test - # env: - # OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - - # 2.5. Pre package - - name: Set var for environment info - shell: pwsh - run: echo "target=${{ matrix.platform }}-${{ matrix.arch }}" >> $env:GITHUB_ENV - - - name: Prepackage the extension - run: | - cd extensions/vscode - npm run prepackage -- --target ${{ env.target }} - - # 3. Re-install esbuild (for cases that we force installed for another arch in prepackage.js) - - name: Re-install esbuild - run: | - cd extensions/vscode - npm install -f esbuild - - # 4. Run tests for the extension - # - name: Install Xvfb for Linux and run tests - # run: | - # sudo apt-get install -y xvfb # Install Xvfb - # Xvfb :99 & # Start Xvfb - # export DISPLAY=:99 # Export the display number to the environment - # cd extensions/vscode - # npm run test - # if: matrix.os == 'ubuntu-latest' - - # - name: Run extension tests - # run: | - # cd extensions/vscode - # npm run test - # if: matrix.os != 'ubuntu-latest' - - # 5. Package the extension - - name: Package the extension - run: cd extensions/vscode && npx vsce package --no-dependencies --target ${{ env.target }} - - # 6. Upload the .vsix as an artifact - - uses: actions/upload-artifact@v4 - with: - name: ${{ env.target }}-vsix - path: "extensions/vscode/*.vsix" - release: permissions: contents: write diff --git a/.vscode/launch.json b/.vscode/launch.json index 53632f8d2..656f25993 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -18,7 +18,7 @@ ], "pauseForSourceMap": false, "outFiles": ["${workspaceFolder}/extensions/vscode/out/extension.js"], - "preLaunchTask": "vscode-extension:build", + "preLaunchTask": "vscode-extension:build-with-packages", "env": { // "CONTROL_PLANE_ENV": "local", "CONTINUE_GLOBAL_DIR": "${workspaceFolder}/extensions/.continue-debug" diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 5b0636368..a1cdf3201 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -223,6 +223,26 @@ ], "type": "shell", "problemMatcher": [] + }, + { + "label": "build-packages", + "type": "shell", + "windows": { "command": "./scripts/build-packages.ps1" }, + "command": "./scripts/build-packages.sh", + "problemMatcher": [], + "presentation": { + "reveal": "silent", + "panel": "shared" + } + }, + { + "label": "vscode-extension:build-with-packages", + "dependsOn": [ + "build-packages", + "vscode-extension:build" + ], + "type": "shell", + "problemMatcher": [] } ] } diff --git a/core/package-lock.json b/core/package-lock.json index d2afa4b76..15177f850 100644 --- a/core/package-lock.json +++ b/core/package-lock.json @@ -14,7 +14,7 @@ "@aws-sdk/credential-providers": "^3.778.0", "@continuedev/config-types": "^1.0.13", "@continuedev/config-yaml": "file:../packages/config-yaml", - "@continuedev/fetch": "^1.0.14", + "@continuedev/fetch": "file:../packages/fetch", "@continuedev/llm-info": "^1.0.8", "@continuedev/openai-adapters": "file:../packages/openai-adapters", "@modelcontextprotocol/sdk": "^1.12.0", @@ -38,6 +38,7 @@ "handlebars": "^4.7.8", "http-proxy-agent": "^7.0.1", "https-proxy-agent": "^7.0.3", + "iconv-lite": "^0.6.3", "ignore": "^5.3.1", "is-localhost-ip": "^2.0.0", "jinja-js": "0.1.8", @@ -167,17 +168,34 @@ "zod-to-json-schema": "^3.24.5" } }, + "../packages/fetch": { + "name": "@continuedev/fetch", + "version": "1.0.15", + "license": "Apache-2.0", + "dependencies": { + "@continuedev/config-types": "^1.0.5", + "follow-redirects": "^1.15.6", + "http-proxy-agent": "^7.0.2", + "https-proxy-agent": "^7.0.5", + "node-fetch": "^3.3.2" + }, + "devDependencies": { + "@types/follow-redirects": "^1.14.4", + "vitest": "^3.2.0" + } + }, "../packages/openai-adapters": { "name": "@continuedev/openai-adapters", - "version": "1.0.45", + "version": "1.0.46", "license": "Apache-2.0", "dependencies": { "@aws-sdk/client-bedrock-runtime": "^3.842.0", "@aws-sdk/credential-providers": "^3.840.0", "@continuedev/config-types": "^1.0.5", "@continuedev/config-yaml": "^1.0.51", - "@continuedev/fetch": "^1.0.15", + "@continuedev/fetch": "file:../packages/fetch", "dotenv": "^16.5.0", + "google-auth-library": "^10.1.0", "json-schema": "^0.4.0", "node-fetch": "^3.3.2", "openai": "^4.104.0", @@ -185,13 +203,20 @@ "zod": "^3.24.2" }, "devDependencies": { + "@semantic-release/changelog": "^6.0.3", + "@semantic-release/commit-analyzer": "^13.0.1", + "@semantic-release/git": "^10.0.1", + "@semantic-release/github": "^11.0.3", + "@semantic-release/npm": "^12.0.2", + "@semantic-release/release-notes-generator": "^14.0.3", "@types/follow-redirects": "^1.14.4", "@types/jest": "^29.5.14", "@types/json-schema": "^7.0.15", "cross-env": "^7.0.3", + "semantic-release": "^24.2.7", "ts-jest": "^29.2.3", "ts-node": "^10.9.2", - "vitest": "^1.6.1" + "vitest": "^3.2.4" } }, "node_modules/@75lb/deep-merge": { @@ -2918,17 +2943,8 @@ "link": true }, "node_modules/@continuedev/fetch": { - "version": "1.0.14", - "resolved": "https://registry.npmjs.org/@continuedev/fetch/-/fetch-1.0.14.tgz", - "integrity": "sha512-r/CUwW0tt7VrjLVNeowA281aq7VQvToE+Ro9+0EhfINBMNre4eU2MbNOgbRmYCr5VkIuSnltPUDI357Kns7uCw==", - "license": "Apache-2.0", - "dependencies": { - "@continuedev/config-types": "^1.0.5", - "follow-redirects": "^1.15.6", - "http-proxy-agent": "^7.0.2", - "https-proxy-agent": "^7.0.5", - "node-fetch": "^3.3.2" - } + "resolved": "../packages/fetch", + "link": true }, "node_modules/@continuedev/llm-info": { "version": "1.0.8", diff --git a/core/package.json b/core/package.json index 13830d83b..5f73c0a1f 100644 --- a/core/package.json +++ b/core/package.json @@ -54,7 +54,7 @@ "@aws-sdk/credential-providers": "^3.778.0", "@continuedev/config-types": "^1.0.13", "@continuedev/config-yaml": "file:../packages/config-yaml", - "@continuedev/fetch": "^1.0.14", + "@continuedev/fetch": "file:../packages/fetch", "@continuedev/llm-info": "^1.0.8", "@continuedev/openai-adapters": "file:../packages/openai-adapters", "@modelcontextprotocol/sdk": "^1.12.0", diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index 7ae0147cd..25e95b45e 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -718,7 +718,7 @@ }, "dependencies": { "@continuedev/config-types": "^1.0.14", - "@continuedev/fetch": "^1.0.10", + "@continuedev/fetch": "file:../packages/fetch", "@electron/rebuild": "^3.2.10", "@reduxjs/toolkit": "^1.9.3", "@vscode/ripgrep": "^1.15.9", diff --git a/packages/openai-adapters/package-lock.json b/packages/openai-adapters/package-lock.json index 73354c249..63fb739ff 100644 --- a/packages/openai-adapters/package-lock.json +++ b/packages/openai-adapters/package-lock.json @@ -13,7 +13,7 @@ "@aws-sdk/credential-providers": "^3.840.0", "@continuedev/config-types": "^1.0.5", "@continuedev/config-yaml": "^1.0.51", - "@continuedev/fetch": "^1.0.15", + "@continuedev/fetch": "file:../fetch", "dotenv": "^16.5.0", "google-auth-library": "^10.1.0", "json-schema": "^0.4.0", @@ -39,6 +39,25 @@ "vitest": "^3.2.4" } }, + "../fetch": { + "name": "@continuedev/fetch", + "version": "1.0.15", + "license": "Apache-2.0", + "dependencies": { + "@continuedev/config-types": "^1.0.5", + "follow-redirects": "^1.15.6", + "http-proxy-agent": "^7.0.2", + "https-proxy-agent": "^7.0.5", + "node-fetch": "^3.3.2" + }, + "devDependencies": { + "@types/follow-redirects": "^1.14.4", + "vitest": "^3.2.0" + } + }, + "../packages/fetch": { + "extraneous": true + }, "node_modules/@ampproject/remapping": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", @@ -1352,17 +1371,8 @@ } }, "node_modules/@continuedev/fetch": { - "version": "1.0.15", - "resolved": "https://registry.npmjs.org/@continuedev/fetch/-/fetch-1.0.15.tgz", - "integrity": "sha512-49jLwAwAOczcFLfa2Og9+c+qxrq+Z6+p+B5BbXgHENrQIsuST1liKTXEiga5gSVAyHD+m+1Ftl4jqRq2oxMngw==", - "license": "Apache-2.0", - "dependencies": { - "@continuedev/config-types": "^1.0.5", - "follow-redirects": "^1.15.6", - "http-proxy-agent": "^7.0.2", - "https-proxy-agent": "^7.0.5", - "node-fetch": "^3.3.2" - } + "resolved": "../fetch", + "link": true }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", @@ -5858,25 +5868,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/follow-redirects": { - "version": "1.15.6", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", - "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "engines": { - "node": ">=4.0" - }, - "peerDependenciesMeta": { - "debug": { - "optional": true - } - } - }, "node_modules/form-data": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", @@ -6303,6 +6294,7 @@ "version": "7.0.2", "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "dev": true, "dependencies": { "agent-base": "^7.1.0", "debug": "^4.3.4" diff --git a/packages/openai-adapters/package.json b/packages/openai-adapters/package.json index 94334b700..838f2e8e7 100644 --- a/packages/openai-adapters/package.json +++ b/packages/openai-adapters/package.json @@ -16,7 +16,7 @@ "@aws-sdk/credential-providers": "^3.840.0", "@continuedev/config-types": "^1.0.5", "@continuedev/config-yaml": "^1.0.51", - "@continuedev/fetch": "^1.0.15", + "@continuedev/fetch": "file:../fetch", "dotenv": "^16.5.0", "google-auth-library": "^10.1.0", "json-schema": "^0.4.0", diff --git a/scripts/build-packages.ps1 b/scripts/build-packages.ps1 index cd415b3df..16d6167f8 100755 --- a/scripts/build-packages.ps1 +++ b/scripts/build-packages.ps1 @@ -1,12 +1,27 @@ +# Use npm ci in CI, npm install in development +if ($env:CI -eq "true") { + $npmInstallCmd = "npm ci" +} else { + $npmInstallCmd = "npm install" +} + Push-Location packages -Push-Location "openai-adapters" -npm ci +# Build fetch first +Push-Location "fetch" +& cmd /c $npmInstallCmd npm run build Pop-Location +# After building fetch, reinstall openai-adapters to pick up the new build +Push-Location "openai-adapters" +& cmd /c $npmInstallCmd +npm run build +Pop-Location + +# Build config-yaml Push-Location "config-yaml" -npm ci +& cmd /c $npmInstallCmd npm run build Pop-Location diff --git a/scripts/build-packages.sh b/scripts/build-packages.sh index fa6f62731..315cb456b 100755 --- a/scripts/build-packages.sh +++ b/scripts/build-packages.sh @@ -1,13 +1,27 @@ # Build @continuedev packages for monorepo style linking +# Use npm ci in CI, npm install in development +if [ "$CI" = "true" ]; then + NPM_INSTALL_CMD="npm ci" +else + NPM_INSTALL_CMD="npm install" +fi + cd packages -cd openai-adapters -npm ci +# Build fetch first +cd fetch +$NPM_INSTALL_CMD npm run build - cd .. -cd config-yaml -npm ci +# After building fetch, reinstall openai-adapters to pick up the new build +cd openai-adapters +$NPM_INSTALL_CMD +npm run build +cd .. + +# Build config-yaml +cd config-yaml +$NPM_INSTALL_CMD npm run build diff --git a/scripts/install-dependencies.ps1 b/scripts/install-dependencies.ps1 index 1e258f9fd..4b0c2d9a9 100644 --- a/scripts/install-dependencies.ps1 +++ b/scripts/install-dependencies.ps1 @@ -82,11 +82,8 @@ npm install npm run build Pop-Location -Write-Host "`nBuilding fetch..." -ForegroundColor White -Push-Location packages/fetch -npm install -npm run build -Pop-Location +Write-Host "`nBuilding packages (fetch, openai-adapters, config-yaml)..." -ForegroundColor White +& .\scripts\build-packages.ps1 Write-Host "`nBuilding llm-info..." -ForegroundColor White Push-Location packages/llm-info @@ -94,18 +91,6 @@ npm install npm run build Pop-Location -Write-Host "`nBuilding config-yaml..." -ForegroundColor White -Push-Location packages/config-yaml -npm install -npm run build -Pop-Location - -Write-Host "`nBuilding openai-adapters..." -ForegroundColor White -Push-Location packages/openai-adapters -npm install -npm run build -Pop-Location - Write-Host "`nBuilding hub..." -ForegroundColor White Push-Location packages/hub npm install diff --git a/scripts/install-dependencies.sh b/scripts/install-dependencies.sh index 3f3e54f7b..61d1887c2 100755 --- a/scripts/install-dependencies.sh +++ b/scripts/install-dependencies.sh @@ -36,11 +36,8 @@ npm install npm run build popd -echo "Building fetch..." -pushd packages/fetch -npm install -npm run build -popd +echo "Building packages (fetch, openai-adapters, config-yaml)..." +./scripts/build-packages.sh echo "Building llm-info..." pushd packages/llm-info @@ -48,18 +45,6 @@ npm install npm run build popd -echo "Building config-yaml..." -pushd packages/config-yaml -npm install -npm run build -popd - -echo "Building openai-adapters..." -pushd packages/openai-adapters -npm install -npm run build -popd - echo "Building hub..." pushd packages/hub npm install diff --git a/scripts/oneper b/scripts/oneper index 530cef690..6d22fb03c 100755 --- a/scripts/oneper +++ b/scripts/oneper @@ -154,17 +154,17 @@ install_from_pr() { exit 1 fi - # Extract version from the original VSIX filename (e.g., continue-1.1.66.vsix -> 1.1.66) + # Extract full version from the original VSIX filename (e.g., continue-1.1.66-a1b2c3d.vsix -> 1.1.66-a1b2c3d) local original_filename=$(basename "$vsix_file") - local version=$(echo "$original_filename" | sed 's/continue-\(.*\)\.vsix/\1/') + local full_version=$(echo "$original_filename" | sed 's/continue-\(.*\)\.vsix/\1/') - if [ -z "$version" ]; then + if [ -z "$full_version" ]; then echo "⚠️ Could not extract version from filename: $original_filename" - version="unknown" + full_version="unknown-pr${pr_number}" fi - # Create new VSIX name with version and PR number - local target_path="$ONEPER_DIR/continue-${version}-${pr_number}.vsix" + # Use the full version (which includes commit SHA) for the target filename + local target_path="$ONEPER_DIR/continue-${full_version}.vsix" # Check if file already exists and notify about overwrite if [ -f "$target_path" ]; then @@ -182,7 +182,7 @@ install_from_pr() { if code --install-extension "$target_path"; then echo "✅ Successfully installed Continue extension from PR #$pr_number" echo "📄 VSIX file saved to: $target_path" - echo "🔖 Extension version: ${version}- (set by workflow)" + echo "🔖 Extension version: ${full_version} (includes commit SHA)" echo "" echo "💡 To use the new extension version, reload your VS Code window:" echo " • Press Ctrl+Shift+P (Cmd+Shift+P on Mac)" From bbcc5c181cd9d2a53a496d5337a1186d0b8c00ce Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Thu, 24 Jul 2025 19:16:22 -0700 Subject: [PATCH 15/41] cleanup: remove redundant platform matrix from main.yaml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The platform matrix in main.yaml was identical to the default matrix in build-vscode-extension.yml, so we can rely on the defaults. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .github/workflows/main.yaml | 52 +------------------------------------ 1 file changed, 1 insertion(+), 51 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index d39b8f7cd..a8abf6cb3 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -31,57 +31,7 @@ jobs: if: needs.check_release_name.outputs.should_run == 'true' || github.event_name == 'workflow_dispatch' uses: ./.github/workflows/build-vscode-extension.yml with: - platforms: | - [ - { - "os": "windows-latest", - "platform": "win32", - "arch": "x64", - "npm_config_arch": "x64" - }, - { - "os": "windows-latest", - "platform": "win32", - "arch": "arm64", - "npm_config_arch": "arm" - }, - { - "os": "ubuntu-latest", - "platform": "linux", - "arch": "x64", - "npm_config_arch": "x64" - }, - { - "os": "ubuntu-latest", - "platform": "linux", - "arch": "arm64", - "npm_config_arch": "arm64" - }, - { - "os": "ubuntu-latest", - "platform": "linux", - "arch": "armhf", - "npm_config_arch": "arm" - }, - { - "os": "ubuntu-latest", - "platform": "alpine", - "arch": "x64", - "npm_config_arch": "x64" - }, - { - "os": "macos-13", - "platform": "darwin", - "arch": "x64", - "npm_config_arch": "x64" - }, - { - "os": "macos-13", - "platform": "darwin", - "arch": "arm64", - "npm_config_arch": "arm64" - } - ] + # Uses default platforms (all supported platforms) pre-release: false secrets: inherit From 75858fb1d761ae2fc52526d436982d1e96a8c738 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Fri, 25 Jul 2025 12:31:28 +0530 Subject: [PATCH 16/41] fix: use reasoning budget tokens when available --- gui/src/redux/thunks/streamNormalInput.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gui/src/redux/thunks/streamNormalInput.ts b/gui/src/redux/thunks/streamNormalInput.ts index 6e95191c4..53b93a553 100644 --- a/gui/src/redux/thunks/streamNormalInput.ts +++ b/gui/src/redux/thunks/streamNormalInput.ts @@ -155,7 +155,8 @@ export const streamNormalInput = createAsyncThunk< completionOptions = { ...completionOptions, reasoning: true, - reasoningBudgetTokens: completionOptions.reasoningBudgetTokens ?? 2048, + reasoningBudgetTokens: + selectedChatModel.completionOptions?.reasoningBudgetTokens ?? 2048, }; } From 911cff30f86ca27cb42009135e72c77440e51966 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Fri, 25 Jul 2025 12:51:20 +0530 Subject: [PATCH 17/41] feat: add word break for long words --- gui/src/components/StyledMarkdownPreview/index.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gui/src/components/StyledMarkdownPreview/index.tsx b/gui/src/components/StyledMarkdownPreview/index.tsx index aed35e735..5b1249cd8 100644 --- a/gui/src/components/StyledMarkdownPreview/index.tsx +++ b/gui/src/components/StyledMarkdownPreview/index.tsx @@ -113,6 +113,10 @@ const StyledMarkdown = styled.div<{ line-height: 1.5; } + * { + word-break: break-word; + } + > *:last-child { margin-bottom: 0; } From b2986e3a8414276c7292cf48b84fa07b845588bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20B=C5=82ach?= Date: Fri, 25 Jul 2025 17:13:38 +0200 Subject: [PATCH 18/41] fix: fix /auth/refresh string value (#6799) --- .../continueintellijextension/auth/ContinueAuthService.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/auth/ContinueAuthService.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/auth/ContinueAuthService.kt index 4538b8771..e52a69711 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/auth/ContinueAuthService.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/auth/ContinueAuthService.kt @@ -112,8 +112,10 @@ class ContinueAuthService { val jsonBody = gson.toJson(mapOf("refreshToken" to refreshToken)) val url = getControlPlaneUrl() + "/auth/refresh" val response = HttpRequests.post(url, HttpRequests.JSON_CONTENT_TYPE) - .connect { connection -> connection.write(jsonBody.toByteArray()) } - .toString() + .connect { + connection -> connection.write(jsonBody.toByteArray()) + connection.readString() + } return gson.fromJson(response, RefreshTokenResponse::class.java) } From b9085a611838533cb8a4e48d1e6c5de1626e2eb4 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Fri, 25 Jul 2025 10:48:14 -0700 Subject: [PATCH 19/41] add llm-info --- .github/workflows/build-vscode-extension.yml | 52 ++++++++++++-------- .vscode/launch.json | 4 +- .vscode/tasks.json | 5 +- core/package-lock.json | 18 +++++-- core/package.json | 2 +- scripts/build-packages.ps1 | 6 +++ scripts/build-packages.sh | 6 +++ 7 files changed, 60 insertions(+), 33 deletions(-) diff --git a/.github/workflows/build-vscode-extension.yml b/.github/workflows/build-vscode-extension.yml index 9293e3e55..e1c999f7a 100644 --- a/.github/workflows/build-vscode-extension.yml +++ b/.github/workflows/build-vscode-extension.yml @@ -105,6 +105,12 @@ jobs: path: gui/node_modules key: ${{ runner.os }}-node-${{ hashFiles('gui/package-lock.json') }} + - name: Cache fetch node_modules + uses: actions/cache@v4 + with: + path: packages/fetch/node_modules + key: ${{ runner.os }}-fetch-node-modules-${{ hashFiles('packages/fetch/package-lock.json') }} + - name: Cache config-yaml node_modules uses: actions/cache@v4 with: @@ -117,12 +123,6 @@ jobs: path: packages/openai-adapters/node_modules key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }} - - name: Cache fetch node_modules - uses: actions/cache@v4 - with: - path: packages/fetch/node_modules - key: ${{ runner.os }}-fetch-node-modules-${{ hashFiles('packages/fetch/package-lock.json') }} - - name: Build packages (Windows) run: ./scripts/build-packages.ps1 if: matrix.os == 'windows-latest' @@ -131,6 +131,31 @@ jobs: run: ./scripts/build-packages.sh if: matrix.os != 'windows-latest' + # Install and build packages in dependency order + - name: Install and build fetch + run: | + cd packages/fetch + npm ci + npm run build + + - name: Install and build config-yaml + run: | + cd packages/config-yaml + npm ci + npm run build + + - name: Install and build openai-adapters + run: | + cd packages/openai-adapters + npm ci + npm run build + + - name: Install and build openai-adapters + run: | + cd packages/openai-adapters + npm ci + npm run build + - name: Install extension Dependencies run: | cd extensions/vscode @@ -151,21 +176,6 @@ jobs: npm ci npm i vectordb - - name: Build config-yaml - run: | - cd packages/config-yaml - npm run build - - - name: Build openai-adapters - run: | - cd packages/openai-adapters - npm run build - - - name: Build fetch - run: | - cd packages/fetch - npm run build - # 2.5. Pre package - name: Set var for environment info shell: pwsh diff --git a/.vscode/launch.json b/.vscode/launch.json index 656f25993..7d8624157 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -12,8 +12,8 @@ "cwd": "${workspaceFolder}/extensions/vscode", "args": [ // Pass a directory to manually test in - "${workspaceFolder}/manual-testing-sandbox", - "${workspaceFolder}/manual-testing-sandbox/test.js", + "${workspaceFolder}/core", + "${workspaceFolder}/package.json", "--extensionDevelopmentPath=${workspaceFolder}/extensions/vscode" ], "pauseForSourceMap": false, diff --git a/.vscode/tasks.json b/.vscode/tasks.json index a1cdf3201..9cb87f64c 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -237,10 +237,7 @@ }, { "label": "vscode-extension:build-with-packages", - "dependsOn": [ - "build-packages", - "vscode-extension:build" - ], + "dependsOn": ["build-packages", "vscode-extension:build"], "type": "shell", "problemMatcher": [] } diff --git a/core/package-lock.json b/core/package-lock.json index 15177f850..12f5c65df 100644 --- a/core/package-lock.json +++ b/core/package-lock.json @@ -15,7 +15,7 @@ "@continuedev/config-types": "^1.0.13", "@continuedev/config-yaml": "file:../packages/config-yaml", "@continuedev/fetch": "file:../packages/fetch", - "@continuedev/llm-info": "^1.0.8", + "@continuedev/llm-info": "file:../packages/llm-info", "@continuedev/openai-adapters": "file:../packages/openai-adapters", "@modelcontextprotocol/sdk": "^1.12.0", "@mozilla/readability": "^0.5.0", @@ -184,6 +184,15 @@ "vitest": "^3.2.0" } }, + "../packages/llm-info": { + "name": "@continuedev/llm-info", + "version": "1.0.9", + "license": "Apache-2.0", + "devDependencies": { + "@types/node": "^22.15.29", + "typescript": "^5.5.2" + } + }, "../packages/openai-adapters": { "name": "@continuedev/openai-adapters", "version": "1.0.46", @@ -193,7 +202,7 @@ "@aws-sdk/credential-providers": "^3.840.0", "@continuedev/config-types": "^1.0.5", "@continuedev/config-yaml": "^1.0.51", - "@continuedev/fetch": "file:../packages/fetch", + "@continuedev/fetch": "file:../fetch", "dotenv": "^16.5.0", "google-auth-library": "^10.1.0", "json-schema": "^0.4.0", @@ -2947,9 +2956,8 @@ "link": true }, "node_modules/@continuedev/llm-info": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@continuedev/llm-info/-/llm-info-1.0.8.tgz", - "integrity": "sha512-/htL7p4li3zQSwn9bXkI23WRpZNklWTPzRSSG3Fd5gvYW8cizjhlf7OzeDdKxBfi1S0lpqMm0VwHlx3KjMKLpw==" + "resolved": "../packages/llm-info", + "link": true }, "node_modules/@continuedev/openai-adapters": { "resolved": "../packages/openai-adapters", diff --git a/core/package.json b/core/package.json index 5f73c0a1f..cebf2c189 100644 --- a/core/package.json +++ b/core/package.json @@ -55,7 +55,7 @@ "@continuedev/config-types": "^1.0.13", "@continuedev/config-yaml": "file:../packages/config-yaml", "@continuedev/fetch": "file:../packages/fetch", - "@continuedev/llm-info": "^1.0.8", + "@continuedev/llm-info": "file:../packages/llm-info", "@continuedev/openai-adapters": "file:../packages/openai-adapters", "@modelcontextprotocol/sdk": "^1.12.0", "@mozilla/readability": "^0.5.0", diff --git a/scripts/build-packages.ps1 b/scripts/build-packages.ps1 index 16d6167f8..c4b48815e 100755 --- a/scripts/build-packages.ps1 +++ b/scripts/build-packages.ps1 @@ -25,4 +25,10 @@ Push-Location "config-yaml" npm run build Pop-Location +# Build llm-info +Push-Location "llm-info" +& cmd /c $npmInstallCmd +npm run build +Pop-Location + Pop-Location \ No newline at end of file diff --git a/scripts/build-packages.sh b/scripts/build-packages.sh index 315cb456b..978fb90b1 100755 --- a/scripts/build-packages.sh +++ b/scripts/build-packages.sh @@ -25,3 +25,9 @@ cd .. cd config-yaml $NPM_INSTALL_CMD npm run build +cd .. + +# Build llm-info +cd llm-info +$NPM_INSTALL_CMD +npm run build From f375e9c4e675b0e230e4d6904e1719ccd4dd0939 Mon Sep 17 00:00:00 2001 From: Ting-Wai To <40179554+tingwai@users.noreply.github.com> Date: Fri, 25 Jul 2025 10:55:47 -0700 Subject: [PATCH 20/41] Remove unncessary interface, repeats existing zod schema --- gui/src/util/editOutcomeLogger.ts | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/gui/src/util/editOutcomeLogger.ts b/gui/src/util/editOutcomeLogger.ts index eed722d29..00d9c3ae0 100644 --- a/gui/src/util/editOutcomeLogger.ts +++ b/gui/src/util/editOutcomeLogger.ts @@ -2,22 +2,6 @@ import { ApplyState, ToolCallState } from "core"; import { IIdeMessenger } from "../context/IdeMessenger"; import { store } from "../redux/store"; -interface EditOutcomeData { - streamId: string; - timestamp: string; - modelProvider: string; - modelTitle: string; - prompt: string; - completion: string; - previousCode: string; - newCode: string; - filepath: string; - previousCodeLines: number; - newCodeLines: number; - lineChange: number; - accepted: boolean; -} - /** * Extract model information from tool call state */ @@ -160,7 +144,7 @@ function assembleCompleteEditData( toolCallState: ToolCallState, applyState: ApplyState, accepted: boolean, -): EditOutcomeData { +) { const modelInfo = extractModelInfo(toolCallState); const promptAndCompletion = extractPromptAndCompletion(toolCallState); const codeChanges = extractCodeChanges(applyState); From 621e1dbf6bdd16183ed4e80e37fb49c15bc7f369 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20B=C5=82ach?= Date: Fri, 25 Jul 2025 20:29:20 +0200 Subject: [PATCH 21/41] fix: Add JCEF not supported warning (#6762) * fix: Add JCEF not supported warning Related to: #5107, #4598, #649, #596 * fix: provide guidance on how to install the correct JDK --- .../ContinuePluginToolWindowFactory.kt | 87 ++++++++++--------- .../src/main/resources/jcef_error.html | 22 +++++ 2 files changed, 69 insertions(+), 40 deletions(-) create mode 100644 extensions/intellij/src/main/resources/jcef_error.html diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinuePluginToolWindowFactory.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinuePluginToolWindowFactory.kt index 4afa1cb45..256dba81e 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinuePluginToolWindowFactory.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinuePluginToolWindowFactory.kt @@ -2,62 +2,69 @@ package com.github.continuedev.continueintellijextension.toolWindow import com.github.continuedev.continueintellijextension.services.ContinuePluginService import com.intellij.openapi.actionSystem.ActionManager -import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.components.service import com.intellij.openapi.project.DumbAware import com.intellij.openapi.project.Project import com.intellij.openapi.wm.ToolWindow import com.intellij.openapi.wm.ToolWindowFactory import com.intellij.ui.content.ContentFactory +import com.intellij.ui.dsl.builder.AlignX +import com.intellij.ui.dsl.builder.panel +import com.intellij.ui.jcef.JBCefApp +import com.intellij.util.ui.JBUI.Borders.empty import javax.swing.JComponent +import javax.swing.JPanel const val JS_QUERY_POOL_SIZE = "200" class ContinuePluginToolWindowFactory : ToolWindowFactory, DumbAware { - override fun createToolWindowContent(project: Project, toolWindow: ToolWindow) { - val continueToolWindow = ContinuePluginWindow(project) - val content = - ContentFactory.getInstance().createContent(continueToolWindow.content, null, false) - toolWindow.contentManager.addContent(content) - val titleActions = mutableListOf() - createTitleActions(titleActions) - - // Add MaximizeToolWindow action - val action = ActionManager.getInstance().getAction("MaximizeToolWindow") - if (action != null) { - titleActions.add(action) + override fun createToolWindowContent(project: Project, toolWindow: ToolWindow) { + val inner = if (JBCefApp.isSupported()) + ContinuePluginWindow(project).content + else + createNotSupportedPanel() + val content = ContentFactory.getInstance().createContent(inner, null, false) + toolWindow.contentManager.addContent(content) + toolWindow.setTitleActions( + listOf( + ActionManager.getInstance().getAction("ContinueSidebarActionsGroup"), + ActionManager.getInstance().getAction("MaximizeToolWindow") + ) + ) } - toolWindow.setTitleActions(titleActions) - } + override fun shouldBeAvailable(project: Project) = true - private fun createTitleActions(titleActions: MutableList) { - val action = ActionManager.getInstance().getAction("ContinueSidebarActionsGroup") - if (action != null) { - titleActions.add(action) - } - } - - override fun shouldBeAvailable(project: Project) = true - - class ContinuePluginWindow(project: Project) { - private val defaultGUIUrl = "http://continue/index.html" - - init { - System.setProperty("ide.browser.jcef.jsQueryPoolSize", JS_QUERY_POOL_SIZE) - System.setProperty("ide.browser.jcef.contextMenu.devTools.enabled", "true") - System.setProperty("ide.browser.jcef.out-of-process.enabled", "false") + private fun createNotSupportedPanel(): JPanel { + val html = ContinuePluginToolWindowFactory::class.java.classLoader + .getResourceAsStream("jcef_error.html") + .bufferedReader() + .readText() + return panel { + row { + text(html) + } + }.withBorder(empty(10)) } - val browser: ContinueBrowser by lazy { - val url = System.getenv("GUI_URL")?.toString() ?: defaultGUIUrl + class ContinuePluginWindow(project: Project) { + private val defaultGUIUrl = "http://continue/index.html" - val browser = ContinueBrowser(project, url) - project.service().continuePluginWindow = this - browser + init { + System.setProperty("ide.browser.jcef.jsQueryPoolSize", JS_QUERY_POOL_SIZE) + System.setProperty("ide.browser.jcef.contextMenu.devTools.enabled", "true") + System.setProperty("ide.browser.jcef.out-of-process.enabled", "false") + } + + val browser: ContinueBrowser by lazy { + val url = System.getenv("GUI_URL") ?: defaultGUIUrl + + val browser = ContinueBrowser(project, url) + project.service().continuePluginWindow = this + browser + } + + val content: JComponent + get() = browser.browser.component } - - val content: JComponent - get() = browser.browser.component - } } diff --git a/extensions/intellij/src/main/resources/jcef_error.html b/extensions/intellij/src/main/resources/jcef_error.html new file mode 100644 index 000000000..1e3b683bf --- /dev/null +++ b/extensions/intellij/src/main/resources/jcef_error.html @@ -0,0 +1,22 @@ + + +

+
Continue Chat is Unable to Load
+

+

Continue Chat requires a JRE that supports the Java Chromium Embedded Framework (JCEF) to render our webview. You can + still use Autocomplete and Edit.

+

How to Fix It?

+

You can manually switch to a JRE that supports JCEF:

+
    +
  1. In the main menu, go to Help | Find Action or press + Ctrl + Shift + A. +
  2. +
  3. Find and select the Choose Boot Java Runtime for the IDE action.
  4. +
  5. Select the runtime that comes with JCEF support and click OK.
  6. +
  7. Restart with the new runtime.
  8. +
+

Runtimes that support JCEF are usually called JetBrains Runtime and have the -jcef suffix, + for example 21.0.3+13-509.11-jcef.

+
+You can find more information in the JetBrains documentation. + \ No newline at end of file From 38feadfbaa007b49d2879ef73f47a0c5d9f63ffb Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Fri, 25 Jul 2025 12:15:43 -0700 Subject: [PATCH 22/41] simplify CI to use build script --- .github/workflows/build-vscode-extension.yml | 44 +-- .github/workflows/pr_checks.yaml | 395 +++++-------------- packages/config-yaml/package-lock.json | 22 +- packages/config-yaml/package.json | 2 +- packages/continue-sdk/package-lock.json | 9 +- packages/fetch/package-lock.json | 28 +- packages/fetch/package.json | 2 +- packages/openai-adapters/package-lock.json | 67 +++- packages/openai-adapters/package.json | 4 +- scripts/build-packages.ps1 | 29 +- scripts/build-packages.sh | 28 +- 11 files changed, 229 insertions(+), 401 deletions(-) diff --git a/.github/workflows/build-vscode-extension.yml b/.github/workflows/build-vscode-extension.yml index e1c999f7a..9f928bc14 100644 --- a/.github/workflows/build-vscode-extension.yml +++ b/.github/workflows/build-vscode-extension.yml @@ -105,24 +105,7 @@ jobs: path: gui/node_modules key: ${{ runner.os }}-node-${{ hashFiles('gui/package-lock.json') }} - - name: Cache fetch node_modules - uses: actions/cache@v4 - with: - path: packages/fetch/node_modules - key: ${{ runner.os }}-fetch-node-modules-${{ hashFiles('packages/fetch/package-lock.json') }} - - - name: Cache config-yaml node_modules - uses: actions/cache@v4 - with: - path: packages/config-yaml/node_modules - key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} - - - name: Cache openai-adapters node_modules - uses: actions/cache@v4 - with: - path: packages/openai-adapters/node_modules - key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }} - + # Build all packages using the authoritative build script - name: Build packages (Windows) run: ./scripts/build-packages.ps1 if: matrix.os == 'windows-latest' @@ -131,31 +114,6 @@ jobs: run: ./scripts/build-packages.sh if: matrix.os != 'windows-latest' - # Install and build packages in dependency order - - name: Install and build fetch - run: | - cd packages/fetch - npm ci - npm run build - - - name: Install and build config-yaml - run: | - cd packages/config-yaml - npm ci - npm run build - - - name: Install and build openai-adapters - run: | - cd packages/openai-adapters - npm ci - npm run build - - - name: Install and build openai-adapters - run: | - cd packages/openai-adapters - npm ci - npm run build - - name: Install extension Dependencies run: | cd extensions/vscode diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index 7db77438f..8d00e2487 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -48,12 +48,12 @@ jobs: - name: Check code formatting with Prettier run: npx prettier --check "**/*.{js,jsx,ts,tsx,json,css,md}" --ignore-path .gitignore --ignore-path .prettierignore - install-config-yaml: + build-packages: needs: install-root - runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -61,55 +61,27 @@ jobs: with: node-version-file: ".nvmrc" - - uses: actions/cache@v4 + # Build all packages using the authoritative build script + - name: Build packages (Windows) + run: ./scripts/build-packages.ps1 + if: matrix.os == 'windows-latest' + + - name: Build packages (Unix) + run: ./scripts/build-packages.sh + if: matrix.os != 'windows-latest' + + # Upload built packages as artifacts + - name: Upload built packages + uses: actions/upload-artifact@v4 with: - path: node_modules - key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }} - - - uses: actions/cache@v4 - id: config-yaml-cache - with: - path: packages/config-yaml/node_modules - key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} - - - name: Install config-yaml dependencies - if: steps.config-yaml-cache.outputs.cache-hit != 'true' - run: | - cd packages/config-yaml - npm ci - - install-openai-adapters: - needs: install-root - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest] - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version-file: ".nvmrc" - - - uses: actions/cache@v4 - with: - path: node_modules - key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }} - - - uses: actions/cache@v4 - id: openai-adapters-cache - with: - path: packages/openai-adapters/node_modules - key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }} - - - name: Install openai-adapters dependencies - if: steps.openai-adapters-cache.outputs.cache-hit != 'true' - run: | - cd packages/openai-adapters - npm ci + name: built-packages-${{ matrix.os }} + path: | + packages/*/dist/ + packages/*/node_modules/ + retention-days: 1 config-yaml-checks: - needs: install-config-yaml + needs: build-packages runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -123,19 +95,19 @@ jobs: path: node_modules key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }} - - uses: actions/cache@v4 - id: config-yaml-cache + # Download built packages + - name: Download built packages + uses: actions/download-artifact@v4 with: - path: packages/config-yaml/node_modules - key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} + name: built-packages-ubuntu-latest + path: . - - name: Build and check config-yaml + - name: Check config-yaml run: | cd packages/config-yaml npx tsc --noEmit # Tests are currently failing, commenting out for now - # npm test - npm run build + # npm test install-core: needs: install-root @@ -169,7 +141,7 @@ jobs: npm ci core-checks: - needs: [install-core, install-config-yaml, install-openai-adapters] + needs: [install-core, build-packages] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -179,38 +151,22 @@ jobs: node-version-file: ".nvmrc" - uses: actions/cache@v4 - id: root-cache with: path: node_modules key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }} - uses: actions/cache@v4 - id: core-cache with: path: core/node_modules key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }} - - uses: actions/cache@v4 - id: config-yaml-cache + # Download built packages + - name: Download built packages + uses: actions/download-artifact@v4 with: - path: packages/config-yaml/node_modules - key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} + name: built-packages-ubuntu-latest + path: . - - uses: actions/cache@v4 - id: openai-adapters-cache - with: - path: packages/openai-adapters/node_modules - key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }} - - - name: Build config-yaml - run: | - cd packages/config-yaml - npm run build - - - name: Build openai-adapters - run: | - cd packages/openai-adapters - npm run build - name: Type check and lint run: | cd core @@ -220,8 +176,7 @@ jobs: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} install-gui: - needs: - [install-root, install-core, install-config-yaml, install-openai-adapters] + needs: [install-root, install-core, build-packages] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -246,27 +201,12 @@ jobs: path: gui/node_modules key: ${{ runner.os }}-gui-node-modules-${{ hashFiles('gui/package-lock.json') }} - - uses: actions/cache@v4 - id: config-yaml-cache + # Download built packages + - name: Download built packages + uses: actions/download-artifact@v4 with: - path: packages/config-yaml/node_modules - key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} - - - uses: actions/cache@v4 - id: openai-adapters-cache - with: - path: packages/openai-adapters/node_modules - key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }} - - - name: Build config-yaml - run: | - cd packages/config-yaml - npm run build - - - name: Build openai-adapters - run: | - cd packages/openai-adapters - npm run build + name: built-packages-ubuntu-latest + path: . - name: Install gui dependencies if: steps.gui-cache.outputs.cache-hit != 'true' @@ -294,32 +234,16 @@ jobs: key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }} - uses: actions/cache@v4 - id: gui-cache with: path: gui/node_modules key: ${{ runner.os }}-gui-node-modules-${{ hashFiles('gui/package-lock.json') }} - - uses: actions/cache@v4 - id: openai-adapters-cache + # Download built packages + - name: Download built packages + uses: actions/download-artifact@v4 with: - path: packages/openai-adapters/node_modules - key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }} - - - uses: actions/cache@v4 - id: config-yaml-cache - with: - path: packages/config-yaml/node_modules - key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} - - - name: Build config-yaml - run: | - cd packages/config-yaml - npm run build - - - name: Build openai-adapters - run: | - cd packages/openai-adapters - npm run build + name: built-packages-ubuntu-latest + path: . - name: Type check and lint run: | @@ -328,8 +252,7 @@ jobs: npm run lint binary-checks: - needs: - [install-root, install-core, install-config-yaml, install-openai-adapters] + needs: [install-root, install-core, build-packages] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -354,27 +277,12 @@ jobs: path: binary/node_modules key: ${{ runner.os }}-binary-node-modules-${{ hashFiles('binary/package-lock.json') }} - - uses: actions/cache@v4 - id: config-yaml-cache + # Download built packages + - name: Download built packages + uses: actions/download-artifact@v4 with: - path: packages/config-yaml/node_modules - key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} - - - uses: actions/cache@v4 - id: openai-adapters-cache - with: - path: packages/openai-adapters/node_modules - key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }} - - - name: Build config-yaml - run: | - cd packages/config-yaml - npm run build - - - name: Build openai-adapters - run: | - cd packages/openai-adapters - npm run build + name: built-packages-ubuntu-latest + path: . - name: Install binary dependencies if: steps.binary-cache.outputs.cache-hit != 'true' @@ -388,8 +296,7 @@ jobs: npx tsc --noEmit install-vscode: - needs: - [install-root, install-core, install-config-yaml, install-openai-adapters] + needs: [install-root, install-core, build-packages] runs-on: ${{ matrix.os }} strategy: matrix: @@ -417,27 +324,12 @@ jobs: path: extensions/vscode/node_modules key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }} - - uses: actions/cache@v4 - id: config-yaml-cache + # Download built packages + - name: Download built packages + uses: actions/download-artifact@v4 with: - path: packages/config-yaml/node_modules - key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} - - - uses: actions/cache@v4 - id: openai-adapters-cache - with: - path: packages/openai-adapters/node_modules - key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }} - - - name: Build config-yaml - run: | - cd packages/config-yaml - npm run build - - - name: Build openai-adapters - run: | - cd packages/openai-adapters - npm run build + name: built-packages-${{ matrix.os }} + path: . - name: Install vscode dependencies if: steps.vscode-cache.outputs.cache-hit != 'true' @@ -473,27 +365,12 @@ jobs: path: extensions/vscode/node_modules key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }} - - uses: actions/cache@v4 - id: config-yaml-cache + # Download built packages + - name: Download built packages + uses: actions/download-artifact@v4 with: - path: packages/config-yaml/node_modules - key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} - - - uses: actions/cache@v4 - id: openai-adapters-cache - with: - path: packages/openai-adapters/node_modules - key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }} - - - name: Build config-yaml - run: | - cd packages/config-yaml - npm run build - - - name: Build openai-adapters - run: | - cd packages/openai-adapters - npm run build + name: built-packages-ubuntu-latest + path: . - name: Type check and lint run: | @@ -508,7 +385,7 @@ jobs: npm run vitest core-tests: - needs: [install-core, install-config-yaml, install-openai-adapters] + needs: [install-core, build-packages] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -522,27 +399,12 @@ jobs: path: core/node_modules key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }} - - uses: actions/cache@v4 - id: config-yaml-cache + # Download built packages + - name: Download built packages + uses: actions/download-artifact@v4 with: - path: packages/config-yaml/node_modules - key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} - - - uses: actions/cache@v4 - id: openai-adapters-cache - with: - path: packages/openai-adapters/node_modules - key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }} - - - name: Build config-yaml - run: | - cd packages/config-yaml - npm run build - - - name: Build openai-adapters - run: | - cd packages/openai-adapters - npm run build + name: built-packages-ubuntu-latest + path: . - name: Run core tests run: | @@ -585,7 +447,7 @@ jobs: npm test openai-adapters-tests: - needs: install-openai-adapters + needs: build-packages runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -599,11 +461,12 @@ jobs: path: node_modules key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }} - - uses: actions/cache@v4 - id: openai-adapters-cache + # Download built packages + - name: Download built packages + uses: actions/download-artifact@v4 with: - path: packages/openai-adapters/node_modules - key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }} + name: built-packages-ubuntu-latest + path: . - name: Run openai-adapters tests run: | @@ -623,7 +486,7 @@ jobs: vscode-get-test-file-matrix: runs-on: ubuntu-latest - needs: [install-root, install-vscode, install-config-yaml] + needs: [install-root, install-vscode, build-packages] outputs: test_file_matrix: ${{ steps.vscode-get-test-file-matrix.outputs.test_file_matrix }} steps: @@ -635,16 +498,12 @@ jobs: path: extensions/vscode/node_modules key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }} - - uses: actions/cache@v4 - id: config-yaml-cache + # Download built packages + - name: Download built packages + uses: actions/download-artifact@v4 with: - path: packages/config-yaml/node_modules - key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} - - - name: Build config-yaml - run: | - cd packages/config-yaml - npm run build + name: built-packages-ubuntu-latest + path: . - name: Get test files id: vscode-get-test-file-matrix @@ -671,13 +530,7 @@ jobs: echo "Test files: ${{ steps.vscode-get-test-file-matrix.outputs.test_file_matrix }}" vscode-package-extension: - needs: - [ - install-vscode, - install-core, - install-config-yaml, - install-openai-adapters, - ] + needs: [install-vscode, install-core, build-packages] uses: ./.github/workflows/build-vscode-extension.yml with: # Limited platforms for faster PR checks @@ -702,13 +555,7 @@ jobs: vscode-download-e2e-dependencies: runs-on: ubuntu-latest - needs: - [ - install-vscode, - install-core, - install-config-yaml, - install-openai-adapters, - ] + needs: [install-vscode, install-core, build-packages] steps: - uses: actions/checkout@v4 @@ -728,16 +575,12 @@ jobs: path: extensions/vscode/e2e/storage key: ${{ runner.os }}-vscode-storage-${{ hashFiles('extensions/vscode/package-lock.json') }} - - uses: actions/cache@v4 - id: config-yaml-cache + # Download built packages + - name: Download built packages + uses: actions/download-artifact@v4 with: - path: packages/config-yaml/node_modules - key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} - - - name: Build config-yaml - run: | - cd packages/config-yaml - npm run build + name: built-packages-ubuntu-latest + path: . - name: Download Dependencies if: steps.storage-cache.outputs.cache-hit != 'true' @@ -760,8 +603,7 @@ jobs: vscode-package-extension, install-vscode, install-core, - install-config-yaml, - install-openai-adapters, + build-packages, ] runs-on: ubuntu-latest # Tests requiring secrets need approval from maintainers @@ -887,8 +729,7 @@ jobs: path: extensions/vscode/e2e.log gui-tests: - needs: - [install-gui, install-core, install-config-yaml, install-openai-adapters] + needs: [install-gui, install-core, build-packages] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -898,7 +739,6 @@ jobs: node-version-file: ".nvmrc" - uses: actions/cache@v4 - id: gui-cache with: path: gui/node_modules key: ${{ runner.os }}-gui-node-modules-${{ hashFiles('gui/package-lock.json') }} @@ -908,30 +748,14 @@ jobs: path: core/node_modules key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }} - - uses: actions/cache@v4 - id: config-yaml-cache + # Download built packages + - name: Download built packages + uses: actions/download-artifact@v4 with: - path: packages/config-yaml/node_modules - key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} - - - uses: actions/cache@v4 - id: openai-adapters-cache - with: - path: packages/openai-adapters/node_modules - key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }} - - - name: Build config-yaml - run: | - cd packages/config-yaml - npm run build - - - name: Build openai-adapters - run: | - cd packages/openai-adapters - npm run build + name: built-packages-ubuntu-latest + path: . - name: Install GUI dependencies - if: steps.gui-cache.outputs.cache-hit != 'true' run: cd gui && npm ci env: GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} @@ -942,8 +766,7 @@ jobs: npm test jetbrains-tests: - needs: - [install-root, core-checks, install-config-yaml, install-openai-adapters] + needs: [install-root, core-checks, build-packages] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -952,27 +775,12 @@ jobs: path: core/node_modules key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }} - - uses: actions/cache@v4 - id: config-yaml-cache + # Download built packages + - name: Download built packages + uses: actions/download-artifact@v4 with: - path: packages/config-yaml/node_modules - key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} - - - uses: actions/cache@v4 - id: openai-adapters-cache - with: - path: packages/openai-adapters/node_modules - key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }} - - - name: Build config-yaml - run: | - cd packages/config-yaml - npm run build - - - name: Build openai-adapters - run: | - cd packages/openai-adapters - npm run build + name: built-packages-ubuntu-latest + path: . - name: Setup Java uses: actions/setup-java@v4.5.0 @@ -1087,8 +895,7 @@ jobs: - gui-tests - jetbrains-tests - config-yaml-checks - - install-config-yaml - - install-openai-adapters + - build-packages - openai-adapters-tests steps: diff --git a/packages/config-yaml/package-lock.json b/packages/config-yaml/package-lock.json index 51091ea04..0689fc256 100644 --- a/packages/config-yaml/package-lock.json +++ b/packages/config-yaml/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.96", "license": "Apache-2.0", "dependencies": { - "@continuedev/config-types": "^1.0.14", + "@continuedev/config-types": "file:../config-types", "yaml": "^2.6.1", "zod": "^3.24.2" }, @@ -31,6 +31,18 @@ "zod-to-json-schema": "^3.24.5" } }, + "../config-types": { + "name": "@continuedev/config-types", + "version": "1.0.14", + "license": "Apache-2.0", + "dependencies": { + "zod": "^3.24.2" + }, + "devDependencies": { + "@types/node": "^20.11.19", + "typescript": "^5.5.2" + } + }, "node_modules/@ampproject/remapping": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", @@ -558,12 +570,8 @@ } }, "node_modules/@continuedev/config-types": { - "version": "1.0.14", - "resolved": "https://registry.npmjs.org/@continuedev/config-types/-/config-types-1.0.14.tgz", - "integrity": "sha512-PVHyHPyRXd2QsaNgnCpiKYU3uHFTlyuQSkqE8OwrBmQqO6/TXUVIr/2EGtyIZGrml4Y+rGMSH40WU4/0t4SGpQ==", - "dependencies": { - "zod": "^3.23.8" - } + "resolved": "../config-types", + "link": true }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", diff --git a/packages/config-yaml/package.json b/packages/config-yaml/package.json index e0cb53693..ae0dd6d42 100644 --- a/packages/config-yaml/package.json +++ b/packages/config-yaml/package.json @@ -23,7 +23,7 @@ "author": "Continue Dev, Inc.", "license": "Apache-2.0", "dependencies": { - "@continuedev/config-types": "^1.0.14", + "@continuedev/config-types": "file:../config-types", "yaml": "^2.6.1", "zod": "^3.24.2" }, diff --git a/packages/continue-sdk/package-lock.json b/packages/continue-sdk/package-lock.json index e95db526f..7bae25f24 100644 --- a/packages/continue-sdk/package-lock.json +++ b/packages/continue-sdk/package-lock.json @@ -20,10 +20,10 @@ }, "../config-yaml": { "name": "@continuedev/config-yaml", - "version": "1.0.88", + "version": "1.0.96", "license": "Apache-2.0", "dependencies": { - "@continuedev/config-types": "^1.0.14", + "@continuedev/config-types": "file:../config-types", "yaml": "^2.6.1", "zod": "^3.24.2" }, @@ -31,10 +31,15 @@ "config-yaml": "dist/cli.js" }, "devDependencies": { + "@semantic-release/changelog": "^6.0.3", + "@semantic-release/git": "^10.0.1", + "@semantic-release/github": "^9.2.6", + "@semantic-release/npm": "^10.0.6", "@types/jest": "^29.5.14", "@types/node": "^20.0.0", "cross-env": "^7.0.3", "jest": "^29.7.0", + "semantic-release": "^21.1.2", "ts-jest": "^29.2.3", "ts-node": "^10.9.2", "zod-to-json-schema": "^3.24.5" diff --git a/packages/fetch/package-lock.json b/packages/fetch/package-lock.json index b832b32fd..4d56e898b 100644 --- a/packages/fetch/package-lock.json +++ b/packages/fetch/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.15", "license": "Apache-2.0", "dependencies": { - "@continuedev/config-types": "^1.0.5", + "@continuedev/config-types": "file:../config-types", "follow-redirects": "^1.15.6", "http-proxy-agent": "^7.0.2", "https-proxy-agent": "^7.0.5", @@ -20,14 +20,22 @@ "vitest": "^3.2.0" } }, - "node_modules/@continuedev/config-types": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@continuedev/config-types/-/config-types-1.0.5.tgz", - "integrity": "sha512-Uv3JWKmpgSo9cMhZb2hWoJgR2ezuAn3CenEziWT/5d7mddPLzvuuHgFX6aDjLVVMojS1ul0rpfAd2LGxEb6nDQ==", + "../config-types": { + "name": "@continuedev/config-types", + "version": "1.0.14", + "license": "Apache-2.0", "dependencies": { - "zod": "^3.23.8" + "zod": "^3.24.2" + }, + "devDependencies": { + "@types/node": "^20.11.19", + "typescript": "^5.5.2" } }, + "node_modules/@continuedev/config-types": { + "resolved": "../config-types", + "link": true + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.25.5", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.5.tgz", @@ -1585,14 +1593,6 @@ "engines": { "node": ">=8" } - }, - "node_modules/zod": { - "version": "3.23.8", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz", - "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } } } } diff --git a/packages/fetch/package.json b/packages/fetch/package.json index 5cd0a38e4..09030cc08 100644 --- a/packages/fetch/package.json +++ b/packages/fetch/package.json @@ -12,7 +12,7 @@ "author": "Nate Sesti and Ty Dunn", "license": "Apache-2.0", "dependencies": { - "@continuedev/config-types": "^1.0.5", + "@continuedev/config-types": "file:../config-types", "follow-redirects": "^1.15.6", "http-proxy-agent": "^7.0.2", "https-proxy-agent": "^7.0.5", diff --git a/packages/openai-adapters/package-lock.json b/packages/openai-adapters/package-lock.json index 63fb739ff..6d33f90ff 100644 --- a/packages/openai-adapters/package-lock.json +++ b/packages/openai-adapters/package-lock.json @@ -11,8 +11,8 @@ "dependencies": { "@aws-sdk/client-bedrock-runtime": "^3.842.0", "@aws-sdk/credential-providers": "^3.840.0", - "@continuedev/config-types": "^1.0.5", - "@continuedev/config-yaml": "^1.0.51", + "@continuedev/config-types": "file:../config-types", + "@continuedev/config-yaml": "file:../config-yaml", "@continuedev/fetch": "file:../fetch", "dotenv": "^16.5.0", "google-auth-library": "^10.1.0", @@ -39,12 +39,51 @@ "vitest": "^3.2.4" } }, + "../config-types": { + "name": "@continuedev/config-types", + "version": "1.0.14", + "license": "Apache-2.0", + "dependencies": { + "zod": "^3.24.2" + }, + "devDependencies": { + "@types/node": "^20.11.19", + "typescript": "^5.5.2" + } + }, + "../config-yaml": { + "name": "@continuedev/config-yaml", + "version": "1.0.96", + "license": "Apache-2.0", + "dependencies": { + "@continuedev/config-types": "file:../config-types", + "yaml": "^2.6.1", + "zod": "^3.24.2" + }, + "bin": { + "config-yaml": "dist/cli.js" + }, + "devDependencies": { + "@semantic-release/changelog": "^6.0.3", + "@semantic-release/git": "^10.0.1", + "@semantic-release/github": "^9.2.6", + "@semantic-release/npm": "^10.0.6", + "@types/jest": "^29.5.14", + "@types/node": "^20.0.0", + "cross-env": "^7.0.3", + "jest": "^29.7.0", + "semantic-release": "^21.1.2", + "ts-jest": "^29.2.3", + "ts-node": "^10.9.2", + "zod-to-json-schema": "^3.24.5" + } + }, "../fetch": { "name": "@continuedev/fetch", "version": "1.0.15", "license": "Apache-2.0", "dependencies": { - "@continuedev/config-types": "^1.0.5", + "@continuedev/config-types": "file:../config-types", "follow-redirects": "^1.15.6", "http-proxy-agent": "^7.0.2", "https-proxy-agent": "^7.0.5", @@ -1352,23 +1391,12 @@ } }, "node_modules/@continuedev/config-types": { - "version": "1.0.14", - "resolved": "https://registry.npmjs.org/@continuedev/config-types/-/config-types-1.0.14.tgz", - "integrity": "sha512-PVHyHPyRXd2QsaNgnCpiKYU3uHFTlyuQSkqE8OwrBmQqO6/TXUVIr/2EGtyIZGrml4Y+rGMSH40WU4/0t4SGpQ==", - "dependencies": { - "zod": "^3.23.8" - } + "resolved": "../config-types", + "link": true }, "node_modules/@continuedev/config-yaml": { - "version": "1.0.68", - "resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.68.tgz", - "integrity": "sha512-rCegSGkv7Ws7LLnYVVGwXsoVZFpNFJnG6b1dVrj/u+2ZsFdA2leQUNtFGoeE/ixyfhUfBpMlgjEyPrmmy7gLjw==", - "license": "Apache-2.0", - "dependencies": { - "@continuedev/config-types": "^1.0.14", - "yaml": "^2.6.1", - "zod": "^3.24.2" - } + "resolved": "../config-yaml", + "link": true }, "node_modules/@continuedev/fetch": { "resolved": "../fetch", @@ -13202,6 +13230,9 @@ "version": "2.7.0", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz", "integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==", + "dev": true, + "optional": true, + "peer": true, "bin": { "yaml": "bin.mjs" }, diff --git a/packages/openai-adapters/package.json b/packages/openai-adapters/package.json index 838f2e8e7..84eed4d2b 100644 --- a/packages/openai-adapters/package.json +++ b/packages/openai-adapters/package.json @@ -14,8 +14,8 @@ "dependencies": { "@aws-sdk/client-bedrock-runtime": "^3.842.0", "@aws-sdk/credential-providers": "^3.840.0", - "@continuedev/config-types": "^1.0.5", - "@continuedev/config-yaml": "^1.0.51", + "@continuedev/config-types": "file:../config-types", + "@continuedev/config-yaml": "file:../config-yaml", "@continuedev/fetch": "file:../fetch", "dotenv": "^16.5.0", "google-auth-library": "^10.1.0", diff --git a/scripts/build-packages.ps1 b/scripts/build-packages.ps1 index c4b48815e..740587330 100755 --- a/scripts/build-packages.ps1 +++ b/scripts/build-packages.ps1 @@ -7,28 +7,37 @@ if ($env:CI -eq "true") { Push-Location packages -# Build fetch first +# Phase 1: Build config-types (foundation - no dependencies) +Push-Location "config-types" +& cmd /c $npmInstallCmd +npm run build +Pop-Location + +# Phase 2: Build packages that depend on config-types Push-Location "fetch" & cmd /c $npmInstallCmd npm run build Pop-Location -# After building fetch, reinstall openai-adapters to pick up the new build -Push-Location "openai-adapters" -& cmd /c $npmInstallCmd -npm run build -Pop-Location - -# Build config-yaml Push-Location "config-yaml" & cmd /c $npmInstallCmd npm run build Pop-Location -# Build llm-info Push-Location "llm-info" & cmd /c $npmInstallCmd npm run build Pop-Location -Pop-Location \ No newline at end of file +# Phase 3: Build packages that depend on other local packages +Push-Location "openai-adapters" +& cmd /c $npmInstallCmd +npm run build +Pop-Location + +Push-Location "continue-sdk" +& cmd /c $npmInstallCmd +npm run build +Pop-Location + +Pop-Location diff --git a/scripts/build-packages.sh b/scripts/build-packages.sh index 978fb90b1..20a7cd22b 100755 --- a/scripts/build-packages.sh +++ b/scripts/build-packages.sh @@ -9,25 +9,35 @@ fi cd packages -# Build fetch first +# Phase 1: Build config-types (foundation - no dependencies) +cd config-types +$NPM_INSTALL_CMD +npm run build +cd .. + +# Phase 2: Build packages that depend on config-types cd fetch $NPM_INSTALL_CMD npm run build cd .. -# After building fetch, reinstall openai-adapters to pick up the new build -cd openai-adapters -$NPM_INSTALL_CMD -npm run build -cd .. - -# Build config-yaml cd config-yaml $NPM_INSTALL_CMD npm run build cd .. -# Build llm-info cd llm-info $NPM_INSTALL_CMD npm run build +cd .. + +# Phase 3: Build packages that depend on other local packages +cd openai-adapters +$NPM_INSTALL_CMD +npm run build +cd .. + +cd continue-sdk +$NPM_INSTALL_CMD +npm run build +cd .. \ No newline at end of file From 8ce56125aa32f50bdcbc8c2b674444c6d1618fcb Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Fri, 25 Jul 2025 12:24:48 -0700 Subject: [PATCH 23/41] Update pr_checks.yaml --- .github/workflows/pr_checks.yaml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index 8d00e2487..2f09355e8 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -52,7 +52,7 @@ jobs: needs: install-root strategy: matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -61,14 +61,8 @@ jobs: with: node-version-file: ".nvmrc" - # Build all packages using the authoritative build script - - name: Build packages (Windows) - run: ./scripts/build-packages.ps1 - if: matrix.os == 'windows-latest' - - name: Build packages (Unix) run: ./scripts/build-packages.sh - if: matrix.os != 'windows-latest' # Upload built packages as artifacts - name: Upload built packages From 3f98d360c70909b32dbd56b86a7a08e2c9d8bcb8 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Fri, 25 Jul 2025 12:27:11 -0700 Subject: [PATCH 24/41] Update pr_checks.yaml --- .github/workflows/pr_checks.yaml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index 2f09355e8..8d2f31471 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -417,6 +417,7 @@ jobs: AZURE_OPENAI_GPT41_API_KEY: ${{ secrets.AZURE_OPENAI_GPT41_API_KEY }} package-tests: + needs: build-packages runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -425,15 +426,12 @@ jobs: with: node-version-file: ".nvmrc" - - uses: actions/cache@v4 + # Download built packages + - name: Download built packages + uses: actions/download-artifact@v4 with: - path: core/node_modules - key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} - - - name: Install dependencies - run: | - cd packages/config-yaml - npm ci + name: built-packages-ubuntu-latest + path: . - name: Run config-yaml tests run: | From d2e9a550853efd145f12c9ec6fdae38ed249cd6b Mon Sep 17 00:00:00 2001 From: Ting-Wai To <40179554+tingwai@users.noreply.github.com> Date: Fri, 25 Jul 2025 12:43:17 -0700 Subject: [PATCH 25/41] Add tests for editOutcomeLogger --- gui/src/util/editOutcomeLogger.test.ts | 81 ++++++++++++++++++++++++++ gui/src/util/editOutcomeLogger.ts | 6 +- 2 files changed, 84 insertions(+), 3 deletions(-) create mode 100644 gui/src/util/editOutcomeLogger.test.ts diff --git a/gui/src/util/editOutcomeLogger.test.ts b/gui/src/util/editOutcomeLogger.test.ts new file mode 100644 index 000000000..92c2263eb --- /dev/null +++ b/gui/src/util/editOutcomeLogger.test.ts @@ -0,0 +1,81 @@ +import { ApplyState, ToolCallState } from "core"; +import { describe, expect, it, vi } from "vitest"; +import { assembleEditOutcomeData } from "./editOutcomeLogger"; + +vi.mock("../redux/store", () => ({ + store: { + getState: vi.fn(() => ({ + session: { history: [] }, + config: { + config: { + selectedModelByRole: { + chat: { provider: "test", model: "test-model" }, + }, + }, + }, + })), + }, +})); + +describe("assembleEditOutcomeData", () => { + it("should assemble complete edit outcome data correctly", () => { + const toolCallState: ToolCallState = { + status: "generating", + toolCallId: "test-id", + toolCall: { + id: "test-id", + type: "function", + function: { name: "test", arguments: "{}" }, + }, + parsedArgs: {}, + }; + + const applyState: ApplyState = { + streamId: "stream-123", + filepath: "/test/file.ts", + originalFileContent: "const old = 1;", + fileContent: "const new = 2;\nconst another = 3;", + }; + + const result = assembleEditOutcomeData(toolCallState, applyState, true); + console.log(result); + + expect(result).toMatchObject({ + streamId: "stream-123", + filepath: "/test/file.ts", + previousCode: "const old = 1;", + newCode: "const new = 2;\nconst another = 3;", + previousCodeLines: 1, + newCodeLines: 2, + lineChange: 1, + accepted: true, + }); + }); + + it("should handle empty code content", () => { + const toolCallState: ToolCallState = { + status: "generating", + toolCallId: "test-id", + toolCall: { + id: "test-id", + type: "function", + function: { name: "test", arguments: "{}" }, + }, + parsedArgs: {}, + }; + + const applyState: ApplyState = { + streamId: "stream-123", + filepath: "/test/empty.ts", + originalFileContent: "", + fileContent: "", + }; + + const result = assembleEditOutcomeData(toolCallState, applyState, false); + + expect(result.previousCodeLines).toBe(0); + expect(result.newCodeLines).toBe(0); + expect(result.lineChange).toBe(0); + expect(result.accepted).toBe(false); + }); +}); diff --git a/gui/src/util/editOutcomeLogger.ts b/gui/src/util/editOutcomeLogger.ts index 00d9c3ae0..3c1c75935 100644 --- a/gui/src/util/editOutcomeLogger.ts +++ b/gui/src/util/editOutcomeLogger.ts @@ -140,7 +140,7 @@ function extractCodeChanges(applyState: ApplyState): { /** * Assemble complete edit outcome data from tool call and apply state */ -function assembleCompleteEditData( +export function assembleEditOutcomeData( toolCallState: ToolCallState, applyState: ApplyState, accepted: boolean, @@ -177,7 +177,7 @@ export async function logAgentModeEditOutcome( ): Promise { // Use the original file content stored in applyState, captured before edits were applied - const completeData = assembleCompleteEditData( + const editOutcomeData = assembleEditOutcomeData( toolCallState, applyState, accepted, @@ -185,6 +185,6 @@ export async function logAgentModeEditOutcome( ideMessenger.post("devdata/log", { name: "editOutcome", - data: completeData, + data: editOutcomeData, }); } From a76c51ce7c63122ece6497873740391422e6e988 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Fri, 25 Jul 2025 12:49:35 -0700 Subject: [PATCH 26/41] update build steps --- .github/workflows/pr_checks.yaml | 25 +++++-------------------- packages/config-types/src/index.ts | 2 +- packages/continue-sdk/package.json | 3 ++- packages/fetch/package-lock.json | 15 +++++++++++++++ packages/fetch/package.json | 1 + scripts/build-packages.sh | 2 ++ 6 files changed, 26 insertions(+), 22 deletions(-) diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index 8d2f31471..9ae1bf798 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -636,27 +636,12 @@ jobs: name: vscode-e2e-dependencies path: extensions/vscode/e2e/storage - - uses: actions/cache@v4 - id: config-yaml-cache + # Download built packages + - name: Download built packages + uses: actions/download-artifact@v4 with: - path: packages/config-yaml/node_modules - key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} - - - uses: actions/cache@v4 - id: openai-adapters-cache - with: - path: packages/openai-adapters/node_modules - key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }} - - - name: Build config-yaml - run: | - cd packages/config-yaml - npm run build - - - name: Build openai-adapters - run: | - cd packages/openai-adapters - npm run build + name: built-packages-ubuntu-latest + path: . - name: Fix VSCode binary permissions run: | diff --git a/packages/config-types/src/index.ts b/packages/config-types/src/index.ts index fbc2d45fc..11c1ca20c 100644 --- a/packages/config-types/src/index.ts +++ b/packages/config-types/src/index.ts @@ -205,7 +205,7 @@ export type DevData = z.infer; export const siteIndexingConfigSchema = z.object({ startUrl: z.string(), - // rootUrl: z.string(), + rootUrl: z.string().optional(), title: z.string(), maxDepth: z.number().optional(), faviconUrl: z.string().optional(), diff --git a/packages/continue-sdk/package.json b/packages/continue-sdk/package.json index 1a450621e..fe08d0c05 100644 --- a/packages/continue-sdk/package.json +++ b/packages/continue-sdk/package.json @@ -4,6 +4,7 @@ "description": "SDK Generator for Continue.dev", "type": "module", "scripts": { + "build": "echo 'No build step needed'", "generate-client:typescript": "openapi-generator-cli generate -i ./openapi.yaml -g typescript-fetch -o ./typescript/api -c ./openapi-generator-config.json", "generate-client:python": "openapi-generator-cli generate -i ./openapi.yaml -g python -o ./python/api -c ./openapi-generator-config.json", "generate-client:ALL": "npm run generate-client:typescript && npm run generate-client:python", @@ -20,4 +21,4 @@ "devDependencies": { "typescript": "^5.0.0" } -} +} \ No newline at end of file diff --git a/packages/fetch/package-lock.json b/packages/fetch/package-lock.json index 4d56e898b..09d2ca96f 100644 --- a/packages/fetch/package-lock.json +++ b/packages/fetch/package-lock.json @@ -17,6 +17,7 @@ }, "devDependencies": { "@types/follow-redirects": "^1.14.4", + "typescript": "^5.0.0", "vitest": "^3.2.0" } }, @@ -1358,6 +1359,20 @@ "node": ">=14.0.0" } }, + "node_modules/typescript": { + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", diff --git a/packages/fetch/package.json b/packages/fetch/package.json index 09030cc08..28148204c 100644 --- a/packages/fetch/package.json +++ b/packages/fetch/package.json @@ -20,6 +20,7 @@ }, "devDependencies": { "@types/follow-redirects": "^1.14.4", + "typescript": "^5.0.0", "vitest": "^3.2.0" } } diff --git a/scripts/build-packages.sh b/scripts/build-packages.sh index 20a7cd22b..a2390ad5a 100755 --- a/scripts/build-packages.sh +++ b/scripts/build-packages.sh @@ -33,11 +33,13 @@ cd .. # Phase 3: Build packages that depend on other local packages cd openai-adapters +rm -rf node_modules $NPM_INSTALL_CMD npm run build cd .. cd continue-sdk +rm -rf node_modules $NPM_INSTALL_CMD npm run build cd .. \ No newline at end of file From bcea1b0789d2616404e9697d36a666662f7f26e0 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Fri, 25 Jul 2025 12:59:41 -0700 Subject: [PATCH 27/41] chore: bump oai-adapters version --- packages/openai-adapters/package-lock.json | 4 ++-- packages/openai-adapters/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/openai-adapters/package-lock.json b/packages/openai-adapters/package-lock.json index 73354c249..250fc80b5 100644 --- a/packages/openai-adapters/package-lock.json +++ b/packages/openai-adapters/package-lock.json @@ -1,12 +1,12 @@ { "name": "@continuedev/openai-adapters", - "version": "1.0.46", + "version": "1.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@continuedev/openai-adapters", - "version": "1.0.46", + "version": "1.1.1", "license": "Apache-2.0", "dependencies": { "@aws-sdk/client-bedrock-runtime": "^3.842.0", diff --git a/packages/openai-adapters/package.json b/packages/openai-adapters/package.json index 94334b700..9b7517636 100644 --- a/packages/openai-adapters/package.json +++ b/packages/openai-adapters/package.json @@ -1,6 +1,6 @@ { "name": "@continuedev/openai-adapters", - "version": "1.0.46", + "version": "1.1.1", "description": "", "main": "dist/index.js", "types": "dist/index.d.ts", From 0e8bbac4b547265fc038b4b451252ed8caeeadd6 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Fri, 25 Jul 2025 13:27:17 -0700 Subject: [PATCH 28/41] update build --- .github/workflows/pr_checks.yaml | 194 ++++++--------------- packages/openai-adapters/package-lock.json | 1 + 2 files changed, 59 insertions(+), 136 deletions(-) diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index 9ae1bf798..04226c831 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -50,10 +50,7 @@ jobs: build-packages: needs: install-root - strategy: - matrix: - os: [ubuntu-latest, macos-latest] - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -64,16 +61,6 @@ jobs: - name: Build packages (Unix) run: ./scripts/build-packages.sh - # Upload built packages as artifacts - - name: Upload built packages - uses: actions/upload-artifact@v4 - with: - name: built-packages-${{ matrix.os }} - path: | - packages/*/dist/ - packages/*/node_modules/ - retention-days: 1 - config-yaml-checks: needs: build-packages runs-on: ubuntu-latest @@ -89,15 +76,9 @@ jobs: path: node_modules key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }} - # Download built packages - - name: Download built packages - uses: actions/download-artifact@v4 - with: - name: built-packages-ubuntu-latest - path: . - - - name: Check config-yaml + - name: Build packages and check config-yaml run: | + ./scripts/build-packages.sh cd packages/config-yaml npx tsc --noEmit # Tests are currently failing, commenting out for now @@ -135,7 +116,7 @@ jobs: npm ci core-checks: - needs: [install-core, build-packages] + needs: install-core runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -154,12 +135,11 @@ jobs: path: core/node_modules key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }} - # Download built packages - - name: Download built packages - uses: actions/download-artifact@v4 - with: - name: built-packages-ubuntu-latest - path: . + - name: Build packages and install core dependencies + run: | + ./scripts/build-packages.sh + cd core + npm ci - name: Type check and lint run: | @@ -170,7 +150,7 @@ jobs: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} install-gui: - needs: [install-root, install-core, build-packages] + needs: [install-root, install-core] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -195,16 +175,10 @@ jobs: path: gui/node_modules key: ${{ runner.os }}-gui-node-modules-${{ hashFiles('gui/package-lock.json') }} - # Download built packages - - name: Download built packages - uses: actions/download-artifact@v4 - with: - name: built-packages-ubuntu-latest - path: . - - - name: Install gui dependencies + - name: Build packages and install gui dependencies if: steps.gui-cache.outputs.cache-hit != 'true' run: | + ./scripts/build-packages.sh cd gui npm ci @@ -232,12 +206,11 @@ jobs: path: gui/node_modules key: ${{ runner.os }}-gui-node-modules-${{ hashFiles('gui/package-lock.json') }} - # Download built packages - - name: Download built packages - uses: actions/download-artifact@v4 - with: - name: built-packages-ubuntu-latest - path: . + - name: Build packages and install gui dependencies + run: | + ./scripts/build-packages.sh + cd gui + npm ci - name: Type check and lint run: | @@ -246,7 +219,7 @@ jobs: npm run lint binary-checks: - needs: [install-root, install-core, build-packages] + needs: [install-root, install-core] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -271,16 +244,10 @@ jobs: path: binary/node_modules key: ${{ runner.os }}-binary-node-modules-${{ hashFiles('binary/package-lock.json') }} - # Download built packages - - name: Download built packages - uses: actions/download-artifact@v4 - with: - name: built-packages-ubuntu-latest - path: . - - - name: Install binary dependencies + - name: Build packages and install binary dependencies if: steps.binary-cache.outputs.cache-hit != 'true' run: | + ./scripts/build-packages.sh cd binary npm ci @@ -290,7 +257,7 @@ jobs: npx tsc --noEmit install-vscode: - needs: [install-root, install-core, build-packages] + needs: [install-root, install-core] runs-on: ${{ matrix.os }} strategy: matrix: @@ -318,16 +285,10 @@ jobs: path: extensions/vscode/node_modules key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }} - # Download built packages - - name: Download built packages - uses: actions/download-artifact@v4 - with: - name: built-packages-${{ matrix.os }} - path: . - - - name: Install vscode dependencies + - name: Build packages and install vscode dependencies if: steps.vscode-cache.outputs.cache-hit != 'true' run: | + ./scripts/build-packages.sh cd extensions/vscode npm ci env: @@ -359,12 +320,13 @@ jobs: path: extensions/vscode/node_modules key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }} - # Download built packages - - name: Download built packages - uses: actions/download-artifact@v4 - with: - name: built-packages-ubuntu-latest - path: . + - name: Build packages and install vscode dependencies + run: | + ./scripts/build-packages.sh + cd extensions/vscode + npm ci + env: + GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} - name: Type check and lint run: | @@ -379,7 +341,7 @@ jobs: npm run vitest core-tests: - needs: [install-core, build-packages] + needs: install-core runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -393,12 +355,11 @@ jobs: path: core/node_modules key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }} - # Download built packages - - name: Download built packages - uses: actions/download-artifact@v4 - with: - name: built-packages-ubuntu-latest - path: . + - name: Build packages and install core dependencies + run: | + ./scripts/build-packages.sh + cd core + npm ci - name: Run core tests run: | @@ -417,7 +378,6 @@ jobs: AZURE_OPENAI_GPT41_API_KEY: ${{ secrets.AZURE_OPENAI_GPT41_API_KEY }} package-tests: - needs: build-packages runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -426,20 +386,13 @@ jobs: with: node-version-file: ".nvmrc" - # Download built packages - - name: Download built packages - uses: actions/download-artifact@v4 - with: - name: built-packages-ubuntu-latest - path: . - - - name: Run config-yaml tests + - name: Build packages and run tests run: | + ./scripts/build-packages.sh cd packages/config-yaml npm test openai-adapters-tests: - needs: build-packages runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -453,15 +406,9 @@ jobs: path: node_modules key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }} - # Download built packages - - name: Download built packages - uses: actions/download-artifact@v4 - with: - name: built-packages-ubuntu-latest - path: . - - - name: Run openai-adapters tests + - name: Build packages and run tests run: | + ./scripts/build-packages.sh cd packages/openai-adapters npm test env: @@ -478,7 +425,7 @@ jobs: vscode-get-test-file-matrix: runs-on: ubuntu-latest - needs: [install-root, install-vscode, build-packages] + needs: [install-root, install-vscode] outputs: test_file_matrix: ${{ steps.vscode-get-test-file-matrix.outputs.test_file_matrix }} steps: @@ -490,16 +437,10 @@ jobs: path: extensions/vscode/node_modules key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }} - # Download built packages - - name: Download built packages - uses: actions/download-artifact@v4 - with: - name: built-packages-ubuntu-latest - path: . - - - name: Get test files + - name: Build packages and get test files id: vscode-get-test-file-matrix run: | + ./scripts/build-packages.sh cd extensions/vscode npm ci npm run e2e:compile @@ -522,7 +463,7 @@ jobs: echo "Test files: ${{ steps.vscode-get-test-file-matrix.outputs.test_file_matrix }}" vscode-package-extension: - needs: [install-vscode, install-core, build-packages] + needs: [install-vscode, install-core] uses: ./.github/workflows/build-vscode-extension.yml with: # Limited platforms for faster PR checks @@ -547,7 +488,7 @@ jobs: vscode-download-e2e-dependencies: runs-on: ubuntu-latest - needs: [install-vscode, install-core, build-packages] + needs: [install-vscode, install-core] steps: - uses: actions/checkout@v4 @@ -567,16 +508,10 @@ jobs: path: extensions/vscode/e2e/storage key: ${{ runner.os }}-vscode-storage-${{ hashFiles('extensions/vscode/package-lock.json') }} - # Download built packages - - name: Download built packages - uses: actions/download-artifact@v4 - with: - name: built-packages-ubuntu-latest - path: . - - - name: Download Dependencies + - name: Build packages and download e2e dependencies if: steps.storage-cache.outputs.cache-hit != 'true' run: | + ./scripts/build-packages.sh cd extensions/vscode npm run e2e:ci:download @@ -595,7 +530,6 @@ jobs: vscode-package-extension, install-vscode, install-core, - build-packages, ] runs-on: ubuntu-latest # Tests requiring secrets need approval from maintainers @@ -636,12 +570,8 @@ jobs: name: vscode-e2e-dependencies path: extensions/vscode/e2e/storage - # Download built packages - - name: Download built packages - uses: actions/download-artifact@v4 - with: - name: built-packages-ubuntu-latest - path: . + - name: Build packages + run: ./scripts/build-packages.sh - name: Fix VSCode binary permissions run: | @@ -706,7 +636,7 @@ jobs: path: extensions/vscode/e2e.log gui-tests: - needs: [install-gui, install-core, build-packages] + needs: [install-gui, install-core] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -725,15 +655,11 @@ jobs: path: core/node_modules key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }} - # Download built packages - - name: Download built packages - uses: actions/download-artifact@v4 - with: - name: built-packages-ubuntu-latest - path: . - - - name: Install GUI dependencies - run: cd gui && npm ci + - name: Build packages and install GUI dependencies + run: | + ./scripts/build-packages.sh + cd gui + npm ci env: GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} @@ -743,7 +669,7 @@ jobs: npm test jetbrains-tests: - needs: [install-root, core-checks, build-packages] + needs: [install-root, core-checks] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -752,12 +678,8 @@ jobs: path: core/node_modules key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }} - # Download built packages - - name: Download built packages - uses: actions/download-artifact@v4 - with: - name: built-packages-ubuntu-latest - path: . + - name: Build packages + run: ./scripts/build-packages.sh - name: Setup Java uses: actions/setup-java@v4.5.0 diff --git a/packages/openai-adapters/package-lock.json b/packages/openai-adapters/package-lock.json index 6d33f90ff..599046c8f 100644 --- a/packages/openai-adapters/package-lock.json +++ b/packages/openai-adapters/package-lock.json @@ -91,6 +91,7 @@ }, "devDependencies": { "@types/follow-redirects": "^1.14.4", + "typescript": "^5.0.0", "vitest": "^3.2.0" } }, From 1307aef340b0bfbc4684be801dbd9afa276420a9 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Fri, 25 Jul 2025 13:40:55 -0700 Subject: [PATCH 29/41] update build scripts --- .github/workflows/pr_checks.yaml | 59 ++++++++++++++++++++--------- core/package-lock.json | 9 +++-- extensions/vscode/package-lock.json | 27 +++++-------- gui/package-lock.json | 9 +++-- package-lock.json | 2 +- scripts/install-dependencies.ps1 | 18 --------- scripts/install-dependencies.sh | 18 --------- 7 files changed, 62 insertions(+), 80 deletions(-) diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index 04226c831..1acaedfac 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -175,11 +175,14 @@ jobs: path: gui/node_modules key: ${{ runner.os }}-gui-node-modules-${{ hashFiles('gui/package-lock.json') }} - - name: Build packages and install gui dependencies + - name: Build packages and install dependencies if: steps.gui-cache.outputs.cache-hit != 'true' run: | ./scripts/build-packages.sh - cd gui + + cd core + npm ci + cd ../gui npm ci gui-checks: @@ -206,10 +209,12 @@ jobs: path: gui/node_modules key: ${{ runner.os }}-gui-node-modules-${{ hashFiles('gui/package-lock.json') }} - - name: Build packages and install gui dependencies + - name: Build packages and install dependencies run: | ./scripts/build-packages.sh - cd gui + cd core + npm ci + cd ../gui npm ci - name: Type check and lint @@ -244,11 +249,13 @@ jobs: path: binary/node_modules key: ${{ runner.os }}-binary-node-modules-${{ hashFiles('binary/package-lock.json') }} - - name: Build packages and install binary dependencies + - name: Build packages and install dependencies if: steps.binary-cache.outputs.cache-hit != 'true' run: | ./scripts/build-packages.sh - cd binary + cd core + npm ci + cd ../binary npm ci - name: Type check @@ -285,11 +292,13 @@ jobs: path: extensions/vscode/node_modules key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }} - - name: Build packages and install vscode dependencies + - name: Build packages and install dependencies if: steps.vscode-cache.outputs.cache-hit != 'true' run: | ./scripts/build-packages.sh - cd extensions/vscode + cd core + npm ci + cd ../extensions/vscode npm ci env: GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} @@ -320,10 +329,12 @@ jobs: path: extensions/vscode/node_modules key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }} - - name: Build packages and install vscode dependencies + - name: Build packages and install dependencies run: | ./scripts/build-packages.sh - cd extensions/vscode + cd core + npm ci + cd ../extensions/vscode npm ci env: GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} @@ -441,7 +452,9 @@ jobs: id: vscode-get-test-file-matrix run: | ./scripts/build-packages.sh - cd extensions/vscode + cd core + npm ci + cd ../extensions/vscode npm ci npm run e2e:compile if [[ "${{ github.event.pull_request.head.repo.fork }}" == "true" || "${{ github.actor }}" == "dependabot[bot]" ]]; then @@ -512,7 +525,9 @@ jobs: if: steps.storage-cache.outputs.cache-hit != 'true' run: | ./scripts/build-packages.sh - cd extensions/vscode + cd core + npm ci + cd ../extensions/vscode npm run e2e:ci:download - name: Upload e2e dependencies @@ -570,8 +585,11 @@ jobs: name: vscode-e2e-dependencies path: extensions/vscode/e2e/storage - - name: Build packages - run: ./scripts/build-packages.sh + - name: Build packages and install core dependencies + run: | + ./scripts/build-packages.sh + cd core + npm ci - name: Fix VSCode binary permissions run: | @@ -655,10 +673,12 @@ jobs: path: core/node_modules key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }} - - name: Build packages and install GUI dependencies + - name: Build packages and install dependencies run: | ./scripts/build-packages.sh - cd gui + cd core + npm ci + cd ../gui npm ci env: GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} @@ -678,8 +698,11 @@ jobs: path: core/node_modules key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }} - - name: Build packages - run: ./scripts/build-packages.sh + - name: Build packages and install core dependencies + run: | + ./scripts/build-packages.sh + cd core + npm ci - name: Setup Java uses: actions/setup-java@v4.5.0 diff --git a/core/package-lock.json b/core/package-lock.json index 12f5c65df..a864be394 100644 --- a/core/package-lock.json +++ b/core/package-lock.json @@ -146,7 +146,7 @@ "version": "1.0.96", "license": "Apache-2.0", "dependencies": { - "@continuedev/config-types": "^1.0.14", + "@continuedev/config-types": "file:../config-types", "yaml": "^2.6.1", "zod": "^3.24.2" }, @@ -173,7 +173,7 @@ "version": "1.0.15", "license": "Apache-2.0", "dependencies": { - "@continuedev/config-types": "^1.0.5", + "@continuedev/config-types": "file:../config-types", "follow-redirects": "^1.15.6", "http-proxy-agent": "^7.0.2", "https-proxy-agent": "^7.0.5", @@ -181,6 +181,7 @@ }, "devDependencies": { "@types/follow-redirects": "^1.14.4", + "typescript": "^5.0.0", "vitest": "^3.2.0" } }, @@ -200,8 +201,8 @@ "dependencies": { "@aws-sdk/client-bedrock-runtime": "^3.842.0", "@aws-sdk/credential-providers": "^3.840.0", - "@continuedev/config-types": "^1.0.5", - "@continuedev/config-yaml": "^1.0.51", + "@continuedev/config-types": "file:../config-types", + "@continuedev/config-yaml": "file:../config-yaml", "@continuedev/fetch": "file:../fetch", "dotenv": "^16.5.0", "google-auth-library": "^10.1.0", diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index 8780ab1e2..188f8771c 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -1,16 +1,16 @@ { "name": "continue", - "version": "1.1.63", + "version": "1.1.67", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "continue", - "version": "1.1.63", + "version": "1.1.67", "license": "Apache-2.0", "dependencies": { "@continuedev/config-types": "^1.0.14", - "@continuedev/fetch": "^1.0.10", + "@continuedev/fetch": "file:../packages/fetch", "@electron/rebuild": "^3.2.10", "@reduxjs/toolkit": "^1.9.3", "@vscode/ripgrep": "^1.15.9", @@ -105,8 +105,8 @@ "@aws-sdk/credential-providers": "^3.778.0", "@continuedev/config-types": "^1.0.13", "@continuedev/config-yaml": "file:../packages/config-yaml", - "@continuedev/fetch": "^1.0.14", - "@continuedev/llm-info": "^1.0.8", + "@continuedev/fetch": "file:../packages/fetch", + "@continuedev/llm-info": "file:../packages/llm-info", "@continuedev/openai-adapters": "file:../packages/openai-adapters", "@modelcontextprotocol/sdk": "^1.12.0", "@mozilla/readability": "^0.5.0", @@ -129,6 +129,7 @@ "handlebars": "^4.7.8", "http-proxy-agent": "^7.0.1", "https-proxy-agent": "^7.0.3", + "iconv-lite": "^0.6.3", "ignore": "^5.3.1", "is-localhost-ip": "^2.0.0", "jinja-js": "0.1.8", @@ -142,7 +143,7 @@ "node-html-markdown": "^1.3.0", "ollama": "^0.4.6", "onnxruntime-node": "1.14.0", - "openai": "^4.76.0", + "openai": "^4.104.0", "p-limit": "^6.1.0", "partial-json": "^0.1.7", "pg": "^8.11.3", @@ -207,6 +208,7 @@ "node": ">=20.19.0" } }, + "../packages/fetch": {}, "node_modules/@75lb/deep-merge": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@75lb/deep-merge/-/deep-merge-1.1.2.tgz", @@ -710,17 +712,8 @@ } }, "node_modules/@continuedev/fetch": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/@continuedev/fetch/-/fetch-1.0.10.tgz", - "integrity": "sha512-RBUXtm/VDz+9Itgw+CxrHXwVXoHCAedGzPOgA7gS5HZ9lObaeCJgEfzmfbln1ocFsfqSFmn5X5wSE7DHgfxpVA==", - "license": "Apache-2.0", - "dependencies": { - "@continuedev/config-types": "^1.0.5", - "follow-redirects": "^1.15.6", - "http-proxy-agent": "^7.0.2", - "https-proxy-agent": "^7.0.5", - "node-fetch": "^3.3.2" - } + "resolved": "../packages/fetch", + "link": true }, "node_modules/@electron/node-gyp": { "version": "10.2.0-electron.1", diff --git a/gui/package-lock.json b/gui/package-lock.json index d611543e2..ce7be87e5 100644 --- a/gui/package-lock.json +++ b/gui/package-lock.json @@ -116,8 +116,8 @@ "@aws-sdk/credential-providers": "^3.778.0", "@continuedev/config-types": "^1.0.13", "@continuedev/config-yaml": "file:../packages/config-yaml", - "@continuedev/fetch": "^1.0.14", - "@continuedev/llm-info": "^1.0.8", + "@continuedev/fetch": "file:../packages/fetch", + "@continuedev/llm-info": "file:../packages/llm-info", "@continuedev/openai-adapters": "file:../packages/openai-adapters", "@modelcontextprotocol/sdk": "^1.12.0", "@mozilla/readability": "^0.5.0", @@ -140,6 +140,7 @@ "handlebars": "^4.7.8", "http-proxy-agent": "^7.0.1", "https-proxy-agent": "^7.0.3", + "iconv-lite": "^0.6.3", "ignore": "^5.3.1", "is-localhost-ip": "^2.0.0", "jinja-js": "0.1.8", @@ -153,7 +154,7 @@ "node-html-markdown": "^1.3.0", "ollama": "^0.4.6", "onnxruntime-node": "1.14.0", - "openai": "^4.76.0", + "openai": "^4.104.0", "p-limit": "^6.1.0", "partial-json": "^0.1.7", "pg": "^8.11.3", @@ -223,7 +224,7 @@ "version": "1.0.96", "license": "Apache-2.0", "dependencies": { - "@continuedev/config-types": "^1.0.14", + "@continuedev/config-types": "file:../config-types", "yaml": "^2.6.1", "zod": "^3.24.2" }, diff --git a/package-lock.json b/package-lock.json index 0a2538840..b4289d422 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "wt-openai-adapters-tests", + "name": "continue", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/scripts/install-dependencies.ps1 b/scripts/install-dependencies.ps1 index 4b0c2d9a9..bb957b090 100644 --- a/scripts/install-dependencies.ps1 +++ b/scripts/install-dependencies.ps1 @@ -76,27 +76,9 @@ if (($null -eq $node)) { Write-Host "`nInstalling root-level dependencies..." -ForegroundColor White npm install -Write-Host "`nBuilding config-types..." -ForegroundColor White -Push-Location packages/config-types -npm install -npm run build -Pop-Location - Write-Host "`nBuilding packages (fetch, openai-adapters, config-yaml)..." -ForegroundColor White & .\scripts\build-packages.ps1 -Write-Host "`nBuilding llm-info..." -ForegroundColor White -Push-Location packages/llm-info -npm install -npm run build -Pop-Location - -Write-Host "`nBuilding hub..." -ForegroundColor White -Push-Location packages/hub -npm install -npm run build -Pop-Location - Write-Host "`nInstalling Core extension dependencies..." -ForegroundColor White Push-Location core npm install diff --git a/scripts/install-dependencies.sh b/scripts/install-dependencies.sh index 61d1887c2..294ce5628 100755 --- a/scripts/install-dependencies.sh +++ b/scripts/install-dependencies.sh @@ -30,27 +30,9 @@ fi echo "Installing root-level dependencies..." npm install -echo "Building config-types..." -pushd packages/config-types -npm install -npm run build -popd - echo "Building packages (fetch, openai-adapters, config-yaml)..." ./scripts/build-packages.sh -echo "Building llm-info..." -pushd packages/llm-info -npm install -npm run build -popd - -echo "Building hub..." -pushd packages/hub -npm install -npm run build -popd - echo "Installing Core extension dependencies..." pushd core ## This flag is set because we pull down Chromium at runtime From b7eb90da793f61aa8ff80bd41b458a8d81c0b317 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Fri, 25 Jul 2025 13:51:33 -0700 Subject: [PATCH 30/41] fix path errors --- extensions/vscode/package-lock.json | 19 ++++--------------- extensions/vscode/package.json | 4 ++-- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index 188f8771c..2303dfd06 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -9,7 +9,7 @@ "version": "1.1.67", "license": "Apache-2.0", "dependencies": { - "@continuedev/config-types": "^1.0.14", + "@continuedev/config-types": "file:../packages/config-types", "@continuedev/fetch": "file:../packages/fetch", "@electron/rebuild": "^3.2.10", "@reduxjs/toolkit": "^1.9.3", @@ -208,6 +208,7 @@ "node": ">=20.19.0" } }, + "../packages/config-types": {}, "../packages/fetch": {}, "node_modules/@75lb/deep-merge": { "version": "1.1.2", @@ -704,12 +705,8 @@ } }, "node_modules/@continuedev/config-types": { - "version": "1.0.14", - "resolved": "https://registry.npmjs.org/@continuedev/config-types/-/config-types-1.0.14.tgz", - "integrity": "sha512-PVHyHPyRXd2QsaNgnCpiKYU3uHFTlyuQSkqE8OwrBmQqO6/TXUVIr/2EGtyIZGrml4Y+rGMSH40WU4/0t4SGpQ==", - "dependencies": { - "zod": "^3.23.8" - } + "resolved": "../packages/config-types", + "link": true }, "node_modules/@continuedev/fetch": { "resolved": "../packages/fetch", @@ -16734,14 +16731,6 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } - }, - "node_modules/zod": { - "version": "3.23.8", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz", - "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } } } } diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index 25e95b45e..f389add49 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -717,8 +717,8 @@ "vscode-extension-tester": "^8.14.1" }, "dependencies": { - "@continuedev/config-types": "^1.0.14", - "@continuedev/fetch": "file:../packages/fetch", + "@continuedev/config-types": "file:../../packages/config-types", + "@continuedev/fetch": "file:../../packages/fetch", "@electron/rebuild": "^3.2.10", "@reduxjs/toolkit": "^1.9.3", "@vscode/ripgrep": "^1.15.9", From b3b5f24a0f60fea2697f71a712a466d11b28fb9f Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Fri, 25 Jul 2025 13:52:47 -0700 Subject: [PATCH 31/41] update locks --- .github/workflows/build-vscode-extension.yml | 2 +- extensions/vscode/package-lock.json | 45 +++++++++++++++++--- 2 files changed, 40 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-vscode-extension.yml b/.github/workflows/build-vscode-extension.yml index 9f928bc14..fd959807e 100644 --- a/.github/workflows/build-vscode-extension.yml +++ b/.github/workflows/build-vscode-extension.yml @@ -110,7 +110,7 @@ jobs: run: ./scripts/build-packages.ps1 if: matrix.os == 'windows-latest' - - name: Build packages (Unix) + - name: Build packages (Linux/macOS) run: ./scripts/build-packages.sh if: matrix.os != 'windows-latest' diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index 2303dfd06..9483160c6 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -9,8 +9,8 @@ "version": "1.1.67", "license": "Apache-2.0", "dependencies": { - "@continuedev/config-types": "file:../packages/config-types", - "@continuedev/fetch": "file:../packages/fetch", + "@continuedev/config-types": "file:../../packages/config-types", + "@continuedev/fetch": "file:../../packages/fetch", "@electron/rebuild": "^3.2.10", "@reduxjs/toolkit": "^1.9.3", "@vscode/ripgrep": "^1.15.9", @@ -208,8 +208,41 @@ "node": ">=20.19.0" } }, - "../packages/config-types": {}, - "../packages/fetch": {}, + "../../packages/config-types": { + "name": "@continuedev/config-types", + "version": "1.0.14", + "license": "Apache-2.0", + "dependencies": { + "zod": "^3.24.2" + }, + "devDependencies": { + "@types/node": "^20.11.19", + "typescript": "^5.5.2" + } + }, + "../../packages/fetch": { + "name": "@continuedev/fetch", + "version": "1.0.15", + "license": "Apache-2.0", + "dependencies": { + "@continuedev/config-types": "file:../config-types", + "follow-redirects": "^1.15.6", + "http-proxy-agent": "^7.0.2", + "https-proxy-agent": "^7.0.5", + "node-fetch": "^3.3.2" + }, + "devDependencies": { + "@types/follow-redirects": "^1.14.4", + "typescript": "^5.0.0", + "vitest": "^3.2.0" + } + }, + "../packages/config-types": { + "extraneous": true + }, + "../packages/fetch": { + "extraneous": true + }, "node_modules/@75lb/deep-merge": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@75lb/deep-merge/-/deep-merge-1.1.2.tgz", @@ -705,11 +738,11 @@ } }, "node_modules/@continuedev/config-types": { - "resolved": "../packages/config-types", + "resolved": "../../packages/config-types", "link": true }, "node_modules/@continuedev/fetch": { - "resolved": "../packages/fetch", + "resolved": "../../packages/fetch", "link": true }, "node_modules/@electron/node-gyp": { From bd96d398742ffc7422db66551adf3d951e8fa8eb Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Fri, 25 Jul 2025 14:02:02 -0700 Subject: [PATCH 32/41] more ci fixes --- .github/workflows/pr_checks.yaml | 45 +++++++++++++++++--------------- core/jest.config.js | 2 +- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index 1acaedfac..93c9b17a4 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -176,14 +176,14 @@ jobs: key: ${{ runner.os }}-gui-node-modules-${{ hashFiles('gui/package-lock.json') }} - name: Build packages and install dependencies - if: steps.gui-cache.outputs.cache-hit != 'true' run: | ./scripts/build-packages.sh - - cd core - npm ci - cd ../gui - npm ci + if [ "${{ steps.gui-cache.outputs.cache-hit }}" != "true" ]; then + cd core + npm ci + cd ../gui + npm ci + fi gui-checks: needs: install-gui @@ -250,13 +250,14 @@ jobs: key: ${{ runner.os }}-binary-node-modules-${{ hashFiles('binary/package-lock.json') }} - name: Build packages and install dependencies - if: steps.binary-cache.outputs.cache-hit != 'true' run: | ./scripts/build-packages.sh - cd core - npm ci - cd ../binary - npm ci + if [ "${{ steps.binary-cache.outputs.cache-hit }}" != "true" ]; then + cd core + npm ci + cd ../binary + npm ci + fi - name: Type check run: | @@ -293,13 +294,14 @@ jobs: key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }} - name: Build packages and install dependencies - if: steps.vscode-cache.outputs.cache-hit != 'true' run: | ./scripts/build-packages.sh - cd core - npm ci - cd ../extensions/vscode - npm ci + if [ "${{ steps.vscode-cache.outputs.cache-hit }}" != "true" ]; then + cd core + npm ci + cd ../extensions/vscode + npm ci + fi env: GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} @@ -522,13 +524,14 @@ jobs: key: ${{ runner.os }}-vscode-storage-${{ hashFiles('extensions/vscode/package-lock.json') }} - name: Build packages and download e2e dependencies - if: steps.storage-cache.outputs.cache-hit != 'true' run: | ./scripts/build-packages.sh - cd core - npm ci - cd ../extensions/vscode - npm run e2e:ci:download + if [ "${{ steps.storage-cache.outputs.cache-hit }}" != "true" ]; then + cd core + npm ci + cd ../extensions/vscode + npm run e2e:ci:download + fi - name: Upload e2e dependencies uses: actions/upload-artifact@v4 diff --git a/core/jest.config.js b/core/jest.config.js index e4464b264..2fcbc3c5c 100644 --- a/core/jest.config.js +++ b/core/jest.config.js @@ -7,7 +7,7 @@ export default { "ts-jest", { useESM: true, - useIsolatedModules: true, + isolatedModules: true, tsconfig: { experimentalDecorators: true, emitDecoratorMetadata: true, From b0ba23d69952bd895f0d8b0e1321b0a66f3d5119 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Fri, 25 Jul 2025 14:17:54 -0700 Subject: [PATCH 33/41] CI fixes --- .github/workflows/pr_checks.yaml | 2 +- packages/llm-info/src/providers/gemini.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index 93c9b17a4..9733f856c 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -491,7 +491,7 @@ jobs: "npm_config_arch": "x64" }, { - "os": "macos-latest", + "os": "macos-13", "platform": "darwin", "arch": "x64", "npm_config_arch": "x64" diff --git a/packages/llm-info/src/providers/gemini.ts b/packages/llm-info/src/providers/gemini.ts index 214ad1299..43eb8532b 100644 --- a/packages/llm-info/src/providers/gemini.ts +++ b/packages/llm-info/src/providers/gemini.ts @@ -43,7 +43,7 @@ export const Gemini: ModelProvider = { contextLength: 1048576, maxCompletionTokens: 8192, mediaTypes: AllMediaTypes, - regex: /gemini-2\.0-flash/i, + regex: /^gemini-2\.0-flash$/i, recommendedFor: ["chat"], }, { @@ -54,7 +54,7 @@ export const Gemini: ModelProvider = { contextLength: 1048576, maxCompletionTokens: 8192, mediaTypes: AllMediaTypes, - regex: /gemini-2\.0-flash-lite/i, + regex: /^gemini-2\.0-flash-lite$/i, recommendedFor: ["chat"], }, { @@ -86,7 +86,7 @@ export const Gemini: ModelProvider = { contextLength: 1048576, maxCompletionTokens: 8192, mediaTypes: AllMediaTypes, - regex: /gemini-2\.0-flash-exp/i, + regex: /^gemini-2\.0-flash-exp$/i, recommendedFor: ["chat"], }, { From eca333fde5b15959bd26075620cf53cae2302637 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Fri, 25 Jul 2025 14:23:02 -0700 Subject: [PATCH 34/41] Update retry.test.ts --- core/llm/utils/retry.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/llm/utils/retry.test.ts b/core/llm/utils/retry.test.ts index 665e010c1..ec383c582 100644 --- a/core/llm/utils/retry.test.ts +++ b/core/llm/utils/retry.test.ts @@ -450,8 +450,8 @@ describe("Retry Functionality", () => { expect(result).toBe("success"); // Should be capped at maxDelay (200ms) not header value (10000ms) - expect(delays[0]).toBeGreaterThan(190); - expect(delays[0]).toBeLessThan(210); + expect(delays[0]).toBeGreaterThanOrEqual(190); + expect(delays[0]).toBeLessThanOrEqual(200); }); it("should handle case-insensitive header names", async () => { From b292ed2126d026ac7407b6e3f27156c6863a1047 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Fri, 25 Jul 2025 14:28:44 -0700 Subject: [PATCH 35/41] Update retry.test.ts --- core/llm/utils/retry.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/llm/utils/retry.test.ts b/core/llm/utils/retry.test.ts index ec383c582..a33b8ebd5 100644 --- a/core/llm/utils/retry.test.ts +++ b/core/llm/utils/retry.test.ts @@ -450,8 +450,9 @@ describe("Retry Functionality", () => { expect(result).toBe("success"); // Should be capped at maxDelay (200ms) not header value (10000ms) + // Allow for ±5% jitter applied to the capped delay expect(delays[0]).toBeGreaterThanOrEqual(190); - expect(delays[0]).toBeLessThanOrEqual(200); + expect(delays[0]).toBeLessThanOrEqual(210); }); it("should handle case-insensitive header names", async () => { From bbb6765b7c2b8feb2dbc0e66c4d8a79d1f38c771 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Fri, 25 Jul 2025 14:32:06 -0700 Subject: [PATCH 36/41] fix jitter --- core/llm/utils/retry.test.ts | 4 ++-- core/llm/utils/retry.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/llm/utils/retry.test.ts b/core/llm/utils/retry.test.ts index a33b8ebd5..111463a0d 100644 --- a/core/llm/utils/retry.test.ts +++ b/core/llm/utils/retry.test.ts @@ -450,9 +450,9 @@ describe("Retry Functionality", () => { expect(result).toBe("success"); // Should be capped at maxDelay (200ms) not header value (10000ms) - // Allow for ±5% jitter applied to the capped delay + // Jitter is applied before maxDelay cap, so delay should never exceed maxDelay expect(delays[0]).toBeGreaterThanOrEqual(190); - expect(delays[0]).toBeLessThanOrEqual(210); + expect(delays[0]).toBeLessThanOrEqual(200); }); it("should handle case-insensitive header names", async () => { diff --git a/core/llm/utils/retry.ts b/core/llm/utils/retry.ts index 416851378..dce06ef5c 100644 --- a/core/llm/utils/retry.ts +++ b/core/llm/utils/retry.ts @@ -149,10 +149,10 @@ function calculateDelay( delayMs = Number(retryAfter) * 1000; } - // Respect maxDelay and add small jitter to spread requests - const cappedDelay = Math.min(delayMs, maxDelay); + // Apply small jitter to spread requests, then respect maxDelay as hard limit const jitterMultiplier = 1 + (Math.random() * 0.1 - 0.05); // Small jitter ±5% - return Math.max(0, Math.floor(cappedDelay * jitterMultiplier)); + const jitteredDelay = delayMs * jitterMultiplier; + return Math.max(0, Math.floor(Math.min(jitteredDelay, maxDelay))); } } From 65a577be23ae5bcfe5d3025e50ed66bde8295de4 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Fri, 25 Jul 2025 14:41:46 -0700 Subject: [PATCH 37/41] Update main-build.yaml --- .github/workflows/main-build.yaml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main-build.yaml b/.github/workflows/main-build.yaml index 10e7bf4e3..de22d6c53 100644 --- a/.github/workflows/main-build.yaml +++ b/.github/workflows/main-build.yaml @@ -9,7 +9,22 @@ jobs: build: uses: ./.github/workflows/build-vscode-extension.yml with: - # Uses default platforms (all supported platforms) + # Build only for macOS latest and Ubuntu latest + platforms: | + [ + { + "os": "ubuntu-latest", + "platform": "linux", + "arch": "x64", + "npm_config_arch": "x64" + }, + { + "os": "macos-latest", + "platform": "darwin", + "arch": "arm64", + "npm_config_arch": "arm64" + } + ] pre-release: false commit-sha: ${{ github.sha }} secrets: inherit \ No newline at end of file From 5d45c46afeb0050c1a9a5b24b4786707b5fcec8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20B=C5=82ach?= Date: Sat, 26 Jul 2025 00:27:25 +0200 Subject: [PATCH 38/41] fix: Add logging of Continue binary IO (#6658) * fix: Add logging of Continue binary IO * reformat --- extensions/intellij/CONTRIBUTING.md | 9 +++++++++ .../continue/process/ContinueProcessHandler.kt | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/extensions/intellij/CONTRIBUTING.md b/extensions/intellij/CONTRIBUTING.md index 9757bc430..b345af3a5 100644 --- a/extensions/intellij/CONTRIBUTING.md +++ b/extensions/intellij/CONTRIBUTING.md @@ -101,6 +101,15 @@ allow for changes to your `config.json` and other files during development, with When using the `Run Continue` task, we automatically tail both prompt logs and IDE logs. +#### Viewing more IDE logs + +You can selectively increase the log granularity (e.g., debug-level logs) as follows: + +- Navigate to `Help | Diagnostic Tools | Debug Log Settings...` +- Add a line in the format: `com.intellij.diagnostic:debug` + +You can find more information about this feature in [official docs](https://youtrack.jetbrains.com/articles/SUPPORT-A-43/How-to-enable-debug-logging-in-IntelliJ-IDEA). + ### Reloading changes - `extensions/intellij`: Attempt to reload changed classes by selecting diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/process/ContinueProcessHandler.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/process/ContinueProcessHandler.kt index 68ec83bf6..8e918b2c3 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/process/ContinueProcessHandler.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/process/ContinueProcessHandler.kt @@ -2,6 +2,7 @@ package com.github.continuedev.continueintellijextension.`continue`.process import com.github.continuedev.continueintellijextension.error.ContinueErrorService import com.intellij.openapi.components.service +import com.intellij.openapi.diagnostic.Logger import kotlinx.coroutines.* import kotlinx.coroutines.channels.Channel import java.io.BufferedReader @@ -19,6 +20,7 @@ class ContinueProcessHandler( private val pendingWrites = Channel(Channel.UNLIMITED) private val writer = OutputStreamWriter(process.output) private val reader = BufferedReader(InputStreamReader(process.input)) + private val log = Logger.getInstance(ContinueProcessHandler::class.java) init { scope.launch(Dispatchers.IO) { @@ -27,6 +29,7 @@ class ContinueProcessHandler( val line = reader.readLine() if (line != null && line.isNotEmpty()) { try { + log.debug("Handle: $line") handleMessage(line) } catch (e: Exception) { service().report(e, "Error handling message: $line") @@ -40,6 +43,7 @@ class ContinueProcessHandler( } scope.launch(Dispatchers.IO) { for (message in pendingWrites) { + log.debug("Write: $message") writer.write(message) writer.write("\r\n") writer.flush() From e9558277de17f9f22bec8262d358504a8fb3da6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20B=C5=82ach?= Date: Sat, 26 Jul 2025 00:41:24 +0200 Subject: [PATCH 39/41] fix: Apply proxy settings on the Continue process using environment variables (solves #5242) (#6752) * fix: Apply proxy settings on the Continue process using environment variables (solves #5242) This is a new and simplified implementation for passing proxy config. It's based on environment variables instead of dedicated message in the protocol, however it has some downsides. More details: * This will not work if we use the binary with USE_TCP, because these env vars can only be set for the process. * The implementation of the process handler has partially changed its behavior. From now on, manual restart (including Continue: Restart Process action) has no artificial delay/it's instant. This was a bug IMO that is fixed now. To test this in a development environment, you need to remove USE_TCP from the run configuration. Currently, we only track two proxy settings controls: whether it's enabled and the proxy address along with the port. To test this, you need to go into the settings, change the state of those controls, then apply. The activity polls their values, and if it detects a change, the service restarts the binary, which reads the new setting on start. There should always be only one process per IDE, regardless of how quickly the settings are changed or how often the binary is restarted manually. * fix: misc.xml * fix --- .../actions/ContinuePluginActions.kt | 2 +- .../continue/CoreMessenger.kt | 16 ++++++--- .../continue/CoreMessengerManager.kt | 23 ++++++------ .../continue/process/ContinueBinaryProcess.kt | 18 +++++++--- .../proxy/ProxyPoolingActivity.kt | 36 +++++++++++++++++++ .../proxy/ProxySettings.kt | 20 +++++++++++ .../services/ContinuePluginService.kt | 2 +- .../src/main/resources/META-INF/plugin.xml | 1 + 8 files changed, 94 insertions(+), 24 deletions(-) create mode 100644 extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/proxy/ProxyPoolingActivity.kt create mode 100644 extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/proxy/ProxySettings.kt diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/actions/ContinuePluginActions.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/actions/ContinuePluginActions.kt index c6df8eddd..b9eec734c 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/actions/ContinuePluginActions.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/actions/ContinuePluginActions.kt @@ -10,7 +10,7 @@ import com.intellij.openapi.fileEditor.FileEditorManager class RestartContinueProcess : AnAction() { override fun actionPerformed(e: AnActionEvent) { val pluginService = getContinuePluginService(e.project) ?: return - pluginService.coreMessengerManager?.restart() + pluginService.coreMessengerManager?.coreMessenger?.restart() } } diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/CoreMessenger.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/CoreMessenger.kt index 1c0ab242a..1e8e78208 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/CoreMessenger.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/CoreMessenger.kt @@ -17,11 +17,11 @@ class CoreMessenger( private val project: Project, private val ideProtocolClient: IdeProtocolClient, val coroutineScope: CoroutineScope, - private val onExit: () -> Unit + private val onUnexpectedExit: () -> Unit ) { private val gson = Gson() private val responseListeners = mutableMapOf Unit>() - private val process = startContinueProcess() + private var process = startContinueProcess() private val log = Logger.getInstance(CoreMessenger::class.java) fun request(messageType: String, data: Any?, messageId: String?, onResponse: (Any?) -> Unit) { @@ -36,7 +36,7 @@ class CoreMessenger( val process = if (isTcp) ContinueSocketProcess() else - ContinueBinaryProcess(onExit) + ContinueBinaryProcess(onUnexpectedExit) return ContinueProcessHandler(coroutineScope, process, ::handleMessage) } @@ -81,7 +81,15 @@ class CoreMessenger( null } - fun killSubProcess() { + fun restart() { + log.warn("Restarting Continue process") + responseListeners.clear() + process.close() + process = startContinueProcess() + } + + fun close() { + log.warn("Closing Continue process") process.close() } } \ No newline at end of file diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/CoreMessengerManager.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/CoreMessengerManager.kt index 3dbf9c2d5..71b367e20 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/CoreMessengerManager.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/CoreMessengerManager.kt @@ -9,37 +9,34 @@ import com.intellij.openapi.project.Project import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.delay import kotlinx.coroutines.launch +import kotlin.time.Duration.Companion.seconds class CoreMessengerManager( - private val project: Project, - private val ideProtocolClient: IdeProtocolClient, + project: Project, + ideProtocolClient: IdeProtocolClient, private val coroutineScope: CoroutineScope ) { - var coreMessenger: CoreMessenger = createCoreMessenger() - private var lastBackoffInterval = 0.5 + val coreMessenger = CoreMessenger(project, ideProtocolClient, coroutineScope, ::onUnexpectedExit) + private var backoffIntervalSeconds = 1 private val log = Logger.getInstance(CoreMessengerManager::class.java) init { setupAnonymousTelemetry() } - fun restart() { + private fun onUnexpectedExit() { coroutineScope.launch { try { - coreMessenger.killSubProcess() - lastBackoffInterval *= 2 - log.warn("Continue process exited, retrying in $lastBackoffInterval seconds") - delay((lastBackoffInterval * 1000).toLong()) - coreMessenger = createCoreMessenger() + delay(backoffIntervalSeconds.seconds) + backoffIntervalSeconds *= 2 + log.warn("Continue process terminated externally, retrying in $backoffIntervalSeconds seconds") + coreMessenger.restart() } catch (e: Exception) { service().capture("jetbrains_core_start_error", mapOf("error" to e)) } } } - private fun createCoreMessenger() = - CoreMessenger(project, ideProtocolClient, coroutineScope, ::restart) - private fun setupAnonymousTelemetry() { coreMessenger.request("config/getSerializedProfileInfo", null, null) { response -> val allowAnonymousTelemetry = diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/process/ContinueBinaryProcess.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/process/ContinueBinaryProcess.kt index f10dd9d65..6ef0c335b 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/process/ContinueBinaryProcess.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/process/ContinueBinaryProcess.kt @@ -1,5 +1,6 @@ package com.github.continuedev.continueintellijextension.`continue`.process +import com.github.continuedev.continueintellijextension.proxy.ProxySettings import com.github.continuedev.continueintellijextension.error.ContinueErrorService import com.github.continuedev.continueintellijextension.services.TelemetryService import com.github.continuedev.continueintellijextension.utils.OS @@ -15,7 +16,9 @@ import java.nio.file.Files import java.nio.file.Paths import java.nio.file.attribute.PosixFilePermission -class ContinueBinaryProcess(private val onExit: () -> Unit) : ContinueProcess { +class ContinueBinaryProcess( + private val onUnexpectedExit: () -> Unit +) : ContinueProcess { private val process = startBinaryProcess() override val input: InputStream = process.inputStream @@ -29,11 +32,16 @@ class ContinueBinaryProcess(private val onExit: () -> Unit) : ContinueProcess { runBlocking(Dispatchers.IO) { setPermissions() } - return ProcessBuilder(path).directory(File(path).parentFile) - .start() - .apply { onExit().thenRun(onExit).thenRun { reportErrorTelemetry() } } - } + val builder = ProcessBuilder(path) + val proxySettings = ProxySettings.getSettings() + if (proxySettings.enabled) + builder.environment() += "HTTP_PROXY" to proxySettings.proxy + return builder + .directory(File(path).parentFile) + .start() + .apply { onExit().thenRun(onUnexpectedExit).thenRun(::reportErrorTelemetry) } + } private fun reportErrorTelemetry() { var err = process.errorStream?.bufferedReader()?.readText()?.trim() diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/proxy/ProxyPoolingActivity.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/proxy/ProxyPoolingActivity.kt new file mode 100644 index 000000000..0d88d0bdd --- /dev/null +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/proxy/ProxyPoolingActivity.kt @@ -0,0 +1,36 @@ +package com.github.continuedev.continueintellijextension.proxy + +import com.github.continuedev.continueintellijextension.services.ContinuePluginService +import com.intellij.openapi.components.service +import com.intellij.openapi.diagnostic.Logger +import com.intellij.openapi.project.Project +import com.intellij.openapi.startup.StartupActivity +import kotlinx.coroutines.* +import kotlin.time.Duration.Companion.seconds + +class ProxyPoolingActivity : StartupActivity { + private val scope = CoroutineScope(Dispatchers.Default) + private var lastSettings = ProxySettings.getSettings() + private val log = Logger.getInstance(ProxyPoolingActivity::class.java) + + override fun runActivity(project: Project) { + scope.launch { + while (isActive) { + val newSettings = ProxySettings.getSettings() + if (newSettings != lastSettings) { + onSettingsChanged(project) + lastSettings = newSettings + } + delay(2.seconds) + } + } + } + + private fun onSettingsChanged(project: Project) { + log.warn("Proxy settings changed, restarting") + project.service().coreMessengerManager?.coreMessenger?.restart() + } +} + + + diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/proxy/ProxySettings.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/proxy/ProxySettings.kt new file mode 100644 index 000000000..70c66637c --- /dev/null +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/proxy/ProxySettings.kt @@ -0,0 +1,20 @@ +package com.github.continuedev.continueintellijextension.proxy + +import com.intellij.util.net.HttpConfigurable + +data class ProxySettings( + val enabled: Boolean, + val proxy: String, +) { + + companion object { + fun getSettings(): ProxySettings { + val settings = HttpConfigurable.getInstance() + return ProxySettings( + enabled = settings.USE_HTTP_PROXY, + proxy = "${settings.PROXY_HOST}:${settings.PROXY_PORT}" + ) + } + } + +} diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/services/ContinuePluginService.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/services/ContinuePluginService.kt index 6ebb8f41f..102981715 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/services/ContinuePluginService.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/services/ContinuePluginService.kt @@ -33,7 +33,7 @@ class ContinuePluginService : Disposable, DumbAware { coroutineScope.cancel() coreMessenger?.coroutineScope?.let { it.cancel() - coreMessenger?.killSubProcess() + coreMessenger?.close() } } diff --git a/extensions/intellij/src/main/resources/META-INF/plugin.xml b/extensions/intellij/src/main/resources/META-INF/plugin.xml index 15a0dd864..22ceb6772 100644 --- a/extensions/intellij/src/main/resources/META-INF/plugin.xml +++ b/extensions/intellij/src/main/resources/META-INF/plugin.xml @@ -40,6 +40,7 @@ + Date: Fri, 25 Jul 2025 15:50:17 -0700 Subject: [PATCH 40/41] feat: make the reasoning btn solid when active (#6756) --- gui/src/components/gui/Alert.tsx | 2 +- gui/src/components/mainInput/InputToolbar.tsx | 24 +++++++++++-------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/gui/src/components/gui/Alert.tsx b/gui/src/components/gui/Alert.tsx index a2739757f..f7eb5b845 100644 --- a/gui/src/components/gui/Alert.tsx +++ b/gui/src/components/gui/Alert.tsx @@ -3,7 +3,7 @@ import { ExclamationCircleIcon, ExclamationTriangleIcon, InformationCircleIcon, -} from "@heroicons/react/24/solid"; +} from "@heroicons/react/16/solid"; import { ReactNode } from "react"; import { vscBackground } from ".."; diff --git a/gui/src/components/mainInput/InputToolbar.tsx b/gui/src/components/mainInput/InputToolbar.tsx index 9be9f25d9..0e2aaa52a 100644 --- a/gui/src/components/mainInput/InputToolbar.tsx +++ b/gui/src/components/mainInput/InputToolbar.tsx @@ -1,8 +1,9 @@ import { AtSymbolIcon, - LightBulbIcon, + LightBulbIcon as LightBulbIconOutline, PhotoIcon, } from "@heroicons/react/24/outline"; +import { LightBulbIcon as LightBulbIconSolid } from "@heroicons/react/24/solid"; import { InputModifiers } from "core"; import { modelSupportsImages, modelSupportsTools } from "core/llm/autodetect"; import { useContext, useRef } from "react"; @@ -13,7 +14,6 @@ import { selectSelectedChatModel } from "../../redux/slices/configSlice"; import { setHasReasoningEnabled } from "../../redux/slices/sessionSlice"; import { exitEdit } from "../../redux/thunks/edit"; import { getAltKeyLabel, isMetaEquivalentKeyPressed } from "../../util"; -import { cn } from "../../util/cn"; import { ToolTip } from "../gui/Tooltip"; import ModelSelect from "../modelSelection/ModelSelect"; import { ModeSelect } from "../ModeSelect"; @@ -141,19 +141,23 @@ function InputToolbar(props: InputToolbarProps) { )} - {defaultModel?.provider === "anthropic" && ( + {defaultModel?.underlyingProviderName === "anthropic" && ( dispatch(setHasReasoningEnabled(!hasReasoningEnabled)) } > - + {hasReasoningEnabled ? ( + + ) : ( + + )} {hasReasoningEnabled From 05674bf409b1407d3df1efd6906b80345fe3e884 Mon Sep 17 00:00:00 2001 From: Tomasz Stefaniak Date: Fri, 25 Jul 2025 17:59:21 -0700 Subject: [PATCH 41/41] chore: bump versions for prerelease --- extensions/intellij/gradle.properties | 2 +- extensions/vscode/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/intellij/gradle.properties b/extensions/intellij/gradle.properties index 2b6ee66d4..eba9d9a65 100644 --- a/extensions/intellij/gradle.properties +++ b/extensions/intellij/gradle.properties @@ -3,7 +3,7 @@ pluginGroup=com.github.continuedev.continueintellijextension pluginName=continue-intellij-extension pluginRepositoryUrl=https://github.com/continuedev/continue # SemVer format -> https://semver.org -pluginVersion=1.0.31 +pluginVersion=1.0.32 # Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html pluginSinceBuild=223 # IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index f389add49..907e84eb6 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -2,7 +2,7 @@ "name": "continue", "icon": "media/icon.png", "author": "Continue Dev, Inc", - "version": "1.1.67", + "version": "1.1.68", "repository": { "type": "git", "url": "https://github.com/continuedev/continue"