-
Notifications
You must be signed in to change notification settings - Fork 6
error 400 at small changes #14
Description
Hello. Im trying to build ai automation for my homebattery an ev. I do this with my homey pro 2023 and chat gpt. I have som problems. The the following text is ai generated. I know nothing about coding.
Here is a clear, concise GitHub-ready issue description you can copy/paste:
Title:
OpenAI “Ask ChatGPT… and WAIT” card clears prompt & sends empty messages → 400 error
Description:
I’m experiencing a consistent issue with the “Ask ChatGPT the question … and WAIT for the full answer” card in Homey.
Whenever I edit the prompt text in the card (even small changes), the card often breaks and the OpenAI API returns:
Error 400: Invalid 'messages': empty array. Expected array with minimum length 1, but got an empty array instead.
This means the card is sending:
{
"messages": []
}instead of the original long prompt.
What seems to happen:
- The card uses one single text field for the entire prompt.
- When the text becomes long (multi-section system rules, JSON-templates, etc.), saving or editing the field frequently causes Homey to silently clear the internal
messageslist before the request is sent. - As soon as Homey sends
messages: [], OpenAI returns 400 and the flow becomes unusable.
Reproduction:
- Create a flow with the “Ask ChatGPT the question… and WAIT” card.
- Paste a long prompt (multiple sections, rules, JSON instructions).
- Save → works initially.
- Reopen the card and add even a single new line or small change.
- Save again → next execution throws:
Error 400 Invalid 'messages': empty array.
Expected behavior:
- The card should preserve the internal message array even when editing long prompt text.
- Saving the card should not produce an invalid empty messages array.
Actual behavior:
- After editing the text field, the card sometimes resets the internal
messagesarray to empty, causing all API calls to fail.
Impact:
- It becomes impossible to maintain or update complex prompts (e.g., Home-energy optimization logic, multi-rule system prompts, structured JSON outputs).
- The card becomes unusable for advanced automation.
- The only workaround is to completely re-paste the entire prompt every time and hope the save doesn’t clear the messages array.
Request:
Please investigate why editing the text field causes the card to send an empty messages array. Ideally, the card should always:
- treat the text field as the
systemmessage, or - expose explicit “system” and “user” message fields (similar to OpenAI Pro),
- and never send
messages: []under any circumstances.
If you want, I can also help you write a short repro flow or attach simplified test prompts.