Make tool factories and PluginTools accept a live config callable#150
Draft
yzx9 wants to merge 1 commit into
Draft
Make tool factories and PluginTools accept a live config callable#150yzx9 wants to merge 1 commit into
yzx9 wants to merge 1 commit into
Conversation
b8ef0de to
9399f25
Compare
Config can now be passed as a zero-arg callable (() -> Config) in addition to a static instance. resolve_config() dynamically detects and resolves it at execution time, so tools observe update_config() changes without being rebuilt. - core.config: add ConfigProvider, ConfigLike (Config | ConfigProvider, PEP 604), and resolve_config(); exported via __all__. - research_tools: the four makeXXX factories resolve cfg lazily inside each closure; drop the dead 'cfg or load_config()' fallback. - workflow.batch_qc: make_batch_precheck now uses ConfigLike/resolve_config (previously an inline duplicate resolver); LeaderAgent passes its ConfigLike provider directly instead of a lambda that would yield a nested callable. - agent_loader: widen cfg to ConfigLike and pass it straight through (no resolve). - tools.PluginTools: accept ConfigLike, resolve via a 'cfg' property, and snapshot config once per method to avoid mid-method inconsistency. - leader_multiagent: LeaderDriven.get_config() returns the current live config; pass it as the provider to load_agent_configs and LeaderAgent. - tests: factory liveness test, PluginTools.cfg resolution test, static-config passthrough tests. Backward compatible: existing callers passing a static Config keep working. Known limitation: update_config currently only mutates LLM fields, so the makeXXX tools stay inert until update_config is widened (follow-up).
9399f25 to
498bcb6
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.
Config can now be passed as a zero-arg callable (() -> Config) in addition to a static instance. resolve_config() dynamically detects and resolves it at execution time, so tools observe update_config() changes without being rebuilt.
Backward compatible: existing callers passing a static Config keep working. Known limitation: update_config currently only mutates LLM fields, so the makeXXX tools stay inert until update_config is widened (follow-up).