WeKnora/internal/application
hujiaxin ead70dec02 fix(session): bound the auto-generated session title to fit the column
GenerateTitle writes the model completion straight into sessions.title,
which every shipped migration declares as VARCHAR(255). When the model
ignores the "short title" instruction and returns an explanation along with
the title, the follow-up Update fails with SQLSTATE 22001 (value too long
for type character varying(255)) and the session silently ends up with no
title. The error only reaches the log and the answer itself is unaffected,
so the failure is easy to miss.

Trim the reasoning prefix and surrounding whitespace, then truncate to 100
runes - by rune rather than byte, so a multi-byte character is never cut in
half - and log a warning when truncation happens so the prompt can be
revisited.
2026-08-20 15:35:34 +08:00
..
repository fix(retrieval): 分段中删除的图片不再被检索到 2026-08-20 12:01:28 +08:00
service fix(session): bound the auto-generated session title to fit the column 2026-08-20 15:35:34 +08:00