* cli : persist reasoning_content in chat history
llama-cli collected reasoning from the stream for display but only
stored assistant content in messages, so --reasoning-preserve could
not re-inject prior thoughts on later turns.
generated_content content;
generate_completion(content, timings);
- impl->messages.push_back({
+ json assistant_msg = {
{"role", "assistant"},
{"content", content.content}
- });
+ };
+ if (!content.reasoning.empty()) {
+ assistant_msg["reasoning_content"] = content.reasoning;
+ }
+ impl->messages.push_back(std::move(assistant_msg));
if (output_file) {
std::string out_content = "Assistant:\n";