fix: load nested .env keys and repair stale wiki model bindings - #384
Open
shsaihdsaiudh wants to merge 1 commit into
Open
fix: load nested .env keys and repair stale wiki model bindings#384shsaihdsaiudh wants to merge 1 commit into
shsaihdsaiudh wants to merge 1 commit into
Conversation
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.
Summary
Fixes #385
Two fixes that make
.env-driven setups with OpenAI-compatible providers (e.g. DeepSeek) work reliably:1.
.envnested/array keys are now bound correctlyLoadEnvFileadded.envkeys to the in-memory configuration with their raw names, so nested keys written in the standard environment-variable form (RepositoryAnalyzer__AllowedLocalPathRoots__0) were never bound toRepositoryAnalyzer:AllowedLocalPathRoots:0. As a result, local-directory import failed with当前未配置允许导入的本地目录根路径even when the whitelist was set in.env.This PR:
__to:when loading.envinto configuration.LOCAL_IMPORT_ROOTtoRepositoryAnalyzer:AllowedLocalPathRoots:0, so the documented.env.examplevariable actually takes effect.2. Stale wiki model bindings are repaired during AI configuration migration
UpsertSettingAsynconly repaired*_PROVIDER_IDsettings, never*_MODEL_IDsettings. On a fresh install with a non-OpenAI-compatible provider configured through legacy env vars,SystemSettingDefaultsseedsWIKI_CATALOG_MODEL_ID=gpt-5-mini/WIKI_CONTENT_MODEL_ID=gpt-5.2, and the migration could not overwrite them. Wiki generation then failed withAI model 'gpt-5-mini' is not available for provider ....This PR:
DefaultModelId(instead of hardcodedgpt-4o-mini) when no model is specified in legacy env vars.Test plan
MigrateAsync_RepairsStaleModelBindingsButKeepsValidOnes.AiProviderPresetSeederTestssuite passes (7/7).deepseek-v4-flashsetup:.envlocal import whitelist works, and wiki catalog/content generation succeeds after migration.