Skip to content

Fix settings env parsing - #6

Merged
ghosteau merged 2 commits into
masterfrom
dev
Sep 3, 2026
Merged

Fix settings env parsing#6
ghosteau merged 2 commits into
masterfrom
dev

Conversation

@ghosteau

@ghosteau ghosteau commented Sep 3, 2026

Copy link
Copy Markdown
Owner

No description provided.

ghosteau and others added 2 commits September 2, 2026 23:24
The container never started. pydantic-settings treats list-typed fields as
complex and JSON-decodes the environment value inside the settings source,
which runs before field validators -- so CORS_ORIGINS=https://embeddings.
mannymcgrail.com failed json.loads and raised SettingsError at import,
before _split_csv ever saw it. ALLOWED_MODELS would have failed identically
on the next line.

Development never hit this because both fields fall back to default_factory
when unset, and they are only set in deployment.

Marking both fields NoDecode hands the raw string to the validator. That on
its own would have silently dropped support for JSON array values, which is
what pydantic-settings accepted before, so the validator now takes either
form. Adds test_config.py covering both, plus the exact environment
docker-compose.yml sets. Raises the pydantic-settings floor to 2.3, which
introduced NoDecode.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ghosteau ghosteau added the bug Something isn't working label Sep 3, 2026
@ghosteau
ghosteau merged commit bebe45d into master Sep 3, 2026
4 checks passed
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