Repository navigation
fix(sound): require tool calls for expansion - #12783
Merged
Merged
Conversation
Require one expand_sound call instead of parsing assistant prose. Reject unsupported templates and invalid arguments before audio generation. Keep installed configuration unchanged and preserve explicit controls. Assisted-by: nib:gpt-6.1-sol Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This was referenced Oct 20, 2026
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.
Description
Related to #12772.
Sound prompt expansion now requires exactly one strict, schema-backed
expand_soundtool call withtool_choice: required, instead of JSON inassistant prose. The server parses and validates only the tool arguments.
Missing, wrong, multiple, or invalid calls stop before audio generation;
assistant prose and reasoning never provide fallback arguments.
Expansion requires
llama-cpp,use_tokenizer_template: true, and amodel/template with native tool support. The request clears explicit grammar
locally without changing the installed configuration. Explicit controls,
authorization, cancellation, and requests without expansion keep their
existing behavior. Documentation and regression tests cover the new contract.
Notes for Reviewers
Verification passes for the backend, function helpers, and HTTP endpoint in
normal and
authbuilds. Both lint runs report zero issues. Reproduce with:The native schema compilation check passes. Real-model inference remains
unverified because authentication blocked runtime validation. Mock-backed
HTTP tests do not establish compatibility with a particular model/template.
Enabling tokenizer templates alone does not guarantee native tool support.
Existing expansion configurations without native tools must select a
compatible model/template; unsupported configurations now fail closed.
Signed commits