Skip to content

fix(config): refresh cached EnvConfig after dotenv load#554

Merged
warren618 merged 1 commit into
mainfrom
codex/issue-541-envconfig-reset
Jul 15, 2026
Merged

fix(config): refresh cached EnvConfig after dotenv load#554
warren618 merged 1 commit into
mainfrom
codex/issue-541-envconfig-reset

Conversation

@warren618

Copy link
Copy Markdown
Collaborator

Summary

  • Invalidate the cached EnvConfig after _ensure_dotenv() loads a real .env file.
  • Ensure the CLI welcome panel, /settings, and dotenv diagnostic use the configured provider and model.
  • Add a regression reproducing configuration cached before dotenv loading.

Root cause

Early CLI imports could initialize the EnvConfig singleton before .env was loaded. _ensure_dotenv() populated os.environ but did not invalidate that stale singleton.

Validation

  • 6 dotenv tests passed
  • 131 focused config/provider/preflight/LLM tests passed
  • 5,384 broader tests passed, with 6 evidence-backed baseline/environment exclusions
  • Compile, Ruff, env-var gate, and diff checks passed

Closes #541

@warren618
warren618 merged commit 77a501a into main Jul 15, 2026
1 check passed
@warren618
warren618 deleted the codex/issue-541-envconfig-reset branch July 15, 2026 12:37
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.

Stale EnvConfig singleton: _ensure_dotenv() loads .env but callers still read bare-environ defaults (welcome panel, /settings, diagnostic log)

1 participant