feat: preserve and echo thinking blocks for extended-thinking models (DeepSeek, Claude thinking mode)
This commit is contained in:
1 parent
d3c74e5681
commit
152d8b972e
6 files changed
+116
-17
No files matched your search
@@ -212,6 +212,15 @@ func assembleMessages(history []session.SessionEntry) []llm.Message {
|
||||
Role: entry.Role,
|
||||
Content: md.Text,
|
||||
}
|
||||
// Restore thinking blocks for assistant messages (must be echoed back).
|
||||
if entry.Role == "assistant" {
|
||||
for _, tb := range md.ThinkingBlocks {
|
||||
msg.ThinkingBlocks = append(msg.ThinkingBlocks, llm.ThinkingBlock{
|
||||
Thinking: tb.Thinking,
|
||||
Signature: tb.Signature,
|
||||
})
|
||||
}
|
||||
}
|
||||
// Convert session images to LLM image content
|
||||
if entry.Role == "user" {
|
||||
for _, img := range md.Images {
|
||||
|
||||
Reference in new issue
Block a user