Bug in PATCH /assistant/{id} — System Prompt (messages) Reset Unexpectedly
Description:
When using the PATCH /assistant/{id} endpoint to update only the model type (e.g. changing model.model from gemini-1.5-pro to gemini-1.5-flash), the messages field (specifically the system prompt) is getting reset to its default value, even though it is not included in the request payload.
Expected Behavior:
If messages is not provided in the PATCH request, the existing system prompt should remain unchanged.
Actual Behavior:
Vapi automatically resets messages to a default value to empty
Steps to Reproduce:
This breaks existing assistant logic where the prompt holds domain-specific behavior or branding, leading to unexpected assistant behavior after seemingly safe updates.
Screenshot (for reference):
Attached.
Request:
Please ensure that the messages field is not reset unless explicitly provided in the PATCH payload.
When using the PATCH /assistant/{id} endpoint to update only the model type (e.g. changing model.model from gemini-1.5-pro to gemini-1.5-flash), the messages field (specifically the system prompt) is getting reset to its default value, even though it is not included in the request payload.
Expected Behavior:
If messages is not provided in the PATCH request, the existing system prompt should remain unchanged.
Actual Behavior:
Vapi automatically resets messages to a default value to empty
Steps to Reproduce:
- Create an assistant with a custom messages system prompt.
- Send a PATCH request to update only the model name:
{
"model": {
"provider": "google",
"model": "gemini-1.5-pro"
}
} - Observe that messages has reverted to the default prompt.
This breaks existing assistant logic where the prompt holds domain-specific behavior or branding, leading to unexpected assistant behavior after seemingly safe updates.
Screenshot (for reference):
Attached.
Request:
Please ensure that the messages field is not reset unless explicitly provided in the PATCH payload.
