Elffuss BraidHub

kikocis/continue public

Merge branch 'main' into feat/cn-docs
Changeseta1c3c7aad6d47d3a4f31c02078d4085ab83e99adb3f130f2841e88d73e72b122
AuthorBekahHW <rhawrot@gmail.com> · 2025-09-18 07:50 -04:00
CommitterBekahHW <rhawrot@gmail.com> · 2025-09-18 07:50 -04:00
Parentse9e21fbbba69, d4eec0630c2e

Browse the files at this changeset

93 files changed

modified .github/workflows/continue-detailed-review.yaml +1 −1
@@ -18,7 +18,7 @@
1818 timeout-minutes: 10
1919 steps:
2020 - name: Run Detailed PR Review
21- uses: continuedev/continue/actions/detailed-review@8373ac24010df1110cd00512f925b63813362da1
21+ uses: continuedev/continue/actions/detailed-review@3ebd8232440080aa8891909753f69d75a87b2c86
2222 with:
2323 continue-api-key: ${{ secrets.CONTINUE_API_KEY }}
2424 continue-org: continuedev
modified .github/workflows/continue-general-review.yaml +1 −1
@@ -18,7 +18,7 @@
1818 timeout-minutes: 10
1919 steps:
2020 - name: Run Continue PR Review Action
21- uses: continuedev/continue/actions/general-review@8373ac24010df1110cd00512f925b63813362da1
21+ uses: continuedev/continue/actions/general-review@3ebd8232440080aa8891909753f69d75a87b2c86
2222 with:
2323 continue-api-key: ${{ secrets.CONTINUE_API_KEY }}
2424 continue-org: "continuedev"
modified .github/workflows/pr-checks.yaml +5 −0
@@ -84,6 +84,9 @@
8484 AZURE_FOUNDRY_CODESTRAL_API_KEY: ${{ secrets.AZURE_FOUNDRY_CODESTRAL_API_KEY }}
8585 AZURE_FOUNDRY_MISTRAL_SMALL_API_KEY: ${{ secrets.AZURE_FOUNDRY_MISTRAL_SMALL_API_KEY }}
8686 AZURE_OPENAI_GPT41_API_KEY: ${{ secrets.AZURE_OPENAI_GPT41_API_KEY }}
87+ VOYAGE_API_KEY: ${{ secrets.VOYAGE_API_KEY }}
88+ RELACE_API_KEY: ${{ secrets.RELACE_API_KEY }}
89+ INCEPTION_API_KEY: ${{ secrets.INCEPTION_API_KEY }}
8790
8891 gui-checks:
8992 runs-on: ubuntu-latest
@@ -217,6 +220,8 @@
217220 AZURE_FOUNDRY_MISTRAL_SMALL_API_KEY: ${{ secrets.AZURE_FOUNDRY_MISTRAL_SMALL_API_KEY }}
218221 AZURE_OPENAI_GPT41_API_KEY: ${{ secrets.AZURE_OPENAI_GPT41_API_KEY }}
219222 VOYAGE_API_KEY: ${{ secrets.VOYAGE_API_KEY }}
223+ RELACE_API_KEY: ${{ secrets.RELACE_API_KEY }}
224+ INCEPTION_API_KEY: ${{ secrets.INCEPTION_API_KEY }}
220225
221226 vscode-get-test-file-matrix:
222227 runs-on: ubuntu-latest
modified .github/workflows/release-config-yaml.yml +2 −0
@@ -32,3 +32,5 @@
3232 AZURE_FOUNDRY_MISTRAL_SMALL_API_KEY: ${{ secrets.AZURE_FOUNDRY_MISTRAL_SMALL_API_KEY }}
3333 AZURE_OPENAI_GPT41_API_KEY: ${{ secrets.AZURE_OPENAI_GPT41_API_KEY }}
3434 VOYAGE_API_KEY: ${{ secrets.VOYAGE_API_KEY }}
35+ RELACE_API_KEY: ${{ secrets.RELACE_API_KEY }}
36+ INCEPTION_API_KEY: ${{ secrets.INCEPTION_API_KEY }}
modified .github/workflows/release-fetch.yml +2 −0
@@ -32,3 +32,5 @@
3232 AZURE_FOUNDRY_MISTRAL_SMALL_API_KEY: ${{ secrets.AZURE_FOUNDRY_MISTRAL_SMALL_API_KEY }}
3333 AZURE_OPENAI_GPT41_API_KEY: ${{ secrets.AZURE_OPENAI_GPT41_API_KEY }}
3434 VOYAGE_API_KEY: ${{ secrets.VOYAGE_API_KEY }}
35+ RELACE_API_KEY: ${{ secrets.RELACE_API_KEY }}
36+ INCEPTION_API_KEY: ${{ secrets.INCEPTION_API_KEY }}
modified .github/workflows/release-llm-info.yml +4 −1
@@ -23,4 +23,7 @@
2323 AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
2424 AZURE_FOUNDRY_CODESTRAL_API_KEY: ${{ secrets.AZURE_FOUNDRY_CODESTRAL_API_KEY }}
2525 AZURE_FOUNDRY_MISTRAL_SMALL_API_KEY: ${{ secrets.AZURE_FOUNDRY_MISTRAL_SMALL_API_KEY }}
26- AZURE_OPENAI_GPT41_API_KEY: ${{ secrets.AZURE_OPENAI_GPT41_API_KEY }}
No newline at the end of the file
26+ AZURE_OPENAI_GPT41_API_KEY: ${{ secrets.AZURE_OPENAI_GPT41_API_KEY }}
27+ VOYAGE_API_KEY: ${{ secrets.VOYAGE_API_KEY }}
28+ RELACE_API_KEY: ${{ secrets.RELACE_API_KEY }}
29+ INCEPTION_API_KEY: ${{ secrets.INCEPTION_API_KEY }}
modified binary/package-lock.json +0 −0

Not shown: the file is larger than the hub shows, or this page holds as much as it shows. View the file.

