Skip to content

Commit 056d13f

Browse files
committed
removing is_user_shell_command
1 parent d270c66 commit 056d13f

File tree

7 files changed

+2
-27
lines changed

7 files changed

+2
-27
lines changed

codex-rs/core/src/exec.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,6 @@ async fn read_capped<R: AsyncRead + Unpin + Send + 'static>(
577577
let chunk = tmp[..n].to_vec();
578578
let msg = EventMsg::ExecCommandOutputDelta(ExecCommandOutputDeltaEvent {
579579
call_id: stream.call_id.clone(),
580-
is_user_shell_command: false,
581580
stream: if is_stderr {
582581
ExecOutputStream::Stderr
583582
} else {

codex-rs/core/src/tools/events.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ impl ToolEmitter {
140140
output.exit_code,
141141
output.duration,
142142
format_exec_output_str(&output),
143-
false,
144143
)
145144
.await;
146145
}
@@ -153,7 +152,6 @@ impl ToolEmitter {
153152
output.exit_code,
154153
output.duration,
155154
format_exec_output_str(&output),
156-
false,
157155
)
158156
.await;
159157
}
@@ -166,7 +164,6 @@ impl ToolEmitter {
166164
-1,
167165
Duration::ZERO,
168166
message.clone(),
169-
false,
170167
)
171168
.await;
172169
}
@@ -232,7 +229,6 @@ impl ToolEmitter {
232229
output.exit_code,
233230
output.duration,
234231
format_exec_output_str(&output),
235-
false,
236232
)
237233
.await;
238234
}
@@ -248,7 +244,6 @@ impl ToolEmitter {
248244
output.exit_code,
249245
output.duration,
250246
format_exec_output_str(&output),
251-
false,
252247
)
253248
.await;
254249
}
@@ -264,7 +259,6 @@ impl ToolEmitter {
264259
-1,
265260
Duration::ZERO,
266261
message.clone(),
267-
false,
268262
)
269263
.await;
270264
}
@@ -323,7 +317,6 @@ impl ToolEmitter {
323317
}
324318
}
325319

