Skip to content

Conversation

@shanevcantwell
Copy link

@shanevcantwell shanevcantwell commented Dec 25, 2025

Summary

Adds the ability to customize tool prompts via .continuerc.json at the workspace level, plus fixes two bugs that were preventing this feature from working.

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):

[TOOL_CALLS]ls BEGIN_ARG: dirPath ./docs END_ARG BEGIN_ARG: recursive false END_ARG

After (clean tool usage with custom prompts):

  • Model lists available tools properly
  • Tools are called via native function calling
  • No broken syntax in output

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.json files fail to load

rcFiles.map(ide.readFile) lost this binding, causing silent failures. Fixed by using rcFiles.map((uri) => ide.readFile(uri)).

Fix #9313: YAML config path ignores .continuerc.json

loadContinueConfigFromYaml never called getWorkspaceRcConfigs. Added conditional loading in doLoadConfig.ts so tool overrides work regardless of config format.

Test plan

  • Verified .continuerc.json loads with JSON config
  • Verified .continuerc.json loads with YAML config
  • Verified disabled: true removes tool from list
  • Verified custom descriptions appear in tool prompts
  • Tested with devstral via LM Studio - clean tool usage

Fixes #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 during chat.

  • New Features
    • Support chatOptions.toolPromptOverrides (keyed by tool name) in YAML model config.
    • Apply overrides at runtime with applyToolOverrides; added ToolOverride type and tests.

Written for commit df3e417. Summary will update on new commits.

@shanevcantwell shanevcantwell requested a review from a team as a code owner December 25, 2025 06:25
@shanevcantwell shanevcantwell requested review from sestinj and removed request for a team December 25, 2025 06:25
@continue
Copy link
Contributor

continue bot commented Dec 25, 2025

All Green - Keep your PRs mergeable

Learn more

All Green is an AI agent that automatically:

✅ Addresses code review comments

✅ Fixes failing CI checks

✅ Resolves merge conflicts


Unsubscribe from All Green comments

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Dec 25, 2025
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 7 files

@continue
Copy link
Contributor

continue bot commented Dec 25, 2025

📚 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:

  • Override tool descriptions
  • Disable specific tools
  • Customize system message prompts
  • Override display titles and action phrases

The documentation follows the existing structure in .continuerc.json section and uses Mintlify components for better discoverability.

@shanevcantwell
Copy link
Author

shanevcantwell commented Dec 25, 2025

@sestinj Just to personalize this a bit... I've been trying to love Continue with my local models for like 6mo now, but tool usage never worked. I finally discovered that there were multiple conflicting messages being prompted to the models. With this in place, and the following tool definitions, tools now "just work", with dozens of mixin tool calls strung together, and no broken tool call text in the stream.

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!
Cheers

{
"mergeBehavior": "merge",
"tools": [
{
"name": "view_diff",
"disabled": true
},
{
"name": "read_file",
"description": "Read the contents of an existing file. Use relative paths from workspace root (e.g., 'src/index.ts').",
"systemMessageDescription": {
"prefix": "To read a file, use the read_file tool with a relative path from workspace root. Example:"
}
},
{
"name": "create_new_file",
"description": "Create a new file with the specified content. Use relative paths from workspace root.",
"systemMessageDescription": {
"prefix": "To create a new file, use the create_new_file tool with a relative path. Example:"
}
},
{
"name": "run_terminal_command",
"description": "Run a shell command in the workspace directory. Stateless between calls. Use Edit tools for file modifications.",
"systemMessageDescription": {
"prefix": "To run a terminal command, use the run_terminal_command tool. Shell is stateless. Use Edit tools instead of sed/awk. Example:"
}
},
{
"name": "grep_search",
"description": "Search file contents using regex patterns. Returns matching lines with context.",
"systemMessageDescription": {
"prefix": "To search file contents, use grep_search with a regex pattern. Example:"
}
},
{
"name": "glob_search",
"description": "Find files by name pattern (e.g., '**/*.ts'). Use for locating files.",
"systemMessageDescription": {
"prefix": "To find files by name pattern, use glob_search. Example:"
}
},
{
"name": "multi_edit",
"description": "Make multiple edits to files. Each edit: filepath, old_string (exact match), new_string.",
"systemMessageDescription": {
"prefix": "To edit files, use multi_edit with filepath, old_string, and new_string. Use relative paths. Example:"
}
}
],
"chatOptions": {
"baseSystemMessage": "You are an AI coding assistant. Focus on completing tasks efficiently. Use relative paths from workspace root for all file operations. Be concise."
}
}

@shanevcantwell
Copy link
Author

shanevcantwell commented Dec 26, 2025

Before & after for reference (with PR #9325 fix) (gpt-oss-20b)

image

Copy link
Collaborator

@RomneyDa RomneyDa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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?

* Configuration for overriding built-in tool prompts.
* Allows customization of tool descriptions and behavior at the repo level.
*/
export interface ToolOverride {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally use Partial<Pick<Tool, ....>> or similar for this type

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cheers, thanks for having a look. I missed that detail about JSON deprecation. No problem at all. I'll put the JSON implementation on a separate branch on my fork in case there is any use for it, and bring in your chatOptions suggestion to replace the PR code. I'll get right on getting it back through the CI.

@github-project-automation github-project-automation bot moved this from Todo to In Progress in Issues and PRs Jan 6, 2026
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>
@shanevcantwell shanevcantwell force-pushed the feature/tool-prompt-overrides branch from 3f26b0d to df3e417 Compare January 7, 2026 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Bug: YAML config path does not load workspace .continuerc.json files Bug: .continuerc.json files fail to load due to 'this' binding issue

2 participants