Hello! I’m here to explain the way i tested patch #65551 related with WordPress AI features introduced recently.
The What
The Patch describes a issue with current AI configuration that involves the connectors to AI providers e.g OpenAI, Claude. And the user describing the issue with the reproduction steps as a regular user changing API Keys during an outage something that is quite common in software as services are not 100 percent reliable on the internet due to multiple factors.

I made a simple plugin to intercept request made to OpenAI being the provider that i have valid API Keys at the moment and saw that the current code wasn’t preserving the API Key when i tried to setup a new key and deleting the previous
The patch
i used the patch described on my Patch Test report and reproducing the same steps as the bug report suggested but the issue persisted so i went deeper and began to notice that the function responsible to tell if an API Key was valid or not very rarely produced an exception and the checking for null seems to me a bad solution more so when something else down the chain was grabbing the exception and producing a false negative, when i artificially made the function return null the code works but my testing shows that the issue could be lying deeper inside the AI client.

Leave a comment