Skip to content

fix(config): skip text_to_speech engine validation when disabled - #1142

Merged
edenreich merged 2 commits into
mainfrom
fix/issue-1141
Sep 1, 2026
Merged

edenreich merged 2 commits into
mainfrom
fix/issue-1141

Conversation

@inference-gateway-maintainer

Copy link
Copy Markdown
Contributor

Resolves #1141

Summary

Config loading exited with code 1 when the shared ~/.infer/config.yaml contained a text_to_speech.engine value the running binary does not know (e.g. gateway written by 0.186.0, read by 0.185.x), even though text_to_speech.enabled was false. A disabled text_to_speech never consults its engine, so Config.Validate now gates the text_to_speech engine/model validation on text_to_speech.enabled: invalid sub-fields of a disabled feature no longer make config loading fatal, which unbricks binaries sharing a userspace config with a newer version (desktop app bundling an older CLI).

Changes

  • config/config.go: wrap the text_to_speech engine/model switch in Config.Validate with a c.TextToSpeech.Enabled guard, with a comment explaining the shared-config-across-versions rationale. Validation still rejects unknown engines and malformed gateway models when the feature is enabled.
  • config/text_to_speech_test.go: new "unknown engine or bad model is ignored when disabled" table test (engine from a newer binary, unknown engine, bad gateway model); the existing "gateway rejects a model without a provider" and "unknown engine is rejected" cases now opt in with Enabled = true since rejection only applies to an enabled feature.

Testing

  • go test -tags purego ./config/ -run TestValidateTextToSpeechEngine -v: all pass, including the new disabled cases.
  • go test -tags purego ./config/: pass; go vet -tags purego ./config/ ./cmd/runtime/: pass.
  • TestPointerDefaultsSurviveWithoutEnvOverride / TestPointerOptionPrecedence in cmd/runtime fail in this Actions-runner sandbox and fail identically on main (documented pre-existing environmental failure; unrelated to this change).
  • Pre-commit hooks (mod tidy, fmt, lint:imports, golangci-lint, markdownlint) all passed on the commit.

…s disabled

An unknown text_to_speech.engine written by a newer binary sharing the same ~/.infer/config.yaml must not make config loading fatal for older binaries, and a disabled text_to_speech never consults its engine. Gate the engine/model validation in Config.Validate on text_to_speech.enabled so a disabled feature tolerates keys from newer versions; validation still rejects unknown engines when the feature is enabled.
Comment thread config/config.go Resolved
@edenreich
edenreich merged commit 30e386e into main Sep 1, 2026
1 check passed
@edenreich
edenreich deleted the fix/issue-1141 branch September 1, 2026 21:42
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.186.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Config loading hard-fails on unknown text_to_speech.engine even when TTS is disabled

1 participant