Skip to content

Config into per-domain settings models #1191

Description

@peteski22

Problem

core/config.py is one flat class of 2,632 lines, ten authors in ninety days.

Proposal

Nested settings models per domain (tools, budgets and pricing, providers and models, tenancy and auth, telemetry, platform), composed into GatewayConfig. Environment variable names and config.yml keys do not change: use field aliases so OTARI_WEB_SEARCH_URL still lands where it did. One PR per domain group, smallest first.

Acceptance

  • Every existing environment variable and YAML key resolves to the same field.
  • GET /api/v1/settings snapshot identical.
  • config.example.yml unchanged in meaning.
  • The OSS smoke gate passes.

Measure

config.py no longer appears among the most frequently changed files over 90 days.

Depends on

Nothing. Note the pydantic-settings nested-delimiter behavior; the alias approach must be verified on the installed version before the first PR.

Part of #1171.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/refactorCodebase structure improvementstype/tech-debtMaintenance and cleanup

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions