[PR #12402] [MERGED] bugfix: restore the current runOptions if loading fails in the CLI #60510

Closed
opened 2026-04-29 15:30:30 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/12402
Author: @pdevine
Created: 9/24/2025
Status: Merged
Merged: 9/26/2025
Merged by: @pdevine

Base: mainHead: pdevine/cli-loadcrash


📝 Commits (1)

  • 7bfbc71 bugfix: restore the current runOptions if loading fails in the CLI

📊 Changes

3 files changed (+338 additions, -1 deletions)

View changed files

📝 cmd/cmd.go (+45 -0)
📝 cmd/cmd_test.go (+284 -0)
📝 cmd/interactive.go (+9 -1)

📄 Description

There are two bugs when using /load <model> for a model that doesn't exist, namely:

  1. it will not restore the current model settings if the current model is a thinking model; and
  2. it will crash is the current model is a non-thinking model

This bug fix saves the current runOptions and then restores them if the model load doesn't happen. It also fixes the crash happening for non-thinking models.

Fixes #12351


🔄 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/12402 **Author:** [@pdevine](https://github.com/pdevine) **Created:** 9/24/2025 **Status:** ✅ Merged **Merged:** 9/26/2025 **Merged by:** [@pdevine](https://github.com/pdevine) **Base:** `main` ← **Head:** `pdevine/cli-loadcrash` --- ### 📝 Commits (1) - [`7bfbc71`](https://github.com/ollama/ollama/commit/7bfbc71c5db574a2f92e7b2a7e9a80b40b111ec6) bugfix: restore the current runOptions if loading fails in the CLI ### 📊 Changes **3 files changed** (+338 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `cmd/cmd.go` (+45 -0) 📝 `cmd/cmd_test.go` (+284 -0) 📝 `cmd/interactive.go` (+9 -1) </details> ### 📄 Description There are two bugs when using `/load <model>` for a model that doesn't exist, namely: 1. it will not restore the current model settings if the current model is a thinking model; and 2. it will crash is the current model is a non-thinking model This bug fix saves the current runOptions and then restores them if the model load doesn't happen. It also fixes the crash happening for non-thinking models. Fixes #12351 --- <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-29 15:30:30 -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#60510