Refactor Agent Registry Wiring and Fix Config Options#22011
Refactor Agent Registry Wiring and Fix Config Options#22011jmchilton wants to merge 6 commits intogalaxyproject:devfrom
Conversation
|
I started working on something unrelated and realized this went astray - config.agents was dead code laying around that should have been cleaned up and we should have attached this stuff to inference_services. From the agent: What
|
| Concern | Read from |
|---|---|
| model, temperature, api_key, api_base_url | inference_services |
| enabled | agents |
Two config dicts for the same logical concept. An admin would need to configure both:
inference_services:
custom_tool:
model: "anthropic:claude-sonnet-4-5"
agents:
custom_tool:
enabled: false # different dict!What should probably happen
The enabled flag should live in inference_services alongside model/temperature, and config.agents / _load_agent_config() should be removed entirely. Something like:
inference_services:
default:
model: "gpt-4o-mini"
temperature: 0.7
custom_tool:
enabled: false # same place as model configThen build_default_registry() and _get_agent_config() both read from inference_services — one config to rule them all.
The structural DI improvements in this branch (killing the global singleton, non-optional get_agent, removing HAS_AGENTS guards) are all good and worth keeping. It's just the config source that needs redirecting.
dcf9f14 to
d8fe8ee
Compare
Replace module-level agent_registry singleton with factory-based Lagom registration. AgentService now receives registry via constructor injection. API layer delegates to AgentService. Orchestrator uses deps.get_agent callback. Remove dead _global_registry and vestigial HAS_AGENTS guards (pydantic-ai is unconditional). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Disabled agents are now excluded from registry, hidden from /api/ai/agents, and raise ConfigurationError if executed directly. Router agent is always-on (warns if config says disabled). Sync config defaults: remove phantom dataset_analyzer, add orchestrator + tool_recommendation. Registry tracks disabled set for clear error messages on handoff attempts. Closes galaxyproject#21996 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pass concrete agent classes directly to register() instead of iterating a list, avoiding mypy inferring the union as abstract. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…agents
config.agents (set by _load_agent_config()) was never read by the agent
framework — agents used inference_services for model/temperature/api_key.
The enabled flag was reading from config.agents while everything else
read inference_services, splitting config across two dicts.
Now all agent config lives under inference_services:
inference_services:
default: { model: gpt-4o-mini }
custom_tool: { enabled: false }
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
d8fe8ee to
61d5e16
Compare
Wire agent registry using our Lagom container instead of module-level singletons - pros and cons of course but this is the documented Galaxy best practice and I think has some real important upsides. Also fixes #21996 while I'm in there.
How to test the changes?
(Select all options that apply)
License