fix: harden system message tools and wire toolOverrides to system message path#10485
Open
shanevcantwell wants to merge 1 commit intocontinuedev:mainfrom
Open
fix: harden system message tools and wire toolOverrides to system message path#10485shanevcantwell wants to merge 1 commit intocontinuedev:mainfrom
shanevcantwell wants to merge 1 commit intocontinuedev:mainfrom
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
capabilities: []orexperimental.onlyUseSystemMessageTools). The previous prose instructions were too vague — local models reverted to XML/JSON tool call formats from their training priors.toolOverridesbeing silently ignored on the system message path.applyToolOverrides()already existed and ran on the native tools path (inBaseLLM.streamChat()), but was never called when tools were injected via system message text. Config YAMLtoolOverridesfordisabledanddescriptionnow take effect on both paths.Changes
core/tools/systemMessageTools/toolCodeblocks/index.ts— Replaced prosesystemMessagePrefix/systemMessageSuffixwith explicit numbered rules that prohibit XML tags, JSON format, and tool inventioncore/index.d.ts— AddedtoolOverridestoModelDescriptioninterfacecore/config/load.ts— SerializedtoolOverridesinllmToSerializedModelDescription()gui/src/redux/thunks/streamNormalInput.ts— ImportedapplyToolOverridesand applied model-level overrides toactiveToolsbefore both the native and system message pathsTest plan
cd core && npm run vitest— 1654 passed, 0 failuresview_diffwithdisabled: trueis absent from system message🤖 Generated with Claude Code
Summary by cubic
Improves reliability of system-message tool calls for local models and applies model-level toolOverrides on that path. Local models now follow the codeblock format, and disabled/description overrides from config are respected.
Written for commit 1a59f1a. Summary will update on new commits.