[PR #14262] server: warn when chat history or embeddings are truncated #19863

Open
opened 2026-04-16 07:18:54 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/14262
Author: @akuligowski9
Created: 2/14/2026
Status: 🔄 Open

Base: mainHead: server/warn-context-truncation


📝 Commits (1)

  • 0e05cfe server: warn when chat history or embeddings are truncated

📊 Changes

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

View changed files

📝 server/prompt.go (+4 -1)
📝 server/routes.go (+3 -0)

📄 Description

Summary

  • Upgrades chat history truncation log from slog.Debug to slog.Warn in server/prompt.go, adding messages dropped count and active context length
  • Adds slog.Warn in server/routes.go when embedding input is silently truncated to fit context window

No behavior change, no API surface change — only log level and message improvements.

Context

Resolves #14259

This addresses a pattern seen across 400+ open issues around context length confusion. Users currently have no way to know when their conversation history is being silently dropped. Related issues: #4967 #3839 #2208 #14173 #14116 #12407 #6286 #12474

Test plan

  • go test ./server/ passes
  • go vet ./server/ clean
  • Manual verification: send a long conversation that exceeds context length and confirm the warning appears in server logs

🤖 Generated with Claude Code


🔄 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/14262 **Author:** [@akuligowski9](https://github.com/akuligowski9) **Created:** 2/14/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `server/warn-context-truncation` --- ### 📝 Commits (1) - [`0e05cfe`](https://github.com/ollama/ollama/commit/0e05cfe4b3e5c85b8e13d6978a51d995d3b8ac72) server: warn when chat history or embeddings are truncated ### 📊 Changes **2 files changed** (+7 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `server/prompt.go` (+4 -1) 📝 `server/routes.go` (+3 -0) </details> ### 📄 Description ## Summary - Upgrades chat history truncation log from `slog.Debug` to `slog.Warn` in `server/prompt.go`, adding messages dropped count and active context length - Adds `slog.Warn` in `server/routes.go` when embedding input is silently truncated to fit context window No behavior change, no API surface change — only log level and message improvements. ## Context Resolves #14259 This addresses a pattern seen across 400+ open issues around context length confusion. Users currently have no way to know when their conversation history is being silently dropped. Related issues: #4967 #3839 #2208 #14173 #14116 #12407 #6286 #12474 ## Test plan - [x] `go test ./server/` passes - [x] `go vet ./server/` clean - [ ] Manual verification: send a long conversation that exceeds context length and confirm the warning appears in server logs 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <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-16 07:18:54 -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#19863