Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Fix stale /copy output after commentary-only turns (#16648)

Eric Trautcc8fd0ff65b6
diff --git a/codex-rs/tui/src/chatwidget.rs b/codex-rs/tui/src/chatwidget.rs
index 02429e9d9b..b0ddb631bd 100644
--- a/codex-rs/tui/src/chatwidget.rs
+++ b/codex-rs/tui/src/chatwidget.rs
@@ -777,7 +777,7 @@ pub(crate) struct ChatWidget {
plan_stream_controller: Option<PlanStreamController>,
// Latest completed user-visible Codex output that `/copy` should place on the clipboard.
last_copyable_output: Option<String>,
- // Final-answer agent message observed during the active turn. App-server turn completion
+ // Latest agent message observed during the active turn. App-server turn completion
// notifications do not repeat this payload, so we promote it when the turn completes.
pending_turn_copyable_output: Option<String>,
running_commands: HashMap<String, RunningCommand>,
@@ -4041,10 +4041,7 @@ impl ChatWidget {
self.finalize_completed_assistant_message(
(!message.is_empty()).then_some(message.as_str()),
);
- if self.agent_turn_running
- && !message.is_empty()
- && matches!(item.phase, Some(MessagePhase::FinalAnswer) | None)
- {
+ if self.agent_turn_running && !message.is_empty() {
self.pending_turn_copyable_output = Some(message.clone());
}
self.pending_status_indicator_restore = match item.phase {