[PR #12724] [MERGED] cloud: don't error sending empty messages #12664

Closed
opened 2025-11-12 16:42:47 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/12724
Author: @pdevine
Created: 10/21/2025
Status: Merged
Merged: 10/22/2025
Merged by: @pdevine

Base: mainHead: pdevine/empty_cloud_messages


📝 Commits (2)

  • 341298d cloud: short-circuit sending messages to a cloud model for empty messages
  • 853b586 remove the short circuit but catch empty messages

📊 Changes

2 files changed (+89 additions, -3 deletions)

View changed files

📝 server/routes.go (+7 -3)
📝 server/routes_generate_test.go (+82 -0)

📄 Description

Currently if you call /api/chat on a remote model it without messages being defined the server will throw a 500 because will try to look to see if a system message has been set. The change will just return an empty load message (similar to non-remote models) instead.

Fixes #12697


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/12724 **Author:** [@pdevine](https://github.com/pdevine) **Created:** 10/21/2025 **Status:** ✅ Merged **Merged:** 10/22/2025 **Merged by:** [@pdevine](https://github.com/pdevine) **Base:** `main` ← **Head:** `pdevine/empty_cloud_messages` --- ### 📝 Commits (2) - [`341298d`](https://github.com/ollama/ollama/commit/341298d2d68de0dda551a25e641f7df0356b1cf6) cloud: short-circuit sending messages to a cloud model for empty messages - [`853b586`](https://github.com/ollama/ollama/commit/853b586530f57683b14ae4919e3c002c96a8afd2) remove the short circuit but catch empty messages ### 📊 Changes **2 files changed** (+89 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `server/routes.go` (+7 -3) 📝 `server/routes_generate_test.go` (+82 -0) </details> ### 📄 Description Currently if you call `/api/chat` on a remote model it without `messages` being defined the server will throw a 500 because will try to look to see if a system message has been set. The change will just return an empty load message (similar to non-remote models) instead. Fixes #12697 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-12 16:42:47 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama-ollama#12664