When showing editor for -F just always show last thing no matter what

This commit is contained in:
2026-08-05 18:12:28 -05:00
parent 618976e316
commit 36ebca3f75
+2 -20
View File
@@ -18,26 +18,8 @@ std::expected<std::string, std::string> run_editor(HarnessState state, bool full
print_history(history_str, j, false);
initial_content << history_str.str();
} else {
// Find the last AI response
const Message* last_ai_msg = nullptr;
for (int i = static_cast<int>(state.history.size()) - 1; i >= 0; --i) {
if (state.history[i].role == "assistant") {
last_ai_msg = &state.history[i];
break;
}
}
if (last_ai_msg) {
initial_content << "[" << last_ai_msg->role << "] ";
if (!last_ai_msg->reasoning.empty()) {
initial_content << "[Thinking: " << last_ai_msg->reasoning << "] ";
}
initial_content << last_ai_msg->content << "\n\n";
} else {
// Fallback to last message if no assistant message found
const auto& last_msg = state.history.back();
initial_content << "[" << last_msg.role << "] " << last_msg.content << "\n\n";
}
const auto& last_msg = state.history.back();
initial_content << "[" << last_msg.role << "] " << last_msg.content << "\n\n";
}
}