Remove OPENAI_CHATGPT_API_KEY fallback and simplify to OPENAI_API_KEY#786
Merged
Conversation
The OpenAI credential was referenced via two env vars: OPENAI_API_KEY and the OPENAI_CHATGPT_API_KEY backward-compat fallback. The latter only existed as an alias and, in both apphosting configs, mapped to the same OPENAI_API_KEY secret. Consolidate on OPENAI_API_KEY (the documented standard and SDK convention) so only one variable is referenced. - src/ai/genkit.ts: drop the fallback, update warning and comment - src/ai/flows/wallet-insights-chat.ts: drop the alias from error detection and the user-facing config message - apphosting.dev.yaml / apphosting.prd.yaml: remove the alias env mapping Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014fbd2ZstdjJNhn3UQGjU5i
Contributor
Author
|
@claude can you code review the pr 786 and make any changes required |
The comment claimed the code fails fast on a missing key, but it warns and continues. Drop the misleading line and keep the accurate one. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014fbd2ZstdjJNhn3UQGjU5i
Contributor
Author
|
Reviewed PR #786. The change is correct and complete:
I found and fixed one minor issue while reviewing:
Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes backward compatibility support for the
OPENAI_CHATGPT_API_KEYenvironment variable and simplifies the codebase to use onlyOPENAI_API_KEY. This change streamlines configuration by eliminating the fallback mechanism that was previously maintained for deployments using the ChatGPT-specific key name.Type of Change
Changes Made
OPENAI_CHATGPT_API_KEYand updated warning message to reference onlyOPENAI_API_KEYOPENAI_CHATGPT_API_KEYOPENAI_CHATGPT_API_KEYfrom API key error detectionOPENAI_API_KEYTest Plan
No testing needed. This is a configuration cleanup that removes unused fallback logic. The primary API key (
OPENAI_API_KEY) continues to work as before. Existing error handling for missing API keys remains intact.Checklist
npm run typecheckpassesnpm run lintpasseshttps://claude.ai/code/session_014fbd2ZstdjJNhn3UQGjU5i