The form that passed every test and never worked
, by the developer of PanelCP
Version 1.1.0 brought the AI assistant. You choose a provider, paste a key and save. The feature had 42 checks behind it, and all of them passed. The form did not work for a single person: whatever you chose, the answer was "Choose a provider".
The line
The list of providers is a table in the code. Each entry says, among other things, whether the provider needs a key, and that field is called key. The form needed the name of the provider as well, so the list was put together like this:
[{"key": k, **v} for k, v in PROVIDERS.items()]
k is the name, for example openai. But v has a field called key too, with the value True, and it comes later, so it wins. Every option of the drop-down list sent the word True instead of the name of a provider.
The correction in 2.3.1:
[{**v, "key": k, "needs_key": v["key"]} for k, v in PROVIDERS.items()]
Why 42 checks were not enough
They called the operation behind the form directly, with the right provider name. They tested streaming, refusals, broken keys, private addresses and hourly limits. All of that was correct. Nothing ever looked at what the browser sends when a person picks an option.
I found it by connecting my own provider on the demo server.
What changed
Since 2.3.1 new work is tested over HTTP the way a browser sends it: load the page, read the fields out of the HTML, fill them in, send them, follow the redirect. The same release corrects two more bugs around that form. When an action failed after "Confirm it is you", the panel led to a page that does not exist. And going back to send the confirmation again ended in "Sign-in expired" over and over.
A test that skips the form does not test the form.