From 9b8187b487159cda3e753f9d242303d857ba321c Mon Sep 17 00:00:00 2001 From: frob Date: Thu, 18 Sep 2025 01:39:04 +0200 Subject: [PATCH] server: skip parsing initial if provided in the prompt for /api/generate (#12289) --- server/routes.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/routes.go b/server/routes.go index dc868038..b1def0de 100644 --- a/server/routes.go +++ b/server/routes.go @@ -429,6 +429,9 @@ func (s *Server) GenerateHandler(c *gin.Context) { OpeningTag: openingTag, ClosingTag: closingTag, } + if strings.HasSuffix(strings.TrimSpace(prompt), openingTag) { + thinkingState.AddContent(openingTag) + } } }