Skip to content

Make tool factories and PluginTools accept a live config callable#150

Draft
yzx9 wants to merge 1 commit into
mainfrom
feat/makexxx-live-config
Draft

Make tool factories and PluginTools accept a live config callable#150
yzx9 wants to merge 1 commit into
mainfrom
feat/makexxx-live-config

Conversation

@yzx9

@yzx9 yzx9 commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator

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).

@yzx9 yzx9 added bug Something isn't working python:uv Pull requests that update python:uv code and removed python:uv Pull requests that update python:uv code labels Jun 24, 2026
@yzx9 yzx9 force-pushed the feat/makexxx-live-config branch from b8ef0de to 9399f25 Compare June 30, 2026 13:41
@yzx9 yzx9 changed the base branch from main to dev June 30, 2026 14:21
@yzx9 yzx9 changed the base branch from dev to main July 3, 2026 02:29
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).
@yzx9 yzx9 force-pushed the feat/makexxx-live-config branch from 9399f25 to 498bcb6 Compare July 4, 2026 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant