fix: correct runtime_settings.json loading and add Agent Pool settings#9223
Open
AlekseyMoyseyuk wants to merge 1 commit intomudler:masterfrom
Open
fix: correct runtime_settings.json loading and add Agent Pool settings#9223AlekseyMoyseyuk wants to merge 1 commit intomudler:masterfrom
AlekseyMoyseyuk wants to merge 1 commit intomudler:masterfrom
Conversation
Signed-off-by: Aleksey Moyseyuk <moyseuk@mail.ru>
628ea61 to
9504343
Compare
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
This PR fixes a critical bug where
runtime_settings.jsonfile-based settings were not being applied correctly when the file was created or modified after application startup. It also adds missing Agent Pool configuration fields to the runtime settings system.Bug Description
The
readRuntimeSettingsJson()function inconfig_file_watcher.gohad inverted logic: it used!envXxxconditions, which meant file settings were only applied when values had already been changed (via API), rather than when they had not been changed. This caused:agent_pool_embedding_model,agent_pool_default_model, and other Agent Pool fields fromruntime_settings.jsonwere completely ignored at startup and during file watchingruntime_settings.jsondidn't exist at startup but was created later, settings were never appliedstartup.goused correct logic (== startupConfig) whileconfig_file_watcher.goused inverted logic (!envXxx)Changes
Bug Fixes
core/application/config_file_watcher.go: Fix!envXxx→envXxxin all 37 conditions, so file settings are applied when values match startup values (not changed via API)core/application/startup.go: Unify env var precedence logic to usestartupConfigcomparison consistentlyNew Features
RuntimeSettings:agent_pool_vector_engine— Vector engine type (e.g.,chromem,postgres)agent_pool_database_url— Database URL for PostgreSQL vector storeagent_pool_agent_hub_url— Custom Agent Hub URLToRuntimeSettings()andApplyRuntimeSettings()inapplication_config.goFiles Changed
core/application/config_file_watcher.gocore/application/startup.gocore/config/runtime_settings.gocore/config/application_config.goToRuntimeSettingsandApplyRuntimeSettingscore/http/react-ui/src/pages/Settings.jsxTesting
go test ./core/config/...)go build ./core/...succeedsBehavior After Fix
How to Test
runtime_settings.json{ "agent_pool_embedding_model": "custom-embedding-model", "agent_pool_vector_engine": "postgres", "agent_pool_database_url": "postgres://user:pass@localhost:5432/db" }POST /api/settings), then verify file changes don't override API values