feat: include "reasoning" messages in Rust TUI (#892)
As shown in the screenshot, we now include reasoning messages from the model in the TUI under the heading "codex reasoning":  To ensure these are visible by default when using `o4-mini`, this also changes the default value for `summary` (formerly `generate_summary`, which is deprecated in favor of `summary` according to the docs) from unset to `"auto"`.
This commit is contained in:
@@ -41,6 +41,9 @@ pub(crate) enum HistoryCell {
|
||||
/// Message from the agent.
|
||||
AgentMessage { lines: Vec<Line<'static>> },
|
||||
|
||||
/// Reasoning event from the agent.
|
||||
AgentReasoning { lines: Vec<Line<'static>> },
|
||||
|
||||
/// An exec tool call that has not finished yet.
|
||||
ActiveExecCommand {
|
||||
call_id: String,
|
||||
@@ -134,6 +137,15 @@ impl HistoryCell {
|
||||
HistoryCell::AgentMessage { lines }
|
||||
}
|
||||
|
||||
pub(crate) fn new_agent_reasoning(text: String) -> Self {
|
||||
let mut lines: Vec<Line<'static>> = Vec::new();
|
||||
lines.push(Line::from("codex reasoning".magenta().italic()));
|
||||
append_markdown(&text, &mut lines);
|
||||
lines.push(Line::from(""));
|
||||
|
||||
HistoryCell::AgentReasoning { lines }
|
||||
}
|
||||
|
||||
pub(crate) fn new_active_exec_command(call_id: String, command: Vec<String>) -> Self {
|
||||
let command_escaped = escape_command(&command);
|
||||
let start = Instant::now();
|
||||
@@ -363,6 +375,7 @@ impl HistoryCell {
|
||||
HistoryCell::WelcomeMessage { lines, .. }
|
||||
| HistoryCell::UserPrompt { lines, .. }
|
||||
| HistoryCell::AgentMessage { lines, .. }
|
||||
| HistoryCell::AgentReasoning { lines, .. }
|
||||
| HistoryCell::BackgroundEvent { lines, .. }
|
||||
| HistoryCell::ErrorEvent { lines, .. }
|
||||
| HistoryCell::SessionInfo { lines, .. }
|
||||
|
||||
Reference in New Issue
Block a user