]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
chat: trim messages sent to StepFun parser (fixes long reasoning loops) (#25238)
authorPiotr Wilkin (ilintar) <redacted>
Fri, 3 Jul 2026 21:12:11 +0000 (23:12 +0200)
committerGitHub <redacted>
Fri, 3 Jul 2026 21:12:11 +0000 (23:12 +0200)
commit2d973636e292ee6f75fadcf08d29cb33511f509f
tree4e2658f937d8234f8bf6502a1ce2fd8186b8ae1e
parentd4cff114c0084f1fbc9b4c62717eca8fb2ae494a
chat: trim messages sent to StepFun parser (fixes long reasoning loops) (#25238)

* chat: trim messages sent to StepFun parser (fixes long reasoning loops)

* add regression test; remove duplicate template

* chat: trim StepFun content parts before rendering

The StepFun trim workaround ran on the already-rendered messages, where
typed content parts have been concatenated into a single string, so the
per-part whitespace could no longer be reached. Move the trim ahead of
rendering and apply it to content_parts text as well as the string
content and reasoning_content. Adds a content-parts regression test.

Co-Authored-By: Piotr Wilkin <redacted>
Assisted-By: Claude Fable 5 <redacted>
---------

Co-authored-by: tarruda <redacted>
common/chat.cpp
models/templates/stepfun-ai-Step-3.5-Flash.jinja [deleted file]
tests/test-chat-auto-parser.cpp
tests/test-chat.cpp