feat: add original_content for history message

This commit is contained in:
yetone
2025-07-17 15:44:47 +08:00
parent cd81fbf8af
commit a08a2e3579
3 changed files with 5 additions and 2 deletions

View File

@@ -237,6 +237,7 @@ function M:add_text_message(ctx, text, state, opts)
}, {
state = state,
uuid = ctx.content_uuid,
original_content = ctx.content,
})
ctx.content_uuid = msg.uuid
local msgs = { msg }
@@ -332,7 +333,7 @@ function M:add_text_message(ctx, text, state, opts)
end
::continue::
end
msg.displayed_content = table.concat(new_content_list, "\n")
msg.message.content = table.concat(new_content_list, "\n")
end
if opts.on_messages_add then opts.on_messages_add(msgs) end
if has_tool_use and state == "generating" then opts.on_stop({ reason = "tool_use", streaming_tool_use = true }) end