Skip to content

Commit 9909ea4

Browse files
committed
fmt
1 parent 675e993 commit 9909ea4

File tree

5 files changed

+37
-18
lines changed

5 files changed

+37
-18
lines changed

codex-rs/core/src/protocol.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ pub enum EventMsg {
352352
ApplyPatchApprovalRequest(ApplyPatchApprovalRequestEvent),
353353

354354
BackgroundEvent(BackgroundEventEvent),
355-
355+
356356
Log(LogEvent),
357357

358358
/// Notification that the agent is about to apply a code patch. Mirrors

codex-rs/tui/src/chatwidget.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use std::sync::Arc;
33

44
use codex_core::codex_wrapper::init_codex;
55
use codex_core::config::Config;
6-
use codex_core::protocol::{AgentMessageEvent, LogEvent};
76
use codex_core::protocol::AgentReasoningEvent;
87
use codex_core::protocol::ApplyPatchApprovalRequestEvent;
98
use codex_core::protocol::ErrorEvent;
@@ -18,6 +17,7 @@ use codex_core::protocol::McpToolCallEndEvent;
1817
use codex_core::protocol::Op;
1918
use codex_core::protocol::PatchApplyBeginEvent;
2019
use codex_core::protocol::TaskCompleteEvent;
20+
use codex_core::protocol::{AgentMessageEvent, LogEvent};
2121
use crossterm::event::KeyEvent;
2222
use ratatui::buffer::Buffer;
2323
use ratatui::layout::Constraint;

codex-rs/tui/src/conversation_history_widget.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ impl ConversationHistoryWidget {
205205
pub fn add_background_event(&mut self, message: String) {
206206
self.add_to_history(HistoryCell::new_background_event(message));
207207
}
208-
208+
209209
pub fn add_log_line(&mut self, line: String) {
210210
self.add_to_history(HistoryCell::new_log_line(line))
211211
}

codex-rs/tui/src/history_cell.rs

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,24 @@ pub(crate) enum PatchEventType {
4949
/// scrollable list.
5050
pub(crate) enum HistoryCell {
5151
/// Welcome message.
52-
WelcomeMessage { view: TextBlock },
52+
WelcomeMessage {
53+
view: TextBlock,
54+
},
5355

5456
/// Message from the user.
55-
UserPrompt { view: TextBlock },
57+
UserPrompt {
58+
view: TextBlock,
59+
},
5660

5761
/// Message from the agent.
58-
AgentMessage { view: TextBlock },
62+
AgentMessage {
63+
view: TextBlock,
64+
},
5965

6066
/// Reasoning event from the agent.
61-
AgentReasoning { view: TextBlock },
67+
AgentReasoning {
68+
view: TextBlock,
69+
},
6270

6371
/// An exec tool call that has not finished yet.
6472
ActiveExecCommand {
@@ -70,7 +78,9 @@ pub(crate) enum HistoryCell {
7078
},
7179

7280
/// Completed exec tool call.
73-
CompletedExecCommand { view: TextBlock },
81+
CompletedExecCommand {
82+
view: TextBlock,
83+
},
7484

7585
/// An MCP tool call that has not finished yet.
7686
ActiveMcpToolCall {
@@ -82,7 +92,9 @@ pub(crate) enum HistoryCell {
8292
},
8393

8494
/// Completed MCP tool call where we show the result serialized as JSON.
85-
CompletedMcpToolCall { view: TextBlock },
95+
CompletedMcpToolCall {
96+
view: TextBlock,
97+
},
8698

8799
/// Completed MCP tool call where the result is an image.
88100
/// Admittedly, [mcp_types::CallToolResult] can have multiple content types,
@@ -101,20 +113,30 @@ pub(crate) enum HistoryCell {
101113
},
102114

103115
/// Background event.
104-
BackgroundEvent { view: TextBlock },
116+
BackgroundEvent {
117+
view: TextBlock,
118+
},
105119

106120
/// Error event from the backend.
107-
ErrorEvent { view: TextBlock },
121+
ErrorEvent {
122+
view: TextBlock,
123+
},
108124

109125
/// Info describing the newly-initialized session.
110-
SessionInfo { view: TextBlock },
126+
SessionInfo {
127+
view: TextBlock,
128+
},
111129

112130
/// A pending code patch that is awaiting user approval. Mirrors the
113131
/// behaviour of `ActiveExecCommand` so the user sees *what* patch the
114132
/// model wants to apply before being prompted to approve or deny it.
115-
PendingPatch { view: TextBlock },
133+
PendingPatch {
134+
view: TextBlock,
135+
},
116136

117-
Log { view: TextBlock }
137+
Log {
138+
view: TextBlock,
139+
},
118140
}
119141

120142
const TOOL_CALL_MAX_LINES: usize = 5;
@@ -467,7 +489,6 @@ impl HistoryCell {
467489
HistoryCell::Log {
468490
view: TextBlock::new(lines),
469491
}
470-
471492
}
472493

473494
pub(crate) fn new_error_event(message: String) -> Self {

codex-rs/tui/src/log_layer.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ pub struct TuiLogLayer {
2525

2626
impl TuiLogLayer {
2727
pub fn new(tx: UnboundedSender<String>) -> Self {
28-
Self {
29-
tx,
30-
}
28+
Self { tx }
3129
}
3230
}
3331

0 commit comments

Comments
 (0)