feat: add tool prompt override support in .continuerc.json#9314
feat: add tool prompt override support in .continuerc.json#9314RomneyDa merged 7 commits intocontinuedev:mainfrom
Conversation
Learn moreAll Green is an AI agent that automatically: ✅ Addresses code review comments ✅ Fixes failing CI checks ✅ Resolves merge conflicts |
|
📚 Documentation PR created: #9315 I've created a documentation PR that adds usage examples and explains the new tool prompt override feature. The docs include accordion components showing how to:
The documentation follows the existing structure in |
|
@sestinj Just to personalize this a bit... I've been trying to love Every model is a little different, so making the tool prompts completely override-able is to me just a necessity. I tried to stick to your established patterns and touch as little as possible, and I think there is minimal drift. I hope you'll consider this a nice xmas gift! { |
|
Before & after for reference (with PR #9325 fix) (gpt-oss-20b)
|
RomneyDa
left a comment
There was a problem hiding this comment.
@shanevcantwell the ability to override tool prompts would be a neat change. Currently JSON configuration is deprecated and we are very tentative to make changes that only work in JSON.
What if we put this under chatOptions in a model's YAML configuration? Or thoughts on other ways we could make this work for most users?
3f26b0d to
df3e417
Compare
There was a problem hiding this comment.
@shanevcantwell realized one more thing, it could be confusing to users if their toolPromptOverrides apply in VS Code but not in the CLI. Are you a CLI user by chance? If so could you take a look at implementing the same override application during CLI tool loading? If not I could take a look at it next week
Note @chezsmithy took a go at unifying the core and CLI tool types recently, somewhat relevant here but we wouldn't need to unify to apply the same toolPromptOverrides to each style of tool definition #8555
Absolutely. This new addition passes existing and a few new tests, but I don't have experience with the CLI to verify it working in realistic situations. New tests: extensions/cli/src/tools/applyToolOverrides.test.ts (6 tests): Returns tools unchanged when no overrides |
|
@shanevcantwell waiting on the final go ahead from team since involves YAML schema change |
RomneyDa
left a comment
There was a problem hiding this comment.
@shanevcantwell appreciate the iterations!
RomneyDa
left a comment
There was a problem hiding this comment.
@shanevcantwell one last tweak, could we call it toolOverrides instead of toolPromptOverrides? Since it adds ability to override all tool properties not just json schema descriptions etc
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>
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>
- 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>
fa52b93 to
0d6ebe1
Compare
|
@shanevcantwell looks like just the gui package lock changes are breaking CI, should work if reverted |
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
@shanevcantwell appreciate the iterations! |
|
🎉 This PR is included in version 1.41.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |


Summary
Adds the ability to customize tool prompts via
.continuerc.jsonat the workspace level, plus fixes two bugs that were preventing this feature from working.ToolOverrideinterface for customizing tool descriptions, disabling tools, or modifying system message prompts.continuerc.jsonfiles (Bug: .continuerc.json files fail to load due to 'this' binding issue #9312).continuerc.jsonfiles (Bug: YAML config path does not load workspace .continuerc.json files #9313)Motivation
Local models (via LM Studio, Ollama, etc.) often struggle with Continue's default tool prompts, which include legacy syntax examples that confuse models into outputting raw
[TOOL_CALLS]BEGIN_ARG...text instead of using proper tool calling.This feature allows per-repo customization of tool prompts to work better with specific models.
Before (broken tool syntax output):
After (clean tool usage with custom prompts):
Example
.continuerc.json{ "mergeBehavior": "merge", "tools": [ { "name": "view_diff", "disabled": true }, { "name": "read_file", "description": "Read file contents. Use relative paths from workspace root.", "systemMessageDescription": { "prefix": "To read a file, use read_file with a relative path:" } } ] }Bug Fixes Included
Fix #9312:
.continuerc.jsonfiles fail to loadrcFiles.map(ide.readFile)lostthisbinding, causing silent failures. Fixed by usingrcFiles.map((uri) => ide.readFile(uri)).Fix #9313: YAML config path ignores
.continuerc.jsonloadContinueConfigFromYamlnever calledgetWorkspaceRcConfigs. Added conditional loading indoLoadConfig.tsso tool overrides work regardless of config format.Test plan
.continuerc.jsonloads with JSON config.continuerc.jsonloads with YAML configdisabled: trueremoves tool from listFixes #9312, Fixes #9313
🤖 Generated with Claude Code
Summary by cubic
Add per-model tool prompt overrides via YAML config to customize or disable tools, applied in BaseLLM and the CLI during chat.
Written for commit f3883ee. Summary will update on new commits.
Continue Tasks:▶️ 1 queued · ▶️ 1 not started · ✅ 1 merged — View all