Compare commits

...

5 Commits

Author SHA1 Message Date
Tomasz Stefaniak
100e7fbf4a fix: ollama tool use 2025-05-09 20:38:46 -07:00
Owen W. Taylor
f1289e9d88 MCPConnection: avoid accidentally mutating options.transport.env
The code that added the PATH to the stdio transport environment was
mutating the original options.transport.env object, which can lead
to an infinite loop of reloading the continue config since
MCPMananagerSingletone.setConnections() compares the old and new
options and forces a refresh if any existing server changed transport
options. This triggers a config reload because in core.ts we have:

  MCPManagerSingleton.getInstance().onConnectionsRefreshed = async () => {
     await this.configHandler.reloadConfig();
  };
Which thens calls setConnections() and so forth...
2025-05-09 20:22:14 -07:00
Nate
caeee8c087 fix: 🚑 load global ~/.continue/assistants 2025-05-09 19:24:06 -07:00
Nate
0550ca071e fix(reg): 🚑 remove log except when in NODE_ENV === "test" 2025-05-09 19:22:26 -07:00
Nate
9c41490d98 bump package.json version 2025-05-09 16:47:11 -07:00
5 changed files with 18 additions and 15 deletions

View File

@@ -279,10 +279,7 @@ export class ConfigHandler {
if (options.includeWorkspace) {
const assistantFiles = await getAllDotContinueYamlFiles(
this.ide,
{
...options,
includeGlobal: false, // Because the global comes from above
},
options,
ASSISTANTS,
);
const profiles = assistantFiles.map((assistant) => {

View File

@@ -55,7 +55,9 @@ class MCPConnection {
private constructTransport(options: MCPOptions): Transport {
switch (options.transport.type) {
case "stdio":
const env: Record<string, string> = options.transport.env || {};
const env: Record<string, string> = options.transport.env
? { ...options.transport.env }
: {};
if (process.env.PATH !== undefined) {
env.PATH = process.env.PATH;
}

View File

@@ -1,5 +1,6 @@
import { Mutex } from "async-mutex";
import { JSONSchema7, JSONSchema7Object } from "json-schema";
import { v4 as uuidv4 } from "uuid";
import {
ChatMessage,
@@ -90,10 +91,10 @@ type OllamaBaseResponse = {
model: string;
created_at: string;
} & (
| {
| {
done: false;
}
| {
| {
done: true;
done_reason: string;
total_duration: number; // Time spent generating the response in nanoseconds
@@ -104,7 +105,7 @@ type OllamaBaseResponse = {
eval_duration: number; // Time spent generating the response in nanoseconds
context: number[]; // An encoding of the conversation used in this response; can be sent in the next request to keep conversational memory
}
);
);
type OllamaErrorResponse = {
error: string;
@@ -113,14 +114,14 @@ type OllamaErrorResponse = {
type OllamaRawResponse =
| OllamaErrorResponse
| (OllamaBaseResponse & {
response: string; // the generated response
});
response: string; // the generated response
});
type OllamaChatResponse =
| OllamaErrorResponse
| (OllamaBaseResponse & {
message: OllamaChatMessage;
});
message: OllamaChatMessage;
});
interface OllamaTool {
type: "function";
@@ -370,7 +371,7 @@ class Ollama extends BaseLLM implements ModelInstaller {
if ("error" in j) {
throw new Error(j.error);
}
j.response ??= ''
j.response ??= "";
yield j.response;
} catch (e) {
throw new Error(`Error parsing Ollama response: ${e} ${chunk}`);
@@ -439,6 +440,7 @@ class Ollama extends BaseLLM implements ModelInstaller {
// But ollama returns the full object in one response with no streaming
chatMessage.toolCalls = res.message.tool_calls.map((tc) => ({
type: "function",
id: `tc_${uuidv4()}`, // Generate a proper UUID with a prefix
function: {
name: tc.function.name,
arguments: JSON.stringify(tc.function.arguments),

View File

@@ -7,7 +7,9 @@ export const logger = winston.createLogger({
format: winston.format.json(),
transports: [
// Write all logs with importance level of `info` or higher to `info.log`
new winston.transports.File({ filename: "e2e.log", level: "info" }),
...(process.env.NODE_ENV === "test"
? [new winston.transports.File({ filename: "e2e.log", level: "info" })]
: []),
// Normal console.log behavior
new winston.transports.Console(),
],

View File

@@ -2,7 +2,7 @@
"name": "continue",
"icon": "media/icon.png",
"author": "Continue Dev, Inc",
"version": "1.1.31",
"version": "1.0.9",
"repository": {
"type": "git",
"url": "https://github.com/continuedev/continue"