Skip to content

fix: env overrides when config.json is missing and add regression test#271

Open
tbeaudouin05 wants to merge 2 commits intosipeed:mainfrom
tbeaudouin05:fix-env-overrides
Open

fix: env overrides when config.json is missing and add regression test#271
tbeaudouin05 wants to merge 2 commits intosipeed:mainfrom
tbeaudouin05:fix-env-overrides

Conversation

@tbeaudouin05
Copy link

@tbeaudouin05 tbeaudouin05 commented Feb 16, 2026

  • Problem: When config.json is absent (common in Fly deployments using secrets/env only), LoadConfig returned defaults without applying env overrides, so the app still used the default model (glm-4.7) and failed due to missing credentials.
  • Fix: Always run env.Parse(cfg) even when config.json is missing, so secrets/env values take effect in env-only deployments.
  • Test: Added TestLoadConfig_EnvOverridesWithoutFile to verify env vars (e.g., Fly secrets for model/provider) are honored without a config file.

@mrbeandev
Copy link

Good catch on the LoadConfig logic! It seems like we're both looking at the parsing order of environment variables. I've actually just updated PR #239 which handles this by unsetting conflicting env vars at the entrypoint level (ensuring the JSON remains the source of truth) while also adding full Coolify/Docker support. It might be worth checking how we can unify these so they don't fight each other!

@Leeaandrob
Copy link
Collaborator

@Zepan Fixes env overrides when config.json is missing entirely, plus regression test. Companion to #270.

Recommendation: Merge. +19 lines with a test. Fixes the bootstrapping experience for new users who haven't created a config file yet.

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.

3 participants