[PR #14486] [CLOSED] bugfix: fix crash bug in token cache logic #40575

Closed
opened 2026-04-23 01:26:39 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/14486
Author: @pdevine
Created: 2/27/2026
Status: Closed

Base: mainHead: pdevine/sampling-cache-error


📝 Commits (1)

  • 857cffd bugfix: fix crash bug in token cache logic

📊 Changes

1 file changed (+5 additions, -0 deletions)

View changed files

📝 x/mlxrunner/cache.go (+5 -0)

📄 Description

This change fixes a problem in the token cache logic to avoid panics caused by empty token arrays by ensuring at least one token remains on full cache hits in the relevant function. The happens if there is an exact match in the cache on subsequent generations.


🔄 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/14486 **Author:** [@pdevine](https://github.com/pdevine) **Created:** 2/27/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `pdevine/sampling-cache-error` --- ### 📝 Commits (1) - [`857cffd`](https://github.com/ollama/ollama/commit/857cffd22a353383228b34a308415262d13492c1) bugfix: fix crash bug in token cache logic ### 📊 Changes **1 file changed** (+5 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `x/mlxrunner/cache.go` (+5 -0) </details> ### 📄 Description This change fixes a problem in the token cache logic to avoid panics caused by empty token arrays by ensuring at least one token remains on full cache hits in the relevant function. The happens if there is an exact match in the cache on subsequent generations. --- <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-23 01:26:39 -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#40575