modified core/config/load.ts +3 −1
@@ -215,8 +215,8 @@
215215 // Prepare models
216216 for (const model of models) {
217217 model.requestOptions = {
218- ...model.requestOptions,
219218 ...config.requestOptions,
219+ ...model.requestOptions,
220220 };
221221 if (roles !== undefined) {
222222 model.roles = model.roles ?? roles;
@@ -545,6 +545,7 @@
545545
546546 // Trigger MCP server refreshes (Config is reloaded again once connected!)
547547 const mcpManager = MCPManagerSingleton.getInstance();
548+
548549 const orgPolicy = PolicySingleton.getInstance().policy;
549550 if (orgPolicy?.policy?.allowMcpServers === false) {
550551 await mcpManager.shutdown();
@@ -555,6 +556,7 @@
555556 id: `continue-mcp-server-${index + 1}`,
556557 name: `MCP Server`,
557558 ...server,
559+ requestOptions: config.requestOptions,
558560 }),
559561 ),
560562 false,
modified core/config/profile/doLoadConfig.ts +0 −1
@@ -187,7 +187,6 @@
187187 const mcpManager = MCPManagerSingleton.getInstance();
188188 const mcpServerStatuses = mcpManager.getStatuses();
189189
190- // Slightly hacky just need connection's client to make slash command for now
191190 const serializableStatuses = mcpServerStatuses.map((server) => {
192191 const { client, ...rest } = server;
193192 return rest;
modified core/config/yaml/loadYaml.ts +17 −17
@@ -4,6 +4,7 @@
44 ConfigResult,
55 ConfigValidationError,
66 isAssistantUnrolledNonNullable,
7+ mergeConfigYamlRequestOptions,
78 mergeUnrolledAssistants,
89 ModelRole,
910 PackageIdentifier,
@@ -34,10 +35,7 @@
3435 import { unrollLocalYamlBlocks } from "./loadLocalYamlBlocks";
3536 import { LocalPlatformClient } from "./LocalPlatformClient";
3637 import { llmsFromModelConfig } from "./models";
37-import {
38- convertYamlMcpToContinueMcp,
39- convertYamlRuleToContinueRule,
40-} from "./yamlToContinueConfig";
38+import { convertYamlRuleToContinueRule } from "./yamlToContinueConfig";
4139
4240 async function loadConfigYaml(options: {
4341 overrideConfigYaml: AssistantUnrolled | undefined;
@@ -155,16 +153,15 @@
155153 };
156154 }
157155
158-async function configYamlToContinueConfig(options: {
156+export async function configYamlToContinueConfig(options: {
159157 config: AssistantUnrolled;
160158 ide: IDE;
161- ideSettings: IdeSettings;
162159 ideInfo: IdeInfo;
163160 uniqueId: string;
164161 llmLogger: ILLMLogger;
165162 workOsAccessToken: string | undefined;
166163 }): Promise<{ config: ContinueConfig; errors: ConfigValidationError[] }> {
167- let { config, ide, ideSettings, ideInfo, uniqueId, llmLogger } = options;
164+ let { config, ide, ideInfo, uniqueId, llmLogger } = options;
168165
169166 const localErrors: ConfigValidationError[] = [];
170167
@@ -192,6 +189,7 @@
192189 summarize: null,
193190 },
194191 rules: [],
192+ requestOptions: { ...config.requestOptions },
195193 };
196194
197195 // Right now, if there are any missing packages in the config, then we will just throw an error
@@ -226,7 +224,13 @@
226224 }
227225 }
228226
229- continueConfig.data = config.data;
227+ continueConfig.data = config.data?.map((d) => ({
228+ ...d,
229+ requestOptions: mergeConfigYamlRequestOptions(
230+ d.requestOptions,
231+ continueConfig.requestOptions,
232+ ),
233+ }));
230234 continueConfig.docs = config.docs?.map((doc) => ({
231235 title: doc.name,
232236 startUrl: doc.startUrl,
@@ -250,12 +254,6 @@
250254 });
251255 });
252256
253- continueConfig.experimental = {
254- modelContextProtocolServers: config.mcpServers?.map(
255- convertYamlMcpToContinueMcp,
256- ),
257- };
258-
259257 // Prompt files -
260258 try {
261259 const promptFiles = await getAllPromptFiles(ide, undefined, true);
@@ -307,9 +305,7 @@
307305 try {
308306 const llms = await llmsFromModelConfig({
309307 model,
310- ide,
311308 uniqueId,
312- ideSettings,
313309 llmLogger,
314310 config: continueConfig,
315311 });
@@ -394,6 +390,7 @@
394390
395391 // Trigger MCP server refreshes (Config is reloaded again once connected!)
396392 const mcpManager = MCPManagerSingleton.getInstance();
393+
397394 const orgPolicy = PolicySingleton.getInstance().policy;
398395 if (orgPolicy?.policy?.allowMcpServers === false) {
399396 await mcpManager.shutdown();
@@ -406,6 +403,10 @@
406403 transport: {
407404 type: "stdio",
408405 args: [],
406+ requestOptions: mergeConfigYamlRequestOptions(
407+ server.requestOptions,
408+ config.requestOptions,
409+ ),
409410 ...(server as any), // TODO: fix the types on mcpServers in config-yaml
410411 },
411412 timeout: server.connectionTimeout,
@@ -464,7 +465,6 @@
464465 await configYamlToContinueConfig({
465466 config: configYamlResult.config,
466467 ide,
467- ideSettings,
468468 ideInfo,
469469 uniqueId,
470470 llmLogger,
modified core/config/yaml/models.ts +11 −22
@@ -1,12 +1,9 @@
1-import { ModelConfig } from "@continuedev/config-yaml";
2-
31 import {
4- ContinueConfig,
5- IDE,
6- IdeSettings,
7- ILLMLogger,
8- LLMOptions,
9-} from "../..";
2+ mergeConfigYamlRequestOptions,
3+ ModelConfig,
4+} from "@continuedev/config-yaml";
5+
6+import { ContinueConfig, ILLMLogger, LLMOptions } from "../..";
107 import { BaseLLM } from "../../llm";
118 import { LLMClasses } from "../../llm/llms";
129
@@ -29,14 +26,12 @@
2926 async function modelConfigToBaseLLM({
3027 model,
3128 uniqueId,
32- ideSettings,
3329 llmLogger,
3430 config,
3531 isFromAutoDetect,
3632 }: {
3733 model: ModelConfig;
3834 uniqueId: string;
39- ideSettings: IdeSettings;
4035 llmLogger: ILLMLogger;
4136 config: ContinueConfig;
4237 isFromAutoDetect?: boolean;
@@ -49,6 +44,11 @@
4944
5045 const { capabilities, ...rest } = model;
5146
47+ const mergedRequestOptions = mergeConfigYamlRequestOptions(
48+ rest.requestOptions,
49+ config.requestOptions,
50+ );
51+
5252 let options: LLMOptions = {
5353 ...rest,
5454 contextLength: model.defaultCompletionOptions?.contextLength,
@@ -74,6 +74,7 @@
7474 },
7575 autocompleteOptions: model.autocompleteOptions,
7676 isFromAutoDetect,
77+ requestOptions: mergedRequestOptions,
7778 };
7879
7980 // Model capabilities - need to be undefined if not found
@@ -154,17 +155,13 @@
154155 async function autodetectModels({
155156 llm,
156157 model,
157- ide,
158158 uniqueId,
159- ideSettings,
160159 llmLogger,
161160 config,
162161 }: {
163162 llm: BaseLLM;
164163 model: ModelConfig;
165- ide: IDE;
166164 uniqueId: string;
167- ideSettings: IdeSettings;
168165 llmLogger: ILLMLogger;
169166 config: ContinueConfig;
170167 }): Promise<BaseLLM[]> {
@@ -183,7 +180,6 @@
183180 name: modelName,
184181 },
185182 uniqueId,
186- ideSettings,
187183 llmLogger,
188184 config,
189185 isFromAutoDetect: true,
@@ -199,23 +195,18 @@
199195
200196 export async function llmsFromModelConfig({
201197 model,
202- ide,
203198 uniqueId,
204- ideSettings,
205199 llmLogger,
206200 config,
207201 }: {
208202 model: ModelConfig;
209- ide: IDE;
210203 uniqueId: string;
211- ideSettings: IdeSettings;
212204 llmLogger: ILLMLogger;
213205 config: ContinueConfig;
214206 }): Promise<BaseLLM[]> {
215207 const baseLlm = await modelConfigToBaseLLM({
216208 model,
217209 uniqueId,
218- ideSettings,
219210 llmLogger,
220211 config,
221212 });
@@ -227,9 +218,7 @@
227218 const models = await autodetectModels({
228219 llm: baseLlm,
229220 model,
230- ide,
231221 uniqueId,
232- ideSettings,
233222 llmLogger,
234223 config,
235224 });
added core/config/yaml/models.vitest.ts +355 −0
@@ -0,0 +1,355 @@
1+import { ModelConfig } from "@continuedev/config-yaml";
2+import { beforeEach, describe, expect, it, vi } from "vitest";
3+
4+import { ContinueConfig, ILLMLogger } from "../..";
5+import { llmsFromModelConfig } from "./models";
6+
7+// Mock the LLM classes
8+vi.mock("../../llm/llms", () => ({
9+ LLMClasses: [
10+ class MockOpenAI {
11+ static providerName = "openai";
12+ static defaultOptions = {
13+ completionOptions: {
14+ maxTokens: 2048,
15+ },
16+ };
17+
18+ constructor(options: any) {
19+ Object.assign(this, options);
20+ }
21+
22+ async listModels() {
23+ return ["gpt-4", "gpt-3.5-turbo"];
24+ }
25+ },
26+ class MockAnthropic {
27+ static providerName = "anthropic";
28+ static defaultOptions = {
29+ completionOptions: {
30+ maxTokens: 4096,
31+ },
32+ };
33+
34+ constructor(options: any) {
35+ Object.assign(this, options);
36+ }
37+
38+ async listModels() {
39+ return ["claude-3-5-sonnet-20241022", "claude-3-haiku-20240307"];
40+ }
41+ },
42+ ],
43+}));
44+
45+describe("llmsFromModelConfig requestOptions merging", () => {
46+ let mockLLMLogger: ILLMLogger;
47+ let mockConfig: ContinueConfig;
48+
49+ beforeEach(() => {
50+ mockLLMLogger = { log: vi.fn() } as any;
51+ mockConfig = {
52+ requestOptions: {
53+ timeout: 30000,
54+ headers: {
55+ "User-Agent": "Continue/1.0.0",
56+ },
57+ proxy: "global-proxy",
58+ },
59+ contextProviders: [],
60+ mcpServerStatuses: [],
61+ rules: [],
62+ selectedModelByRole: {
63+ apply: null,
64+ autocomplete: null,
65+ chat: null,
66+ edit: null,
67+ embed: null,
68+ rerank: null,
69+ summarize: null,
70+ },
71+ modelsByRole: {
72+ apply: [],
73+ autocomplete: [],
74+ chat: [],
75+ edit: [],
76+ embed: [],
77+ rerank: [],
78+ summarize: [],
79+ },
80+ slashCommands: [],
81+ tools: [],
82+ allowAnonymousTelemetry: false,
83+ } as ContinueConfig;
84+ vi.clearAllMocks();
85+ });
86+
87+ it("should merge model requestOptions with config requestOptions", async () => {
88+ const model: ModelConfig = {
89+ name: "test-openai",
90+ provider: "openai",
91+ model: "gpt-4",
92+ requestOptions: {
93+ timeout: 60000,
94+ headers: {
95+ Authorization: "Bearer token123",
96+ },
97+ proxy: "model-proxy",
98+ },
99+ };
100+
101+ const result = await llmsFromModelConfig({
102+ model,
103+ uniqueId: "test-id",
104+ llmLogger: mockLLMLogger,
105+ config: mockConfig,
106+ });
107+
108+ expect(result).toHaveLength(1);
109+ const llm = result[0];
110+
111+ // The LLM should have merged requestOptions
112+ expect(llm.requestOptions).toEqual({
113+ timeout: 60000, // model-specific takes precedence
114+ headers: {
115+ "User-Agent": "Continue/1.0.0", // from global request options
116+ Authorization: "Bearer token123", // from model
117+ },
118+ proxy: "model-proxy", // model-specific takes precedence
119+ });
120+ });
121+
122+ it("should use config requestOptions when model has no requestOptions", async () => {
123+ const model: ModelConfig = {
124+ name: "test-openai",
125+ provider: "openai",
126+ model: "gpt-4",
127+ // no requestOptions
128+ };
129+
130+ const result = await llmsFromModelConfig({
131+ model,
132+ uniqueId: "test-id",
133+ llmLogger: mockLLMLogger,
134+ config: mockConfig,
135+ });
136+
137+ expect(result).toHaveLength(1);
138+ const llm = result[0];
139+
140+ // The LLM should have config requestOptions
141+ expect(llm.requestOptions).toEqual(mockConfig.requestOptions);
142+ });
143+
144+ it("should use model requestOptions when config has no requestOptions", async () => {
145+ const model: ModelConfig = {
146+ name: "test-openai",
147+ provider: "openai",
148+ model: "gpt-4",
149+ requestOptions: {
150+ timeout: 45000,
151+ headers: {
152+ "API-Key": "secret",
153+ },
154+ },
155+ };
156+
157+ const configWithoutOptions = { ...mockConfig };
158+ delete configWithoutOptions.requestOptions;
159+
160+ const result = await llmsFromModelConfig({
161+ model,
162+ uniqueId: "test-id",
163+ llmLogger: mockLLMLogger,
164+ config: configWithoutOptions,
165+ });
166+
167+ expect(result).toHaveLength(1);
168+ const llm = result[0];
169+
170+ // The LLM should have model requestOptions
171+ expect(llm.requestOptions).toEqual(model.requestOptions);
172+ });
173+
174+ it("should handle empty headers correctly in merge", async () => {
175+ const model: ModelConfig = {
176+ name: "test-openai",
177+ provider: "openai",
178+ model: "gpt-4",
179+ requestOptions: {
180+ timeout: 60000,
181+ headers: {},
182+ },
183+ };
184+
185+ const configWithEmptyHeaders = {
186+ ...mockConfig,
187+ requestOptions: {
188+ ...mockConfig.requestOptions!,
189+ headers: {},
190+ },
191+ };
192+
193+ const result = await llmsFromModelConfig({
194+ model,
195+ uniqueId: "test-id",
196+ llmLogger: mockLLMLogger,
197+ config: configWithEmptyHeaders,
198+ });
199+
200+ expect(result).toHaveLength(1);
201+ const llm = result[0];
202+
203+ // When headers merge to empty object, they should be undefined
204+ expect(llm.requestOptions).toEqual({
205+ timeout: 60000,
206+ proxy: "global-proxy",
207+ headers: undefined,
208+ });
209+ });
210+
211+ it("should handle autodetect models with merged requestOptions", async () => {
212+ const model: ModelConfig = {
213+ name: "autodetect-openai",
214+ provider: "openai",
215+ model: "AUTODETECT",
216+ requestOptions: {
217+ timeout: 120000,
218+ headers: {
219+ "X-Custom": "autodetect",
220+ },
221+ },
222+ };
223+
224+ const result = await llmsFromModelConfig({
225+ model,
226+ uniqueId: "test-id",
227+ llmLogger: mockLLMLogger,
228+ config: mockConfig,
229+ });
230+
231+ // Should return multiple models from listModels()
232+ expect(result.length).toBeGreaterThan(0);
233+
234+ // Each detected model should have the merged requestOptions
235+ result.forEach((llm) => {
236+ expect(llm.requestOptions).toEqual({
237+ timeout: 120000, // model-specific takes precedence
238+ headers: {
239+ "User-Agent": "Continue/1.0.0", // from global request options
240+ "X-Custom": "autodetect", // from model
241+ },
242+ proxy: "global-proxy", // from global request options
243+ });
244+ });
245+ });
246+
247+ it("should handle unknown provider gracefully", async () => {
248+ const model: ModelConfig = {
249+ name: "unknown-provider",
250+ provider: "unknown",
251+ model: "unknown-model",
252+ requestOptions: {
253+ timeout: 60000,
254+ },
255+ };
256+
257+ const result = await llmsFromModelConfig({
258+ model,
259+ uniqueId: "test-id",
260+ llmLogger: mockLLMLogger,
261+ config: mockConfig,
262+ });
263+
264+ // Should return empty array for unknown provider
265+ expect(result).toHaveLength(0);
266+ });
267+
268+ it("should preserve other model properties while merging requestOptions", async () => {
269+ const model: ModelConfig = {
270+ name: "test-anthropic",
271+ provider: "anthropic",
272+ model: "claude-3-5-sonnet-20241022",
273+ roles: ["chat", "summarize"],
274+ capabilities: ["tool_use", "image_input"],
275+ defaultCompletionOptions: {
276+ temperature: 0.7,
277+ maxTokens: 1000,
278+ },
279+ requestOptions: {
280+ timeout: 90000,
281+ },
282+ };
283+
284+ const result = await llmsFromModelConfig({
285+ model,
286+ uniqueId: "test-id",
287+ llmLogger: mockLLMLogger,
288+ config: mockConfig,
289+ });
290+
291+ expect(result).toHaveLength(1);
292+ const llm = result[0];
293+
294+ // Should preserve model properties
295+ expect(llm.title).toBe("test-anthropic");
296+ expect(llm.completionOptions?.temperature).toBe(0.7);
297+ expect(llm.completionOptions?.maxTokens).toBe(1000);
298+ expect(llm.capabilities?.tools).toBe(true);
299+ expect(llm.capabilities?.uploadImage).toBe(true);
300+
301+ // Should have merged requestOptions
302+ expect(llm.requestOptions).toEqual({
303+ timeout: 90000,
304+ headers: {
305+ "User-Agent": "Continue/1.0.0",
306+ },
307+ proxy: "global-proxy",
308+ });
309+ });
310+
311+ it("should handle complex header merging scenarios", async () => {
312+ const model: ModelConfig = {
313+ name: "complex-headers",
314+ provider: "openai",
315+ model: "gpt-4",
316+ requestOptions: {
317+ headers: {
318+ Authorization: "Bearer model-token",
319+ Accept: "application/json", // Should override config Accept
320+ "X-Model-Specific": "true",
321+ },
322+ },
323+ };
324+
325+ const configWithMoreHeaders = {
326+ ...mockConfig,
327+ requestOptions: {
328+ ...mockConfig.requestOptions!,
329+ headers: {
330+ ...mockConfig.requestOptions!.headers,
331+ Accept: "text/plain", // Should be overridden by model
332+ "Cache-Control": "no-cache",
333+ },
334+ },
335+ };
336+
337+ const result = await llmsFromModelConfig({
338+ model,
339+ uniqueId: "test-id",
340+ llmLogger: mockLLMLogger,
341+ config: configWithMoreHeaders,
342+ });
343+
344+ expect(result).toHaveLength(1);
345+ const llm = result[0];
346+
347+ expect(llm.requestOptions?.headers).toEqual({
348+ "User-Agent": "Continue/1.0.0", // from global request options
349+ "Cache-Control": "no-cache", // from global request options
350+ Authorization: "Bearer model-token", // from model
351+ Accept: "application/json", // from model (overrides config)
352+ "X-Model-Specific": "true", // from model
353+ });
354+ });
355+});
modified core/core.ts +6 −0
@@ -18,6 +18,7 @@
1818 import DocsService from "./indexing/docs/DocsService";
1919 import { countTokens } from "./llm/countTokens";
2020 import Ollama from "./llm/llms/Ollama";
21+import Lemonade from "./llm/llms/Lemonade";
2122 import { EditAggregator } from "./nextEdit/context/aggregateEdits";
2223 import { createNewPromptFileV2 } from "./promptFiles/createNewPromptFile";
2324 import { callTool } from "./tools/callTool";
@@ -1263,6 +1264,9 @@
12631264 if (msg.data.title === "Ollama") {
12641265 const models = await new Ollama({ model: "" }).listModels();
12651266 return models;
1267+ } else if (msg.data.title === "Lemonade") {
1268+ const models = await new Lemonade({ model: "" }).listModels();
1269+ return models;
12661270 } else {
12671271 return undefined;
12681272 }
@@ -1348,6 +1352,8 @@
13481352 selectedCode,
13491353 reranker: config.selectedModelByRole.rerank,
13501354 fetch: (url, init) =>
1355+ // Important note: context providers fetch uses global request options not LLM request options
1356+ // Because LLM calls are handled separately
13511357 fetchwithRequestOptions(url, init, config.requestOptions),
13521358 isInAgentMode: msg.data.isInAgentMode,
13531359 });
modified core/index.d.ts +2 −0
@@ -1099,6 +1099,7 @@
10991099 exampleArgs?: Array<[string, string | number]>;
11001100 };
11011101 defaultToolPolicy?: ToolPolicy;
1102+ toolCallIcon?: string;
11021103 evaluateToolCallPolicy?: (
11031104 basePolicy: ToolPolicy,
11041105 parsedArgs: Record<string, unknown>,
@@ -1281,6 +1282,7 @@
12811282 transport: TransportOptions;
12821283 faviconUrl?: string;
12831284 timeout?: number;
1285+ requestOptions?: RequestOptions;
12841286 }
12851287
12861288 export type MCPConnectionStatus =
modified core/indexing/ignore.ts +7 −0
@@ -203,6 +203,13 @@
203203 ...ADDITIONAL_INDEXING_IGNORE_DIRS,
204204 ];
205205
206+export const DEFAULT_IGNORES = [
207+ ...DEFAULT_IGNORE_FILETYPES,
208+ ...DEFAULT_IGNORE_DIRS,
209+];
210+
211+export const defaultIgnoresGlob = `!{${DEFAULT_IGNORES.join(",")}}`;
212+
206213 // Create ignore instances
207214 export const defaultSecurityIgnoreFile = ignore().add(
208215 DEFAULT_SECURITY_IGNORE_FILETYPES,
modified core/llm/autodetect.ts +2 −0
@@ -45,6 +45,7 @@
4545
4646 const PROVIDER_HANDLES_TEMPLATING: string[] = [
4747 "lmstudio",
48+ "lemonade",
4849 "openai",
4950 "nvidia",
5051 "ollama",
@@ -67,6 +68,7 @@
6768 const PROVIDER_SUPPORTS_IMAGES: string[] = [
6869 "openai",
6970 "ollama",
71+ "lemonade",
7072 "cohere",
7173 "gemini",
7274 "msty",
modified core/llm/countTokens.ts +1 −1
@@ -85,7 +85,7 @@
8585
8686 function countImageTokens(content: MessagePart): number {
8787 if (content.type === "imageUrl") {
88- return 85;
88+ return 1024;
8989 }
9090 throw new Error("Non-image content type");
9191 }
modified core/llm/index.ts +22 −7
@@ -30,6 +30,7 @@
3030 TemplateType,
3131 Usage,
3232 } from "../index.js";
33+import { isLemonadeInstalled } from "../util/lemonadeHelper.js";
3334 import { Logger } from "../util/Logger.js";
3435 import mergeJson from "../util/merge.js";
3536 import { renderChatMessage } from "../util/messageContent.js";
@@ -503,6 +504,24 @@
503504 : "Unable to connect to local Ollama instance. Ollama may not be installed or may not running.";
504505 throw new Error(message);
505506 }
507+ if (
508+ e.code === "ECONNREFUSED" &&
509+ e.message.includes("http://localhost:8000")
510+ ) {
511+ const isInstalled = await isLemonadeInstalled();
512+ let message: string;
513+ if (process.platform === "linux") {
514+ // On Linux, isLemonadeInstalled checks if it's running (via health endpoint)
515+ message =
516+ "Unable to connect to local Lemonade instance. Please ensure Lemonade is running. Visit http://lemonade-server.ai for setup instructions.";
517+ } else {
518+ // On Windows, we can check if it's installed
519+ message = isInstalled
520+ ? "Unable to connect to local Lemonade instance. Lemonade server may not be running."
521+ : "Unable to connect to local Lemonade instance. Lemonade may not be installed or may not be running.";
522+ }
523+ throw new Error(message);
524+ }
506525 }
507526 throw e;
508527 }
@@ -537,18 +556,14 @@
537556 }
538557
539558 private _formatChatMessage(msg: ChatMessage): string {
540- let contentToShow = "";
541- if (msg.role === "tool") {
542- contentToShow = msg.content;
543- } else if (msg.role === "assistant" && msg.toolCalls?.length) {
544- contentToShow = msg.toolCalls
559+ let contentToShow = renderChatMessage(msg);
560+ if (msg.role === "assistant" && msg.toolCalls?.length) {
561+ contentToShow += msg.toolCalls
545562 ?.map(
546563 (toolCall) =>
547564 `${toolCall.function?.name}(${toolCall.function?.arguments})`,
548565 )
549566 .join("\n");
550- } else if ("content" in msg) {
551- contentToShow = renderChatMessage(msg);
552567 }
553568
554569 return `<${msg.role}>\n${contentToShow}\n\n`;
modified core/llm/llms/Anthropic.ts +31 −6
@@ -68,6 +68,17 @@
6868 return finalOptions;
6969 }
7070
71+ private buildTextPart(text: string, addCaching: boolean) {
72+ const part: any = {
73+ type: "text",
74+ text,
75+ };
76+ if (addCaching) {
77+ part.cache_control = { type: "ephemeral" };
78+ }
79+ return part;
80+ }
81+
7182 private convertMessage(message: ChatMessage, addCaching: boolean): any {
7283 if (message.role === "tool") {
7384 return {
@@ -81,14 +92,30 @@
8192 ],
8293 };
8394 } else if (message.role === "assistant" && message.toolCalls) {
84- return {
85- role: "assistant",
86- content: message.toolCalls.map((toolCall) => ({
95+ const parts: any[] = [];
96+ if (message.content) {
97+ if (typeof message.content === "string") {
98+ parts.push(this.buildTextPart(message.content, addCaching));
99+ } else if (message.content.length > 0) {
100+ const textContent = message.content.filter((p) => p.type === "text");
101+ const textParts = textContent.map((part, idx) => {
102+ const cache = idx === textContent.length - 1 && addCaching;
103+ return this.buildTextPart(part.text, cache);
104+ });
105+ parts.push(...textParts);
106+ }
107+ }
108+ parts.push(
109+ ...message.toolCalls.map((toolCall) => ({
87110 type: "tool_use",
88111 id: toolCall.id,
89112 name: toolCall.function?.name,
90113 input: safeParseToolCallArgs(toolCall),
91114 })),
115+ );
116+ return {
117+ role: "assistant",
118+ content: parts,
92119 };
93120 } else if (message.role === "thinking" && !message.redactedThinking) {
94121 return {
@@ -154,9 +181,7 @@
154181
155182 public convertMessages(msgs: ChatMessage[]): any[] {
156183 // should be public for use within VertexAI
157- const filteredmessages = msgs.filter(
158- (m) => m.role !== "system" && !!m.content,
159- );
184+ const filteredmessages = msgs.filter((m) => m.role !== "system");
160185 const lastTwoUserMsgIndices = filteredmessages
161186 .map((msg, index) => (msg.role === "user" ? index : -1))
162187 .filter((index) => index !== -1)
added core/llm/llms/Lemonade.ts +12 −0
@@ -0,0 +1,12 @@
1+import { LLMOptions } from "../../index.js";
2+
3+import OpenAI from "./OpenAI.js";
4+
5+class Lemonade extends OpenAI {
6+ static providerName = "lemonade";
7+ static defaultOptions: Partial<LLMOptions> = {
8+ apiBase: "http://localhost:8000/api/v1/",
9+ };
10+}
11+
12+export default Lemonade;
modified core/llm/llms/Ollama.ts +5 −0
@@ -269,6 +269,11 @@
269269 return this.modelMap[this.model] ?? this.model;
270270 }
271271
272+ get contextLength() {
273+ const DEFAULT_OLLAMA_CONTEXT_LENGTH = 8192; // twice of https://github.com/ollama/ollama/blob/29ddfc2cab7f5a83a96c3133094f67b22e4f27d1/envconfig/config.go#L185
274+ return this._contextLength ?? DEFAULT_OLLAMA_CONTEXT_LENGTH;
275+ }
276+
272277 private _getModelFileParams(
273278 options: CompletionOptions,
274279 ): OllamaModelFileParams {
modified core/llm/llms/OpenAI.ts +1 −1
@@ -174,7 +174,7 @@
174174 protected _getHeaders() {
175175 return {
176176 "Content-Type": "application/json",
177- Authorization: `Bearer ${this.apiKey}`,
177+ ...(this.apiKey && { Authorization: `Bearer ${this.apiKey}` }),
178178 "api-key": this.apiKey ?? "", // For Azure
179179 };
180180 }
modified core/llm/llms/index.ts +2 −0
@@ -33,6 +33,7 @@
3333 import LlamaCpp from "./LlamaCpp";
3434 import Llamafile from "./Llamafile";
3535 import LlamaStack from "./LlamaStack";
36+import Lemonade from "./Lemonade";
3637 import LMStudio from "./LMStudio";
3738 import Mistral from "./Mistral";
3839 import MockLLM from "./Mock";
@@ -82,6 +83,7 @@
8283 LlamaCpp,
8384 OpenAI,
8485 OVHcloud,
86+ Lemonade,
8587 LMStudio,
8688 Mistral,
8789 Bedrock,
modified core/llm/streamChat.ts +1 −1
@@ -95,7 +95,7 @@
9595 ...init,
9696 signal: abortController.signal,
9797 },
98- config.requestOptions,
98+ model.requestOptions,
9999 ),
100100 completionOptions,
101101 abortController,
modified core/llm/toolSupport.ts +1 −2
@@ -374,9 +374,8 @@
374374 [/o[134]/],
375375 [/deepseek/, /r1|reasoner/],
376376 [/gemini/, /2\.5/, /pro/],
377- [/gpt/, /4/],
378377 [/gpt-5/],
379- [/claude/, /sonnet/, /3\.5|3\.7|3-5|3-7|-4/],
378+ [/claude/, /sonnet/, /3\.7|3-7|-4/],
380379 [/claude/, /opus/, /-4/],
381380 ];
382381 for (const combo of recs) {
modified core/package-lock.json +0 −0

Not shown: the file is larger than the hub shows, or this page holds as much as it shows. View the file.

modified core/tools/definitions/createRuleBlock.ts +1 −0
@@ -84,4 +84,5 @@
8484 ["alwaysApply", "false"],
8585 ],
8686 },
87+ toolCallIcon: "PencilIcon",
8788 };
modified core/tools/definitions/fetchUrlContent.ts +1 −0
@@ -30,4 +30,5 @@
3030 prefix: `To fetch the content of a URL, use the ${BuiltInToolNames.FetchUrlContent} tool. For example, to read the contents of a webpage, you might respond with:`,
3131 exampleArgs: [["url", "https://example.com"]],
3232 },
33+ toolCallIcon: "GlobeAltIcon",
3334 };
modified core/tools/definitions/globSearch.ts +2 −1
@@ -13,7 +13,7 @@
1313 function: {
1414 name: BuiltInToolNames.FileGlobSearch,
1515 description:
16- "Search for files recursively in the project using glob patterns. Supports ** for recursive directory search. Output may be truncated; use targeted patterns",
16+ "Search for files recursively in the project using glob patterns. Supports ** for recursive directory search. Will not show many build, cache, secrets dirs/files (can use ls tool instead). Output may be truncated; use targeted patterns",
1717 parameters: {
1818 type: "object",
1919 required: ["pattern"],
@@ -30,4 +30,5 @@
3030 prefix: `To return a list of files based on a glob search pattern, use the ${BuiltInToolNames.FileGlobSearch} tool`,
3131 exampleArgs: [["pattern", "*.py"]],
3232 },
33+ toolCallIcon: "MagnifyingGlassIcon",
3334 };
modified core/tools/definitions/grepSearch.ts +2 −1
@@ -13,7 +13,7 @@
1313 function: {
1414 name: BuiltInToolNames.GrepSearch,
1515 description:
16- "Perform a search over the repository using ripgrep. Output may be truncated, so use targeted queries",
16+ "Perform a search over the repository using ripgrep. Will not include results for many build, cache, secrets dirs/files. Output may be truncated, so use targeted queries",
1717 parameters: {
1818 type: "object",
1919 required: ["query"],
@@ -31,4 +31,5 @@
3131 prefix: `To perform a grep search within the project, call the ${BuiltInToolNames.GrepSearch} tool with the query pattern to match. For example:`,
3232 exampleArgs: [["query", ".*main_services.*"]],
3333 },
34+ toolCallIcon: "MagnifyingGlassIcon",
3435 };
modified core/tools/definitions/ls.ts +1 −0
@@ -38,4 +38,5 @@
3838 ["recursive", "false"],
3939 ],
4040 },
41+ toolCallIcon: "FolderIcon",
4142 };
modified core/tools/definitions/readCurrentlyOpenFile.ts +1 −0
@@ -24,4 +24,5 @@
2424 prefix: `To view the user's currently open file, use the ${BuiltInToolNames.ReadCurrentlyOpenFile} tool.
2525 If the user is asking about a file and you don't see any code, use this to check the current file`,
2626 },
27+ toolCallIcon: "DocumentTextIcon",
2728 };
modified core/tools/definitions/readFile.ts +1 −0
@@ -31,4 +31,5 @@
3131 exampleArgs: [["filepath", "path/to/the_file.txt"]],
3232 },
3333 defaultToolPolicy: "allowedWithoutPermission",
34+ toolCallIcon: "DocumentIcon",
3435 };
modified core/tools/definitions/readFileRange.ts +1 −0
@@ -48,4 +48,5 @@
4848 ],
4949 },
5050 defaultToolPolicy: "allowedWithoutPermission",
51+ toolCallIcon: "DocumentIcon",
5152 };
modified core/tools/definitions/searchWeb.ts +1 −0
@@ -30,4 +30,5 @@
3030 prefix: `To search the web, use the ${BuiltInToolNames.SearchWeb} tool with a natural language query. For example, to search for the current weather, you would respond with:`,
3131 exampleArgs: [["query", "What is the current weather in San Francisco?"]],
3232 },
33+ toolCallIcon: "GlobeAltIcon",
3334 };
modified core/tools/definitions/viewDiff.ts +1 −0
@@ -23,4 +23,5 @@
2323 prefix: `To view the current git diff, use the ${BuiltInToolNames.ViewDiff} tool. This will show you the changes made in the working directory compared to the last commit.`,
2424 },
2525 defaultToolPolicy: "allowedWithoutPermission",
26+ toolCallIcon: "CodeBracketIcon",
2627 };
modified core/tools/definitions/viewRepoMap.ts +1 −0
@@ -23,4 +23,5 @@
2323 prefix: `To view the repository map, use the ${BuiltInToolNames.ViewRepoMap} tool. This will provide a visual representation of the project's structure and organization.`,
2424 },
2525 defaultToolPolicy: "allowedWithPermission",
26+ toolCallIcon: "MapIcon",
2627 };
modified core/tools/definitions/viewSubdirectory.ts +1 −0
@@ -30,4 +30,5 @@
3030 exampleArgs: [["directory_path", "path/to/subdirectory"]],
3131 },
3232 defaultToolPolicy: "allowedWithPermission",
33+ toolCallIcon: "FolderOpenIcon",
3334 };
modified core/tools/index.ts +2 −1
@@ -1,4 +1,5 @@
11 import { ConfigDependentToolParams, Tool } from "..";
2+import { isRecommendedAgentModel } from "../llm/toolSupport";
23 import * as toolDefinitions from "./definitions";
34
45 // I'm writing these as functions because we've messed up 3 TIMES by pushing to const, causing duplicate tool definitions on subsequent config loads.
@@ -36,7 +37,7 @@
3637 );
3738 }
3839
39- if (modelName?.includes("claude") || modelName?.includes("gpt-5")) {
40+ if (modelName && isRecommendedAgentModel(modelName)) {
4041 tools.push(toolDefinitions.multiEditTool);
4142 } else {
4243 tools.push(toolDefinitions.editFileTool);
added core/util/lemonadeHelper.ts +59 −0
@@ -0,0 +1,59 @@
1+import { exec } from "node:child_process";
2+import { IDE } from "..";
3+
4+export async function isLemonadeInstalled(): Promise<boolean> {
5+ // On Windows, check if lemonade-server command exists
6+ if (process.platform === "win32") {
7+ return new Promise((resolve, _reject) => {
8+ exec("where.exe lemonade-server", (error, _stdout, _stderr) => {
9+ resolve(!error);
10+ });
11+ });
12+ }
13+
14+ // On Linux, check if the health endpoint is accessible
15+ try {
16+ const response = await fetch("http://localhost:8000/api/v1/health", {
17+ method: "GET",
18+ signal: AbortSignal.timeout(3000), // 3 second timeout
19+ });
20+
21+ if (response.ok) {
22+ const data = await response.json();
23+ return data.status === "ok";
24+ }
25+ return false;
26+ } catch {
27+ return false;
28+ }
29+}
30+
31+export async function startLocalLemonade(ide: IDE): Promise<any> {
32+ let startCommand: string | undefined;
33+
34+ switch (process.platform) {
35+ case "linux": // Linux
36+ // On Linux, direct users to start Lemonade manually
37+ return ide.showToast(
38+ "info",
39+ "Please start Lemonade manually. Visit https://lemonade-server.ai for instructions.",
40+ );
41+
42+ case "win32": // Windows
43+ startCommand = "lemonade-server serve\n";
44+ break;
45+
46+ default:
47+ return ide.showToast(
48+ "error",
49+ "Cannot start Lemonade: platform not supported!",
50+ );
51+ }
52+
53+ if (startCommand) {
54+ return ide.runCommand(startCommand, {
55+ reuseTerminal: true,
56+ terminalName: "Start Lemonade",
57+ });
58+ }
59+}
added docs/customize/model-providers/assets/tetrate-get-api-key.png +0 −0

Binary content is not shown. View the file.

modified docs/customize/model-providers/assets/tetrate-remix.png +0 −0

Not shown: the file is larger than the hub shows, or this page holds as much as it shows. View the file.

added docs/customize/model-providers/assets/tetrate-sign-in.png +0 −0

Binary content is not shown. View the file.

added docs/customize/model-providers/more/lemonade.mdx +81 −0
@@ -0,0 +1,81 @@
1+---
2+title: "Lemonade Server"
3+description: "Configure Lemonade Server with Continue for refreshingly fast local LLM inference on GPUs and NPUs"
4+---
5+
6+<Info>
7+ Get started with [Lemonade Server](https://lemonade-server.ai/) - Refreshingly fast LLMs on GPUs and NPUs with seamless Continue integration
8+</Info>
9+
10+## Overview
11+
12+Lemonade Server provides optimized local LLM inference with support for GPU and NPU hardware acceleration. It offers an OpenAI-compatible API that seamlessly integrates with Continue and other open-source platforms.
13+
14+## Installation
15+
16+Download and install Lemonade Server from [lemonade-server.ai](https://lemonade-server.ai/).
17+
18+## Configuration
19+
20+Lemonade Server is available directly in the Continue UI as a provider. You can select it from the model provider dropdown without manual configuration.
21+
22+### Option 1: Using the Continue UI (Recommended)
23+
24+1. Click on the model selector dropdown in Continue
25+2. Select "Add Model"
26+3. Choose "Lemonade Server" from the provider list
27+4. Continue will automatically configure the connection
28+
29+### Option 2: Manual Configuration
30+
31+If you need custom settings, you can manually configure Lemonade:
32+
33+<Tabs>
34+ <Tab title="YAML">
35+ ```yaml title="config.yaml"
36+ models:
37+ - name: Lemonade
38+ provider: lemonade
39+ model: <MODEL_NAME>
40+ apiBase: http://localhost:8000/api/v1/
41+ ```
42+ </Tab>
43+ <Tab title="JSON (Deprecated)">
44+ ```json title="config.json"
45+ {
46+ "models": [
47+ {
48+ "title": "Lemonade",
49+ "provider": "lemonade",
50+ "model": "<MODEL_NAME>",
51+ "apiBase": "http://localhost:8000/api/v1/"
52+ }
53+ ]
54+ }
55+ ```
56+ </Tab>
57+</Tabs>
58+
59+## Getting Started
60+
61+1. **Install Lemonade Server**: Download from [lemonade-server.ai](https://lemonade-server.ai/)
62+2. **Start the server**: Launch Lemonade Server (runs on `http://localhost:8000/api/v1/` by default)
63+3. **Add to Continue**: Select Lemonade Server from the model provider dropdown in Continue
64+4. **Load a model**: Choose your preferred model through the interface
65+
66+## Hardware Support
67+
68+Lemonade Server automatically detects and optimizes for available hardware:
69+- **NPU**: Neural Processing Unit acceleration for efficient inference
70+- **GPU**: Full GPU acceleration support
71+- **CPU**: Optimized CPU fallback when accelerators are unavailable
72+
73+## Key Features
74+
75+- OpenAI-compatible API for seamless integration
76+- Support for popular model formats
77+- Automatic hardware detection and optimization
78+- Integration with Continue, Open WebUI, Gaia, and AnythingLLM
79+- Active open-source community
80+
81+[View the source](https://github.com/continuedev/continue/blob/main/core/llm/llms/Lemonade.ts)
No newline at the end of the file
modified docs/customize/model-providers/top-level/tetrate_agent_router_service.mdx +226 −57
@@ -3,81 +3,250 @@
33 sidebarTitle: "Tetrate Agent Router Service"
44 slug: ../tetrate-agent-router-service
55 ---
6-
7-The **Tetrate Agent Router Service** provides a unified Gateway for accessing various AI models with fast inference capabilities as well as embedding services.
6+The **Tetrate Agent Router Service** provides a unified Gateway for accessing various AI models with fast inference capabilities.
87
98 This gateway acts as an intelligent router that can distribute requests across multiple model providers, offering enterprise-grade reliability and performance optimization.
109
11-## Getting Started
10+<Tip>
11+Want to get started quickly? Sign up for the [Tetrate Agent Router Service](https://router.tetrate.ai/) to get an API key, then use [Tetrate on Continue Hub](https://hub.continue.dev/tetrate) to get started fast.
12+</Tip>
1213
13-1. Obtain an API key from the [Agent Router Service portal](https://api.router.tetrate.ai/)
14-2. Configure Continue to use Agent Router Service as your model provider
14+## Setup
1515
16-## Configuring Models
16+<Steps>
17+<Step title="Sign in or sign up">
18+Visit the [Agent Router Service portal](https://router.tetrate.ai/) and create an account to get your API key
19+<img src="../assets/tetrate-sign-in.png" alt="Tetrate sign in page" style={{width: '250px', maxWidth: '100%'}} />
20+</Step>
1721
18-You can also quickly use models from Tetrate on the Cotninue Hub by visiting Tetrate on the Continue Hub [here](https://hub.continue.dev/tetrate). The easiest way if you don't see the model you want to use is to remix one of the models on the Tetrate page and change the model to the one you want to use.
22+<Step title="Get your API key">
23+Go to the [API keys page](https://router.tetrate.ai/api-keys) to get your key
24+<img src="../assets/tetrate-get-api-key.png" alt="Tetrate get API key" style={{width: '250px', maxWidth: '100%'}} />
25+</Step>
1926
20-![Remix a model from Tetrate on Continue Hub](../assets/tetrate-remix.png)
27+<Step title="Configure Continue">
28+- Choose a configuration method below.
29+- If you use the Continue VS Code extension, install version `>=1.2.3`.
30+</Step>
31+
32+</Steps>
2133
22-### Available Models
2334
24-Agent Router Service supports routing to various models.
25-Go to the [Agent Router Service model catalog](https://router.tetrate.ai/models) for a full list of supported models.
35+### Quickstart with Continue Hub
2636
27-## Configuration Options
37+Fastest way: use preconfigured models from Tetrate on Continue Hub
2838
29-As Agent Router Service is an OpenAI API compatible provider, you can configure it like any other OpenAI API compatible provider. Therefore you will be setting `provider: openai` and `apiBase: https://api.router.tetrate.ai/v1`.
39+<Steps>
40+<Step title="Browse models">
41+Open [Tetrate on Continue Hub](https://hub.continue.dev/tetrate) and pick a model (e.g., [Claude Sonnet 4](https://hub.continue.dev/tetrate/claude-sonnet-4))
42+</Step>
3043
31-Update your Continue configuration file (`~/.continue/config.yaml`) with your Agent Router Service API key:
44+<Step title="Use or remix">
45+Click "Use Model", or "Remix" to change the model ID if needed
46+</Step>
3247
33-### On your local machine
48+<Step title="Add your API key">
49+Add your API key to Continue. See [adding secrets in Continue Hub](/hub/secrets/secret-types) and [managing local secrets in the FAQ](/faqs#managing-local-secrets-and-environment-variables)
50+<Tip>
51+Add it as a Continue Hub secret named `TETRATE_API_KEY` to reuse across projects.
52+</Tip>
53+</Step>
54+</Steps>
3455
35-#### In your config.yaml
56+![Remix a model from Tetrate on Continue Hub](../assets/tetrate-remix.png)
3657
37-```yaml title="config.yaml"
58+<Info>
59+If a model is missing, remix a similar one and set the `model` field to the target ID.
60+</Info>
61+
62+### Configuration Methods
63+
64+<CardGroup cols={1}>
65+ <Card title="In Local Agent Configuration" icon="folder" vertical>
66+ Use a Tetrate model block from the Hub or define it directly in your local agent configuration.
67+ </Card>
68+ <Card title="Continue Hub" icon="cloud" vertical>
69+ Use a Tetrate model block from the Hub or define your own on the Hub.
70+ </Card>
71+ <Card title="Using Local Model Blocks" icon="file-lines" vertical>
72+ Create a local model block for reuse across agents without publishing it to the Hub.
73+ </Card>
74+</CardGroup>
75+
76+
77+### Configuration Examples
78+<Info>
79+**Click a tab** to see an example.
80+</Info>
81+<Tabs>
82+<Tab title="In Local Agent Configuration">
83+
84+**When to use**: Simple local setups (like using the VS Code extension) when you don't need shared or published blocks.
85+
86+Use a Tetrate model block from the Hub in your local agent configuration:
87+
88+```yaml title="~/.continue/config.yaml"
89+name: Local Agent
90+version: 1.0.0
91+schema: v1
3892 models:
39- - name: <MODEL_NAME>
40- provider: openai
41- model: <MODEL_ID>
42- apiKey: <TETRATE_API_KEY>
43- apiBase: https://api.router.tetrate.ai/v1
93+ - uses: tetrate/claude-sonnet-4
94+ with:
95+ TETRATE_API_KEY: ${{ secrets.TETRATE_API_KEY }}
96+context:
97+ - provider: code
98+ - provider: docs
99+ - provider: diff
100+ - provider: terminal
101+ - provider: problems
102+ - provider: folder
103+ - provider: codebase
44104 ```
45105
46-#### As a local model block
47-
48-Review the configuration reference for [model blocks](/reference#models) and using [local blocks](/reference#local-blocks). Ensure you look at the roles and capabilities section and review the [model capabilities guide](/customize/deep-dives/model-capabilities).
49-
50-```yaml title="model_name.yaml"
51- name: <MODEL_NAME>
52- models:
53- - name: <MODEL_NAME>
54- provider: openai
55- model: <MODEL_ID>
56- apiKey: ${{ inputs.TETRATE_API_KEY }}
57- apiBase: https://api.router.tetrate.ai/v1
58- roles:
59- - chat
60- - edit
61- - apply
62- capabilities:
63- - tool_use
106+Or define the model directly:
107+
108+```yaml title="~/.continue/config.yaml"
109+name: Local Agent
110+version: 1.0.0
111+schema: v1
112+models:
113+ - name: Claude Sonnet 4
114+ provider: tars
115+ model: claude-4-sonnet-20250514
116+ apiKey: ${{ secrets.TETRATE_API_KEY }}
117+ roles:
118+ - chat
119+ - edit
120+ - apply
121+ capabilities:
122+ - tool_use
123+context:
124+ - provider: code
125+ - provider: docs
126+ - provider: diff
127+ - provider: terminal
128+ - provider: problems
129+ - provider: folder
130+ - provider: codebase
131+```
132+</Tab>
133+<Tab title="Continue Hub">
134+**When to use**: Share configurations across teams or contribute to the community.
135+
136+**The Model Block:**
137+
138+```yaml title="tetrate/claude-sonnet-4"
139+name: Claude Sonnet 4
140+version: 1.0.14
141+schema: v1
142+models:
143+ - name: Claude Sonnet 4 - Tetrate
144+ provider: tars
145+ model: claude-4-sonnet-20250514
146+ apiKey: ${{ inputs.TETRATE_API_KEY }}
147+ roles:
148+ - chat
149+ - edit
150+ - apply
151+ capabilities:
152+ - tool_use
64153 ```
154+View the model block `tetrate/claude-sonnet-4` on the [Continue Hub](https://hub.continue.dev/tetrate/claude-sonnet-4).
65155
66-### On Model Block on Continue Hub
67-Learn how to use model blocks on Continue Hub [here](/hub/blocks/create-a-block).
68-
69-```yaml title="model_name.yaml"
70- name: <MODEL_NAME>
71- models:
72- - name: <MODEL_NAME>
73- provider: openai
74- model: <MODEL_ID>
75- apiKey: ${{ inputs.TETRATE_API_KEY }}
76- apiBase: https://api.router.tetrate.ai/v1
77- roles:
78- - chat
79- - edit
80- - apply
81- capabilities:
82- - tool_use
156+**Reference it in your Agent configuration:**
157+
158+```yaml title="my-agent"
159+name: My Agent
160+version: 1.0.0
161+schema: v1
162+models:
163+ - uses: tetrate/claude-sonnet-4
164+ with:
165+ TETRATE_API_KEY: ${{ secrets.TETRATE_API_KEY }}
166+context:
167+ - uses: continuedev/diff-context
168+ - uses: continuedev/terminal-context
169+ - uses: continuedev/file-context
170+```
171+<Tip>
172+To customize, see the [model block creation guide](/hub/blocks/create-a-block).
173+</Tip>
174+
175+</Tab>
176+
177+<Tab title="Using Local Model Blocks">
178+**When to use**: Reuse configurations across agents and keep them local or in GitHub (not on Continue Hub).
179+
180+**The Local Model Block:**
181+<Info>
182+Name the file `my-claude-4-model.yaml` so you can reference it in the Agent.
183+</Info>
184+
185+```yaml title="~/.continue/models/my-claude-4-model.yaml"
186+name: Claude Sonnet 4
187+version: 1.0.1
188+schema: v1
189+models:
190+ - name: Claude Sonnet 4
191+ provider: tars
192+ model: claude-4-sonnet-20250514
193+ apiKey: ${{ inputs.TETRATE_API_KEY }}
194+ roles:
195+ - chat
196+ - edit
197+ - apply
198+ capabilities:
199+ - tool_use
200+```
201+Reference it as `my-claude-4-model` in your Agent configuration:
202+
203+```yaml title="~/.continue/agents/simple-agent.yaml"
204+name: Simple Agent
205+version: 1.0.0
206+schema: v1
207+models:
208+ - uses: my-claude-4-model
209+ with:
210+ TETRATE_API_KEY: ${{ secrets.TETRATE_API_KEY }}
211+context:
212+ - uses: continuedev/diff-context
213+ - uses: continuedev/terminal-context
214+ - uses: continuedev/file-context
83215 ```
216+
217+<Tip>
218+Learn more about [model blocks](/reference#models) and [local blocks](/reference#local-blocks).
219+</Tip>
220+
221+</Tab>
222+</Tabs>
223+
224+---
225+
226+## Troubleshooting Common Issues
227+
228+<CardGroup cols={2}>
229+ <Card title="Invalid API key" icon="key" vertical>
230+ Verify your API key is active and has no extra spaces.
231+ </Card>
232+ <Card title="Model not found" icon="ban" href="https://router.tetrate.ai/models" vertical>
233+ Confirm the model ID matches the Tetrate catalog.
234+ </Card>
235+ <Card title="Slow responses" icon="code" vertical>
236+ Check your network or try a less-loaded model. Contact Tetrate support if issues persist.
237+ </Card>
238+ <Card title="Configuration not loading" icon="file-lines" vertical>
239+ Validate YAML syntax and review error messages in Continue. If using Hub, ensure the block is published.
240+ </Card>
241+</CardGroup>
242+
243+---
244+
245+## Join the Community
246+Connect with Tetrate and other builders for help and discussion.
247+
248+<CardGroup cols={1}>
249+ <Card title="Join the Tetrate Community" icon="slack" href="https://join.slack.com/t/tetrate-agent-router/shared_invite/zt-399tv7hjm-6YMXztGywTOQrMIolvEBNg">
250+Get answers, insights, and best practices for secure, scalable infrastructure
251+ </Card>
252+</CardGroup>
modified docs/docs.json +0 −4
@@ -360,10 +360,6 @@
360360 "source": "/hub/blocks",
361361 "destination": "/hub/blocks/intro"
362362 },
363- {
364- "source": "/hub/agents/intro",
365- "destination": "/hub/agents/intro"
366- },
367363 {
368364 "source": "/customize",
369365 "destination": "/customization/overview"
modified docs/reference.mdx +1 −0
@@ -403,6 +403,7 @@
403403 - `env`: An optional map of environment variables for the server process.
404404 - `cwd`: An optional working directory to run the command in. Can be absolute or relative path.
405405 - `connectionTimeout`: An optional connection timeout number to the server in milliseconds.
406+- `requestOptions`: Optional request options for `sse` and `streamable-http` servers. Same format as [model requestOptions](#models).
406407
407408 **Example:**
408409
modified extensions/cli/package.json +1 −1
@@ -37,7 +37,7 @@
3737 "license": "Apache-2.0",
3838 "repository": {
3939 "type": "git",
40- "url": "https://github.com/continuedev/cli.git"
40+ "url": "https://github.com/continuedev/continue.git"
4141 },
4242 "bugs": {
4343 "url": "https://github.com/continuedev/continue/issues"
modified extensions/cli/src/stream/streamChatResponse.ts +15 −0
@@ -16,9 +16,11 @@
1616 import { ToolCall } from "../tools/index.js";
1717 import {
1818 chatCompletionStreamWithBackoff,
19+ isContextLengthError,
1920 withExponentialBackoff,
2021 } from "../util/exponentialBackoff.js";
2122 import { logger } from "../util/logger.js";
23+import { validateContextLength } from "../util/tokenizer.js";
2224
2325 import { getAllTools, handleToolCalls } from "./handleToolCalls.js";
2426 import { handleAutoCompaction } from "./streamChatResponse.autoCompaction.js";
@@ -148,6 +150,12 @@
148150 tools,
149151 } = options;
150152
153+ // Validate context length before making the request
154+ const validation = validateContextLength(chatHistory, model);
155+ if (!validation.isValid) {
156+ throw new Error(`Context length validation failed: ${validation.error}`);
157+ }
158+
151159 // Get fresh system message and inject it
152160 const systemMessage = await systemMessageService.getSystemMessage();
153161 const openaiChatHistory = convertFromUnifiedHistoryWithSystemMessage(
@@ -277,6 +285,13 @@
277285 shouldContinue: false,
278286 };
279287 }
288+
289+ // Handle context length errors with helpful message
290+ if (isContextLengthError(error)) {
291+ logger.debug(`Context length exceeded: ${error}`);
292+ throw new Error(`Context length exceeded: ${error}`);
293+ }
294+
280295 throw error;
281296 }
282297
modified extensions/cli/src/util/exponentialBackoff.ts +30 −0
@@ -77,10 +77,40 @@
7777 );
7878 }
7979
80+/**
81+ * Checks if the error indicates a context length issue (non-retryable)
82+ */
83+export function isContextLengthError(error: any): boolean {
84+ const errorMessage = error.message?.toLowerCase() || "";
85+ const contextLengthPatterns = [
86+ // Anthropic Claude
87+ "input length and max_tokens exceed context limit",
88+ "decrease input length or max_tokens",
89+ // OpenAI
90+ "maximum context length",
91+ "reduce the length of the messages",
92+ // Mistral
93+ "tokens in the prompt exceeds",
94+ "use a shorter prompt",
95+ // Generic patterns
96+ "context_length_exceeded",
97+ "invalid_request_error",
98+ ];
99+
100+ return contextLengthPatterns.some((pattern) =>
101+ errorMessage.includes(pattern),
102+ );
103+}
104+
80105 /**
81106 * Determines if an error is retryable based on the error type and status code
82107 */
83108 function isRetryableError(error: any): boolean {
109+ // Context length errors are never retryable - they need user intervention
110+ if (isContextLengthError(error)) {
111+ return false;
112+ }
113+
84114 // Network errors are retryable
85115 if (isNetworkError(error)) {
86116 return true;
added extensions/cli/src/util/tokenizer.contextValidation.test.ts +62 −0
@@ -0,0 +1,62 @@
1+import { ModelConfig } from "@continuedev/config-yaml";
2+import { describe, expect, it } from "vitest";
3+
4+import { validateContextLength } from "./tokenizer.js";
5+
6+describe("validateContextLength", () => {
7+ const createMockModel = (
8+ contextLength: number,
9+ maxTokens?: number,
10+ ): ModelConfig => ({
11+ name: "test-model",
12+ model: "test",
13+ provider: "openai",
14+ defaultCompletionOptions: {
15+ contextLength,
16+ maxTokens,
17+ },
18+ });
19+
20+ const createMockHistory = (messageCount: number, contentLength = 100) => {
21+ return Array.from({ length: messageCount }, (_, i) => ({
22+ message: {
23+ role: "user" as const,
24+ content: "x".repeat(contentLength), // Roughly contentLength/4 tokens
25+ },
26+ contextItems: [],
27+ }));
28+ };
29+
30+ it("should pass validation when within context limits", () => {
31+ const model = createMockModel(1000, 200);
32+ const chatHistory = createMockHistory(5, 40); // ~50 tokens total
33+
34+ const result = validateContextLength(chatHistory, model);
35+
36+ expect(result.isValid).toBe(true);
37+ expect(result.error).toBeUndefined();
38+ });
39+
40+ it("should fail validation when input + maxTokens exceeds context limit", () => {
41+ const model = createMockModel(1000, 800);
42+ const chatHistory = createMockHistory(20, 100); // ~500+ tokens
43+
44+ const result = validateContextLength(chatHistory, model);
45+
46+ expect(result.isValid).toBe(false);
47+ expect(result.error).toContain("Context length exceeded");
48+ expect(result.error).toContain("input");
49+ expect(result.error).toContain("max_tokens");
50+ expect(result.error).toContain("context_limit");
51+ });
52+
53+ it("should handle large models with appropriate scaling", () => {
54+ const model = createMockModel(200_000, 64_000); // Claude-like model
55+ const chatHistory = createMockHistory(100, 1000); // Large conversation
56+
57+ const result = validateContextLength(chatHistory, model);
58+
59+ expect(result.contextLimit).toBe(200_000);
60+ expect(result.maxTokens).toBe(64_000);
61+ });
62+});
modified extensions/cli/src/util/tokenizer.test.ts +2 −2
@@ -78,14 +78,14 @@
7878 role: "user",
7979 content: [
8080 { type: "text", text: "Hello" }, // 5 chars -> ~2 tokens
81- { type: "imageUrl", imageUrl: { url: "test.jpg" } }, // +85 tokens
81+ { type: "imageUrl", imageUrl: { url: "test.jpg" } }, // +1024 tokens
8282 ],
8383 },
8484 contextItems: [],
8585 };
8686
8787 const tokenCount = countChatHistoryItemTokens(historyItem);
88- expect(tokenCount).toBe(89); // 2 + 85 + 2 role tokens
88+ expect(tokenCount).toBe(1028); // 2 + 1024 + 2 role tokens
8989 });
9090
9191 it("should count tokens for tool calls", () => {
modified extensions/cli/src/util/tokenizer.ts +44 −1
@@ -47,7 +47,7 @@
4747 // Images and other content types have their own token costs
4848 // but we'll use a rough estimate for now
4949 if (part.type === "imageUrl") {
50- tokenCount += 85; // Rough estimate for image tokens
50+ tokenCount += 1024; // Rough estimate for image tokens
5151 }
5252 }
5353 }
@@ -192,3 +192,46 @@
192192 const limit = getModelContextLimit(model);
193193 return `Approaching context limit (${(limit / 1000).toFixed(0)}K tokens). Auto-compacting chat history...`;
194194 }
195+
196+/**
197+ * Validates that the input tokens + max_tokens don't exceed context limit
198+ * @param chatHistory The chat history to validate
199+ * @param model The model configuration
200+ * @returns Validation result with error details if invalid
201+ */
202+export function validateContextLength(
203+ chatHistory: ChatHistoryItem[],
204+ model: ModelConfig,
205+): {
206+ isValid: boolean;
207+ error?: string;
208+ inputTokens?: number;
209+ contextLimit?: number;
210+ maxTokens?: number;
211+} {
212+ const inputTokens = countChatHistoryTokens(chatHistory);
213+ const contextLimit = getModelContextLimit(model);
214+ const maxTokens = model.defaultCompletionOptions?.maxTokens || 0;
215+
216+ // If maxTokens is not set, use 35% default reservation for output
217+ const reservedForOutput =
218+ maxTokens > 0 ? maxTokens : Math.ceil(contextLimit * 0.35);
219+ const totalRequired = inputTokens + reservedForOutput;
220+
221+ if (totalRequired > contextLimit) {
222+ return {
223+ isValid: false,
224+ error: `Context length exceeded: input (${inputTokens.toLocaleString()}) + max_tokens (${reservedForOutput.toLocaleString()}) = ${totalRequired.toLocaleString()} > context_limit (${contextLimit.toLocaleString()})`,
225+ inputTokens,
226+ contextLimit,
227+ maxTokens: reservedForOutput,
228+ };
229+ }
230+
231+ return {
232+ isValid: true,
233+ inputTokens,
234+ contextLimit,
235+ maxTokens: reservedForOutput,
236+ };
237+}
modified extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IntelliJIde.kt +82 −2
@@ -45,6 +45,76 @@
4545 private val continuePluginService: ContinuePluginService,
4646
4747 ) : IDE {
48+
49+ // Security-focused ignore patterns - should always be excluded for security reasons
50+ private val DEFAULT_SECURITY_IGNORE_FILETYPES = listOf(
51+ // Environment and configuration files with secrets
52+ "*.env", "*.env.*", ".env*", "config.json", "config.yaml", "config.yml",
53+ "settings.json", "appsettings.json", "appsettings.*.json",
54+
55+ // Certificate and key files
56+ "*.key", "*.pem", "*.p12", "*.pfx", "*.crt", "*.cer", "*.jks",
57+ "*.keystore", "*.truststore",
58+
59+ // Database files that may contain sensitive data
60+ "*.db", "*.sqlite", "*.sqlite3", "*.mdb", "*.accdb",
61+
62+ // Credential and secret files
63+ "*.secret", "*.secrets", "credentials", "credentials.*", "auth.json",
64+ "token", "token.*", "*.token",
65+
66+ // Backup files that might contain sensitive data
67+ "*.bak", "*.backup", "*.old", "*.orig",
68+
69+ // Docker secrets
70+ "docker-compose.override.yml", "docker-compose.override.yaml",
71+
72+ // SSH and GPG
73+ "id_rsa", "id_dsa", "id_ecdsa", "id_ed25519", "*.ppk", "*.gpg"
74+ )
75+
76+ private val DEFAULT_SECURITY_IGNORE_DIRS = listOf(
77+ // Environment and configuration directories
78+ ".env/", "env/",
79+
80+ // Cloud provider credential directories
81+ ".aws/", ".gcp/", ".azure/", ".kube/", ".docker/",
82+
83+ // Secret directories
84+ "secrets/", ".secrets/", "private/", ".private/", "certs/",
85+ "certificates/", "keys/", ".ssh/", ".gnupg/", ".gpg/",
86+
87+ // Temporary directories that might contain sensitive data
88+ "tmp/secrets/", "temp/secrets/", ".tmp/"
89+ )
90+
91+ // Additional non-security patterns for general indexing exclusion
92+ private val ADDITIONAL_SEARCH_IGNORE_FILETYPES = listOf(
93+ "*.DS_Store", "*-lock.json", "*.lock", "*.log", "*.ttf", "*.png",
94+ "*.jpg", "*.jpeg", "*.gif", "*.mp4", "*.svg", "*.ico", "*.pdf",
95+ "*.zip", "*.gz", "*.tar", "*.dmg", "*.tgz", "*.rar", "*.7z",
96+ "*.exe", "*.dll", "*.obj", "*.o", "*.o.d", "*.a", "*.lib",
97+ "*.so", "*.dylib", "*.ncb", "*.sdf", "*.woff", "*.woff2",
98+ "*.eot", "*.cur", "*.avi", "*.mpg", "*.mpeg", "*.mov", "*.mp3",
99+ "*.mkv", "*.webm", "*.jar", "*.onnx", "*.parquet", "*.pqt",
100+ "*.wav", "*.webp", "*.wasm", "*.plist", "*.profraw", "*.gcda",
101+ "*.gcno", "go.sum", "*.gitignore", "*.gitkeep", "*.continueignore",
102+ "*.csv", "*.uasset", "*.pdb", "*.bin", "*.pag", "*.swp", "*.jsonl"
103+ )
104+
105+ private val ADDITIONAL_SEARCH_IGNORE_DIRS = listOf(
106+ ".git/", ".svn/", "node_modules/", "dist/", "build/", "Build/",
107+ "target/", "out/", "bin/", ".pytest_cache/", ".vscode-test/",
108+ "__pycache__/", "site-packages/", ".gradle/", ".mvn/", ".cache/",
109+ "gems/", "vendor/", ".venv/", "venv/", ".vscode/", ".idea/", ".vs/",
110+ ".continue/"
111+ )
112+
113+ // Combined patterns for use in ripgrep
114+ private val DEFAULT_IGNORES = DEFAULT_SECURITY_IGNORE_FILETYPES +
115+ DEFAULT_SECURITY_IGNORE_DIRS +
116+ ADDITIONAL_SEARCH_IGNORE_FILETYPES +
117+ ADDITIONAL_SEARCH_IGNORE_DIRS
48118
49119 private val gitService = GitService(project, continuePluginService)
50120 private val fileUtils = FileUtils(project)
@@ -335,6 +405,9 @@
335405 val ideInfo = this.getIdeInfo()
336406 if (ideInfo.remoteName == "local") {
337407 try {
408+ // Create a single combined ignore pattern using glob brace expansion
409+ val defaultIgnorePattern = DEFAULT_IGNORES.joinToString(",") { it }
410+
338411 var commandArgs = mutableListOf<String>(
339412 ripgrep,
340413 "--files",
@@ -343,7 +416,9 @@
343416 "--ignore-file",
344417 ".continueignore",
345418 "--ignore-file",
346- ".gitignore"
419+ ".gitignore",
420+ "--glob",
421+ "!{${defaultIgnorePattern}}"
347422 )
348423 if (maxResults != null) {
349424 commandArgs.add("--max-count")
@@ -370,6 +445,9 @@
370445 val ideInfo = this.getIdeInfo()
371446 if (ideInfo.remoteName == "local") {
372447 try {
448+ // Create a single combined ignore pattern for ripgrep
449+ val defaultIgnorePattern = DEFAULT_IGNORES.joinToString(",") { it }
450+
373451 val commandArgs = mutableListOf(
374452 ripgrep,
375453 "-i",
@@ -379,7 +457,9 @@
379457 ".gitignore",
380458 "-C",
381459 "2",
382- "--heading"
460+ "--heading",
461+ "--glob",
462+ "!{${defaultIgnorePattern}}" // Exclude all default ignores using brace expansion
383463 )
384464
385465 // Conditionally add maxResults flag
modified extensions/vscode/package-lock.json +0 −0

Not shown: the file is larger than the hub shows, or this page holds as much as it shows. View the file.

modified extensions/vscode/src/VsCodeIde.ts +18 −1
@@ -3,6 +3,7 @@
33
44 import { Range } from "core";
55 import { EXTENSION_NAME } from "core/control-plane/env";
6+import { DEFAULT_IGNORES, defaultIgnoresGlob } from "core/indexing/ignore";
67 import * as URI from "uri-js";
78 import * as vscode from "vscode";
89
@@ -452,7 +453,9 @@
452453 resolve(output);
453454 } else if (code === 1) {
454455 // No matches
455- resolve("No matches found");
456+ resolve(
457+ "No matches found. Build, secrets, etc. dirs and files are not included.",
458+ );
456459 } else {
457460 reject(new Error(`Process exited with code ${code}`));
458461 }
@@ -464,6 +467,8 @@
464467 pattern: string,
465468 maxResults?: number,
466469 ): Promise<string[]> {
470+ // Create a single combined ignore pattern for ripgrep (calculated once)
471+
467472 if (vscode.env.remoteName) {
468473 // TODO better tests for this remote search implementation
469474 // throw new Error("Ripgrep not supported, this workspace is remote");
@@ -475,6 +480,11 @@
475480 );
476481
477482 const ignoreGlobs: Set<string> = new Set();
483+ // Add default ignores from core
484+ for (const pattern of DEFAULT_IGNORES) {
485+ ignoreGlobs.add(pattern);
486+ }
487+
478488 for (const file of ignoreFiles) {
479489 const content = await this.ideUtils.readFile(file);
480490 if (content === null) {
@@ -535,6 +545,7 @@
535545 return results.map((result) => vscode.workspace.asRelativePath(result));
536546 } else {
537547 const results: string[] = [];
548+ // Create a single combined ignore pattern using glob brace expansion
538549 for (const dir of await this.getWorkspaceDirs()) {
539550 const dirResults = await this.runRipgrepQuery(dir, [
540551 "--files",
@@ -544,6 +555,8 @@
544555 ".continueignore",
545556 "--ignore-file",
546557 ".gitignore",
558+ "--glob",
559+ defaultIgnoresGlob,
547560 ...(maxResults ? ["--max-count", String(maxResults)] : []),
548561 ]);
549562
@@ -566,6 +579,7 @@
566579 throw new Error("Ripgrep not supported, this workspace is remote");
567580 }
568581 const results: string[] = [];
582+
569583 for (const dir of await this.getWorkspaceDirs()) {
570584 const dirResults = await this.runRipgrepQuery(dir, [
571585 "-i", // Case-insensitive search
@@ -576,6 +590,9 @@
576590 "-C",
577591 "2", // Show 2 lines of context
578592 "--heading", // Only show filepath once per result
593+ // Use a single glob with all default ignores
594+ "--glob",
595+ defaultIgnoresGlob,
579596 ...(maxResults ? ["-m", maxResults.toString()] : []),
580597 "-e",
581598 query, // Pattern to search for
modified extensions/vscode/src/commands.ts +4 −0
@@ -9,6 +9,7 @@
99 import { walkDirAsync } from "core/indexing/walkDir";
1010 import { isModelInstaller } from "core/llm";
1111 import { startLocalOllama } from "core/util/ollamaHelper";
12+import { startLocalLemonade } from "core/util/lemonadeHelper";
1213 import { getConfigJsonPath, getConfigYamlPath } from "core/util/paths";
1314 import { Telemetry } from "core/util/posthog";
1415 import * as vscode from "vscode";
@@ -620,6 +621,9 @@
620621 "continue.startLocalOllama": () => {
621622 startLocalOllama(ide);
622623 },
624+ "continue.startLocalLemonade": () => {
625+ startLocalLemonade(ide);
626+ },
623627 "continue.installModel": async (
624628 modelName: string,
625629 llmProvider: ILLM | undefined,
modified extensions/vscode/src/diff/vertical/handler.ts +38 −0
@@ -76,6 +76,39 @@
7676 this.disposables.push(disposable);
7777 }
7878
79+ /** ensures the current target file is open and focused before performing edits*/
80+ private async ensureCurrentFileIsFocused() {
81+ const targetUri = this.editor.document.uri;
82+ const active = vscode.window.activeTextEditor;
83+ if (
84+ active &&
85+ URI.equal(active.document.uri.toString(), targetUri.toString())
86+ ) {
87+ this.editor = active;
88+ return;
89+ }
90+
91+ const visible = vscode.window.visibleTextEditors.find((foundEditor) =>
92+ URI.equal(foundEditor.document.uri.toString(), targetUri.toString()),
93+ );
94+ if (visible) {
95+ await vscode.window.showTextDocument(visible.document, {
96+ preview: false,
97+ preserveFocus: false,
98+ viewColumn: visible.viewColumn,
99+ });
100+ this.editor = vscode.window.activeTextEditor ?? visible;
101+ return;
102+ }
103+
104+ const doc = await vscode.workspace.openTextDocument(targetUri);
105+ const editor = await vscode.window.showTextDocument(doc, {
106+ preview: false,
107+ preserveFocus: false,
108+ });
109+ this.editor = editor;
110+ }
111+
79112 public get range(): vscode.Range {
80113 const startLine = Math.min(this.startLine, this.endLine);
81114 const endLine = Math.max(this.startLine, this.endLine);
@@ -296,6 +329,8 @@
296329 // Diff is messed up without this delay.
297330 await new Promise((resolve) => setTimeout(resolve, 100));
298331
332+ await this.ensureCurrentFileIsFocused();
333+
299334 // First, we reset the original diff by rejecting all pending diff blocks
300335 const blocks = this.editorToVerticalDiffCodeLens.get(this.fileUri) ?? [];
301336 for (const block of blocks.reverse()) {
@@ -443,6 +478,7 @@
443478 }
444479
445480 private async insertTextAboveLine(index: number, text: string) {
481+ await this.ensureCurrentFileIsFocused();
446482 await this.editor.edit(
447483 (editBuilder) => {
448484 const lineCount = this.editor.document.lineCount;
@@ -471,6 +507,7 @@
471507
472508 private async deleteLinesAt(index: number, numLines = 1) {
473509 const startLine = new vscode.Position(index, 0);
510+ await this.ensureCurrentFileIsFocused();
474511 await this.editor.edit(
475512 (editBuilder) => {
476513 editBuilder.delete(
@@ -482,6 +519,7 @@
482519 }
483520
484521 private async deleteRangeLines(ranges: vscode.Range[]) {
522+ await this.ensureCurrentFileIsFocused();
485523 await this.editor.edit(
486524 (editBuilder) => {
487525 for (const range of ranges) {
modified extensions/vscode/src/diff/vertical/manager.ts +1 −1
@@ -51,7 +51,7 @@
5151 this.fileUriToHandler.get(fileUri)?.clear(false);
5252 this.fileUriToHandler.delete(fileUri);
5353 }
54- const editor = vscode.window.activeTextEditor; // TODO might cause issues if user switches files
54+ const editor = vscode.window.activeTextEditor;
5555 if (editor && URI.equal(editor.document.uri.toString(), fileUri)) {
5656 const handler = new VerticalDiffHandler(
5757 startLine,
modified extensions/vscode/src/util/errorHandling.ts +29 −1
@@ -3,13 +3,41 @@
33 import * as vscode from "vscode";
44
55 /**
6- * @param error Handles common LLM errors. Currently only handles Ollama-related errors.
6+ * @param error Handles common LLM errors. Currently handles Ollama and Lemonade-related errors.
77 * @returns true if error is handled, false otherwise
88 */
99 export async function handleLLMError(error: unknown): Promise<boolean> {
1010 if (!error || !(error instanceof Error) || !error.message) {
1111 return false;
1212 }
13+
14+ // Handle Lemonade errors
15+ if (error.message.toLowerCase().includes("lemonade")) {
16+ let message: string = error.message;
17+ let options: string[] | undefined;
18+
19+ // For Windows, offer to start Lemonade if it's installed but not running
20+ if (
21+ process.platform === "win32" &&
22+ message.includes("Lemonade server may not be running")
23+ ) {
24+ options = ["Start Lemonade", "Setup Instructions"];
25+ } else {
26+ // For all other cases (Linux, not installed, etc.), direct to setup instructions
27+ options = ["Setup Instructions"];
28+ }
29+
30+ vscode.window.showErrorMessage(message, ...options).then((val) => {
31+ if (val === "Setup Instructions") {
32+ vscode.env.openExternal(vscode.Uri.parse("https://lemonade-server.ai"));
33+ } else if (val === "Start Lemonade") {
34+ vscode.commands.executeCommand("continue.startLocalLemonade");
35+ }
36+ });
37+ return true;
38+ }
39+
40+ // Handle Ollama errors
1341 if (!error.message.toLowerCase().includes("ollama")) {
1442 return false;
1543 }
modified extensions/vscode/src/webviewProtocol.ts +1 −1
@@ -107,7 +107,7 @@
107107
108108 if (e.cause) {
109109 if (e.cause.name === "ConnectTimeoutError") {
110- message = `Connection timed out. If you expect it to take a long time to connect, you can increase the timeout in config.json by setting "requestOptions": { "timeout": 10000 }. You can find the full config reference here: https://docs.continue.dev/reference/config`;
110+ message = `Connection timed out. If you expect it to take a long time to connect, you can increase the timeout in your config by setting "requestOptions": { "timeout": 10000 }. You can find the full config reference here: https://docs.continue.dev/reference/config`;
111111 } else if (e.cause.code === "ECONNREFUSED") {
112112 message = `Connection was refused. This likely means that there is no server running at the specified URL. If you are running your own server you may need to set the "apiBase" parameter in config.json. For example, you can set up an OpenAI-compatible server like here: https://docs.continue.dev/reference/Model%20Providers/openai#openai-compatible-servers--apis`;
113113 } else {
modified gui/package-lock.json +0 −0

Not shown: the file is larger than the hub shows, or this page holds as much as it shows. View the file.

added gui/public/logos/lemonade.png +0 −0

Binary content is not shown. View the file.

modified gui/src/components/AssistantAndOrgListbox/AssistantOption.tsx +19 −2
@@ -1,4 +1,7 @@
1-import { ExclamationTriangleIcon } from "@heroicons/react/24/outline";
1+import {
2+ Cog6ToothIcon,
3+ ExclamationTriangleIcon,
4+} from "@heroicons/react/24/outline";
25 import { ProfileDescription } from "core/config/ProfileLifecycleManager";
36 import { useContext, useMemo } from "react";
47 import { useNavigate } from "react-router-dom";
@@ -48,7 +51,7 @@
4851 disabled={hasFatalErrors}
4952 onClick={!hasFatalErrors ? handleOptionClick : undefined}
5053 fontSizeModifier={-2}
51- className={selected ? "bg-list-active text-list-active-foreground" : ""}
54+ className={`group ${selected ? "bg-list-active text-list-active-foreground" : ""}`}
5255 >
5356 <div className="flex w-full items-center justify-between gap-10 py-0.5">
5457 <div className="flex w-full items-center gap-3">
@@ -62,6 +65,20 @@
6265 </span>
6366 </div>
6467 <div className="flex flex-row items-center gap-1.5">
68+ <Button
69+ variant="ghost"
70+ size="sm"
71+ className="text-description-muted hover:enabled:text-foreground my-0 h-4 w-4 p-0 opacity-0 transition-opacity group-hover:opacity-100"
72+ onClick={(e) => {
73+ e.stopPropagation();
74+ ideMessenger.post("config/openProfile", {
75+ profileId: profile.id,
76+ });
77+ onClick(); // Close the listbox
78+ }}
79+ >
80+ <Cog6ToothIcon className="h-3.5 w-3.5" />
81+ </Button>
6582 {profile.errors && profile.errors?.length > 0 && (
6683 <ToolTip content="View errors">
6784 <Button
modified gui/src/components/AssistantAndOrgListbox/OrganizationOption.tsx +18 −4
@@ -1,14 +1,16 @@
1-import { CheckIcon } from "@heroicons/react/24/outline";
1+import { Cog6ToothIcon } from "@heroicons/react/24/outline";
22 import {
33 BuildingOfficeIcon,
44 UserCircleIcon,
55 UserIcon,
66 } from "@heroicons/react/24/solid";
77 import { useContext } from "react";
8+import { useNavigate } from "react-router-dom";
89 import { IdeMessengerContext } from "../../context/IdeMessenger";
910 import { useAppDispatch, useAppSelector } from "../../redux/hooks";
1011 import { setSelectedOrgId } from "../../redux/slices/profilesSlice";
11-import { ListboxOption } from "../ui";
12+import { CONFIG_ROUTES } from "../../util/navigation";
13+import { Button, ListboxOption } from "../ui";
1214
1315 interface OrganizationOptionProps {
1416 organization: { id: string; name: string; iconUrl?: string | null };
@@ -45,6 +47,7 @@
4547 onClose,
4648 }: OrganizationOptionProps) {
4749 const dispatch = useAppDispatch();
50+ const navigate = useNavigate();
4851 const ideMessenger = useContext(IdeMessengerContext);
4952 const selectedOrgId = useAppSelector(
5053 (state) => state.profiles.selectedOrganizationId,
@@ -64,7 +67,7 @@
6467 value={organization.id}
6568 onClick={handleOptionClick}
6669 fontSizeModifier={-2}
67- className={isSelected ? "bg-list-active text-list-active-foreground" : ""}
70+ className={`group ${isSelected ? "bg-list-active text-list-active-foreground" : ""}`}
6871 >
6972 <div className="flex w-full items-center justify-between gap-10 py-0.5">
7073 <div className="flex w-full items-center gap-3">
@@ -78,7 +81,18 @@
7881 </span>
7982 </div>
8083 <div className="flex flex-row items-center gap-1.5">
81- {isSelected && <CheckIcon className="h-3.5 w-3.5 flex-shrink-0" />}
84+ <Button
85+ variant="ghost"
86+ size="sm"
87+ className="text-description-muted hover:enabled:text-foreground my-0 h-4 w-4 p-0 opacity-0 transition-opacity group-hover:opacity-100"
88+ onClick={(e) => {
89+ e.stopPropagation();
90+ navigate(CONFIG_ROUTES.ORGANIZATIONS);
91+ onClose(); // Close the listbox
92+ }}
93+ >
94+ <Cog6ToothIcon className="h-3.5 w-3.5" />
95+ </Button>
8296 </div>
8397 </div>
8498 </ListboxOption>
modified gui/src/components/AssistantAndOrgListbox/index.tsx +2 −32
@@ -2,9 +2,7 @@
22 ArrowPathIcon,
33 ArrowRightStartOnRectangleIcon,
44 Cog6ToothIcon,
5- PencilIcon,
65 PlusIcon,
7- WrenchScrewdriverIcon,
86 } from "@heroicons/react/24/outline";
97 import { isOnPremSession } from "core/control-plane/AuthTypes";
108 import { useContext, useEffect, useRef } from "react";
@@ -155,7 +153,7 @@
155153 className="max-h-32 -translate-x-1.5 overflow-y-auto pb-0"
156154 style={{ zIndex: 200 }}
157155 >
158- <div className="flex items-center justify-between p-2">
156+ <div className="flex items-center justify-between px-1.5 py-1">
159157 <span className="text-description text-xs font-medium">
160158 Agents
161159 </span>
@@ -193,7 +191,7 @@
193191 {shouldRenderOrgInfo && (
194192 <>
195193 <Divider className="!mb-0.5 !mt-0" />
196- <div className="flex items-center justify-between p-2">
194+ <div className="flex items-center justify-between px-1.5 py-1">
197195 <span className="text-description text-xs font-medium">
198196 Organizations
199197 </span>
@@ -232,34 +230,6 @@
232230 {/* Settings Section */}
233231 {variant !== "sidebar" && (
234232 <div>
235- <Button
236- onClick={(e) => {
237- e.stopPropagation();
238- onRulesConfig();
239- }}
240- variant="ghost"
241- size="sm"
242- className="text-description hover:bg-input my-0 w-full justify-start py-1.5 pl-1 text-left"
243- >
244- <div className="flex w-full items-center">
245- <PencilIcon className="ml-1.5 mr-2 h-3.5 w-3.5 flex-shrink-0" />
246- <span className="text-2xs">Rules</span>
247- </div>
248- </Button>
249- <Button
250- onClick={(e) => {
251- e.stopPropagation();
252- onToolsConfig();
253- }}
254- variant="ghost"
255- size="sm"
256- className="text-description hover:bg-input my-0 w-full justify-start py-1.5 pl-1 text-left"
257- >
258- <div className="flex w-full items-center">
259- <WrenchScrewdriverIcon className="ml-1.5 mr-2 h-3.5 w-3.5 flex-shrink-0" />
260- <span className="text-2xs">Tools</span>
261- </div>
262- </Button>
263233 <Button
264234 onClick={(e) => {
265235 e.stopPropagation();
modified gui/src/components/mainInput/Lump/EditBlockButton.tsx +1 −1
@@ -6,7 +6,7 @@
66
77 type SectionKey = Exclude<
88 keyof ConfigYaml,
9- "name" | "version" | "schema" | "metadata" | "env"
9+ "name" | "version" | "schema" | "metadata" | "env" | "requestOptions"
1010 >;
1111
1212 interface EditBlockButtonProps<T extends SectionKey> {
modified gui/src/components/mainInput/Lump/LumpToolbar/BlockSettingsTopToolbar.tsx +77 −3
@@ -1,24 +1,45 @@
1-import { ExclamationTriangleIcon } from "@heroicons/react/24/outline";
1+import {
2+ CubeIcon,
3+ ExclamationTriangleIcon,
4+ PencilIcon,
5+ WrenchScrewdriverIcon,
6+} from "@heroicons/react/24/outline";
27 import { useContext, useEffect, useState } from "react";
38 import { useNavigate } from "react-router-dom";
49 import { IdeMessengerContext } from "../../../../context/IdeMessenger";
5-import { useAppSelector } from "../../../../redux/hooks";
10+import { useAppDispatch, useAppSelector } from "../../../../redux/hooks";
11+import {
12+ selectPendingToolCalls,
13+ selectToolCallsByStatus,
14+} from "../../../../redux/selectors/selectToolCalls";
15+import { setSelectedProfile } from "../../../../redux/slices/profilesSlice";
616 import FreeTrialButton from "../../../FreeTrialButton";
717 import { ToolTip } from "../../../gui/Tooltip";
18+import HoverItem from "../../InputToolbar/HoverItem";
819
920 import { usesFreeTrialApiKey } from "core/config/usesFreeTrialApiKey";
1021 import type { FreeTrialStatus } from "core/control-plane/client";
22+import { useAuth } from "../../../../context/Auth";
1123 import { getLocalStorage } from "../../../../util/localStorage";
1224 import { CONFIG_ROUTES } from "../../../../util/navigation";
1325 import { AssistantAndOrgListbox } from "../../../AssistantAndOrgListbox";
1426
1527 export function BlockSettingsTopToolbar() {
1628 const navigate = useNavigate();
29+ const dispatch = useAppDispatch();
30+ const { selectedProfile } = useAuth();
1731
1832 const configError = useAppSelector((store) => store.config.configError);
1933 const config = useAppSelector((state) => state.config.config);
2034 const ideMessenger = useContext(IdeMessengerContext);
2135
36+ const pendingToolCalls = useAppSelector(selectPendingToolCalls);
37+ const callingToolCalls = useAppSelector((state) =>
38+ selectToolCallsByStatus(state, "calling"),
39+ );
40+ const hasActiveContent =
41+ pendingToolCalls.length > 0 || callingToolCalls.length > 0;
42+
2243 const [freeTrialStatus, setFreeTrialStatus] =
2344 useState<FreeTrialStatus | null>(null);
2445 const hasExitedFreeTrial = getLocalStorage("hasExitedFreeTrial");
@@ -53,9 +74,39 @@
5374
5475 const shouldShowError = configError && configError?.length > 0;
5576
77+ const handleRulesClick = () => {
78+ if (selectedProfile) {
79+ dispatch(setSelectedProfile(selectedProfile.id));
80+ ideMessenger.post("didChangeSelectedProfile", {
81+ id: selectedProfile.id,
82+ });
83+ }
84+ navigate(CONFIG_ROUTES.RULES);
85+ };
86+
87+ const handleToolsClick = () => {
88+ if (selectedProfile) {
89+ dispatch(setSelectedProfile(selectedProfile.id));
90+ ideMessenger.post("didChangeSelectedProfile", {
91+ id: selectedProfile.id,
92+ });
93+ }
94+ navigate(CONFIG_ROUTES.TOOLS);
95+ };
96+
97+ const handleModelsClick = () => {
98+ if (selectedProfile) {
99+ dispatch(setSelectedProfile(selectedProfile.id));
100+ ideMessenger.post("didChangeSelectedProfile", {
101+ id: selectedProfile.id,
102+ });
103+ }
104+ navigate(CONFIG_ROUTES.MODELS);
105+ };
106+
56107 return (
57108 <div className="flex flex-1 items-center justify-between gap-1.5">
58- <div>
109+ <div className="flex items-center gap-1">
59110 {shouldShowError && (
60111 <ToolTip delayShow={700} content="View configuration errors">
61112 <div
@@ -78,7 +129,30 @@
78129 </div>
79130 </ToolTip>
80131 )}
132+
133+ {!hasActiveContent && (
134+ <div className="flex items-center gap-1.5">
135+ <ToolTip content="Configure rules">
136+ <HoverItem onClick={handleRulesClick} px={2}>
137+ <PencilIcon className="text-description-muted h-3 w-3 hover:brightness-125" />
138+ </HoverItem>
139+ </ToolTip>
140+
141+ <ToolTip content="Configure tools">
142+ <HoverItem onClick={handleToolsClick} px={2}>
143+ <WrenchScrewdriverIcon className="text-description-muted h-3 w-3 hover:brightness-125" />
144+ </HoverItem>
145+ </ToolTip>
146+
147+ <ToolTip content="Configure models">
148+ <HoverItem onClick={handleModelsClick} px={2}>
149+ <CubeIcon className="text-description-muted h-3 w-3 hover:brightness-125" />
150+ </HoverItem>
151+ </ToolTip>
152+ </div>
153+ )}
81154 </div>
155+
82156 <ToolTip
83157 place="top"
84158 content={isUsingFreeTrial ? "View free trial usage" : "Select Agent"}
modified gui/src/components/mainInput/TipTapEditor/TipTapEditor.tsx +17 −0
@@ -120,6 +120,23 @@
120120 }
121121 }, [props.isMainInput, isStreaming, editor]);
122122
123+ // Recovery mechanism: ensure historical inputs regain editability when streaming ends
124+ useEffect(() => {
125+ if (!isStreaming && !props.isMainInput && editor) {
126+ // Small delay to ensure editor state has settled after streaming transition
127+ const timeoutId = setTimeout(() => {
128+ if (editor && !editor.isDestroyed) {
129+ // Force re-enable the editor
130+ editor.setOptions({ editable: true });
131+ // Trigger view update to refresh editor state
132+ editor.view.dispatch(editor.state.tr);
133+ }
134+ }, 100);
135+
136+ return () => clearTimeout(timeoutId);
137+ }
138+ }, [isStreaming, props.isMainInput]);
139+
123140 const [showDragOverMsg, setShowDragOverMsg] = useState(false);
124141
125142 const [activeKey, setActiveKey] = useState<string | null>(null);
modified gui/src/components/modelSelection/ModelSelect.tsx +49 −32
@@ -1,6 +1,5 @@
11 import {
22 ArrowPathIcon,
3- CheckIcon,
43 ChevronDownIcon,
54 Cog6ToothIcon,
65 CubeIcon,
@@ -16,7 +15,9 @@
1615 import { updateSelectedModelByRole } from "../../redux/thunks/updateSelectedModelByRole";
1716 import { getMetaKeyLabel, isMetaEquivalentKeyPressed } from "../../util";
1817 import { CONFIG_ROUTES } from "../../util/navigation";
18+import { ToolTip } from "../gui/Tooltip";
1919 import {
20+ Button,
2021 Listbox,
2122 ListboxButton,
2223 ListboxOption,
@@ -57,6 +58,8 @@
5758 showMissingApiKeyMsg,
5859 isSelected,
5960 }: ModelOptionProps) {
61+ const navigate = useNavigate();
62+
6063 function handleOptionClick(e: any) {
6164 if (showMissingApiKeyMsg) {
6265 e.preventDefault();
@@ -64,12 +67,18 @@
6467 }
6568 }
6669
70+ function handleConfigureClick(e: React.MouseEvent) {
71+ e.stopPropagation();
72+ navigate(CONFIG_ROUTES.MODELS);
73+ }
74+
6775 return (
6876 <ListboxOption
6977 key={idx}
7078 disabled={showMissingApiKeyMsg}
7179 value={option.value}
7280 onClick={handleOptionClick}
81+ className={`group ${isSelected ? "bg-list-active text-list-active-foreground" : ""}`}
7382 >
7483 <div className="flex w-full items-center justify-between gap-5">
7584 <div className="flex items-center gap-2 py-0.5">
@@ -88,9 +97,14 @@
8897 )}
8998 </span>
9099 </div>
91- <CheckIcon
92- className={`h-3 w-3 flex-shrink-0 ${isSelected ? "" : "invisible"}`}
93- />
100+ <Button
101+ variant="ghost"
102+ size="sm"
103+ className="text-description-muted hover:enabled:text-foreground my-0 h-4 w-4 p-0 opacity-0 transition-opacity group-hover:opacity-100"
104+ onClick={handleConfigureClick}
105+ >
106+ <Cog6ToothIcon className="h-3.5 w-3.5" />
107+ </Button>
94108 </div>
95109 </ListboxOption>
96110 );
@@ -245,8 +259,21 @@
245259 />
246260 </ListboxButton>
247261 <ListboxOptions className="min-w-[160px]">
248- <div className="flex items-center justify-between gap-1 px-2 py-1">
249- <span className="text-description font-semibold">Models</span>
262+ <div className="flex items-center justify-between px-1.5 py-1">
263+ <span className="text-description text-xs font-medium">Models</span>
264+ <div className="flex items-center gap-0.5">
265+ <Button
266+ onClick={(e) => {
267+ e.stopPropagation();
268+ onClickConfigureModels(e);
269+ }}
270+ variant="ghost"
271+ size="sm"
272+ className="my-0 h-5 w-5 p-0"
273+ >
274+ <Cog6ToothIcon className="text-description h-3.5 w-3.5" />
275+ </Button>
276+ </div>
250277 </div>
251278
252279 <div className="no-scrollbar max-h-[300px] overflow-y-auto">
@@ -274,36 +301,26 @@
274301
275302 {!isConfigLoading && (
276303 <>
277- <Divider className="!mb-0" />
278-
279304 {selectedProfile?.profileType === "local" && (
280- <ListboxOption
281- key={options.length}
282- onClick={onClickAddModel}
283- value={"addModel" as any}
284- fontSizeModifier={-2}
285- className="px-2 py-2"
286- >
287- <span className="text-description text-2xs flex flex-row items-center">
288- <PlusIcon className="mr-1.5 h-3.5 w-3.5" />
289- Add Chat model
290- </span>
291- </ListboxOption>
305+ <>
306+ <Divider className="!mb-0" />
307+ <ListboxOption
308+ key={options.length}
309+ onClick={onClickAddModel}
310+ value={"addModel" as any}
311+ fontSizeModifier={-2}
312+ className="px-2 py-2"
313+ >
314+ <span className="text-description text-2xs flex flex-row items-center">
315+ <PlusIcon className="mr-1.5 h-3.5 w-3.5" />
316+ Add Chat model
317+ </span>
318+ </ListboxOption>
319+ </>
292320 )}
293321
294- <ListboxOption
295- value="configure-models"
296- fontSizeModifier={-2}
297- className="px-2 py-2"
298- onClick={onClickConfigureModels}
299- >
300- <span className="text-description text-2xs flex flex-row items-center">
301- <Cog6ToothIcon className="mr-1.5 h-3.5 w-3.5" />
302- Configure models
303- </span>
304- </ListboxOption>
305322 <Divider className="!my-0" />
306- <div className="text-description flex items-center justify-between gap-1.5 px-2 py-2">
323+ <div className="text-description flex items-center justify-start p-2">
307324 <span className="block" style={{ fontSize: tinyFont }}>
308325 <code>{getMetaKeyLabel()}'</code> to toggle model
309326 </span>
deleted gui/src/components/modelSelection/Toggle.tsx +0 −57
@@ -1,57 +0,0 @@
1-import styled from "styled-components";
2-import {
3- defaultBorderRadius,
4- lightGray,
5- vscInputBackground,
6- vscListActiveBackground,
7- vscListActiveForeground,
8-} from "..";
9-
10-const TopDiv = styled.div`
11- display: flex;
12- align-items: center;
13- text-align: center;
14- margin: auto;
15- width: fit-content;
16- cursor: pointer;
17-
18- border: 1px solid ${lightGray};
19-
20- background-color: ${vscInputBackground};
21- border-radius: ${defaultBorderRadius};
22-
23- &:hover {
24- background-color: ${lightGray}55;
25- }
26-`;
27-
28-const SubDiv = styled.div<{ selected: boolean }>`
29- text-align: center;
30- padding: 8px 12px;
31- border-radius: ${defaultBorderRadius};
32-
33- transition: all 0.2s ease-in-out;
34-
35- ${(props) =>
36- props.selected &&
37- `
38- background-color: ${vscListActiveBackground};
39- color: ${vscListActiveForeground};
40- `}
41-`;
42-
43-function Toggle(props: {
44- optionOne: string;
45- optionTwo: string;
46- selected: boolean;
47- onClick: () => void;
48-}) {
49- return (
50- <TopDiv onClick={props.onClick}>
51- <SubDiv selected={props.selected}>{props.optionOne}</SubDiv>
52- <SubDiv selected={!props.selected}>{props.optionTwo}</SubDiv>
53- </TopDiv>
54- );
55-}
56-
57-export default Toggle;
modified gui/src/pages/AddNewModel/configs/providers.ts +32 −0
@@ -566,6 +566,38 @@
566566 packages: [models.grokBeta],
567567 apiKeyUrl: "https://console.x.ai/",
568568 },
569+ lemonade: {
570+ title: "Lemonade",
571+ provider: "lemonade",
572+ description:
573+ "High-performance local LLM inference with AMD hardware optimization",
574+ longDescription:
575+ "Lemonade provides optimized local LLM inference with support for AMD NPU, GPU, and CPU acceleration. Visit [lemonade-server.ai](https://lemonade-server.ai/) for installation and setup instructions. Once the Lemonade server is running, you can begin using Continue with your local models.",
576+ icon: "lemonade.png",
577+ tags: [ModelProviderTags.Local, ModelProviderTags.OpenSource],
578+ params: {
579+ apiBase: "http://localhost:8000/api/v1/",
580+ },
581+ packages: [
582+ {
583+ ...models.AUTODETECT,
584+ params: {
585+ ...models.AUTODETECT.params,
586+ title: "Lemonade",
587+ },
588+ },
589+ ...openSourceModels,
590+ ],
591+ collectInputFor: [
592+ ...completionParamsInputsConfigs,
593+ {
594+ ...apiBaseInput,
595+ defaultValue: "http://localhost:8000/api/v1/",
596+ required: true,
597+ },
598+ ],
599+ downloadUrl: "http://lemonade-server.ai",
600+ },
569601 lmstudio: {
570602 title: "LM Studio",
571603 provider: "lmstudio",
modified gui/src/pages/config/index.tsx +4 −10
@@ -1,5 +1,5 @@
11 import { isOnPremSession } from "core/control-plane/AuthTypes";
2-import React, { useEffect, useState } from "react";
2+import React, { useState } from "react";
33 import { useNavigate, useSearchParams } from "react-router-dom";
44 import { AssistantAndOrgListbox } from "../../components/AssistantAndOrgListbox";
55 import Alert from "../../components/gui/Alert";
@@ -14,17 +14,11 @@
1414 useNavigationListener();
1515 const navigate = useNavigate();
1616 const [searchParams] = useSearchParams();
17- const [activeTab, setActiveTab] = useState("settings");
17+ const [activeTab, setActiveTab] = useState(() => {
18+ return searchParams.get("tab") || "settings";
19+ });
1820 const { session, organizations } = useAuth();
1921
20- // Set initial tab from URL parameter
21- useEffect(() => {
22- const tab = searchParams.get("tab");
23- if (tab) {
24- setActiveTab(tab);
25- }
26- }, [searchParams]);
27-
2822 const allTabs = getAllTabs();
2923 const shouldRenderOrgInfo =
3024 session && organizations.length > 1 && !isOnPremSession(session);
modified gui/src/pages/gui/ToolCallDiv/FindAndReplace.test.tsx +10 −3
@@ -19,9 +19,16 @@
1919 useFontSize: () => 14,
2020 }));
2121
22-vi.mock("../../../util/clientTools/findAndReplaceUtils", () => ({
23- performFindAndReplace: vi.fn(),
24-}));
22+vi.mock("../../../util/clientTools/findAndReplaceUtils", async () => {
23+ const actual = await vi.importActual(
24+ "../../../util/clientTools/findAndReplaceUtils",
25+ );
26+
27+ return {
28+ performFindAndReplace: vi.fn(),
29+ trimEmptyLines: actual.trimEmptyLines,
30+ };
31+});
2532
2633 vi.mock("./utils", () => ({
2734 getStatusIcon: vi.fn(() => <div data-testid="status-icon">✓</div>),
modified gui/src/pages/gui/ToolCallDiv/FindAndReplace.tsx +8 −3
@@ -13,7 +13,10 @@
1313 selectApplyStateByToolCallId,
1414 selectToolCallById,
1515 } from "../../../redux/selectors/selectToolCalls";
16-import { performFindAndReplace } from "../../../util/clientTools/findAndReplaceUtils";
16+import {
17+ performFindAndReplace,
18+ trimEmptyLines,
19+} from "../../../util/clientTools/findAndReplaceUtils";
1720 import { cn } from "../../../util/cn";
1821 import { getStatusIcon } from "./utils";
1922
@@ -313,14 +316,16 @@
313316 const showMiddleEllipses =
314317 !isFirst && !isLast && lines.length > MAX_SAME_LINES * 2 + 1;
315318
316- const startLines = showStartEllipsis
319+ let startLines = showStartEllipsis
317320 ? lines.slice(-MAX_SAME_LINES)
318321 : showMiddleEllipses || showEndEllipsis
319322 ? lines.slice(0, MAX_SAME_LINES)
320323 : lines;
321- const endLines = showMiddleEllipses
324+ startLines = trimEmptyLines({ lines: startLines, fromEnd: false });
325+ let endLines = showMiddleEllipses
322326 ? lines.slice(-MAX_SAME_LINES)
323327 : [];
328+ endLines = trimEmptyLines({ lines: endLines, fromEnd: true });
324329
325330 return (
326331 <div key={index}>
modified gui/src/pages/gui/ToolCallDiv/SimpleToolCallUI.tsx +0 −13
@@ -43,18 +43,6 @@
4343 }
4444 }
4545
46- function handleToggleClick() {
47- if (isToggleable) {
48- setOpen((prev) => !prev);
49- }
50- }
51-
52- function handleIconClick() {
53- if (isSingleItem) {
54- openContextItem(shownContextItems[0], ideMessenger);
55- }
56- }
57-
5846 return (
5947 <div className="mt-1 flex flex-col px-4">
6048 <div className="flex min-w-0 flex-row items-center justify-between gap-2">
@@ -69,7 +57,6 @@
6957 icon={Icon}
7058 isToggleable={isToggleable}
7159 open={shouldShowContent}
72- onClick={isToggleable ? handleToggleClick : handleIconClick}
7360 isClickable={isSingleItem}
7461 />
7562 <ToolCallStatusMessage tool={tool} toolCallState={toolCallState} />
modified gui/src/pages/gui/ToolCallDiv/index.tsx +9 −3
@@ -1,4 +1,7 @@
1-import { ArrowRightIcon } from "@heroicons/react/24/outline";
1+import {
2+ ArrowRightIcon,
3+ MagnifyingGlassIcon,
4+} from "@heroicons/react/24/outline";
25 import { ToolCallState } from "core";
36 import { BuiltInToolNames } from "core/tools/builtIn";
47 import { useState } from "react";
@@ -7,7 +10,7 @@
710 import { GroupedToolCallHeader } from "./GroupedToolCallHeader";
811 import { SimpleToolCallUI } from "./SimpleToolCallUI";
912 import { ToolCallDisplay } from "./ToolCallDisplay";
10-import { getStatusIcon, toolCallIcons } from "./utils";
13+import { getIconByName, getStatusIcon } from "./utils";
1114
1215 interface ToolCallDivProps {
1316 toolCallStates: ToolCallState[];
@@ -37,7 +40,10 @@
3740 (tool) => toolCallState.toolCall.function?.name === tool.function.name,
3841 );
3942 const functionName = toolCallState.toolCall.function?.name;
40- const icon = functionName && toolCallIcons[functionName];
43+ const icon =
44+ functionName && tool?.toolCallIcon
45+ ? getIconByName(tool.toolCallIcon)
46+ : undefined;
4147
4248 if (icon) {
4349 return (
modified gui/src/pages/gui/ToolCallDiv/utils.tsx +15 −32
@@ -1,25 +1,11 @@
1-import {
2- ArrowRightIcon,
3- CheckIcon,
4- CodeBracketIcon,
5- DocumentIcon,
6- DocumentTextIcon,
7- FolderIcon,
8- FolderOpenIcon,
9- GlobeAltIcon,
10- MagnifyingGlassIcon,
11- MapIcon,
12- PencilIcon,
13- XMarkIcon,
14-} from "@heroicons/react/24/outline";
1+import * as Icons from "@heroicons/react/24/outline";
152 import {
163 ContextItem,
174 ContextItemWithId,
185 ToolCallState,
196 ToolStatus,
207 } from "core";
21-import { BuiltInToolNames } from "core/tools/builtIn";
22-import { ComponentType } from "react";
8+import { ComponentType, SVGProps } from "react";
239 import { vscButtonBackground } from "../../../components";
2410 import Spinner from "../../../components/gui/Spinner";
2511
@@ -70,19 +56,16 @@
7056 return "Performing";
7157 }
7258
73-export const toolCallIcons: Record<string, ComponentType> = {
74- [BuiltInToolNames.FileGlobSearch]: MagnifyingGlassIcon,
75- [BuiltInToolNames.GrepSearch]: MagnifyingGlassIcon,
76- [BuiltInToolNames.LSTool]: FolderIcon,
77- [BuiltInToolNames.ReadCurrentlyOpenFile]: DocumentTextIcon,
78- [BuiltInToolNames.ReadFile]: DocumentIcon,
79- [BuiltInToolNames.FetchUrlContent]: GlobeAltIcon,
80- [BuiltInToolNames.SearchWeb]: GlobeAltIcon,
81- [BuiltInToolNames.ViewDiff]: CodeBracketIcon,
82- [BuiltInToolNames.ViewRepoMap]: MapIcon,
83- [BuiltInToolNames.ViewSubdirectory]: FolderOpenIcon,
84- [BuiltInToolNames.CreateRuleBlock]: PencilIcon,
85-};
59+type IconName = keyof typeof Icons;
60+
61+type Icon = ComponentType<SVGProps<SVGSVGElement>> | undefined;
62+
63+export function getIconByName(name: string): Icon | null {
64+ if (name in Icons) {
65+ return Icons[name as IconName] as Icon;
66+ }
67+ return null;
68+}
8669
8770 export function getStatusIcon(state: ToolStatus) {
8871 switch (state) {
@@ -90,12 +73,12 @@
9073 case "calling":
9174 return <Spinner />;
9275 case "generated":
93- return <ArrowRightIcon color={vscButtonBackground} />;
76+ return <Icons.ArrowRightIcon color={vscButtonBackground} />;
9477 case "done":
95- return <CheckIcon className="text-success" />;
78+ return <Icons.CheckIcon className="text-success" />;
9679 case "canceled":
9780 case "errored":
98- return <XMarkIcon className="text-error" />;
81+ return <Icons.XMarkIcon className="text-error" />;
9982 }
10083 }
10184
modified gui/src/util/clientTools/findAndReplaceUtils.test.ts +21 −0
@@ -4,6 +4,7 @@
44 EMPTY_NON_FIRST_EDIT_MESSAGE,
55 FOUND_MULTIPLE_FIND_STRINGS_ERROR,
66 performFindAndReplace,
7+ trimEmptyLines,
78 validateCreatingForMultiEdit,
89 validateSingleEdit,
910 } from "./findAndReplaceUtils";
@@ -454,3 +455,23 @@
454455 });
455456 });
456457 });
458+
459+describe("trimEmptyLines", () => {
460+ it("trims leading empty lines from start", () => {
461+ const input = ["", "", "a", "", "b"];
462+ const result = trimEmptyLines({ lines: input, fromEnd: false });
463+ expect(result).toEqual(["a", "", "b"]);
464+ });
465+
466+ it("trims trailing empty lines from end", () => {
467+ const input = ["a", "", "b", "", ""];
468+ const result = trimEmptyLines({ lines: input, fromEnd: true });
469+ expect(result).toEqual(["a", "", "b"]);
470+ });
471+
472+ it("returns empty array when all lines are empty", () => {
473+ const input = ["", "", ""];
474+ const result = trimEmptyLines({ lines: input, fromEnd: false });
475+ expect(result).toEqual([]);
476+ });
477+});
modified gui/src/util/clientTools/findAndReplaceUtils.ts +19 −0
@@ -95,3 +95,22 @@
9595
9696 return isCreating;
9797 }
98+
99+export function trimEmptyLines({
100+ lines,
101+ fromEnd,
102+}: {
103+ lines: string[];
104+ fromEnd: boolean;
105+}): string[] {
106+ lines = fromEnd ? lines.toReversed() : lines.slice();
107+ const newLines: string[] = [];
108+ let shouldContinueRemoving = true;
109+ for (let index = 0; index < lines.length; index++) {
110+ const line = lines[index];
111+ if (shouldContinueRemoving && line.trim() === "") continue;
112+ shouldContinueRemoving = false;
113+ newLines.push(line);
114+ }
115+ return fromEnd ? newLines.reverse() : newLines;
116+}
modified packages/config-yaml/package.json +1 −1
@@ -1,6 +1,6 @@
11 {
22 "name": "@continuedev/config-yaml",
3- "version": "1.14.0",
3+ "version": "1.17.0",
44 "description": "",
55 "main": "dist/index.js",
66 "types": "dist/index.d.ts",
modified packages/config-yaml/src/converter.ts +1 −0
@@ -193,6 +193,7 @@
193193 prompts,
194194 mcpServers,
195195 docs,
196+ requestOptions: configJson.requestOptions,
196197 };
197198
198199 return configYaml;
modified packages/config-yaml/src/interfaces/slugs.ts +11 −4
@@ -1,3 +1,5 @@
1+import os from "node:os";
2+
13 export interface PackageSlug {
24 ownerSlug: string;
35 packageSlug: string;
@@ -61,13 +63,18 @@
6163 fileUri: identifier.substring(7),
6264 };
6365 }
64- // Otherwise, it's a slug
65- else {
66+ // support ~ by replacing with home directory
67+ else if (identifier.startsWith("~")) {
6668 return {
67- uriType: "slug",
68- fullSlug: decodeFullSlug(identifier),
69+ uriType: "file",
70+ fileUri: identifier.replace("~", os.homedir()),
6971 };
7072 }
73+ // Otherwise, it's a slug
74+ return {
75+ uriType: "slug",
76+ fullSlug: decodeFullSlug(identifier),
77+ };
7178 }
7279
7380 export enum VirtualTags {
added packages/config-yaml/src/load/merge.test.ts +235 −0
@@ -0,0 +1,235 @@
1+import { describe, expect, it } from "@jest/globals";
2+import type { RequestOptions } from "../schemas/models.js";
3+import { mergeConfigYamlRequestOptions } from "./merge.js";
4+
5+describe("mergeConfigYamlRequestOptions", () => {
6+ it("should return undefined when both base and global are undefined", () => {
7+ const result = mergeConfigYamlRequestOptions(undefined, undefined);
8+ expect(result).toBeUndefined();
9+ });
10+
11+ it("should return global when base is undefined", () => {
12+ const global: RequestOptions = {
13+ timeout: 5000,
14+ verifySsl: true,
15+ headers: { Authorization: "Bearer token" },
16+ };
17+ const result = mergeConfigYamlRequestOptions(undefined, global);
18+ expect(result).toEqual(global);
19+ });
20+
21+ it("should return base when global is undefined", () => {
22+ const base: RequestOptions = {
23+ timeout: 3000,
24+ verifySsl: false,
25+ headers: { "X-Custom": "value" },
26+ };
27+ const result = mergeConfigYamlRequestOptions(base, undefined);
28+ expect(result).toEqual(base);
29+ });
30+
31+ it("should merge headers from both objects", () => {
32+ const base: RequestOptions = {
33+ headers: { "X-Base": "base-value", "X-Common": "base-common" },
34+ };
35+ const global: RequestOptions = {
36+ headers: { "X-Global": "global-value", "X-Common": "global-common" },
37+ };
38+ const result = mergeConfigYamlRequestOptions(base, global);
39+ expect(result?.headers).toEqual({
40+ "X-Global": "global-value",
41+ "X-Common": "base-common", // base overrides global
42+ "X-Base": "base-value",
43+ });
44+ });
45+
46+ it("should override simple values with base values", () => {
47+ const base: RequestOptions = {
48+ timeout: 3000,
49+ verifySsl: false,
50+ proxy: "http://base-proxy.com",
51+ };
52+ const global: RequestOptions = {
53+ timeout: 5000,
54+ verifySsl: true,
55+ proxy: "http://global-proxy.com",
56+ caBundlePath: "/path/to/ca",
57+ };
58+ const result = mergeConfigYamlRequestOptions(base, global);
59+ expect(result).toEqual({
60+ timeout: 3000, // base overrides
61+ verifySsl: false, // base overrides
62+ proxy: "http://base-proxy.com", // base overrides
63+ caBundlePath: "/path/to/ca", // only in global
64+ headers: undefined,
65+ });
66+ });
67+
68+ it("should handle noProxy array properly (base overrides)", () => {
69+ const base: RequestOptions = {
70+ noProxy: ["localhost", "127.0.0.1"],
71+ };
72+ const global: RequestOptions = {
73+ noProxy: ["192.168.1.1", "example.com"],
74+ };
75+ const result = mergeConfigYamlRequestOptions(base, global);
76+ expect(result?.noProxy).toEqual(["localhost", "127.0.0.1"]); // base overrides completely
77+ });
78+
79+ it("should handle extraBodyProperties (base overrides)", () => {
80+ const base: RequestOptions = {
81+ extraBodyProperties: { baseProp: "baseValue", common: "base" },
82+ };
83+ const global: RequestOptions = {
84+ extraBodyProperties: { globalProp: "globalValue", common: "global" },
85+ };
86+ const result = mergeConfigYamlRequestOptions(base, global);
87+ expect(result?.extraBodyProperties).toEqual({
88+ baseProp: "baseValue",
89+ common: "base",
90+ }); // base overrides completely
91+ });
92+
93+ it("should handle clientCertificate (base overrides)", () => {
94+ const base: RequestOptions = {
95+ clientCertificate: {
96+ cert: "base-cert",
97+ key: "base-key",
98+ passphrase: "base-pass",
99+ },
100+ };
101+ const global: RequestOptions = {
102+ clientCertificate: {
103+ cert: "global-cert",
104+ key: "global-key",
105+ },
106+ };
107+ const result = mergeConfigYamlRequestOptions(base, global);
108+ expect(result?.clientCertificate).toEqual({
109+ cert: "base-cert",
110+ key: "base-key",
111+ passphrase: "base-pass",
112+ }); // base overrides completely
113+ });
114+
115+ it("should return undefined headers when both have empty headers", () => {
116+ const base: RequestOptions = {
117+ headers: {},
118+ timeout: 1000,
119+ };
120+ const global: RequestOptions = {
121+ headers: {},
122+ verifySsl: true,
123+ };
124+ const result = mergeConfigYamlRequestOptions(base, global);
125+ expect(result?.headers).toBeUndefined();
126+ expect(result?.timeout).toBe(1000);
127+ expect(result?.verifySsl).toBe(true);
128+ });
129+
130+ it("should handle caBundlePath as string", () => {
131+ const base: RequestOptions = {
132+ caBundlePath: "/base/ca.pem",
133+ };
134+ const global: RequestOptions = {
135+ caBundlePath: "/global/ca.pem",
136+ };
137+ const result = mergeConfigYamlRequestOptions(base, global);
138+ expect(result?.caBundlePath).toBe("/base/ca.pem"); // base overrides
139+ });
140+
141+ it("should handle caBundlePath as array", () => {
142+ const base: RequestOptions = {
143+ caBundlePath: ["/base/ca1.pem", "/base/ca2.pem"],
144+ };
145+ const global: RequestOptions = {
146+ caBundlePath: ["/global/ca.pem"],
147+ };
148+ const result = mergeConfigYamlRequestOptions(base, global);
149+ expect(result?.caBundlePath).toEqual(["/base/ca1.pem", "/base/ca2.pem"]); // base overrides
150+ });
151+
152+ it("should preserve all fields from base when global has different fields", () => {
153+ const base: RequestOptions = {
154+ timeout: 3000,
155+ headers: { "X-Base": "value" },
156+ noProxy: ["localhost"],
157+ };
158+ const global: RequestOptions = {
159+ verifySsl: true,
160+ proxy: "http://proxy.com",
161+ caBundlePath: "/ca.pem",
162+ };
163+ const result = mergeConfigYamlRequestOptions(base, global);
164+ expect(result).toEqual({
165+ timeout: 3000,
166+ verifySsl: true,
167+ proxy: "http://proxy.com",
168+ caBundlePath: "/ca.pem",
169+ headers: { "X-Base": "value" },
170+ noProxy: ["localhost"],
171+ });
172+ });
173+
174+ it("should handle complex header merging scenario", () => {
175+ const base: RequestOptions = {
176+ headers: {
177+ Authorization: "Bearer base-token",
178+ "X-Custom-Header": "base-custom",
179+ "Content-Type": "application/json",
180+ },
181+ };
182+ const global: RequestOptions = {
183+ headers: {
184+ Authorization: "Bearer global-token",
185+ "X-Global-Header": "global-value",
186+ "Accept-Language": "en-US",
187+ },
188+ };
189+ const result = mergeConfigYamlRequestOptions(base, global);
190+ expect(result?.headers).toEqual({
191+ Authorization: "Bearer base-token", // base overrides
192+ "X-Global-Header": "global-value", // from global
193+ "Accept-Language": "en-US", // from global
194+ "X-Custom-Header": "base-custom", // from base
195+ "Content-Type": "application/json", // from base
196+ });
197+ });
198+
199+ it("should handle all possible fields", () => {
200+ const base: RequestOptions = {
201+ timeout: 1000,
202+ verifySsl: false,
203+ caBundlePath: ["/base/ca.pem"],
204+ proxy: "http://base-proxy.com",
205+ headers: { "X-Base": "base" },
206+ extraBodyProperties: { baseProp: true },
207+ noProxy: ["base.local"],
208+ clientCertificate: { cert: "base-cert", key: "base-key" },
209+ };
210+ const global: RequestOptions = {
211+ timeout: 2000,
212+ verifySsl: true,
213+ caBundlePath: ["/global/ca.pem"],
214+ proxy: "http://global-proxy.com",
215+ headers: { "X-Global": "global" },
216+ extraBodyProperties: { globalProp: false },
217+ noProxy: ["global.local"],
218+ clientCertificate: { cert: "global-cert", key: "global-key" },
219+ };
220+ const result = mergeConfigYamlRequestOptions(base, global);
221+ expect(result).toEqual({
222+ timeout: 1000, // base overrides
223+ verifySsl: false, // base overrides
224+ caBundlePath: ["/base/ca.pem"], // base overrides
225+ proxy: "http://base-proxy.com", // base overrides
226+ headers: {
227+ "X-Global": "global",
228+ "X-Base": "base",
229+ }, // merged
230+ extraBodyProperties: { baseProp: true }, // base overrides
231+ noProxy: ["base.local"], // base overrides
232+ clientCertificate: { cert: "base-cert", key: "base-key" }, // base overrides
233+ });
234+ });
235+});
modified packages/config-yaml/src/load/merge.ts +35 −0
@@ -1,3 +1,4 @@
1+import { RequestOptions } from "../browser.js";
12 import { AssistantUnrolled, ConfigYaml } from "../schemas/index.js";
23
34 export function mergePackages(
@@ -14,6 +15,10 @@
1415 prompts: [...(current.prompts ?? []), ...(incoming.prompts ?? [])],
1516 docs: [...(current.docs ?? []), ...(incoming.docs ?? [])],
1617 env: { ...current.env, ...incoming.env },
18+ requestOptions: mergeConfigYamlRequestOptions(
19+ current.requestOptions,
20+ incoming.requestOptions,
21+ ),
1722 };
1823 }
1924
@@ -31,5 +36,35 @@
3136 mcpServers: [...(current.mcpServers ?? []), ...(incoming.mcpServers ?? [])],
3237 prompts: [...(current.prompts ?? []), ...(incoming.prompts ?? [])],
3338 env: { ...current.env, ...incoming.env },
39+ requestOptions: mergeConfigYamlRequestOptions(
40+ current.requestOptions,
41+ incoming.requestOptions,
42+ ),
43+ };
44+}
45+
46+export function mergeConfigYamlRequestOptions(
47+ base: RequestOptions | undefined,
48+ global: RequestOptions | undefined,
49+): RequestOptions | undefined {
50+ if (!base && !global) {
51+ return undefined;
52+ }
53+ if (!base) {
54+ return global;
55+ }
56+ if (!global) {
57+ return base;
58+ }
59+
60+ const headers = {
61+ ...global.headers,
62+ ...base.headers,
63+ };
64+
65+ return {
66+ ...global,
67+ ...base, // base overrides for simple values as well as noProxy and extraBodyProperties
68+ headers: Object.keys(headers).length === 0 ? undefined : headers, // headers are the only thing that really merge
3469 };
3570 }
modified packages/config-yaml/src/load/unroll.ts +23 −3
@@ -1,5 +1,6 @@
11 import * as YAML from "yaml";
22 import { ZodError } from "zod";
3+import { mergeConfigYamlRequestOptions, RequestOptions } from "../browser.js";
34 import { PlatformClient, Registry } from "../interfaces/index.js";
45 import { encodeSecretLocation } from "../interfaces/SecretResult.js";
56 import {
@@ -203,6 +204,7 @@
203204 injectBlocks?: PackageIdentifier[];
204205 allowlistedBlocks?: PackageSlug[];
205206 blocklistedBlocks?: PackageSlug[];
207+ injectRequestOptions?: RequestOptions;
206208 }
207209
208210 export interface DoNotRenderSecretsUnrollAssistantOptions
@@ -274,6 +276,7 @@
274276 options.injectBlocks,
275277 options.allowlistedBlocks,
276278 options.blocklistedBlocks,
279+ options.injectRequestOptions,
277280 );
278281
279282 // Back to a string so we can fill in template variables
@@ -302,14 +305,14 @@
302305 const renderedYaml = renderTemplateData(templatedYaml, { secrets });
303306
304307 // Parse again and replace models with proxy versions where secrets weren't rendered
305- const finalConfig = useProxyForUnrenderedSecrets(
308+ const renderedConfig = useProxyForUnrenderedSecrets(
306309 parseAssistantUnrolled(renderedYaml),
307310 id,
308311 options.orgScopeId,
309312 options.onPremProxyUrl,
310313 );
311314
312- return { config: finalConfig, errors, configLoadInterrupted };
315+ return { config: renderedConfig, errors, configLoadInterrupted };
313316 }
314317
315318 function isPackageAllowed(
@@ -350,6 +353,7 @@
350353 injectBlocks: PackageIdentifier[] | undefined,
351354 allowlistedBlocks?: PackageSlug[],
352355 blocklistedBlocks?: PackageSlug[],
356+ injectRequestOptions?: RequestOptions,
353357 ): Promise<ConfigResult<AssistantUnrolled>> {
354358 const errors: ConfigValidationError[] = [];
355359
@@ -363,11 +367,27 @@
363367 const unrolledAssistant: AssistantUnrolled = {
364368 name: assistant.name,
365369 version: assistant.version,
370+ requestOptions: assistant.requestOptions,
366371 };
367372
373+ if (injectRequestOptions) {
374+ unrolledAssistant.requestOptions = mergeConfigYamlRequestOptions(
375+ assistant.requestOptions,
376+ injectRequestOptions,
377+ );
378+ } else {
379+ unrolledAssistant.requestOptions = assistant.requestOptions;
380+ }
381+
368382 const sections: (keyof Omit<
369383 ConfigYaml,
370- "name" | "version" | "rules" | "schema" | "metadata" | "env"
384+ | "name"
385+ | "version"
386+ | "rules"
387+ | "schema"
388+ | "metadata"
389+ | "env"
390+ | "requestOptions"
371391 >)[] = ["models", "context", "data", "mcpServers", "prompts", "docs"];
372392
373393 // Process all sections in parallel
modified packages/config-yaml/src/markdown/createMarkdownRule.ts +5 −0
@@ -36,6 +36,7 @@
3636 globs?: string | string[];
3737 regex?: string | string[];
3838 alwaysApply?: boolean;
39+ invokable?: boolean;
3940 } = {},
4041 ): string {
4142 const frontmatter: RuleFrontmatter = {};
@@ -54,6 +55,10 @@
5455 frontmatter.description = options.description.trim();
5556 }
5657
58+ if (options.invokable !== undefined) {
59+ frontmatter.invokable = options.invokable;
60+ }
61+
5762 if (options.alwaysApply !== undefined) {
5863 frontmatter.alwaysApply = options.alwaysApply;
5964 }
modified packages/config-yaml/src/schemas/index.ts +2 −0
@@ -117,6 +117,7 @@
117117 schema: z.string().optional(),
118118 metadata: z.record(z.string()).and(commonMetadataSchema.partial()).optional(),
119119 env: envRecord.optional(),
120+ requestOptions: requestOptionsSchema.optional(),
120121 });
121122
122123 const modelsUsesSchema = z
@@ -262,6 +263,7 @@
262263 api_base: z.string().optional(),
263264 api_key: z.string().optional(),
264265 env: envRecord.optional(),
266+ requestOptions: requestOptionsSchema.optional(),
265267 });
266268
267269 export type Config = z.infer<typeof configSchema>;
modified packages/continue-sdk/package-lock.json +2 −2
@@ -20,10 +20,10 @@
2020 },
2121 "../config-yaml": {
2222 "name": "@continuedev/config-yaml",
23- "version": "1.0.96",
23+ "version": "1.14.0",
2424 "license": "Apache-2.0",
2525 "dependencies": {
26- "@continuedev/config-types": "file:../config-types",
26+ "@continuedev/config-types": "^1.0.14",
2727 "yaml": "^2.6.1",
2828 "zod": "^3.24.2"
2929 },
modified packages/llm-info/src/providers/os.ts +1 −0
@@ -4,5 +4,6 @@
44 {
55 model: "starcoder2:3b",
66 displayName: "StarCoder 2 3B",
7+ contextLength: 8192,
78 },
89 ];
modified packages/openai-adapters/package-lock.json +0 −0

Not shown: the file is larger than the hub shows, or this page holds as much as it shows. View the file.

modified packages/openai-adapters/package.json +1 −1
@@ -1,6 +1,6 @@
11 {
22 "name": "@continuedev/openai-adapters",
3- "version": "1.14.0",
3+ "version": "1.15.0",
44 "description": "",
55 "main": "dist/index.js",
66 "types": "dist/index.d.ts",
modified packages/openai-adapters/src/apis/Anthropic.ts +23 −3
@@ -140,9 +140,25 @@
140140 ],
141141 };
142142 } else if (message.role === "assistant" && message.tool_calls) {
143- return {
144- role: "assistant",
145- content: message.tool_calls.map((toolCall) => {
143+ const parts: any[] = [];
144+ if (message.content) {
145+ if (typeof message.content === "string") {
146+ parts.push({
147+ type: "text",
148+ text: message.content,
149+ });
150+ } else if (message.content.length > 0) {
151+ parts.push(
152+ message.content.map((c) => ({
153+ type: "text",
154+ text: c.type === "text" ? c.text : c.refusal,
155+ })),
156+ );
157+ }
158+ }
159+
160+ parts.push(
161+ ...message.tool_calls.map((toolCall) => {
146162 // Type guard for function tool calls
147163 if (toolCall.type === "function" && "function" in toolCall) {
148164 return {
@@ -158,6 +174,10 @@
158174 throw new Error(`Unsupported tool call type: ${toolCall.type}`);
159175 }
160176 }),
177+ );
178+ return {
179+ role: "assistant",
180+ content: parts,
161181 };
162182 }
163183