Repository navigation
refactor(server): read [embed_fallback] and resolve its env overrides in the core (#1414) - #1415
Merged
Merged
Conversation
… in the core (#1414) FallbackSettings (core) now owns the UTEKE_EMBED_FALLBACK_* override rules (env wins, empty env ignored). The CLI delegates to it instead of its own copy, and uteke-serve reads [embed_fallback] and applies it when api_key, base_url and model are all set. First step of #1355 (split by section). Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
This was referenced Oct 13, 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.
What
FallbackSettings::with_env_overrides()(and an injectablewith_overrides_from) own theUTEKE_EMBED_FALLBACK_{API_KEY,BASE_URL,ENDPOINT_PATH,MODEL}rules: env wins, an empty variable counts as unset.EmbedFallbackConfig::is_configured/resolve_with_envnow delegate to the core type instead of keeping their own copy (same behaviour; its existing tests are unchanged and green).ServerFileConfiggets[embed_fallback]; after the store is opened, a fully configured fallback (api_key, base_url AND model) is applied withset_fallback_settings, as the CLI already does. Logged asEmbedding fallback: enabled (<url>).Why
Closes #1414, step A of #1355 (split by section, not one big move). A server using an external embedder could not fall back to a second endpoint although the CLI could, and the override rules were written once per consumer. The project-local
uteke.tomlstays untrusted forembed_fallback.api_key/base_url/endpoint_paththrough the shared layered resolver (covered by a test).Testing
-D warnings,cargo test --workspace, vecq-only core lib tests greenuteke-serve: primary embedder pointing at a dead port. Without a fallbackrememberreturnedembedding_written: falsewith the connection error; withUTEKE_EMBED_FALLBACK_*pointing at a fake OpenAI-compatible server it returnedembedding_written: trueand the fake server logged exactly 1 request. Not run: a real second embedderuteke.tomlalready holds a complete[embed_fallback]starts using it (it was ignored before)🤖 Generated with Claude Code