Skip to content

Conversation

mambisi
Copy link
Contributor

@mambisi mambisi commented Aug 14, 2025

Fixes firebase deployment error: When deploying firebase cloud functions fails i functions: Loading and analyzing source code for codebase default to determine what to deploy due to checking the api keys in environmental variable before deployed.

@github-actions github-actions bot added the js label Aug 14, 2025
@mambisi mambisi changed the title Add precondition as option configuration fix(js) Add precondition as option configuration Aug 15, 2025
@mambisi mambisi changed the title fix(js) Add precondition as option configuration fix(js):Add precondition as option configuration Aug 15, 2025
@pavelgj pavelgj requested a review from ssbushi August 20, 2025 13:29
@ssbushi
Copy link
Contributor

ssbushi commented Aug 20, 2025

Thanks for the fix, I'm kinda torn on this. Do we really need this to be a separate argument to the plugin interface?

I think the API key checking can be handled in the initializer, resolver methods respectively. WDYT @pavelgj ?

@ssbushi ssbushi requested a review from pavelgj August 20, 2025 14:01
@ssbushi
Copy link
Contributor

ssbushi commented Aug 20, 2025

I see it. The apiKey needs to be resolved before the client object is constructed, so this has to happen before initializer and resolver are invoked. However, without the apiKey in xAI or deepseek plugins, they will not work correctly.

...options,
precondition: async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one way I see this working is if this is not just a precondition but aresolveOptions function. It should return the resolved options which can be used to create the OpenAI client.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that should be good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants