Skip to content

fix(sound): require tool calls for expansion - #12783

Merged
mudler merged 1 commit into
masterfrom
fix/sound-expansion-tool
Oct 19, 2026
Merged

mudler merged 1 commit into
masterfrom
fix/sound-expansion-tool

Conversation

@mudler-agent

Copy link
Copy Markdown
Collaborator

Description

Related to #12772.

Sound prompt expansion now requires exactly one strict, schema-backed
expand_sound tool call with tool_choice: required, instead of JSON in
assistant 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 a
model/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 auth builds. Both lint runs report zero issues. Reproduce with:

go test -p 2 ./core/backend ./pkg/functions ./core/http/endpoints/elevenlabs -count=1
go test -p 2 -tags auth ./core/backend ./pkg/functions ./core/http/endpoints/elevenlabs -count=1
golangci-lint run ./core/backend/... ./pkg/functions/... ./core/http/endpoints/elevenlabs/...
golangci-lint run --build-tags auth ./core/backend/... ./pkg/functions/... ./core/http/endpoints/elevenlabs/...

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

  • Yes, I signed my commits.
  • Documentation updated (docs/content/) for user-facing changes, or not applicable

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>
@mudler
mudler merged commit 2f4eaf1 into master Oct 19, 2026
20 of 23 checks passed
@mudler
mudler deleted the fix/sound-expansion-tool branch October 19, 2026 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants