[PR #8996] [MERGED] api: document client stream behavior with a test #12834

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

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/8996
Author: @BruceMacD
Created: 2/10/2025
Status: Merged
Merged: 2/20/2025
Merged by: @BruceMacD

Base: mainHead: brucemacd/client-stream


📝 Commits (2)

  • cf914aa api: document client stream behavior with a test
  • 67b42a2 test case feedback

📊 Changes

2 files changed (+211 additions, -1 deletions)

View changed files

📝 api/client.go (+1 -1)
📝 api/client_test.go (+210 -0)

📄 Description

Added unit tests to verify error handling behavior in the Client.stream method. Tests cover various error scenarios including:

  • Error responses with status codes >= 400
  • Error messages with successful status codes
  • Empty error messages
  • Successful responses

Also modified error handling order in stream() to check HTTP status code before error message, ensuring consistent behavior with StatusError type.


🔄 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/8996 **Author:** [@BruceMacD](https://github.com/BruceMacD) **Created:** 2/10/2025 **Status:** ✅ Merged **Merged:** 2/20/2025 **Merged by:** [@BruceMacD](https://github.com/BruceMacD) **Base:** `main` ← **Head:** `brucemacd/client-stream` --- ### 📝 Commits (2) - [`cf914aa`](https://github.com/ollama/ollama/commit/cf914aa406341a3b658841161c5792c7f0fcdaad) api: document client stream behavior with a test - [`67b42a2`](https://github.com/ollama/ollama/commit/67b42a2aea2219200db271b79ec89ae76da07441) test case feedback ### 📊 Changes **2 files changed** (+211 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `api/client.go` (+1 -1) 📝 `api/client_test.go` (+210 -0) </details> ### 📄 Description Added unit tests to verify error handling behavior in the Client.stream method. Tests cover various error scenarios including: - Error responses with status codes >= 400 - Error messages with successful status codes - Empty error messages - Successful responses Also modified error handling order in stream() to check HTTP status code before error message, ensuring consistent behavior with StatusError type. --- <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 00: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#12834