fix(#1284): honor display_commentary/display_reasoning in history (#1297)

This commit is contained in:
m57 authored and GitHub committed 2026-09-26 22:05:32 +03:00
1 parent c34de55dd9
commit 45de69a271
3 files changed
+176 -6

No files matched your search

@@ -179,13 +179,18 @@ internal fun mapServerMessages(
?: existingById[restId]?.timestamp
?: System.currentTimeMillis()
val rawContent = msg.displayContentText ?: msg.contentText
val rawContent = msg.visibleText
// #1284: projected reasoning already excludes public commentary; it is authoritative.
val rowReasoning =
msg.reasoningText.ifBlank {
if (role == MessageRole.ASSISTANT) {
reasoningSources[index]?.reasoningText.orEmpty()
} else {
existingById[restId]?.reasoningText.orEmpty()
if (msg.hasDisplayReasoning) {
msg.displayReasoningText
} else {
msg.reasoningText.ifBlank {
if (role == MessageRole.ASSISTANT) {
reasoningSources[index]?.reasoningText.orEmpty()
} else {
existingById[restId]?.reasoningText.orEmpty()
}
}
}