Skip to content

fix: Initialize environment variables for the active non-OpenAI provider #1012

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

itomise
Copy link

@itomise itomise commented May 18, 2025

Fixes #975

This PR addresses issue #975 by correcting an initialization problem for non-OpenAI providers. It also adds a new option to the initial setup prompt to guide users who wish to configure alternative providers (e.g., Azure) via the ~/.codex/config.json file, aiming to make this process more straightforward for newcomers.
For instance, when I first tried to use Azure, I followed the README using the --provider option, but was still prompted for OpenAI login, which was a bit confusing. This new prompt option is intended to prevent such initial hurdles.

Similar improvements may have been addressed in PR #990. If that PR sufficiently covers the necessary changes, please feel free to close this one.

itomise added 2 commits May 18, 2025 17:06
Fixed a bug where API keys and other necessary environment variables
were not loaded for non-OpenAI providers. The application now correctly
reads the environment variables specific to the selected provider
during startup.
Allows users to choose an alternative provider (e.g. Azure, Ollama) from the
initial API-key dialog. Selecting this option:
• generates ~/.codex/config.json via loadConfig/saveConfig so the file exists
• switches UI to an exit screen instructing the user to edit the config
• exits the process shortly after so the user can restart Codex

The step union is extended to include 'exit' and the select handler updated
to switch on item.value for clearer logic.
Copy link

github-actions bot commented May 18, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@itomise
Copy link
Author

itomise commented May 18, 2025

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request May 18, 2025
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.

Azure Open AI not supported(?)
1 participant