Elffuss BraidHub

kikocis/continue public

Merge branch 'main' of https://github.com/continuedev/continue into fbricon/save-chat
Changeset2b8d1c29d506a9c1fb23b9f08e6181d9ad24a4448ad215fe49b4b5806cc87e9b
AuthorDallin Romney <dallinromney@gmail.com> · 2025-09-22 14:41 -07:00
CommitterDallin Romney <dallinromney@gmail.com> · 2025-09-22 14:41 -07:00
Parents0c0253914415, 89cedaf513f2

Browse the files at this changeset

21 files changed

modified .github/workflows/main.yaml +17 −17
@@ -26,8 +26,24 @@
2626 echo "should_run=false" >> $GITHUB_OUTPUT
2727 fi
2828
29+ check-version:
30+ runs-on: ubuntu-latest
31+ steps:
32+ - name: Checkout
33+ uses: actions/checkout@v5
34+ with:
35+ fetch-depth: 0 # This ensures all tags are fetched
36+
37+ - name: Checkout tag
38+ run: git checkout ${GITHUB_REF#refs/tags/}
39+
40+ - name: Make sure version isn't odd
41+ run: |
42+ cd extensions/vscode
43+ node scripts/versionCheck.js
44+
2945 build:
30- needs: check_release_name
46+ needs: [check_release_name, check-version]
3147 if: needs.check_release_name.outputs.should_run == 'true' || github.event_name == 'workflow_dispatch'
3248 runs-on: ${{ matrix.os }}
3349 strategy:
@@ -88,22 +104,6 @@
88104 name: ${{ matrix.platform }}-${{ matrix.arch }}-vsix
89105 path: "extensions/vscode/*.vsix"
90106
91- check-version:
92- runs-on: ubuntu-latest
93- steps:
94- - name: Checkout
95- uses: actions/checkout@v5
96- with:
97- fetch-depth: 0 # This ensures all tags are fetched
98-
99- - name: Checkout tag
100- run: git checkout ${GITHUB_REF#refs/tags/}
101-
102- - name: Make sure version isn't odd
103- run: |
104- cd extensions/vscode
105- node scripts/versionCheck.js
106-
107107 release:
108108 permissions:
109109 contents: write
modified core/context/mcp/MCPOauth.vitest.ts +3 −0
@@ -240,6 +240,7 @@
240240 transport: { type: "sse" as const, url: "https://server1.com" },
241241 status: "connected" as const,
242242 errors: [],
243+ infos: [],
243244 isProtectedResource: false,
244245 prompts: [],
245246 tools: [],
@@ -252,6 +253,7 @@
252253 transport: { type: "sse" as const, url: "https://server2.com" },
253254 status: "connected" as const,
254255 errors: [],
256+ infos: [],
255257 isProtectedResource: false,
256258 prompts: [],
257259 tools: [],
@@ -309,6 +311,7 @@
309311 transport: { type: "sse" as const, url: "" },
310312 status: "connected" as const,
311313 errors: [],
314+ infos: [],
312315 isProtectedResource: false,
313316 prompts: [],
314317 tools: [],
modified core/llm/llms/SambaNova.ts +4 −5
@@ -9,17 +9,16 @@
99 };
1010
1111 private static MODEL_IDS: { [name: string]: string } = {
12- "llama4-scout": "Llama-4-Scout-17B-16E-Instruct",
1312 "llama4-maverick": "Llama-4-Maverick-17B-128E-Instruct",
1413 "llama3.3-70b": "Meta-Llama-3.3-70B-Instruct",
14+ "llama3.3-swalllow-70b": "Llama-3.3-Swallow-70B-Instruct-v0.4",
1515 "llama3.1-8b": "Meta-Llama-3.1-8B-Instruct",
16- "llama3.1-405b": "Meta-Llama-3.1-405B-Instruct",
17- "llama3.2-1b": "Meta-Llama-3.2-1B-Instruct",
18- "llama3.2-3b": "Meta-Llama-3.2-3B-Instruct",
19- "qwq-32b": "QwQ-32B",
2016 "deepseek-r1-distill-llama-70b": "DeepSeek-R1-Distill-Llama-70B",
2117 "deepseek-r1": "DeepSeek-R1",
2218 "deepseek-v3": "DeepSeek-V3-0324",
19+ "deepseek-v3.1": "DeepSeek-V3-0324",
20+ "gpt-oss-120b": "gpt-oss-120b",
21+ "qwen3-32b": "Qwen3-32B",
2322 };
2423
2524 protected _convertModelName(model: string) {
modified core/llm/toolSupport.ts +3 −1
@@ -203,7 +203,9 @@
203203 if (
204204 model.toLowerCase().startsWith("meta-llama-3") ||
205205 model.toLowerCase().includes("llama-4") ||
206- model.toLowerCase().includes("deepseek")
206+ model.toLowerCase().includes("deepseek") ||
207+ model.toLowerCase().includes("gpt") ||
208+ model.toLowerCase().includes("qwen")
207209 ) {
208210 return true;
209211 }
modified docs/customize/model-providers/more/SambaNova.mdx +5 −5
@@ -1,6 +1,6 @@
11 ---
22 title: "SambaNova"
3-description: "Configure SambaNova Cloud with Continue to access their high-performance platform for running large AI models, including Llama 4 Scout with world record open source model performance"
3+description: "Configure SambaCloud with Continue to access their high-performance platform for running large AI models, including Llama 4 Scout with world record open source model performance"
44 ---
55
66 The SambaNova Cloud is a cloud platform for running large AI models with the world record open source models performance. You can follow the instructions in [this blog post](https://sambanova.ai/blog/accelerating-coding-with-sambanova-cloud?ref=blog.continue.dev) to configure your setup.
@@ -9,9 +9,9 @@
99 <Tab title="YAML">
1010 ```yaml title="config.yaml"
1111 models:
12- - name: SambaNova Llama 4 Scout
12+ - name: GPT OSS 120B
1313 provider: sambanova
14- model: Llama-4-Scout-17B-16E-Instruct
14+ model: gpt-oss-120b
1515 apiKey: <YOUR_SAMBANOVA_API_KEY>
1616 ```
1717 </Tab>
@@ -20,9 +20,9 @@
2020 {
2121 "models": [
2222 {
23- "title": "SambaNova Llama 4 Scout",
23+ "title": "GPT OSS 120B",
2424 "provider": "sambanova",
25- "model": "Llama-4-Scout-17B-16E-Instruct",
25+ "model": "gpt-oss-120b",
2626 "apiKey": "<YOUR_SAMBANOVA_API_KEY>"
2727 }
2828 ]
modified extensions/cli/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/cli/package.json +0 −2
@@ -77,7 +77,6 @@
7777 "@types/jszip": "^3.4.0",
7878 "@types/nock": "^10.0.3",
7979 "@types/react": "^19.1.8",
80- "@types/readline-sync": "^1.4.8",
8180 "@types/shell-quote": "^1.7.5",
8281 "@types/supertest": "^6.0.3",
8382 "@types/turndown": "^5.0.5",
@@ -122,7 +121,6 @@
122121 "prettier": "^3.6.2",
123122 "prettier-plugin-tailwindcss": "^0.6.14",
124123 "react": "^19.1.0",
125- "readline-sync": "^1.4.10",
126124 "semantic-release": "^24.2.7",
127125 "shell-quote": "^1.8.3",
128126 "supertest": "^7.1.3",
modified extensions/cli/src/commands/chat.ts +3 −3
@@ -1,8 +1,7 @@
11 import { ModelConfig } from "@continuedev/config-yaml";
22 import chalk from "chalk";
3-import type { ChatHistoryItem, Session } from "core/index.js";
3+import { ChatHistoryItem, Session } from "core";
44 import { ChatDescriber } from "core/util/chatDescriber.js";
5-import * as readlineSync from "readline-sync";
65
76 import { compactChatHistory, findCompactionIndex } from "../compaction.js";
87 import { processCommandFlags } from "../flags/flagProcessor.js";
@@ -25,6 +24,7 @@
2524 import { gracefulExit } from "../util/exit.js";
2625 import { formatAnthropicError, formatError } from "../util/formatError.js";
2726 import { logger } from "../util/logger.js";
27+import { question } from "../util/prompt.js";
2828 import {
2929 calculateContextUsagePercentage,
3030 countChatHistoryTokens,
@@ -454,7 +454,7 @@
454454 const userInput =
455455 isFirstMessage && initialUserInput
456456 ? initialUserInput
457- : readlineSync.question(`\n${chalk.bold.green("You:")} `);
457+ : await question(`\n${chalk.bold.green("You:")} `);
458458
459459 isFirstMessage = false;
460460
modified extensions/cli/src/freeTrialTransition.ts +10 −11
@@ -4,14 +4,14 @@
44
55 import chalk from "chalk";
66 import open from "open";
7-import * as readlineSync from "readline-sync";
87
98 import { env } from "./env.js";
109 import {
11- isValidAnthropicApiKey,
1210 getApiKeyValidationError,
11+ isValidAnthropicApiKey,
1312 } from "./util/apiKeyValidation.js";
1413 import { gracefulExit } from "./util/exit.js";
14+import { question, questionWithChoices } from "./util/prompt.js";
1515 import { updateAnthropicModelInYaml } from "./util/yamlConfigUpdater.js";
1616
1717 const CONFIG_PATH = path.join(env.continueHome, "config.yaml");
@@ -52,10 +52,12 @@
5252 console.log(chalk.white("1. 💳 Sign up for models add-on"));
5353 console.log(chalk.white("2. 🔑 Enter your Anthropic API key"));
5454
55- const choice = readlineSync.question(chalk.yellow("\nEnter choice (1): "), {
56- limit: ["1", "2", ""],
57- limitMessage: chalk.dim("Please enter 1 or 2"),
58- });
55+ const choice = await questionWithChoices(
56+ chalk.yellow("\nEnter choice (1): "),
57+ ["1", "2", ""],
58+ "1",
59+ chalk.dim("Please enter 1 or 2"),
60+ );
5961
6062 if (choice === "1" || choice === "") {
6163 // Option 1: Open models setup page
@@ -81,15 +83,12 @@
8183 }
8284
8385 // Wait for user to acknowledge
84- readlineSync.question(chalk.dim("\nPress Enter to exit..."));
86+ await question(chalk.dim("\nPress Enter to exit..."));
8587 await gracefulExit(0);
8688 } else if (choice === "2") {
8789 // Option 2: Enter Anthropic API key
88- const apiKey = readlineSync.question(
90+ const apiKey = await question(
8991 chalk.white("\nEnter your Anthropic API key: "),
90- {
91- hideEchoBack: true,
92- },
9392 );
9493
9594 if (!isValidAnthropicApiKey(apiKey)) {
modified extensions/cli/src/onboarding.ts +8 −9
@@ -5,7 +5,6 @@
55 import { BaseLlmApi } from "@continuedev/openai-adapters";
66 import { DefaultApiInterface } from "@continuedev/sdk/dist/api/dist/index.js";
77 import chalk from "chalk";
8-import * as readlineSync from "readline-sync";
98
109 import { processPromptOrRule } from "./args.js";
1110 import { AuthConfig, isAuthenticated, login } from "./auth/workos.js";
@@ -16,6 +15,7 @@
1615 getApiKeyValidationError,
1716 isValidAnthropicApiKey,
1817 } from "./util/apiKeyValidation.js";
18+import { question, questionWithChoices } from "./util/prompt.js";
1919 import { updateAnthropicModelInYaml } from "./util/yamlConfigUpdater.js";
2020
2121 const CONFIG_PATH = path.join(env.continueHome, "config.yaml");
@@ -97,10 +97,12 @@
9797 console.log(chalk.white("1. ⏩ Log in with Continue"));
9898 console.log(chalk.white("2. 🔑 Enter your Anthropic API key"));
9999
100- const choice = readlineSync.question(chalk.yellow("\nEnter choice (1): "), {
101- limit: ["1", "2", ""],
102- limitMessage: chalk.dim("Please enter 1 or 2"),
103- });
100+ const choice = await questionWithChoices(
101+ chalk.yellow("\nEnter choice (1): "),
102+ ["1", "2", ""],
103+ "1",
104+ chalk.dim("Please enter 1 or 2"),
105+ );
104106
105107 if (choice === "1" || choice === "") {
106108 const newAuthConfig = await login();
@@ -111,11 +113,8 @@
111113 const result = await initialize(finalAuthConfig, undefined);
112114 return { ...result, wasOnboarded: true };
113115 } else if (choice === "2") {
114- const apiKey = readlineSync.question(
116+ const apiKey = await question(
115117 chalk.white("\nEnter your Anthropic API key: "),
116- {
117- hideEchoBack: true,
118- },
119118 );
120119
121120 if (!isValidAnthropicApiKey(apiKey)) {
added extensions/cli/src/util/prompt.test.ts +277 −0
@@ -0,0 +1,277 @@
1+import * as readline from "readline";
2+
3+import {
4+ describe,
5+ expect,
6+ it,
7+ vi,
8+ beforeEach,
9+ afterEach,
10+ MockInstance,
11+} from "vitest";
12+
13+// Mock readline module
14+vi.mock("readline", () => ({
15+ createInterface: vi.fn(),
16+}));
17+
18+import { question, questionWithChoices } from "./prompt.js";
19+
20+describe("prompt utilities", () => {
21+ let mockInterface: any;
22+ let consoleLogSpy: MockInstance<typeof console.log>;
23+ let processExitSpy: MockInstance<typeof process.exit>;
24+
25+ beforeEach(() => {
26+ // Create a mock readline interface
27+ mockInterface = {
28+ question: vi.fn(),
29+ close: vi.fn(),
30+ on: vi.fn(),
31+ };
32+
33+ // Mock readline.createInterface to return our mock interface
34+ (readline.createInterface as any).mockReturnValue(mockInterface);
35+
36+ // Mock console.log for limit messages
37+ consoleLogSpy = vi.spyOn(console, "log").mockImplementation(() => {});
38+
39+ // Mock process.exit
40+ processExitSpy = vi.spyOn(process, "exit").mockImplementation((() => {
41+ throw new Error("Process exit");
42+ }) as any);
43+ });
44+
45+ afterEach(() => {
46+ vi.clearAllMocks();
47+ consoleLogSpy.mockRestore();
48+ processExitSpy.mockRestore();
49+ });
50+
51+ describe("question", () => {
52+ it("should return user input", async () => {
53+ const promptText = "What is your name? ";
54+ const userInput = "John Doe";
55+
56+ // Setup mock to call the callback with user input
57+ mockInterface.question.mockImplementation(
58+ (prompt: string, callback: (answer: string) => void) => {
59+ setTimeout(() => callback(userInput), 0);
60+ },
61+ );
62+
63+ const result = await question(promptText);
64+
65+ expect(mockInterface.question).toHaveBeenCalledWith(
66+ promptText,
67+ expect.any(Function),
68+ );
69+ expect(mockInterface.close).toHaveBeenCalled();
70+ expect(result).toBe(userInput);
71+ });
72+
73+ it("should handle empty input", async () => {
74+ const promptText = "Enter something: ";
75+
76+ mockInterface.question.mockImplementation(
77+ (prompt: string, callback: (answer: string) => void) => {
78+ setTimeout(() => callback(""), 0);
79+ },
80+ );
81+
82+ const result = await question(promptText);
83+
84+ expect(result).toBe("");
85+ });
86+
87+ it("should handle special characters in input", async () => {
88+ const promptText = "Enter special chars: ";
89+ const userInput = "!@#$%^&*()_+-=[]{}|;':\",./<>?";
90+
91+ mockInterface.question.mockImplementation(
92+ (prompt: string, callback: (answer: string) => void) => {
93+ setTimeout(() => callback(userInput), 0);
94+ },
95+ );
96+
97+ const result = await question(promptText);
98+
99+ expect(result).toBe(userInput);
100+ });
101+
102+ it.skip("should handle SIGINT (Ctrl+C) by exiting process", async () => {
103+ const promptText = "Enter something: ";
104+ let sigintHandler: (() => void) | null = null;
105+
106+ // Setup mock to capture SIGINT handler
107+ mockInterface.on.mockImplementation(
108+ (event: string, handler: () => void) => {
109+ if (event === "SIGINT") {
110+ sigintHandler = handler;
111+ }
112+ return mockInterface;
113+ },
114+ );
115+
116+ // Setup question mock that doesn't resolve immediately
117+ mockInterface.question.mockImplementation(() => {
118+ // Trigger SIGINT after question is called
119+ setTimeout(() => {
120+ if (sigintHandler) {
121+ sigintHandler();
122+ }
123+ }, 10);
124+ });
125+
126+ // The promise should reject when SIGINT is triggered
127+ await expect(question(promptText)).rejects.toThrow("Process exit");
128+ expect(processExitSpy).toHaveBeenCalledWith(0);
129+ });
130+ });
131+
132+ describe("questionWithChoices", () => {
133+ it("should accept valid choice", async () => {
134+ const promptText = "Choose (1): ";
135+ const choices = ["1", "2", "3"];
136+ const userChoice = "2";
137+
138+ mockInterface.question.mockImplementationOnce(
139+ (prompt: string, callback: (answer: string) => void) => {
140+ setTimeout(() => callback(userChoice), 0);
141+ },
142+ );
143+
144+ const result = await questionWithChoices(promptText, choices);
145+ expect(result).toBe(userChoice);
146+ });
147+
148+ it("should use default choice when empty input is provided", async () => {
149+ const promptText = "Choose (1): ";
150+ const choices = ["1", "2", "3"];
151+ const defaultChoice = "1";
152+
153+ mockInterface.question.mockImplementationOnce(
154+ (prompt: string, callback: (answer: string) => void) => {
155+ setTimeout(() => callback(""), 0);
156+ },
157+ );
158+
159+ const result = await questionWithChoices(
160+ promptText,
161+ choices,
162+ defaultChoice,
163+ );
164+ expect(result).toBe(defaultChoice);
165+ });
166+
167+ it("should reject invalid choice and ask again", async () => {
168+ const promptText = "Choose (1 or 2): ";
169+ const choices = ["1", "2"];
170+ const limitMessage = "Please enter 1 or 2";
171+
172+ let callCount = 0;
173+ mockInterface.question.mockImplementation(
174+ (prompt: string, callback: (answer: string) => void) => {
175+ setTimeout(() => {
176+ if (callCount === 0) {
177+ callCount++;
178+ callback("3"); // Invalid choice
179+ } else {
180+ callback("1"); // Valid choice
181+ }
182+ }, 0);
183+ },
184+ );
185+
186+ const result = await questionWithChoices(
187+ promptText,
188+ choices,
189+ undefined,
190+ limitMessage,
191+ );
192+ expect(result).toBe("1");
193+ expect(consoleLogSpy).toHaveBeenCalledWith(limitMessage);
194+ });
195+
196+ it("should handle multiple invalid attempts before valid choice", async () => {
197+ const promptText = "Choose: ";
198+ const choices = ["yes", "no"];
199+ const limitMessage = "Invalid choice";
200+
201+ let callCount = 0;
202+ const invalidAnswers = ["maybe", "perhaps"];
203+ mockInterface.question.mockImplementation(
204+ (prompt: string, callback: (answer: string) => void) => {
205+ setTimeout(() => {
206+ if (callCount < invalidAnswers.length) {
207+ callback(invalidAnswers[callCount++]);
208+ } else {
209+ callback("yes");
210+ }
211+ }, 0);
212+ },
213+ );
214+
215+ const result = await questionWithChoices(
216+ promptText,
217+ choices,
218+ undefined,
219+ limitMessage,
220+ );
221+ expect(result).toBe("yes");
222+ expect(consoleLogSpy).toHaveBeenCalledTimes(2);
223+ });
224+
225+ it("should not show limit message when none provided", async () => {
226+ const promptText = "Choose: ";
227+ const choices = ["a", "b"];
228+
229+ let callCount = 0;
230+ mockInterface.question.mockImplementation(
231+ (prompt: string, callback: (answer: string) => void) => {
232+ setTimeout(() => {
233+ if (callCount === 0) {
234+ callCount++;
235+ callback("c"); // Invalid
236+ } else {
237+ callback("a"); // Valid
238+ }
239+ }, 0);
240+ },
241+ );
242+
243+ const result = await questionWithChoices(promptText, choices);
244+ expect(result).toBe("a");
245+ expect(consoleLogSpy).not.toHaveBeenCalled();
246+ });
247+
248+ it("should handle empty string as valid choice", async () => {
249+ const promptText = "Press Enter to continue or type 'cancel': ";
250+ const choices = ["", "cancel"];
251+
252+ mockInterface.question.mockImplementationOnce(
253+ (prompt: string, callback: (answer: string) => void) => {
254+ setTimeout(() => callback(""), 0);
255+ },
256+ );
257+
258+ const result = await questionWithChoices(promptText, choices);
259+ expect(result).toBe("");
260+ });
261+
262+ it("should handle choice with spaces", async () => {
263+ const promptText = "Choose an option: ";
264+ const choices = ["option one", "option two", "option three"];
265+ const userChoice = "option two";
266+
267+ mockInterface.question.mockImplementationOnce(
268+ (prompt: string, callback: (answer: string) => void) => {
269+ setTimeout(() => callback(userChoice), 0);
270+ },
271+ );
272+
273+ const result = await questionWithChoices(promptText, choices);
274+ expect(result).toBe(userChoice);
275+ });
276+ });
277+});
added extensions/cli/src/util/prompt.ts +60 −0
@@ -0,0 +1,60 @@
1+import * as readline from "readline";
2+
3+/**
4+ * Creates a promise-based question prompt using readline
5+ * Properly handles backspace and Ctrl+C
6+ */
7+export function question(prompt: string): Promise<string> {
8+ return new Promise((resolve) => {
9+ const rl = readline.createInterface({
10+ input: process.stdin,
11+ output: process.stdout,
12+ terminal: true,
13+ });
14+
15+ // Handle Ctrl+C properly
16+ rl.on("SIGINT", () => {
17+ console.log("\n");
18+ rl.close();
19+ process.exit(0);
20+ });
21+
22+ rl.question(prompt, (answer) => {
23+ rl.close();
24+ resolve(answer);
25+ });
26+ });
27+}
28+
29+/**
30+ * Creates a prompt with limited choices
31+ * @param prompt The prompt to display
32+ * @param choices Array of valid choices
33+ * @param defaultChoice Default choice if user presses enter
34+ * @param limitMessage Message to show when invalid choice is entered
35+ */
36+export async function questionWithChoices(
37+ prompt: string,
38+ choices: string[],
39+ defaultChoice?: string,
40+ limitMessage?: string,
41+): Promise<string> {
42+ while (true) {
43+ const answer = await question(prompt);
44+
45+ // Handle default choice
46+ if (answer === "" && defaultChoice !== undefined) {
47+ return defaultChoice;
48+ }
49+
50+ // Check if answer is valid
51+ if (choices.includes(answer)) {
52+ return answer;
53+ }
54+
55+ // Show limit message if provided
56+ if (limitMessage) {
57+ console.log(limitMessage);
58+ }
59+ }
60+}
modified extensions/vscode/package.json +1 −1
@@ -2,7 +2,7 @@
22 "name": "continue",
33 "icon": "media/icon.png",
44 "author": "Continue Dev, Inc",
5- "version": "1.3.11",
5+ "version": "1.3.12",
66 "repository": {
77 "type": "git",
88 "url": "https://github.com/continuedev/continue"
modified gui/src/pages/AddNewModel/configs/models.ts +50 −66
@@ -592,7 +592,7 @@
592592 contextLength: 8192,
593593 },
594594 icon: "meta.png",
595- providerOptions: ["ollama", "groq", "llama.cpp", "sambanova", "nebius"],
595+ providerOptions: ["ollama", "groq", "llama.cpp", "nebius"],
596596 isOpenSource: false,
597597 },
598598 llama323bChat: {
@@ -605,7 +605,7 @@
605605 contextLength: 8192,
606606 },
607607 icon: "meta.png",
608- providerOptions: ["ollama", "groq", "llama.cpp", "sambanova", "together"],
608+ providerOptions: ["ollama", "groq", "llama.cpp", "together"],
609609 isOpenSource: false,
610610 },
611611 llama3211bChat: {
@@ -1705,25 +1705,13 @@
17051705 providerOptions: ["siliconflow"],
17061706 isOpenSource: true,
17071707 },
1708- llama4Scout: {
1709- title: "Llama 4 Scout Instruct",
1710- description: "A model from Meta, fine-tuned for chat",
1711- params: {
1712- title: "Llama 4 Scout Instruct",
1713- model: "Llama-4-Scout-17B-16E-Instruct",
1714- contextLength: 16_000,
1715- },
1716- icon: "meta.png",
1717- providerOptions: ["sambanova"],
1718- isOpenSource: true,
1719- },
17201708 llama4Maverick: {
17211709 title: "Llama 4 Maverick Instruct",
17221710 description: "A model from Meta, fine-tuned for chat",
17231711 params: {
17241712 title: "Llama 4 Maverick Instruct",
17251713 model: "Llama-4-Maverick-17B-128E-Instruct",
1726- contextLength: 16_000,
1714+ contextLength: 128_000,
17271715 },
17281716 icon: "meta.png",
17291717 providerOptions: ["sambanova"],
@@ -1741,71 +1729,31 @@
17411729 providerOptions: ["sambanova"],
17421730 isOpenSource: true,
17431731 },
1744- llama318BInstruct: {
1745- title: "Llama3.1 8B",
1746- description: "A model from Meta, fine-tuned for chat",
1747- refUrl: "",
1748- params: {
1749- title: "Llama 3.1 8B Instruct",
1750- model: "Meta-Llama-3.1-8B-Instruct",
1751- contextLength: 16_000,
1752- },
1753- icon: "meta.png",
1754- providerOptions: ["sambanova"],
1755- isOpenSource: true,
1756- },
1757- llama31405BInstruct: {
1758- title: "Llama3.1 405B",
1759- description: "A model from Meta, fine-tuned for chat",
1760- refUrl: "",
1732+ llama33Swallow70BInstruct: {
1733+ title: "Llama 3.3 Swallow 70B Instruct",
1734+ description: "A model from TokyoTech, fine-tuned for chat",
17611735 params: {
1762- title: "Llama 3.1 405B Instruct",
1763- model: "Meta-Llama-3.1-405B-Instruct",
1764- contextLength: 16_000,
1736+ title: "Llama 3.3 70B instruct",
1737+ model: "Llama-3.3-Swallow-70B-Instruct-v0.4",
1738+ contextLength: 128_000,
17651739 },
17661740 icon: "meta.png",
17671741 providerOptions: ["sambanova"],
17681742 isOpenSource: true,
17691743 },
1770- llama321BInstruct: {
1771- title: "Llama3.2 1B",
1744+ llama318BInstruct: {
1745+ title: "Llama3.1 8B",
17721746 description: "A model from Meta, fine-tuned for chat",
17731747 refUrl: "",
17741748 params: {
1775- title: "Llama 3.2 1B Instruct",
1776- model: "Meta-Llama-3.2-1B-Instruct",
1749+ title: "Llama 3.1 8B Instruct",
1750+ model: "Meta-Llama-3.1-8B-Instruct",
17771751 contextLength: 16_000,
17781752 },
17791753 icon: "meta.png",
17801754 providerOptions: ["sambanova"],
17811755 isOpenSource: true,
17821756 },
1783- llama323BInstruct: {
1784- title: "Llama3.2 3B",
1785- description: "A model from Meta, fine-tuned for chat",
1786- refUrl: "",
1787- params: {
1788- title: "Llama 3.2 3B Instruct",
1789- model: "Meta-Llama-3.2-3B-Instruct",
1790- contextLength: 8192,
1791- },
1792- icon: "meta.png",
1793- providerOptions: ["sambanova"],
1794- isOpenSource: true,
1795- },
1796- qwq32B: {
1797- title: "QwQ 32B",
1798- description:
1799- "QwQ-32B is Qwen's latest experimental research model, focusing on improving AI reasoning capabilities.",
1800- params: {
1801- title: "QwQ 32B",
1802- model: "QwQ-32B",
1803- contextLength: 16_000,
1804- },
1805- icon: "qwen.png",
1806- providerOptions: ["sambanova"],
1807- isOpenSource: true,
1808- },
18091757 deepseekR1DistillLlama70B: {
18101758 title: "DeepSeek R1 Distill Llama 70B",
18111759 description: "A llama 3.1 70 model distilled from deekseek R1",
@@ -1824,7 +1772,7 @@
18241772 params: {
18251773 title: "DeepSeek R1",
18261774 model: "DeepSeek-R1",
1827- contextLength: 8192,
1775+ contextLength: 32_000,
18281776 },
18291777 icon: "deepseek.png",
18301778 providerOptions: ["sambanova"],
@@ -1842,6 +1790,42 @@
18421790 providerOptions: ["sambanova"],
18431791 isOpenSource: true,
18441792 },
1793+ deepseekV31: {
1794+ title: "DeepSeek V3.1",
1795+ description: "DeekSeek V3.1 reasoning model from DeepSeek",
1796+ params: {
1797+ title: "DeepSeek V3.1",
1798+ model: "DeepSeek-V3.1",
1799+ contextLength: 32_000,
1800+ },
1801+ icon: "deepseek.png",
1802+ providerOptions: ["sambanova"],
1803+ isOpenSource: true,
1804+ },
1805+ qwen332B: {
1806+ title: "Qwen 3 32B",
1807+ description: "Qwen 3 32B model from Alibaba",
1808+ params: {
1809+ title: "Qwen 3 32B",
1810+ model: "Qwen3-32B",
1811+ contextLength: 8192,
1812+ },
1813+ icon: "qwen.png",
1814+ providerOptions: ["sambanova"],
1815+ isOpenSource: true,
1816+ },
1817+ gptOss120b: {
1818+ title: "GPT OSS 120B",
1819+ description: "GPT oss 120b reasoning model from OpenAI",
1820+ params: {
1821+ title: "GPT OSS 120B",
1822+ model: "gpt-oss-120b",
1823+ contextLength: 128_000,
1824+ },
1825+ icon: "openai.png",
1826+ providerOptions: ["sambanova"],
1827+ isOpenSource: true,
1828+ },
18451829 AUTODETECT: {
18461830 title: "Autodetect",
18471831 description:
modified gui/src/pages/AddNewModel/configs/providers.ts +4 −5
@@ -809,17 +809,16 @@
809809 ...completionParamsInputsConfigs,
810810 ],
811811 packages: [
812- models.llama4Scout,
813812 models.llama4Maverick,
814813 models.llama3370BInstruct,
814+ models.llama33Swallow70BInstruct,
815815 models.llama318BInstruct,
816- models.llama31405BInstruct,
817- models.llama321BInstruct,
818- models.llama323BInstruct,
819- models.qwq32B,
820816 models.deepseekR1DistillLlama70B,
821817 models.deepseekR1,
822818 models.deepseekV3,
819+ models.deepseekV31,
820+ models.qwen332B,
821+ models.gptOss120b,
823822 ],
824823 apiKeyUrl: "https://cloud.sambanova.ai/apis",
825824 },
modified gui/src/redux/selectors/selectToolCalls.ts +3 −1
@@ -50,7 +50,9 @@
5050 (_store: RootState, toolCallId: string) => toolCallId,
5151 ],
5252 (applyStates, toolCallId) => {
53- return applyStates.states.find((state) => state.toolCallId === toolCallId);
53+ return applyStates.states.findLast(
54+ (state) => state.toolCallId === toolCallId,
55+ );
5456 },
5557 );
5658
modified gui/src/redux/thunks/streamResponseAfterToolCall.ts +1 −1
@@ -69,7 +69,7 @@
6969
7070 // Check if we should continue streaming based on tool call completion
7171 const history = getState().session.history;
72- const assistantMessage = history.find(
72+ const assistantMessage = history.findLast(
7373 (item) =>
7474 item.message.role === "assistant" &&
7575 item.toolCallStates?.some((tc) => tc.toolCallId === toolCallId),
modified gui/src/redux/util/index.ts +3 −2
@@ -66,7 +66,8 @@
6666 chatHistory: RootState["session"]["history"],
6767 toolCallId: string,
6868 ): ToolCallState | undefined {
69- for (const item of chatHistory) {
69+ for (let i = chatHistory.length - 1; i >= 0; i--) {
70+ const item = chatHistory[i];
7071 if (item.toolCallStates) {
7172 const toolCallState = item.toolCallStates.find(
7273 (state) => state.toolCallId === toolCallId,
@@ -84,7 +85,7 @@
8485 chatHistory: RootState["session"]["history"],
8586 toolCallId: string,
8687 ): ChatHistoryItemWithMessageId | undefined {
87- return chatHistory.find(
88+ return chatHistory.findLast(
8889 (item) =>
8990 item.message.role === "tool" && item.message.toolCallId === toolCallId,
9091 );
modified packages/openai-adapters/src/index.ts +5 −0
@@ -18,6 +18,7 @@
1818 import { WatsonXApi } from "./apis/WatsonX.js";
1919 import { BaseLlmApi } from "./apis/base.js";
2020 import { LLMConfig, OpenAIConfigSchema } from "./types.js";
21+import { appendPathToUrlIfNotPresent } from "./util/appendPathToUrl.js";
2122
2223 dotenv.config();
2324
@@ -141,6 +142,10 @@
141142 case "lmstudio":
142143 return openAICompatible("http://localhost:1234/", config);
143144 case "ollama":
145+ // for openai compaitability, we need to add /v1 to the end of the url
146+ // this is required for cli (for core, endpoints are overriden by core/llm/llms/Ollama.ts)
147+ if (config.apiBase)
148+ config.apiBase = appendPathToUrlIfNotPresent(config.apiBase, "v1");
144149 return openAICompatible("http://localhost:11434/v1/", config);
145150 case "mock":
146151 return new MockApi();
modified packages/openai-adapters/src/test/main.test.ts +48 −0
@@ -311,4 +311,52 @@
311311 );
312312 expect((azure as OpenAIApi).openai.apiKey).toBe("sk-xxx");
313313 });
314+
315+ describe("ollama api base", () => {
316+ it('should have correct default API base for "ollama"', () => {
317+ const ollama = constructLlmApi({
318+ provider: "ollama",
319+ });
320+
321+ expect((ollama as OpenAIApi).openai.baseURL).toBe(
322+ "http://localhost:11434/v1/",
323+ );
324+ });
325+ it('should append /v1 to apiBase for "ollama"', () => {
326+ const ollama = constructLlmApi({
327+ provider: "ollama",
328+ apiBase: "http://localhost:123",
329+ });
330+
331+ expect((ollama as OpenAIApi).openai.baseURL).toBe(
332+ "http://localhost:123/v1/",
333+ );
334+ });
335+ it("should not reappend /v1 to apibase for ollama if it is already present", () => {
336+ const ollama = constructLlmApi({
337+ provider: "ollama",
338+ apiBase: "http://localhost:123/v1/",
339+ });
340+
341+ expect((ollama as OpenAIApi).openai.baseURL).toBe(
342+ "http://localhost:123/v1/",
343+ );
344+ });
345+ it("should append v1 if apiBase is like myhostv1/", () => {
346+ const ollama = constructLlmApi({
347+ provider: "ollama",
348+ apiBase: "https://myhostv1/",
349+ });
350+ expect((ollama as OpenAIApi).openai.baseURL).toBe("https://myhostv1/v1/");
351+ });
352+ it("should preserve query params and append v1 in apibase", () => {
353+ const ollama = constructLlmApi({
354+ provider: "ollama",
355+ apiBase: "https://test.com:123/ollama-server?x=1",
356+ });
357+ expect((ollama as OpenAIApi).openai.baseURL).toBe(
358+ "https://test.com:123/ollama-server/v1/?x=1",
359+ );
360+ });
361+ });
314362 });
added packages/openai-adapters/src/util/appendPathToUrl.ts +17 −0
@@ -0,0 +1,17 @@
1+export function appendPathToUrlIfNotPresent(
2+ urlString: string,
3+ pathWithoutSlash: string,
4+) {
5+ const url = new URL(urlString);
6+ if (!url.pathname.endsWith("/")) {
7+ url.pathname += "/";
8+ }
9+ if (!url.pathname.endsWith(pathWithoutSlash + "/")) {
10+ url.pathname += pathWithoutSlash + "/";
11+ }
12+ if (url.search) {
13+ return url.toString();
14+ }
15+ // append slash at the end
16+ return url.toString();
17+}