-
Notifications
You must be signed in to change notification settings - Fork 4k
Open
Labels
ide:vscodeRelates specifically to VS Code extensionRelates specifically to VS Code extensionkind:bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behavioros:windowsHappening specifically on WindowsHappening specifically on Windows
Description
Before submitting your bug report
- I've tried using the "Ask AI" feature on the Continue docs site to see if the docs have an answer
- I'm not able to find a related conversation on GitHub discussions that reports the same bug
- I'm not able to find an open issue that reports the same bug
- I've seen the troubleshooting guide on the Continue Docs
Relevant environment info
- OS: Windows 11 using WSL2 (Continue Plugin is installed in WSL2)
- Continue version: 1.2.11
- IDE version: 1.107.1
- Model: qwen2.5-coder:14b
- config:
name: AI Agents Config
version: 1.0.0
schema: v1
models:
- name: Qwen Coder 14B
provider: ollama
model: qwen2.5-coder:14b
defaultCompletionOptions:
contextLength: 16384
reasoning: false
apiBase: http://192.168.1.12:11434/
roles:
- chat
- edit
- apply
- autocomplete
capabilities:
- tool_use
- name: Nomic Embed
provider: ollama
model: nomic-embed-text
apiBase: http://192.168.1.12:11434/
roles:
- embed
- rerank
context:
- provider: code
- provider: docs
- provider: diff
- provider: terminal
- provider: problems
- provider: folder
- provider: codebase
- provider: open
params:
onlyPinned: true
- provider: tree
- provider: debugger
params:
stackDepth: 3
- provider: repo-map
params:
includeSignatures: false
OR link to agent in Continue hub:Description
Whan asking in Agent mode to add additional line of code to existing JS it seems it replaces the whole file with some output that is supposed to be in the chat. The suggestions for the code change is correct, but the edit tool messes up the file.
I have seen this behavior also with qwen3:14b (model where the thinking process is output in the edited file).
Acually it starts changing the file and the messes it up.
To reproduce
- Install Ollamma and pull the required models
- Unzip the sample nodejs project and open in VS Code (in WSL2 connected from Windows hosted VSCode)
- Open the index.js and as Continue to add additional console log in to the currently open file
Log output
@Current File Please add additional console.log to the current file at the last line of the main method.
<important_rules>
You are in agent mode.
If you need to use multiple tools, you can call multiple read only tools simultaneously.
Always include the language and file name in the info string when you write code blocks.
If you are editing "src/main.py" for example, your code block should start with ' src/main.py'
For larger codeblocks (>20 lines), use brief language-appropriate placeholders for unmodified sections, e.g. '// ... existing code ...'
However, only output codeblocks for suggestion and demonstration purposes, for example, when enumerating multiple hypothetical options. For implementing changes, use the edit tools.
</important_rules>
<tool_use_instructions>
You have access to several "tools" that you can use at any time to retrieve information and/or perform tasks for the User.
To use a tool, respond with a tool code block () using the syntax shown in the examples below:
The following tools are available to you:
To read a file with a known filepath, use the read_file tool. For example, to read a file located at 'path/to/file.txt', you would respond with this:
TOOL_NAME: read_file
BEGIN_ARG: filepath
path/to/the_file.txt
END_ARG
To create a NEW file, use the create_new_file tool with the relative filepath and new contents. For example, to create a file located at 'path/to/file.txt', you would respond with:
TOOL_NAME: create_new_file
BEGIN_ARG: filepath
path/to/the_file.txt
END_ARG
BEGIN_ARG: contents
Contents of the file
END_ARG
To run a terminal command, use the run_terminal_command tool
The shell is not stateful and will not remember any previous commands. When a command is run in the background ALWAYS suggest using shell commands to stop it; NEVER suggest using Ctrl+C. When suggesting subsequent shell commands ALWAYS format them in shell command blocks. Do NOT perform actions requiring special/admin privileges. Choose terminal commands and scripts optimized for linux and x64 and shell /bin/bash.
You can also optionally include the waitForCompletion argument set to false to run the command in the background.
For example, to see the git log, you could respond with:
TOOL_NAME: run_terminal_command
BEGIN_ARG: command
git log
END_ARG
To return a list of files based on a glob search pattern, use the file_glob_search tool
TOOL_NAME: file_glob_search
BEGIN_ARG: pattern
*.py
END_ARG
To view the current git diff, use the view_diff tool. This will show you the changes made in the working directory compared to the last commit.
TOOL_NAME: view_diff
To view the user's currently open file, use the read_currently_open_file tool.
If the user is asking about a file and you don't see any code, use this to check the current file
TOOL_NAME: read_currently_open_file
To list files and folders in a given directory, call the ls tool with "dirPath" and "recursive". For example:
TOOL_NAME: ls
BEGIN_ARG: dirPath
path/to/dir
END_ARG
BEGIN_ARG: recursive
false
END_ARG
Sometimes the user will provide feedback or guidance on your output. If you were not aware of these "rules", consider using the create_rule_block tool to persist the rule for future interactions.
This tool cannot be used to edit existing rules, but you can search in the ".continue/rules" folder and use the edit tool to manage rules.
To create a rule, respond with a create_rule_block tool call and the following arguments:
- name: Short, descriptive name summarizing the rule's purpose (e.g. 'React Standards', 'Type Hints')
- rule: Clear, imperative instruction for future code generation (e.g. 'Use named exports', 'Add Python type hints'). Each rule should focus on one specific standard.
- description: Description of when this rule should be applied. Required for Agent Requested rules (AI decides when to apply). Optional for other types.
- globs: Optional file patterns to which this rule applies (e.g. ['**/*.{ts,tsx}'] or ['src/**/*.ts', 'tests/**/*.ts'])
- alwaysApply: Whether this rule should always be applied. Set to false for Agent Requested and Manual rules. Omit or set to true for Always and Auto Attached rules.
For example:
TOOL_NAME: create_rule_block
BEGIN_ARG: name
Use PropTypes
END_ARG
BEGIN_ARG: rule
Always use PropTypes when declaring React component properties
END_ARG
BEGIN_ARG: description
Ensure that all prop types are explicitly declared for better type safety and code maintainability in React components.
END_ARG
BEGIN_ARG: globs
**/*.js
END_ARG
BEGIN_ARG: alwaysApply
false
END_ARG
To fetch the content of a URL, use the fetch_url_content tool. For example, to read the contents of a webpage, you might respond with:
TOOL_NAME: fetch_url_content
BEGIN_ARG: url
https://example.com
END_ARG
To retrieve "rules" that contain more context/instructions based on their descriptions, use the request_rule tool with the name of the rule. The available rules are:
No rules available.
For example, you might respond with:
TOOL_NAME: request_rule
BEGIN_ARG: name
rule_name
END_ARG
To edit an EXISTING file, use the edit_existing_file tool with
- filepath: the relative filepath to the file.
- changes: Any modifications to the file, showing only needed changes. Do NOT wrap this in a codeblock or write anything besides the code changes. In larger files, use brief language-appropriate placeholders for large unmodified sections, e.g. '// ... existing code ...'
Only use this tool if you already know the contents of the file. Otherwise, use the read_file or read_currently_open_file tool to read it first.
For example:
TOOL_NAME: edit_existing_file
BEGIN_ARG: filepath
path/to/the_file.ts
END_ARG
BEGIN_ARG: changes
// ... existing code ...
function subtract(a: number, b: number): number {
return a - b;
}
// ... rest of code ...
END_ARG
To perform exact string replacements in files, use the single_find_and_replace tool with a filepath (relative to the root of the workspace) and the strings to find and replace.
For example, you could respond with:
TOOL_NAME: single_find_and_replace
BEGIN_ARG: filepath
path/to/file.ts
END_ARG
BEGIN_ARG: old_string
const oldVariable = 'value'
END_ARG
BEGIN_ARG: new_string
const newVariable = 'updated'
END_ARG
BEGIN_ARG: replace_all
false
END_ARG
If it seems like the User's request could be solved with one of the tools, choose the BEST one for the job based on the user's request and the tool descriptions
Then send the codeblock (YOU call the tool, not the user). Always start the codeblock on a new line.
Do not perform actions with/for hypothetical files. Ask the user or use tools to deduce which files are relevant.
You can only call ONE tool at at time. The tool codeblock should be the last thing you say; stop your response after the tool codeblock.
</tool_use_instructions>
user
This is the currently open file:
/index.js
import { fileURLToPath } from 'node:url';
const message = 'Hello';
const place = 'World';
export function stringConcat(str1, str2) {
return str1 + str2;
}
export function testVariable(log = console.log) {
log('This is %s', variable1);
log('This is %s', variable2);
let variable3 = 'a local test variable';
const variable4 = 'a constant local test variable';
if (typeof variable1 === 'undefined') {
var variable2 = 'another test variable';
let variable3 = 'a different local test variable';
console.log('This is %s', variable3);
}
var variable1 = 'a test variable';
log('This is %s', variable1);
log('This is %s', variable2);
log('This is %s', variable3);
log('This is %s', variable4);
}
export function reverseString(value) {
let reversedValue = '';
value.split('').forEach((char) => {
reversedValue = char + reversedValue;
});
return reversedValue;
}
export function printMessages(log = console.log) {
log('Hello, World!');
log('%s, %s!', message, place);
log(`${message}, ${place}!`);
}
// Only run when executed directly, so imports (like tests) don't trigger output.
if (process.argv[1] === fileURLToPath(import.meta.url)) {
console.log(stringConcat('Hello', 'World'));
console.log(stringConcat('1', '2'));
console.log(stringConcat('1', 2));
console.log(stringConcat(1, 2));
const price = 12.5;
const qty = 3;
const total = (price * qty).toFixed(2);
console.log(`Total: $${total}`);
const amount = 1234.56;
console.log(
`Total: ${new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
}).format(amount)}`
);
const loc = new Intl.Locale('en-US');
console.log(loc.language);
console.log(loc.region);
console.log(loc.baseName);
let bool1 = true;
console.log(`Boolean value: ${1 + 1} `);
console.log(`Boolean value: ${bool1} the opposite ${!bool1}`);
const a = 123456789012345678901234567890n;
console.log(a.toString());
console.log('Name:', '12123', 'Age:', 12);
console.log(typeof a);
console.log(typeof null);
console.log('Here is something undefined:', undefined);
console.log('Here is something null:', null);
console.log('alabala');
console.log('alabala');
for (let i = 0; i < 10; i++) {
console.log('Iteration:', i);
}
console.log('This is another iteration');
console.log('This is another iteration');
for (let index = 0; index < 10; index++) {
console.log(index);
}
console.log('This is a new string');
console.log('This is a new string');
}
Please add additional console.log to the current file at the last line of the main method.
assistant
TOOL_NAME: edit_existing_file
BEGIN_ARG: filepath
"src/index.js"
END_ARG
BEGIN_ARG: changes
"// ... existing code ...\nconsole.log('Final message from the script');"
END_ARG
user
Tool output for edit_existing_file tool call:
The user cancelled this tool call.
user
@Current File Please add additional console.log to the current file at the last line of the main method.
assistant
TOOL_NAME: read_currently_open_file
user
Tool output for read_currently_open_file tool call:
/index.js
import { fileURLToPath } from 'node:url';
const message = 'Hello';
const place = 'World';
export function stringConcat(str1, str2) {
return str1 + str2;
}
export function testVariable(log = console.log) {
log('This is %s', variable1);
log('This is %s', variable2);
let variable3 = 'a local test variable';
const variable4 = 'a constant local test variable';
if (typeof variable1 === 'undefined') {
var variable2 = 'another test variable';
let variable3 = 'a different local test variable';
console.log('This is %s', variable3);
}
var variable1 = 'a test variable';
log('This is %s', variable1);
log('This is %s', variable2);
log('This is %s', variable3);
log('This is %s', variable4);
}
export function reverseString(value) {
let reversedValue = '';
value.split('').forEach((char) => {
reversedValue = char + reversedValue;
});
return reversedValue;
}
export function printMessages(log = console.log) {
log('Hello, World!');
log('%s, %s!', message, place);
log(`${message}, ${place}!`);
}
// Only run when executed directly, so imports (like tests) don't trigger output.
if (process.argv[1] === fileURLToPath(import.meta.url)) {
console.log(stringConcat('Hello', 'World'));
console.log(stringConcat('1', '2'));
console.log(stringConcat('1', 2));
console.log(stringConcat(1, 2));
const price = 12.5;
const qty = 3;
const total = (price * qty).toFixed(2);
console.log(`Total: $${total}`);
const amount = 1234.56;
console.log(
`Total: ${new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
}).format(amount)}`
);
const loc = new Intl.Locale('en-US');
console.log(loc.language);
console.log(loc.region);
console.log(loc.baseName);
let bool1 = true;
console.log(`Boolean value: ${1 + 1} `);
console.log(`Boolean value: ${bool1} the opposite ${!bool1}`);
const a = 123456789012345678901234567890n;
console.log(a.toString());
console.log('Name:', '12123', 'Age:', 12);
console.log(typeof a);
console.log(typeof null);
console.log('Here is something undefined:', undefined);
console.log('Here is something null:', null);
console.log('alabala');
console.log('alabala');
for (let i = 0; i < 10; i++) {
console.log('Iteration:', i);
}
console.log('This is another iteration');
console.log('This is another iteration');
for (let index = 0; index < 10; index++) {
console.log(index);
}
console.log('This is a new string');
console.log('This is a new string');
}
assistant
To add an additional `console.log` statement at the last line of the main method, I will use the `edit_existing_file` tool again.
TOOL_NAME: edit_existing_file
BEGIN_ARG: filepath
"src/index.js"
END_ARG
BEGIN_ARG: changes
"// ... existing code ...\nconsole.log('Final message from the script');\nconsole.log('Script execution completed.');"
END_ARG
user
Tool output for edit_existing_file tool call:
The user cancelled this tool call.
user
The following file is currently open. Don't reference it if it's not relevant to the user's message:
/index.js
import { fileURLToPath } from 'node:url';
const message = 'Hello';
const place = 'World';
export function stringConcat(str1, str2) {
return str1 + str2;
}
export function testVariable(log = console.log) {
log('This is %s', variable1);
log('This is %s', variable2);
let variable3 = 'a local test variable';
const variable4 = 'a constant local test variable';
if (typeof variable1 === 'undefined') {
var variable2 = 'another test variable';
let variable3 = 'a different local test variable';
console.log('This is %s', variable3);
}
var variable1 = 'a test variable';
log('This is %s', variable1);
log('This is %s', variable2);
log('This is %s', variable3);
log('This is %s', variable4);
}
export function reverseString(value) {
let reversedValue = '';
value.split('').forEach((char) => {
reversedValue = char + reversedValue;
});
return reversedValue;
}
export function printMessages(log = console.log) {
log('Hello, World!');
log('%s, %s!', message, place);
log(`${message}, ${place}!`);
}
// Only run when executed directly, so imports (like tests) don't trigger output.
if (process.argv[1] === fileURLToPath(import.meta.url)) {
console.log(stringConcat('Hello', 'World'));
console.log(stringConcat('1', '2'));
console.log(stringConcat('1', 2));
console.log(stringConcat(1, 2));
const price = 12.5;
const qty = 3;
const total = (price * qty).toFixed(2);
console.log(`Total: $${total}`);
const amount = 1234.56;
console.log(
`Total: ${new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
}).format(amount)}`
);
const loc = new Intl.Locale('en-US');
console.log(loc.language);
console.log(loc.region);
console.log(loc.baseName);
let bool1 = true;
console.log(`Boolean value: ${1 + 1} `);
console.log(`Boolean value: ${bool1} the opposite ${!bool1}`);
const a = 123456789012345678901234567890n;
console.log(a.toString());
console.log('Name:', '12123', 'Age:', 12);
console.log(typeof a);
console.log(typeof null);
console.log('Here is something undefined:', undefined);
console.log('Here is something null:', null);
console.log('alabala');
console.log('alabala');
for (let i = 0; i < 10; i++) {
console.log('Iteration:', i);
}
console.log('This is another iteration');
console.log('This is another iteration');
for (let index = 0; index < 10; index++) {
console.log(index);
}
console.log('This is a new string');
console.log('This is a new string');
}
@Current File Please add additional console.log to the current file at the last line of the main method.
Options
{
"contextLength": 16384,
"reasoning": false,
"model": "qwen2.5-coder:14b",
"maxTokens": 4096
}
assistant
TOOL_NAME: edit_existing_file
BEGIN_ARG: filepath
"src/index.js"
END_ARG
BEGIN_ARG: changes
"// ...
assistant
existing code ...\nconsole.log('Final message from the script');\nconsole.log('Script execution completed.');"
END_ARG
Prompt
import { fileURLToPath } from 'node:url';
const message = 'Hello';
const place = 'World';
export function stringConcat(str1, str2) {
return str1 + str2;
}
export function testVariable(log = console.log) {
log('This is %s', variable1);
log('This is %s', variable2);
let variable3 = 'a local test variable';
const variable4 = 'a constant local test variable';
if (typeof variable1 === 'undefined') {
var variable2 = 'another test variable';
let variable3 = 'a different local test variable';
console.log('This is %s', variable3);
}
var variable1 = 'a test variable';
log('This is %s', variable1);
log('This is %s', variable2);
log('This is %s', variable3);
log('This is %s', variable4);
}
export function reverseString(value) {
let reversedValue = '';
value.split('').forEach((char) => {
reversedValue = char + reversedValue;
});
return reversedValue;
}
export function printMessages(log = console.log) {
log('Hello, World!');
log('%s, %s!', message, place);
log(`${message}, ${place}!`);
}
// Only run when executed directly, so imports (like tests) don't trigger output.
if (process.argv[1] === fileURLToPath(import.meta.url)) {
console.log(stringConcat('Hello', 'World'));
console.log(stringConcat('1', '2'));
console.log(stringConcat('1', 2));
console.log(stringConcat(1, 2));
const price = 12.5;
const qty = 3;
const total = (price * qty).toFixed(2);
console.log(`Total: $${total}`);
const amount = 1234.56;
console.log(
`Total: ${new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
}).format(amount)}`
);
const loc = new Intl.Locale('en-US');
console.log(loc.language);
console.log(loc.region);
console.log(loc.baseName);
let bool1 = true;
console.log(`Boolean value: ${1 + 1} `);
console.log(`Boolean value: ${bool1} the opposite ${!bool1}`);
const a = 123456789012345678901234567890n;
console.log(a.toString());
console.log('Name:', '12123', 'Age:', 12);
console.log(typeof a);
console.log(typeof null);
console.log('Here is something undefined:', undefined);
console.log('Here is something null:', null);
console.log('alabala');
console.log('alabala');
for (let i = 0; i < 10; i++) {
console.log('Iteration:', i);
}
console.log('This is another iteration');
console.log('This is another iteration');
for (let index = 0; index < 10; index++) {
console.log(index);
}
console.log('This is a new string');
console.log('This is a new string');
}
The following code was suggested as an edit:
// ... existing code ...
console.log('Final message from the script');
console.log('Script execution completed.');
Please apply it to the previous code.
Options
{
"contextLength": 16384,
"reasoning": false,
"model": "qwen2.5-coder:14b",
"maxTokens": 4096,
"raw": true
}Metadata
Metadata
Assignees
Labels
ide:vscodeRelates specifically to VS Code extensionRelates specifically to VS Code extensionkind:bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behavioros:windowsHappening specifically on WindowsHappening specifically on Windows
Type
Projects
Status
Todo