feat: selective field-based config hot-reload #2185
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
Implements selective hot-reload for runtime configs as requested in #984. Instead of restarting all orchestrators on every config file change, the system now:
system_prompt_base,system_governance,system_prompt_examples,hertz) are updated in-place on the liveRuntimeConfigviasetattr()— no orchestrator restart neededagent_inputs,agent_actions,cortex_llm,simulators,backgrounds, etc.) still trigger the existing full reload pathKey design decisions
hertzvalidation (must be > 0)json5import already in both cortex filesCortexRuntimeandModeCortexRuntimewhere_check_config_changesalready existsMulti-mode specifics
system_governance,system_prompt_examplessystem_prompt_base,system_prompt_examples,hertz,description,display_nameModeConfigonly; changes to the active mode also patch the liveRuntimeConfigFiles changed
src/runtime/single_mode/cortex.py— added_read_raw_config,_detect_changed_fields,_apply_safe_reload; renamed_reload_config→_full_reload; updated_check_config_changesrouting logicsrc/runtime/multi_mode/cortex.py— same pattern adapted forModeSystemConfig+ModeConfighierarchytests/runtime/single_mode/test_cortex.py— updated existing tests + 11 new selective reload teststests/runtime/multi_mode/test_cortex.py— updated existing tests + 12 new selective reload testsTest plan
_full_reload_full_reloadCloses #984