[PR #14846] fix: Validate message role in CreateRequest #14873

Open
opened 2026-04-13 01:04:32 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/14846
Author: @LincolnBurrows2017
Created: 3/14/2026
Status: 🔄 Open

Base: mainHead: fix-message-role-validation


📝 Commits (3)

  • c48be94 fix: correct typo ViewSeperator -> ViewSeparator in deepseekocr model
  • a09e4e8 fix: preserve decimal precision in HumanBytes for values >= 10
  • c2946db fix: validate message role in Modelfile CreateRequest

📊 Changes

4 files changed (+12 additions, -5 deletions)

View changed files

📝 format/bytes.go (+2 -2)
📝 format/bytes_test.go (+5 -0)
📝 model/models/deepseekocr/model.go (+2 -3)
📝 parser/parser.go (+3 -0)

📄 Description

Summary

Bug: In parser/parser.go, the CreateRequest function did not validate message roles.

Fix

Added validation using existing isValidMessageRole function.


🔄 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/14846 **Author:** [@LincolnBurrows2017](https://github.com/LincolnBurrows2017) **Created:** 3/14/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix-message-role-validation` --- ### 📝 Commits (3) - [`c48be94`](https://github.com/ollama/ollama/commit/c48be94ac71ffe697cb92e7ca4b8eecd6d93826b) fix: correct typo ViewSeperator -> ViewSeparator in deepseekocr model - [`a09e4e8`](https://github.com/ollama/ollama/commit/a09e4e88df885360421f6fafa839b284b690d1eb) fix: preserve decimal precision in HumanBytes for values >= 10 - [`c2946db`](https://github.com/ollama/ollama/commit/c2946dbc11c2a6dbb5ee5fd45614b9943ca7b54e) fix: validate message role in Modelfile CreateRequest ### 📊 Changes **4 files changed** (+12 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `format/bytes.go` (+2 -2) 📝 `format/bytes_test.go` (+5 -0) 📝 `model/models/deepseekocr/model.go` (+2 -3) 📝 `parser/parser.go` (+3 -0) </details> ### 📄 Description ## Summary Bug: In `parser/parser.go`, the `CreateRequest` function did not validate message roles. ## Fix Added validation using existing `isValidMessageRole` function. --- <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 2026-04-13 01:04:32 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#14873