Repository navigation
fix(config): skip text_to_speech engine validation when disabled - #1142
Merged
Merged
Conversation
…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.
inference-gateway-maintainer
Bot
marked this pull request as ready for review
September 1, 2026 21:33
inference-gateway-maintainer
Bot
requested a review
from a team
as a code owner
September 1, 2026 21:33
edenreich
reviewed
Sep 1, 2026
Contributor
|
🎉 This PR is included in version 0.186.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Resolves #1141
Summary
Config loading exited with code 1 when the shared
~/.infer/config.yamlcontained atext_to_speech.enginevalue the running binary does not know (e.g.gatewaywritten by 0.186.0, read by 0.185.x), even thoughtext_to_speech.enabledwasfalse. A disabled text_to_speech never consults its engine, soConfig.Validatenow gates the text_to_speech engine/model validation ontext_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 thetext_to_speechengine/model switch inConfig.Validatewith ac.TextToSpeech.Enabledguard, 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 withEnabled = truesince 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/TestPointerOptionPrecedenceincmd/runtimefail in this Actions-runner sandbox and fail identically on main (documented pre-existing environmental failure; unrelated to this change).