[PR #9930] [CLOSED] Limit collation 9929 #38972

Closed
opened 2026-04-22 23:37:18 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/9930
Author: @gabe-l-hart
Created: 3/21/2025
Status: Closed

Base: mainHead: LimitCollation-9929


📝 Commits (3)

  • e08fd5a feat: Expose IsKnowMessageRole outside of the parser package
  • ff6e184 feat: Only collate if msg.Role is one of the known roles
  • 2eb645e test: Add a unit test to validate collation of known roles only

📊 Changes

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

View changed files

📝 parser/parser.go (+5 -1)
📝 template/template.go (+2 -1)
📝 template/template_test.go (+67 -0)

📄 Description

Description

Closes #9929

This PR limits the collation logic to only apply to "user", "system", and "assistant" roles.

Discussion

  • It looks like #9874 was reverted in #9917, but there's no discussion on the PR, so I'm not clear if the decision to support other roles was revisited, or if this is a temporary state.
  • In the current implementation, I exposed IsKnownMessageRole as a public function in the parser package, but there may be a better central place to put the list of "known" roles

🔄 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/9930 **Author:** [@gabe-l-hart](https://github.com/gabe-l-hart) **Created:** 3/21/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `LimitCollation-9929` --- ### 📝 Commits (3) - [`e08fd5a`](https://github.com/ollama/ollama/commit/e08fd5a4bf9351d8ce0c851952b956ec2693d23b) feat: Expose IsKnowMessageRole outside of the parser package - [`ff6e184`](https://github.com/ollama/ollama/commit/ff6e184366e7f3831f4631017c60f398d58650d8) feat: Only collate if msg.Role is one of the known roles - [`2eb645e`](https://github.com/ollama/ollama/commit/2eb645e7e764c8d0d2a217e754ef9b1d5aa98c3d) test: Add a unit test to validate collation of known roles only ### 📊 Changes **3 files changed** (+74 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `parser/parser.go` (+5 -1) 📝 `template/template.go` (+2 -1) 📝 `template/template_test.go` (+67 -0) </details> ### 📄 Description ## Description Closes #9929 This PR limits the collation logic to only apply to `"user"`, `"system"`, and `"assistant"` roles. ## Discussion * It looks like #9874 was reverted in #9917, but there's no discussion on the PR, so I'm not clear if the decision to support other roles was revisited, or if this is a temporary state. * In the current implementation, I exposed `IsKnownMessageRole` as a public function in the `parser` package, but there may be a better central place to put the list of "known" roles --- <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-22 23:37:18 -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#38972