Skip to content

feat: refactor structural data endpoints to read from SettingsService via JSON settings #502

@Aureliolo

Description

@Aureliolo

Summary

Refactor agents, departments, and providers API endpoints to read from SettingsService via JSON-type settings instead of directly from RootConfig. This makes structural org data (agent roster, department hierarchy, provider configs) editable at runtime through the DB/API without YAML edits or restarts.

Context

Issue #497 migrates scalar config consumers (budget limits, coordination topology, autonomy level, etc.) to SettingsService. However, structural data endpoints still read directly from app_state.config:

  • api/controllers/agents.pyapp_state.config.agents (tuple of AgentConfig)
  • api/controllers/departments.pyapp_state.config.departments (tuple of Department)
  • api/controllers/providers.pyapp_state.config.providers (dict of ProviderConfig)
  • api/controllers/company.pyconfig.agents, config.departments
  • api/controllers/analytics.pylen(config.agents)

These are complex nested Pydantic models that don't map to individual scalar settings. They need JSON-type SettingDefinition entries in the registry.

Scope

  • Add JSON-type settings: company/agents, company/departments, providers/configs
  • Enhance config_bridge.extract_from_config() to serialize Pydantic models and dicts/lists as JSON (currently uses str() which produces repr, not valid JSON)
  • Add ConfigResolver methods: get_agents(), get_departments(), get_provider_configs() that deserialize JSON back to typed Pydantic models
  • Migrate the 5 controller files listed above
  • Update corresponding tests

Blocked By

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    prio:mediumShould do, but not blockingscope:large3+ days of workscope:medium1-3 days of workspec:architectureDESIGN_SPEC Section 15 - Technical Architecturespec:providersDESIGN_SPEC Section 9 - Model Provider Layertype:featureNew feature implementation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions