Skip to content

refactor(config): remove ACP singleton, expose acp_agents on AppConfig#2778

Open
ShenAC-SAC wants to merge 1 commit intobytedance:mainfrom
ShenAC-SAC:fix/2687-acp-singleton
Open

refactor(config): remove ACP singleton, expose acp_agents on AppConfig#2778
ShenAC-SAC wants to merge 1 commit intobytedance:mainfrom
ShenAC-SAC:fix/2687-acp-singleton

Conversation

@ShenAC-SAC
Copy link
Copy Markdown
Contributor

Summary

Removes the legacy deerflow.config.acp_config global singleton API (load_acp_config_from_dict / get_acp_agents). ACP agent configuration is now sourced exclusively from AppConfig.acp_agents, eliminating the dual source-of-truth between the singleton and the pydantic-validated config.

addresses #2687 item 2

Changes

  • acp_config.py: keep only ACPAgentConfig pydantic model; drop module-level singleton + loader/getter
  • app_config.py: remove _validate_acp_agents (pydantic already validates dict[str, ACPAgentConfig]); stop loading the singleton from YAML
  • tools/tools.py: read config.acp_agents directly via getattr
  • agents/lead_agent/prompt.py::_build_acp_section: drop singleton fallback, rely on app_config.acp_agents
  • tools/builtins/invoke_acp_agent_tool.py: unchanged (already uses ACPAgentConfig only)
  • Tests migrated to construct AppConfig with acp_agents directly; monkeypatches against get_acp_agents removed

Verification

  • make lint passes
  • make test — 3051 passed, 18 skipped

Drops the legacy load_acp_config_from_dict / get_acp_agents singleton API.
acp_agents is now sourced exclusively from AppConfig.acp_agents, eliminating
the dual source-of-truth between the global singleton and the validated config.

- acp_config.py keeps only ACPAgentConfig pydantic model
- app_config.py removes _validate_acp_agents (handled by pydantic)
- tools.py reads config.acp_agents directly
- lead_agent/prompt._build_acp_section drops singleton fallback
- tests migrated to construct AppConfig with acp_agents

addresses bytedance#2687 item 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant