Commit graph

402 commits

Author SHA1 Message Date
Patrick Erichsen
d335ac1db1 Merge upstream continuedev/continue main (47 commits)
Includes: ClawRouter provider, JetBrains stability fixes, security
vulnerability patches, docs improvements, and dependency bumps.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 14:58:21 -07:00
Dallin Romney
7463037f4a
fix: remove inline backtick fences from tool instruction prose (#11869)
fix: remove inline backtick fences from tool instruction prose (#11674)

The system prompt prefix and suffix contained raw triple-backtick
sequences in prose text, producing an odd number of fence markers.
This made it ambiguous for models to distinguish actual tool-call
code fences from inline mentions of the syntax. Remove inline fence
syntax from prose, relying on the adjacent examples to convey the
format.
2026-03-25 18:56:15 -07:00
Dallin Romney
ff89a88299
fix: coerce MCP tool args to match schema string types (#11852)
* fix: coerce MCP tool args to match schema string types

When tool call arguments are parsed via JSON.parse(), string-typed
parameters containing valid JSON (e.g. file content for .json files)
get deeply parsed into objects. Built-in tools handle this via
getStringArg(), but MCP tools with dynamic schemas had no equivalent
fix, causing write_file and similar tools to receive objects instead
of strings.

Add coerceArgsToSchema() that checks the tool's inputSchema and
re-stringifies any values that should be strings before passing
args to the MCP client.

Fixes #8510

* fix: narrow coercion to only objects/arrays, not numbers/booleans

Only re-stringify values that are objects or arrays (the actual
deep-parsing issue). Numbers and booleans passed to a string-typed
parameter are left as-is so they surface as type errors rather than
being silently converted.
2026-03-25 16:39:01 -07:00
Nate
42030c70b6 Merge upstream continuedev/continue main (66 commits)
Brings in upstream fixes and features while preserving fork's
removals (free-trial, hub/community, control-plane).

Notable upstream additions:
- Gemini AI SDK support, Bedrock API key auth
- CLI session export/import, skills slash command
- Tool support expansion, reasoning message handling
- Model catalog updates (Claude 4.6, Gemini 3.1 Pro)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 14:10:34 -07:00
shanevcantwell
c79e6489a7
fix: restrict terminal childProcess.spawn to local-only environments (#10538)
fix: restrict childProcess.spawn to local-only environments

childProcess.spawn executes on the extension host machine. With
extensionKind: ["ui", "workspace"], the extension host almost always
runs locally. For any remote workspace (SSH, WSL, Dev Container,
Codespaces, tunnel), spawning locally either runs commands on the wrong
machine or fails with ENOENT when the local shell doesn't exist in the
extension host context.

Replace ENABLED_FOR_REMOTES (which listed all remote types) with
LOCAL_ONLY (just "" and "local"). All remote types now fall through to
ide.runCommand() which delegates to VS Code's integrated terminal and
executes in the correct remote environment.

The isWindowsHostWithRemote guard is removed as it is now redundant —
the platform-agnostic check handles all cases.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 20:33:04 -07:00
MumuTW
ffb6ea45f0
Fix system-message tools parser when tool call is non-terminal (#11092)
* fix(openai-adapters): map reasoning-delta to reasoning_content

* Fix system-message tool parser for non-terminal tool calls

* Fix duplicate predefined tools in dynamic system-message section

* fix(openai-adapters): fix TS syntax error in vercelStreamConverter test

The `as typeof X & Y` type assertion was ambiguous to the TypeScript
parser without parentheses, causing TS1005 errors across all CI checks.
Simplify to `as any` since this is a test assertion.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: remove unrelated vercelStreamConverter changes

Per reviewer feedback — keeping this PR focused on the
system-message tools parser fix.

* fix: correct test expectations for post-tool-call content preservation

The 'preserves content after a tool call' test incorrectly consumed the
trailing newline and preserved text within the tool-call loop. Adjusted
the loop count from 6 to 4 (actual tool-call deltas) and added explicit
assertions for the trailing newline and preserved content chunks.

The 'mid-message' test was missing an assertion for the newline chunk
emitted between the closing codeblock fence and trailing text.

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: MumuTW <mumu@novel98.com>
2026-03-24 11:56:43 -07:00
Keita A.
5d19470aa9
fix: add default timeout for terminal command tool execution (#10550)
* fix: add default timeout for terminal command tool execution

Terminal commands with waitForCompletion=true had no timeout, risking
indefinite hangs. Adds a 2-minute default timeout with graceful
SIGTERM -> 5s grace period -> SIGKILL escalation. Both streaming
and non-streaming code paths are covered. The SIGKILL timer is
properly cleared if the process exits during the grace period.

* fix: correct process running check and clear SIGKILL timer

Replace `childProc.killed` with `exitCode === null && signalCode === null`
for accurate process-state detection, and clear sigkillTimeoutId in error
handlers to prevent delayed kills after rejection.

Applied to both streaming and non-streaming paths.

---------

Co-authored-by: amabito <192487536+amabito@users.noreply.github.com>
Co-authored-by: amabito <amabito@local>
2026-03-24 11:04:28 -07:00
Patrick Erichsen
b60273502e refactor: remove Hub/Mission Control connection code (CON-5885)
Remove all ControlPlaneClient infrastructure, WorkOS auth, managed proxy,
platform profile loading, org policy enforcement, and credits UI.
Config is now fully local — only file-based config.yaml and .env secrets.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 12:55:19 -07:00
shanevcantwell
fe0661e386 fix: harden system message tools and wire toolOverrides to system message path (#10485)
fix: harden system message tools instructions and wire toolOverrides to system message path

The system message tools path (used when models don't support native tool
calling) had two issues:

1. Weak format instructions - the prefix/suffix used vague prose that local
   models often ignored, reverting to XML or JSON tool call formats from
   their training priors. Replaced with explicit numbered rules that
   prohibit alternative formats.

2. toolOverrides silently ignored - applyToolOverrides() existed and ran on
   the native tools path (in BaseLLM.streamChat), but was never called on
   the system message path. Config YAML toolOverrides for disabled and
   description had no effect when tools were injected via system message.

Fixed by:
- Strengthening systemMessagePrefix/Suffix in toolCodeblocks framework
- Adding toolOverrides to ModelDescription interface and serialization
- Calling applyToolOverrides() in streamNormalInput before both paths

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 17:00:34 -07:00
shanevcantwell
df8ef7ad56
fix: harden system message tools and wire toolOverrides to system message path (#10485)
fix: harden system message tools instructions and wire toolOverrides to system message path

The system message tools path (used when models don't support native tool
calling) had two issues:

1. Weak format instructions - the prefix/suffix used vague prose that local
   models often ignored, reverting to XML or JSON tool call formats from
   their training priors. Replaced with explicit numbered rules that
   prohibit alternative formats.

2. toolOverrides silently ignored - applyToolOverrides() existed and ran on
   the native tools path (in BaseLLM.streamChat), but was never called on
   the system message path. Config YAML toolOverrides for disabled and
   description had no effect when tools were injected via system message.

Fixed by:
- Strengthening systemMessagePrefix/Suffix in toolCodeblocks framework
- Adding toolOverrides to ModelDescription interface and serialization
- Calling applyToolOverrides() in streamNormalInput before both paths

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 12:52:05 -07:00
zerone0x
b091f5184d
fix: preserve leading dot in ls tool path resolution (#10515)
The `resolveLsToolDirPath` function incorrectly stripped leading dots
from paths like `.continue/rules`, converting them to `continue/rules`
which doesn't exist. This broke the ls tool for any hidden directory.

Remove the faulty condition that matched paths starting with "." but
not "./" and stripped their first character. The path resolver handles
these paths correctly without preprocessing.

Fixes #10466

Co-authored-by: Claude <noreply@anthropic.com>
2026-03-10 00:08:14 -07:00
MumuTW
e63c5f8994
Fix duplicate predefined tools in dynamic tools system message (#11101)
Fix duplicate predefined tools in dynamic system-message section
2026-03-09 23:42:02 -07:00
Nate Sesti
faca87bbc8
fix: add security check to createNewFile tool (CWE-22) (#11238)
* fix: add security check to createNewFile tool (CWE-22)

The createNewFile tool was missing the throwIfFileIsSecurityConcern()
check that readFile already has, allowing path traversal to write
sensitive file types (e.g. .env, SSH keys) via prompt injection.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: upgrade tar-fs to patch CVE-2024-12905 and CVE-2025-59343

core/vendor had tar-fs@2.1.2 (via prebuild-install) and tar-fs@3.0.8,
both in vulnerable ranges. npm audit fix upgraded them.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 12:27:47 -07:00
Dallin Romney
ce63eae384
feat: make create/read rule tools disabled by default (#10543)
feat: create/read rule tools disabled by default
2026-02-16 12:15:57 -08:00
shanevcantwell
b7c2b4f074 fix: generalize Windows remote detection for terminal commands
Broadens the Windows-with-remote check from WSL-only to all non-local
remotes (Dev Container, SSH, Codespaces, etc.) so that terminal commands
fall back to ide.runCommand() instead of trying to spawn powershell.exe.

Fixes #10007

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 08:01:35 -07:00
Dallin Romney
a7a5351b9c
feat: limited MCP App support (#10132)
* feat: MCP apps part 1

* feat: MCP app support part 3

* chore: cleanup PR

* chore: clean up mcp ui app types

* fix: address cubic feedback
2026-02-05 19:07:44 -08:00
shanevcantwell
d80845c403
feat: add tool prompt override support in .continuerc.json (#9314)
* feat: add tool prompt overrides support in YAML model config

Adds per-model tool prompt overrides under chatOptions in YAML config:

```yaml
models:
  - name: my-model
    chatOptions:
      toolPromptOverrides:
        run_terminal_command:
          description: "Custom description"
        view_diff:
          disabled: true
```

This replaces the JSON-only implementation with YAML-only support as
requested by maintainers. The JSON implementation is preserved on the
`feature/tool-prompt-overrides-json` branch for reference.

Changes:
- Add toolOverrideSchema to chatOptionsSchema (packages/config-yaml)
- Add ToolOverride interface and toolPromptOverrides to LLMOptions (core)
- Store and apply overrides in BaseLLM.streamChat()
- Add applyToolOverrides utility with comprehensive tests

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(cli): add tool prompt overrides support for CLI parity

Apply toolPromptOverrides from YAML model config in CLI,
ensuring feature parity with VS Code extension.

- Add applyChatCompletionToolOverrides helper for CLI tool format
- Apply overrides in streamChatResponse before LLM calls
- Support description changes and disabling tools
- Add unit tests for override logic

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* chore: package lock update

* ci: retrigger after hub 502

* refactor: rename toolPromptOverrides to toolOverrides

- Rename property across core, config-yaml, and CLI
- Consolidate ToolOverride type to extend ToolOverrideConfig from
  config-yaml instead of duplicating 7 fields
- Inline record-to-array conversion to match file patterns

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* chore: retrigger CI (clean run)

* chore: revert gui package-lock to main

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Dallin Romney <dallinromney@gmail.com>
2026-02-02 21:55:21 -08:00
silencezhoudev
82f6f69522 fix: support object-type arguments in tool call parsing
Add type check in safeParseToolCallArgs to handle cases where
toolCall.function.arguments is already an object instead of a JSON string.
This prevents parameter loss and 'argument is required' errors in tool calls.
2026-01-21 18:16:12 +08:00
shanevcantwell
c565bdc464 fix: use ide.runCommand when Windows host connects to WSL
When the VS Code extension runs on Windows but connects to WSL,
direct shell spawning fails because process.platform is "win32"
but commands should execute in the Linux WSL environment.

This caused: spawn powershell.exe ENOENT

The fix detects this scenario and falls back to ide.runCommand(),
letting VS Code handle the remote terminal execution properly.

Fixes #9661

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 10:55:16 -07:00
uinstinct
f5c345254d support relative path for workspace dirs 2026-01-15 19:00:09 +05:30
uinstinct
b9bcd33cce add supporting files for skill tool 2026-01-15 13:05:03 +05:30
uinstinct
2ecccb0fa5 Merge branch 'main' into agent-skills 2026-01-15 11:39:22 +05:30
Dallin Romney
e419333183
Merge pull request #9325 from shanevcantwell/fix/wsl2-terminal-command-uri
fix: handle non-file URI schemes in runTerminalCommand for WSL2
2026-01-14 13:26:24 -08:00
Volodymyr Bychkovyak
c078d772eb fix issue with lsTool listing fs root instead of current folder 2026-01-06 22:53:36 -06:00
shanevcantwell
8e5a7c2152 refactor: generalize remote URI handling and remove CLAUDE.md
- Remove WSL-specific check in favor of generic URI handling
- Support all vscode-remote:// URI schemes (WSL, SSH, dev-container)
- Prefer file:// URIs when available, fall back to remote URIs
- Add tests for various remote URI formats
- Remove CLAUDE.md per reviewer feedback (use AGENTS.md convention)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 19:08:33 -07:00
uinstinct
5f7ecaba01 fix test lints 2026-01-06 17:58:53 +05:30
uinstinct
c219e3e5c9 read skill is a tool definition 2026-01-06 17:31:04 +05:30
uinstinct
cef4b8ded2 get config dependent tool definitions async 2026-01-06 17:30:19 +05:30
uinstinct
d7543312c2 prevent loading in system message 2026-01-06 17:22:59 +05:30
uinstinct
b6eddec2f4 add read skill tool 2025-12-30 12:51:16 +05:30
shanevcantwell
6b30a88fb0 style: fix prettier formatting
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 06:27:00 -07:00
shanevcantwell
27adb1d677 fix: use try/finally for env cleanup in test
Ensures process.env.HOME is restored even if assertions fail,
preventing flaky behavior in subsequent tests.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 05:36:39 -07:00
shanevcantwell
3ef9f89e8f test: add comprehensive tests for WSL workspace path resolution
Tests cover:
- Basic WSL URI parsing
- URL-encoded spaces and special characters
- Unicode path handling
- Different WSL distro names
- Priority of WSL URIs over file:// URIs
- Fallback behavior
- Edge cases (plus signs, percent signs, mixed encoding)
- Comparison with fileURLToPath behavior

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 05:30:02 -07:00
shanevcantwell
074a6c74ba fix: decode URI-encoded pathname for WSL workspace paths
Paths with spaces or special characters (e.g., /home/user/my%20project)
need decodeURIComponent() to match actual filesystem paths.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 05:14:40 -07:00
shanevcantwell
eab2ac1e04 fix: properly resolve WSL2 workspace paths in runTerminalCommand
Parse vscode-remote://wsl+distro/path URIs to extract the actual
workspace path instead of falling back to Windows HOME directory.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 05:10:13 -07:00
shanevcantwell
788e25338a fix: wrap fileURLToPath in try-catch for WSL2 compatibility
The fileURLToPath function can throw "The URL must be of scheme file"
in some WSL2/remote environments with malformed URIs. Wrap in try-catch
to fall through to HOME directory fallback.

Fixes #8091

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 02:57:06 -07:00
Dallin Romney
41c4f297f3 fix: prompt tweak 2025-12-11 23:01:45 -08:00
Dallin Romney
46b31af330 fix: clarify can't edit in parallel with itself either 2025-12-11 23:01:23 -08:00
continue[bot]
d70bdbbf28
Fix readFileRange Kotlin Int overflow in IntelliJ plugin (#8976)
* Fix readFileRange Kotlin Int overflow in IntelliJ plugin

Replace Number.MAX_SAFE_INTEGER with Int.MAX_VALUE (2147483647) to prevent
JSON deserialization errors in IntelliJ plugins.

The issue occurred because JavaScript's Number.MAX_SAFE_INTEGER (2^53 - 1)
exceeds Kotlin's Int maximum value (2^31 - 1), causing the following error:
'java.lang.NumberFormatException: Expected an int but was 9007199254740991'

This change ensures compatibility with Kotlin's Int type while still reading
to the end of each line as intended.

Fixes #8517

Co-authored-by: dallin <dallin@continue.dev>
Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <noreply@continue.dev>

* Trigger CI re-run

The previous CI failure was a flaky test in the CLI extension, unrelated to our changes.

Co-authored-by: dallin <dallin@continue.dev>
Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <noreply@continue.dev>

* Extract magic number into MAX_CHAR_POSITION constant

Improve code maintainability by defining the Kotlin Int.MAX_VALUE as a
named constant with clear documentation.

Co-authored-by: dallin <dallin@continue.dev>
Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <noreply@continue.dev>

* Trigger CI re-run for flaky tests

Flaky UI tests failing intermittently on macOS (Node 18, 20) but passing
on all other platforms. Tests are unrelated to readFileRange changes.

Co-authored-by: dallin <dallin@continue.dev>
Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <noreply@continue.dev>

* Fix flaky CLI UI tests on macOS

Increase timeouts for UI rendering tests on macOS to prevent race conditions.
The tests were failing intermittently on macOS with Node 18/20 due to
insufficient wait times for UI stabilization.

Changes:
- Double timeouts on macOS in TUIChat.fileSearch.test.tsx
- Add extra 100ms wait on macOS in TUIChat.slashCommands.test.tsx
- Tests now pass consistently across all platforms

Co-authored-by: dallin <dallin@continue.dev>
Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <noreply@continue.dev>

* fix: revert test changes

---------

Co-authored-by: continue[bot] <continue[bot]@users.noreply.github.com>
Co-authored-by: Continue <noreply@continue.dev>
Co-authored-by: Dallin Romney <dallinromney@gmail.com>
2025-12-05 12:13:39 -08:00
Matt Cowger
e04c21f9c8 Address comments from @RomneyDa 2025-12-02 20:28:45 +00:00
Matt Cowger
a3810024c6 Add tests to match. 2025-12-02 20:15:10 +00:00
Matt Cowger
5f14a2fa66 fix: handle JSON contents of create_new_file
Handle case where JSON content was parsed into an object by the tool call parser.  If the arguments to the tool call are valid JSON (e.g. the model attempts to create a .json file) the earlier call to JSON.parse() will have deeply parsed the returned contents. If that has happened, convert back to string.

Fixes: #8972
2025-12-02 20:08:26 +00:00
Dallin Romney
814cc205fb fix: unify cwd and add missing case 2025-11-27 02:29:13 -08:00
Aditya Mitra
a20e11227f
Merge pull request #8830 from uinstinct/ripgrep-regex
fix: regular expressions in ripgrep
2025-11-27 01:43:17 -08:00
Dallin Romney
462e7168bd fix: terminal cwd tests 2025-11-24 15:12:20 -08:00
Continue Agent
857903aa5b Add test coverage for runTerminalCommand cwd handling with non-file URIs
Tests verify that the fix correctly:
- Filters for file:// URIs before calling fileURLToPath
- Falls back to HOME/USERPROFILE/cwd/tmpdir when no file URIs exist
- Handles various workspace configurations (empty, non-file URIs, mixed)
- Works across different remote environments (local, WSL, dev-container)

Co-authored-by: nate <nate@continue.dev>

Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <noreply@continue.dev>
2025-11-24 21:56:19 +00:00
Dallin Romney
4837ef1352 fix: only set cwd to file URI if file uri found 2025-11-24 13:49:29 -08:00
Dallin Romney
7c369e0ac9 fix: only set cwd to file URI if found 2025-11-24 13:49:10 -08:00
continue[bot]
705dc7097c
Merge pull request #8674 from continuedev/dallinbriggs/8673-bash-tool-guidance
Add guidance to Bash tools to prefer edit tools over bash commands
2025-11-10 17:38:21 -08:00
Aditya Mitra
03fda47566
refactor: specify grep search tool to use regex (#8384)
* refactor: specify grep search tool to use regex

* more refinement
2025-10-22 14:46:24 -07:00