SIGN IN SIGN UP

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>
S
shanevcantwell committed
df8ef7ad5692f62dcd403008e3cd0d5cc8caa08f
Parent: 72735f3
Committed by GitHub <noreply@github.com> on 3/13/2026, 7:52:05 PM