326-
#[allow(clippy::too_many_arguments)]
327320
async fn emit_exec_end(
328321
ctx: ToolEventCtx<'_>,
329322
stdout: String,
@@ -332,14 +325,12 @@ async fn emit_exec_end(
332325
exit_code: i32,
333326
duration: Duration,
334327
formatted_output: String,
335-
is_user_shell_command: bool,
336328
) {
337329
ctx.session
338330
.send_event(
339331
ctx.turn,
340332
EventMsg::ExecCommandEnd(ExecCommandEndEvent {
341333
call_id: ctx.call_id.to_string(),
342-
is_user_shell_command,
343334
stdout,
344335
stderr,
345336
aggregated_output,

codex-rs/core/src/tools/handlers/unified_exec.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ impl ToolHandler for UnifiedExecHandler {
152152
if !response.output.is_empty() {
153153
let delta = ExecCommandOutputDeltaEvent {
154154
call_id: response.event_call_id.clone(),
155-
is_user_shell_command: false,
156155
stream: ExecOutputStream::Stdout,
157156
chunk: response.output.as_bytes().to_vec(),
158157
};

codex-rs/exec/tests/event_processor_with_json_output.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,6 @@ fn exec_command_end_success_produces_completed_command_item() {
650650
"c2",
651651
EventMsg::ExecCommandEnd(ExecCommandEndEvent {
652652
call_id: "1".to_string(),
653-
is_user_shell_command: false,
654653
stdout: String::new(),
655654
stderr: String::new(),
656655
aggregated_output: "hi\n".to_string(),
@@ -711,7 +710,6 @@ fn exec_command_end_failure_produces_failed_command_item() {
711710
"c2",
712711
EventMsg::ExecCommandEnd(ExecCommandEndEvent {
713712
call_id: "2".to_string(),
714-
is_user_shell_command: false,
715713
stdout: String::new(),
716714
stderr: String::new(),
717715
aggregated_output: String::new(),
@@ -746,7 +744,6 @@ fn exec_command_end_without_begin_is_ignored() {
746744
"c1",
747745
EventMsg::ExecCommandEnd(ExecCommandEndEvent {
748746
call_id: "no-begin".to_string(),
749-
is_user_shell_command: false,
750747
stdout: String::new(),
751748
stderr: String::new(),
752749
aggregated_output: String::new(),

codex-rs/protocol/src/protocol.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,10 +1222,6 @@ pub struct ExecCommandBeginEvent {
12221222
pub struct ExecCommandEndEvent {
12231223
/// Identifier for the ExecCommandBegin that finished.
12241224
pub call_id: String,
1225-
/// True when this exec was initiated directly by the user (e.g. bang command),
1226-
/// not by the agent/model. Defaults to false for backwards compatibility.
1227-
#[serde(default)]
1228-
pub is_user_shell_command: bool,
12291225
/// Captured stdout
12301226
pub stdout: String,
12311227
/// Captured stderr
@@ -1262,10 +1258,6 @@ pub enum ExecOutputStream {
12621258
pub struct ExecCommandOutputDeltaEvent {
12631259
/// Identifier for the ExecCommandBegin that produced this chunk.
12641260
pub call_id: String,
1265-
/// True when this exec was initiated directly by the user (e.g. bang command),
1266-
/// not by the agent/model. Defaults to false for backwards compatibility.
1267-
#[serde(default)]
1268-
pub is_user_shell_command: bool,
12691261
/// Which stream produced this chunk.
12701262
pub stream: ExecOutputStream,
12711263
/// Raw bytes from the stream (may not be valid UTF-8).
@@ -1552,13 +1544,12 @@ mod tests {
15521544
fn vec_u8_as_base64_serialization_and_deserialization() -> Result<()> {
15531545
let event = ExecCommandOutputDeltaEvent {
15541546
call_id: "call21".to_string(),
1555-
is_user_shell_command: false,
15561547
stream: ExecOutputStream::Stdout,
15571548
chunk: vec![1, 2, 3, 4, 5],
15581549
};
15591550
let serialized = serde_json::to_string(&event)?;
15601551
assert_eq!(
1561-
r#"{"call_id":"call21","is_user_shell_command":false,"stream":"stdout","chunk":"AQIDBAU="}"#,
1552+
r#"{"call_id":"call21","stream":"stdout","chunk":"AQIDBAU="}"#,
15621553
serialized,
15631554
);
15641555

codex-rs/tui/src/chatwidget.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ impl ChatWidget {
824824
let running = self.running_commands.remove(&ev.call_id);
825825
let (command, parsed, is_user_shell_command) = match running {
826826
Some(rc) => (rc.command, rc.parsed_cmd, rc.is_user_shell_command),
827-
None => (vec![ev.call_id.clone()], Vec::new(), ev.is_user_shell_command),
827+
None => (vec![ev.call_id.clone()], Vec::new(), false),
828828
};
829829

830830
let needs_new = self

codex-rs/tui/src/chatwidget/tests.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,6 @@ fn end_exec(chat: &mut ChatWidget, call_id: &str, stdout: &str, stderr: &str, ex
640640
id: call_id.to_string(),
641641
msg: EventMsg::ExecCommandEnd(ExecCommandEndEvent {
642642
call_id: call_id.to_string(),
643-
is_user_shell_command: false,
644643
stdout: stdout.to_string(),
645644
stderr: stderr.to_string(),
646645
aggregated_output: aggregated.clone(),
@@ -2775,7 +2774,6 @@ fn chatwidget_exec_and_status_layout_vt100_snapshot() {
27752774
id: "c1".into(),
27762775
msg: EventMsg::ExecCommandEnd(ExecCommandEndEvent {
27772776
call_id: "c1".into(),
2778-
is_user_shell_command: false,
27792777
stdout: String::new(),
27802778
stderr: String::new(),
27812779
aggregated_output: String::new(),

0 commit comments

Comments
 (0)