[PR #8130] [MERGED] llm: do not silently fail for supplied, but invalid formats #38513

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

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/8130
Author: @bmizerany
Created: 12/17/2024
Status: Merged
Merged: 12/17/2024
Merged by: @bmizerany

Base: mainHead: bmizerany/donotsilentlyfail


📝 Commits (1)

  • f61903b llm: do not silently fail for supplied, but invalid formats

📊 Changes

3 files changed (+96 additions, -29 deletions)

View changed files

📝 .golangci.yaml (+0 -4)
📝 llm/server.go (+33 -25)
llm/server_test.go (+63 -0)

📄 Description

Changes in #8002 introduced fixes for bugs with mangling JSON Schemas.
It also fixed a bug where the server would silently fail when clients
requested invalid formats. It also, unfortunately, introduced a bug
where the server would reject requests with an empty format, which
should be allowed.

The change in #8127 updated the code to allow the empty format, but also
reintroduced the regression where the server would silently fail when
the format was set, but invalid.

This commit fixes both regressions. The server does not reject the empty
format, but it does reject invalid formats. It also adds tests to help
us catch regressions in the future.

Also, the updated code provides a more detailed error message when a
client sends a non-empty, but invalid format, echoing the invalid format
in the response.

This commits also takes the opportunity to remove superfluous linter
checks.


🔄 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/8130 **Author:** [@bmizerany](https://github.com/bmizerany) **Created:** 12/17/2024 **Status:** ✅ Merged **Merged:** 12/17/2024 **Merged by:** [@bmizerany](https://github.com/bmizerany) **Base:** `main` ← **Head:** `bmizerany/donotsilentlyfail` --- ### 📝 Commits (1) - [`f61903b`](https://github.com/ollama/ollama/commit/f61903b10b0172e7cddc38f0452605338a158d06) llm: do not silently fail for supplied, but invalid formats ### 📊 Changes **3 files changed** (+96 additions, -29 deletions) <details> <summary>View changed files</summary> 📝 `.golangci.yaml` (+0 -4) 📝 `llm/server.go` (+33 -25) ➕ `llm/server_test.go` (+63 -0) </details> ### 📄 Description Changes in #8002 introduced fixes for bugs with mangling JSON Schemas. It also fixed a bug where the server would silently fail when clients requested invalid formats. It also, unfortunately, introduced a bug where the server would reject requests with an empty format, which should be allowed. The change in #8127 updated the code to allow the empty format, but also reintroduced the regression where the server would silently fail when the format was set, but invalid. This commit fixes both regressions. The server does not reject the empty format, but it does reject invalid formats. It also adds tests to help us catch regressions in the future. Also, the updated code provides a more detailed error message when a client sends a non-empty, but invalid format, echoing the invalid format in the response. This commits also takes the opportunity to remove superfluous linter checks. --- <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:10:50 -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#38513