Merge remote-tracking branch 'upstream/main'
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
commit
8225bff02d
7 changed files with 28 additions and 24 deletions
|
|
@ -9,6 +9,7 @@ import {
|
|||
ILLMLogger,
|
||||
} from "../index.js";
|
||||
import { GlobalContext } from "../util/GlobalContext.js";
|
||||
import { getConfigYamlPath } from "../util/paths.js";
|
||||
|
||||
import EventEmitter from "node:events";
|
||||
import { Logger } from "../util/Logger.js";
|
||||
|
|
@ -346,6 +347,7 @@ export class ConfigHandler {
|
|||
return;
|
||||
}
|
||||
|
||||
getConfigYamlPath();
|
||||
const configFile = element?.sourceFile ?? profile.profileDescription.uri;
|
||||
await this.ide.openFile(configFile);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ class Ollama extends BaseLLM implements ModelInstaller {
|
|||
private static modelsBeingInstalledMutex = new Mutex();
|
||||
|
||||
private fimSupported: boolean = false;
|
||||
private templateSupportsTools: boolean | undefined = undefined;
|
||||
|
||||
private modelInfoPromise: Promise<void> | undefined = undefined;
|
||||
private explicitContextLength: boolean;
|
||||
|
||||
|
|
@ -240,11 +240,6 @@ class Ollama extends BaseLLM implements ModelInstaller {
|
|||
* it's a good indication the model supports FIM.
|
||||
*/
|
||||
this.fimSupported = !!body?.template?.includes(".Suffix");
|
||||
|
||||
// Check if model template supports tool calling (same pattern as .Suffix above)
|
||||
if (body?.template) {
|
||||
this.templateSupportsTools = body.template.includes(".Tools");
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
// console.warn("Error calling the Ollama /api/show endpoint: ", e);
|
||||
|
|
@ -516,12 +511,7 @@ class Ollama extends BaseLLM implements ModelInstaller {
|
|||
stream: options.stream,
|
||||
// format: options.format, // Not currently in base completion options
|
||||
};
|
||||
// Only include tools with user messages, and only if the template supports them
|
||||
if (
|
||||
options.tools?.length &&
|
||||
ollamaMessages.at(-1)?.role === "user" &&
|
||||
this.templateSupportsTools !== false
|
||||
) {
|
||||
if (options.tools?.length && ollamaMessages.at(-1)?.role === "user") {
|
||||
chatOptions.tools = options.tools.map((tool) => ({
|
||||
type: "function",
|
||||
function: {
|
||||
|
|
|
|||
|
|
@ -118,15 +118,12 @@ export function getConfigJsonPath(): string {
|
|||
|
||||
export function getConfigYamlPath(ideType?: IdeType): string {
|
||||
const p = path.join(getContinueGlobalPath(), "config.yaml");
|
||||
if (!fs.existsSync(p) && !fs.existsSync(getConfigJsonPath())) {
|
||||
if (ideType === "jetbrains") {
|
||||
// https://github.com/continuedev/continue/pull/7224
|
||||
// This was here because we had different context provider support between jetbrains and vs code
|
||||
// Leaving so we could differentiate later but for now configs are the same between IDEs
|
||||
fs.writeFileSync(p, YAML.stringify(defaultConfig));
|
||||
} else {
|
||||
fs.writeFileSync(p, YAML.stringify(defaultConfig));
|
||||
}
|
||||
const exists = fs.existsSync(p);
|
||||
const isEmpty = exists && fs.readFileSync(p, "utf8").trim() === "";
|
||||
const needsCreation = !exists && !fs.existsSync(getConfigJsonPath());
|
||||
|
||||
if (needsCreation || isEmpty) {
|
||||
fs.writeFileSync(p, YAML.stringify(defaultConfig));
|
||||
setConfigFilePermissions(p);
|
||||
}
|
||||
return p;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
pluginGroup=com.github.continuedev.continueintellijextension
|
||||
pluginVersion=1.0.65
|
||||
pluginVersion=1.0.67
|
||||
platformVersion=2024.1
|
||||
kotlin.stdlib.default.dependency=false
|
||||
org.gradle.configuration-cache=true
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ object UriUtils {
|
|||
// Handle Windows file paths with authority component
|
||||
if (uriStr.startsWith("file://") && !uriStr.startsWith("file:///")) {
|
||||
val path = uriStr.substringAfter("file://")
|
||||
return URI("file:///$path")
|
||||
return URI("file", "", "/$path", null)
|
||||
}
|
||||
|
||||
return try {
|
||||
|
|
|
|||
|
|
@ -60,4 +60,19 @@ class UriUtilsTest : TestCase() {
|
|||
val expectedFile = File("/path/to/file with spaces")
|
||||
assertEquals(expectedFile, result)
|
||||
}
|
||||
|
||||
// Regression test for #10978 — bracket directories like [gamemode]
|
||||
fun `test square brackets in path`() {
|
||||
val uri = "file:///path/to/[gamemode]/file.lua"
|
||||
val result = UriUtils.uriToFile(uri)
|
||||
assertEquals(File("/path/to/[gamemode]/file.lua"), result)
|
||||
}
|
||||
|
||||
fun `test Windows path with square brackets`() {
|
||||
val uri = "file://C:/Users/user/projects/[gamemode]/file.lua"
|
||||
val parsed = UriUtils.parseUri(uri)
|
||||
assertEquals("file", parsed.scheme)
|
||||
assertEquals("/C:/Users/user/projects/[gamemode]/file.lua", parsed.path)
|
||||
assertEquals("file:///C:/Users/user/projects/%5Bgamemode%5D/file.lua", parsed.toString())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"name": "continue",
|
||||
"icon": "media/icon.png",
|
||||
"author": "Continue Dev, Inc",
|
||||
"version": "1.3.36",
|
||||
"version": "1.3.38",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/continuedev/continue"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue