Skip to content

Commit 8225bff

Browse files
Merge remote-tracking branch 'upstream/main'
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2 parents b58af57 + d220a2e commit 8225bff

File tree

7 files changed

+28
-24
lines changed

7 files changed

+28
-24
lines changed

core/config/ConfigHandler.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
ILLMLogger,
1010
} from "../index.js";
1111
import { GlobalContext } from "../util/GlobalContext.js";
12+
import { getConfigYamlPath } from "../util/paths.js";
1213

1314
import EventEmitter from "node:events";
1415
import { Logger } from "../util/Logger.js";
@@ -346,6 +347,7 @@ export class ConfigHandler {
346347
return;
347348
}
348349

350+
getConfigYamlPath();
349351
const configFile = element?.sourceFile ?? profile.profileDescription.uri;
350352
await this.ide.openFile(configFile);
351353
}

core/llm/llms/Ollama.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ class Ollama extends BaseLLM implements ModelInstaller {
161161
private static modelsBeingInstalledMutex = new Mutex();
162162

163163
private fimSupported: boolean = false;
164-
private templateSupportsTools: boolean | undefined = undefined;
164+
165165
private modelInfoPromise: Promise<void> | undefined = undefined;
166166
private explicitContextLength: boolean;
167167

@@ -240,11 +240,6 @@ class Ollama extends BaseLLM implements ModelInstaller {
240240
* it's a good indication the model supports FIM.
241241
*/
242242
this.fimSupported = !!body?.template?.includes(".Suffix");
243-
244-
// Check if model template supports tool calling (same pattern as .Suffix above)
245-
if (body?.template) {
246-
this.templateSupportsTools = body.template.includes(".Tools");
247-
}
248243
})
249244
.catch((e) => {
250245
// console.warn("Error calling the Ollama /api/show endpoint: ", e);
@@ -516,12 +511,7 @@ class Ollama extends BaseLLM implements ModelInstaller {
516511
stream: options.stream,
517512
// format: options.format, // Not currently in base completion options
518513
};
519-
// Only include tools with user messages, and only if the template supports them
520-
if (
521-
options.tools?.length &&
522-
ollamaMessages.at(-1)?.role === "user" &&
523-
this.templateSupportsTools !== false
524-
) {
514+
if (options.tools?.length && ollamaMessages.at(-1)?.role === "user") {
525515
chatOptions.tools = options.tools.map((tool) => ({
526516
type: "function",
527517
function: {

core/util/paths.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,12 @@ export function getConfigJsonPath(): string {
118118

119119
export function getConfigYamlPath(ideType?: IdeType): string {
120120
const p = path.join(getContinueGlobalPath(), "config.yaml");
121-
if (!fs.existsSync(p) && !fs.existsSync(getConfigJsonPath())) {
122-
if (ideType === "jetbrains") {
123-
// https://github.com/continuedev/continue/pull/7224
124-
// This was here because we had different context provider support between jetbrains and vs code
125-
// Leaving so we could differentiate later but for now configs are the same between IDEs
126-
fs.writeFileSync(p, YAML.stringify(defaultConfig));
127-
} else {
128-
fs.writeFileSync(p, YAML.stringify(defaultConfig));
129-
}
121+
const exists = fs.existsSync(p);
122+
const isEmpty = exists && fs.readFileSync(p, "utf8").trim() === "";
123+
const needsCreation = !exists && !fs.existsSync(getConfigJsonPath());
124+
125+
if (needsCreation || isEmpty) {
126+
fs.writeFileSync(p, YAML.stringify(defaultConfig));
130127
setConfigFilePermissions(p);
131128
}
132129
return p;

extensions/intellij/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
pluginGroup=com.github.continuedev.continueintellijextension
2-
pluginVersion=1.0.65
2+
pluginVersion=1.0.67
33
platformVersion=2024.1
44
kotlin.stdlib.default.dependency=false
55
org.gradle.configuration-cache=true

extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/UriUtils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ object UriUtils {
2626
// Handle Windows file paths with authority component
2727
if (uriStr.startsWith("file://") && !uriStr.startsWith("file:///")) {
2828
val path = uriStr.substringAfter("file://")
29-
return URI("file:///$path")
29+
return URI("file", "", "/$path", null)
3030
}
3131

3232
return try {

extensions/intellij/src/test/kotlin/com/github/continuedev/continueintellijextension/unit/UriUtilsTest.kt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,19 @@ class UriUtilsTest : TestCase() {
6060
val expectedFile = File("/path/to/file with spaces")
6161
assertEquals(expectedFile, result)
6262
}
63+
64+
// Regression test for #10978 — bracket directories like [gamemode]
65+
fun `test square brackets in path`() {
66+
val uri = "file:///path/to/[gamemode]/file.lua"
67+
val result = UriUtils.uriToFile(uri)
68+
assertEquals(File("/path/to/[gamemode]/file.lua"), result)
69+
}
70+
71+
fun `test Windows path with square brackets`() {
72+
val uri = "file://C:/Users/user/projects/[gamemode]/file.lua"
73+
val parsed = UriUtils.parseUri(uri)
74+
assertEquals("file", parsed.scheme)
75+
assertEquals("/C:/Users/user/projects/[gamemode]/file.lua", parsed.path)
76+
assertEquals("file:///C:/Users/user/projects/%5Bgamemode%5D/file.lua", parsed.toString())
77+
}
6378
}

extensions/vscode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "continue",
33
"icon": "media/icon.png",
44
"author": "Continue Dev, Inc",
5-
"version": "1.3.36",
5+
"version": "1.3.38",
66
"repository": {
77
"type": "git",
88
"url": "https://github.com/continuedev/continue"

0 commit comments

Comments
 (0)