mirror of
https://github.com/openai/codex.git
synced 2026-10-28 18:58:46 +00:00
chore: enforce argument-comment lint across all targets
This commit is contained in:
@@ -582,8 +582,8 @@ mod tests {
|
||||
fn suppresses_final_stdout_message_when_both_streams_are_terminals() {
|
||||
assert!(!should_print_final_message_to_stdout(
|
||||
Some("hello"),
|
||||
true,
|
||||
true
|
||||
/*stdout_is_terminal*/ true,
|
||||
/*stderr_is_terminal*/ true
|
||||
));
|
||||
}
|
||||
|
||||
@@ -591,8 +591,8 @@ mod tests {
|
||||
fn prints_final_stdout_message_when_stdout_is_not_terminal() {
|
||||
assert!(should_print_final_message_to_stdout(
|
||||
Some("hello"),
|
||||
false,
|
||||
true
|
||||
/*stdout_is_terminal*/ false,
|
||||
/*stderr_is_terminal*/ true
|
||||
));
|
||||
}
|
||||
|
||||
@@ -600,23 +600,26 @@ mod tests {
|
||||
fn prints_final_stdout_message_when_stderr_is_not_terminal() {
|
||||
assert!(should_print_final_message_to_stdout(
|
||||
Some("hello"),
|
||||
true,
|
||||
false
|
||||
/*stdout_is_terminal*/ true,
|
||||
/*stderr_is_terminal*/ false
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn suppresses_final_stdout_message_when_missing() {
|
||||
assert!(!should_print_final_message_to_stdout(None, false, false));
|
||||
assert!(!should_print_final_message_to_stdout(
|
||||
/*final_message*/ None, /*stdout_is_terminal*/ false,
|
||||
/*stderr_is_terminal*/ false
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn prints_final_tty_message_when_not_yet_rendered() {
|
||||
assert!(should_print_final_message_to_tty(
|
||||
Some("hello"),
|
||||
false,
|
||||
true,
|
||||
true
|
||||
/*final_message_rendered*/ false,
|
||||
/*stdout_is_terminal*/ true,
|
||||
/*stderr_is_terminal*/ true
|
||||
));
|
||||
}
|
||||
|
||||
@@ -624,9 +627,9 @@ mod tests {
|
||||
fn suppresses_final_tty_message_when_already_rendered() {
|
||||
assert!(!should_print_final_message_to_tty(
|
||||
Some("hello"),
|
||||
true,
|
||||
true,
|
||||
true
|
||||
/*final_message_rendered*/ true,
|
||||
/*stdout_is_terminal*/ true,
|
||||
/*stderr_is_terminal*/ true
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
@@ -1781,7 +1781,7 @@ mod tests {
|
||||
#[test]
|
||||
fn lagged_event_warning_message_is_explicit() {
|
||||
assert_eq!(
|
||||
lagged_event_warning_message(7),
|
||||
lagged_event_warning_message(/*skipped*/ 7),
|
||||
"in-process app-server event stream lagged; dropped 7 events".to_string()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ fn session_configured_produces_thread_started_event() {
|
||||
|
||||
#[test]
|
||||
fn turn_started_emits_turn_started_event() {
|
||||
let mut processor = EventProcessorWithJsonOutput::new(None);
|
||||
let mut processor = EventProcessorWithJsonOutput::new(/*last_message_path*/ None);
|
||||
|
||||
let collected =
|
||||
processor.collect_thread_events(ServerNotification::TurnStarted(TurnStartedNotification {
|
||||
@@ -158,7 +158,7 @@ fn turn_started_emits_turn_started_event() {
|
||||
|
||||
#[test]
|
||||
fn command_execution_started_and_completed_translate_to_thread_events() {
|
||||
let mut processor = EventProcessorWithJsonOutput::new(None);
|
||||
let mut processor = EventProcessorWithJsonOutput::new(/*last_message_path*/ None);
|
||||
let command_item = ThreadItem::CommandExecution {
|
||||
id: "cmd-1".to_string(),
|
||||
command: "ls".to_string(),
|
||||
@@ -235,7 +235,7 @@ fn command_execution_started_and_completed_translate_to_thread_events() {
|
||||
|
||||
#[test]
|
||||
fn empty_reasoning_items_are_ignored() {
|
||||
let mut processor = EventProcessorWithJsonOutput::new(None);
|
||||
let mut processor = EventProcessorWithJsonOutput::new(/*last_message_path*/ None);
|
||||
|
||||
let collected = processor.collect_thread_events(ServerNotification::ItemCompleted(
|
||||
ItemCompletedNotification {
|
||||
@@ -260,7 +260,7 @@ fn empty_reasoning_items_are_ignored() {
|
||||
|
||||
#[test]
|
||||
fn unsupported_items_do_not_consume_synthetic_ids() {
|
||||
let mut processor = EventProcessorWithJsonOutput::new(None);
|
||||
let mut processor = EventProcessorWithJsonOutput::new(/*last_message_path*/ None);
|
||||
|
||||
let ignored = processor.collect_thread_events(ServerNotification::ItemCompleted(
|
||||
ItemCompletedNotification {
|
||||
@@ -312,7 +312,7 @@ fn unsupported_items_do_not_consume_synthetic_ids() {
|
||||
|
||||
#[test]
|
||||
fn reasoning_items_emit_summary_not_raw_content() {
|
||||
let mut processor = EventProcessorWithJsonOutput::new(None);
|
||||
let mut processor = EventProcessorWithJsonOutput::new(/*last_message_path*/ None);
|
||||
|
||||
let collected = processor.collect_thread_events(ServerNotification::ItemCompleted(
|
||||
ItemCompletedNotification {
|
||||
@@ -344,7 +344,7 @@ fn reasoning_items_emit_summary_not_raw_content() {
|
||||
|
||||
#[test]
|
||||
fn web_search_completion_preserves_query_and_action() {
|
||||
let mut processor = EventProcessorWithJsonOutput::new(None);
|
||||
let mut processor = EventProcessorWithJsonOutput::new(/*last_message_path*/ None);
|
||||
|
||||
let collected = processor.collect_thread_events(ServerNotification::ItemCompleted(
|
||||
ItemCompletedNotification {
|
||||
@@ -384,7 +384,7 @@ fn web_search_completion_preserves_query_and_action() {
|
||||
|
||||
#[test]
|
||||
fn web_search_start_and_completion_reuse_item_id() {
|
||||
let mut processor = EventProcessorWithJsonOutput::new(None);
|
||||
let mut processor = EventProcessorWithJsonOutput::new(/*last_message_path*/ None);
|
||||
|
||||
let started =
|
||||
processor.collect_thread_events(ServerNotification::ItemStarted(ItemStartedNotification {
|
||||
@@ -451,7 +451,7 @@ fn web_search_start_and_completion_reuse_item_id() {
|
||||
|
||||
#[test]
|
||||
fn mcp_tool_call_begin_and_end_emit_item_events() {
|
||||
let mut processor = EventProcessorWithJsonOutput::new(None);
|
||||
let mut processor = EventProcessorWithJsonOutput::new(/*last_message_path*/ None);
|
||||
|
||||
let started =
|
||||
processor.collect_thread_events(ServerNotification::ItemStarted(ItemStartedNotification {
|
||||
@@ -533,7 +533,7 @@ fn mcp_tool_call_begin_and_end_emit_item_events() {
|
||||
|
||||
#[test]
|
||||
fn mcp_tool_call_failure_sets_failed_status() {
|
||||
let mut processor = EventProcessorWithJsonOutput::new(None);
|
||||
let mut processor = EventProcessorWithJsonOutput::new(/*last_message_path*/ None);
|
||||
|
||||
let collected = processor.collect_thread_events(ServerNotification::ItemCompleted(
|
||||
ItemCompletedNotification {
|
||||
@@ -579,7 +579,7 @@ fn mcp_tool_call_failure_sets_failed_status() {
|
||||
|
||||
#[test]
|
||||
fn mcp_tool_call_defaults_arguments_and_preserves_structured_content() {
|
||||
let mut processor = EventProcessorWithJsonOutput::new(None);
|
||||
let mut processor = EventProcessorWithJsonOutput::new(/*last_message_path*/ None);
|
||||
|
||||
let started =
|
||||
processor.collect_thread_events(ServerNotification::ItemStarted(ItemStartedNotification {
|
||||
@@ -667,7 +667,7 @@ fn mcp_tool_call_defaults_arguments_and_preserves_structured_content() {
|
||||
|
||||
#[test]
|
||||
fn collab_spawn_begin_and_end_emit_item_events() {
|
||||
let mut processor = EventProcessorWithJsonOutput::new(None);
|
||||
let mut processor = EventProcessorWithJsonOutput::new(/*last_message_path*/ None);
|
||||
|
||||
let started =
|
||||
processor.collect_thread_events(ServerNotification::ItemStarted(ItemStartedNotification {
|
||||
@@ -757,7 +757,7 @@ fn collab_spawn_begin_and_end_emit_item_events() {
|
||||
|
||||
#[test]
|
||||
fn file_change_completion_maps_change_kinds() {
|
||||
let mut processor = EventProcessorWithJsonOutput::new(None);
|
||||
let mut processor = EventProcessorWithJsonOutput::new(/*last_message_path*/ None);
|
||||
|
||||
let collected = processor.collect_thread_events(ServerNotification::ItemCompleted(
|
||||
ItemCompletedNotification {
|
||||
@@ -819,7 +819,7 @@ fn file_change_completion_maps_change_kinds() {
|
||||
|
||||
#[test]
|
||||
fn file_change_declined_maps_to_failed_status() {
|
||||
let mut processor = EventProcessorWithJsonOutput::new(None);
|
||||
let mut processor = EventProcessorWithJsonOutput::new(/*last_message_path*/ None);
|
||||
|
||||
let collected = processor.collect_thread_events(ServerNotification::ItemCompleted(
|
||||
ItemCompletedNotification {
|
||||
@@ -859,7 +859,7 @@ fn file_change_declined_maps_to_failed_status() {
|
||||
|
||||
#[test]
|
||||
fn agent_message_item_updates_final_message() {
|
||||
let mut processor = EventProcessorWithJsonOutput::new(None);
|
||||
let mut processor = EventProcessorWithJsonOutput::new(/*last_message_path*/ None);
|
||||
|
||||
let collected = processor.collect_thread_events(ServerNotification::ItemCompleted(
|
||||
ItemCompletedNotification {
|
||||
@@ -893,7 +893,7 @@ fn agent_message_item_updates_final_message() {
|
||||
|
||||
#[test]
|
||||
fn agent_message_item_started_is_ignored() {
|
||||
let mut processor = EventProcessorWithJsonOutput::new(None);
|
||||
let mut processor = EventProcessorWithJsonOutput::new(/*last_message_path*/ None);
|
||||
|
||||
let collected =
|
||||
processor.collect_thread_events(ServerNotification::ItemStarted(ItemStartedNotification {
|
||||
@@ -918,7 +918,7 @@ fn agent_message_item_started_is_ignored() {
|
||||
|
||||
#[test]
|
||||
fn reasoning_item_completed_uses_synthetic_id() {
|
||||
let mut processor = EventProcessorWithJsonOutput::new(None);
|
||||
let mut processor = EventProcessorWithJsonOutput::new(/*last_message_path*/ None);
|
||||
|
||||
let collected = processor.collect_thread_events(ServerNotification::ItemCompleted(
|
||||
ItemCompletedNotification {
|
||||
@@ -950,7 +950,7 @@ fn reasoning_item_completed_uses_synthetic_id() {
|
||||
|
||||
#[test]
|
||||
fn warning_event_produces_error_item() {
|
||||
let mut processor = EventProcessorWithJsonOutput::new(None);
|
||||
let mut processor = EventProcessorWithJsonOutput::new(/*last_message_path*/ None);
|
||||
|
||||
let collected = processor.collect_warning(
|
||||
"Heads up: Long conversations and multiple compactions can cause the model to be less accurate. Start a new conversation when possible to keep conversations small and targeted.".to_string(),
|
||||
@@ -974,7 +974,7 @@ fn warning_event_produces_error_item() {
|
||||
|
||||
#[test]
|
||||
fn plan_update_emits_started_then_updated_then_completed() {
|
||||
let mut processor = EventProcessorWithJsonOutput::new(None);
|
||||
let mut processor = EventProcessorWithJsonOutput::new(/*last_message_path*/ None);
|
||||
|
||||
let started = processor.collect_thread_events(ServerNotification::TurnPlanUpdated(
|
||||
TurnPlanUpdatedNotification {
|
||||
@@ -1101,7 +1101,7 @@ fn plan_update_emits_started_then_updated_then_completed() {
|
||||
|
||||
#[test]
|
||||
fn plan_update_after_completion_starts_new_todo_list_with_new_id() {
|
||||
let mut processor = EventProcessorWithJsonOutput::new(None);
|
||||
let mut processor = EventProcessorWithJsonOutput::new(/*last_message_path*/ None);
|
||||
|
||||
let _ = processor.collect_thread_events(ServerNotification::TurnPlanUpdated(
|
||||
TurnPlanUpdatedNotification {
|
||||
@@ -1159,7 +1159,7 @@ fn plan_update_after_completion_starts_new_todo_list_with_new_id() {
|
||||
|
||||
#[test]
|
||||
fn token_usage_update_is_emitted_on_turn_completion() {
|
||||
let mut processor = EventProcessorWithJsonOutput::new(None);
|
||||
let mut processor = EventProcessorWithJsonOutput::new(/*last_message_path*/ None);
|
||||
|
||||
let usage_update =
|
||||
processor.collect_thread_events(ServerNotification::ThreadTokenUsageUpdated(
|
||||
@@ -1221,7 +1221,7 @@ fn token_usage_update_is_emitted_on_turn_completion() {
|
||||
|
||||
#[test]
|
||||
fn turn_completion_recovers_final_message_from_turn_items() {
|
||||
let mut processor = EventProcessorWithJsonOutput::new(None);
|
||||
let mut processor = EventProcessorWithJsonOutput::new(/*last_message_path*/ None);
|
||||
|
||||
let completed = processor.collect_thread_events(ServerNotification::TurnCompleted(
|
||||
TurnCompletedNotification {
|
||||
@@ -1254,7 +1254,7 @@ fn turn_completion_recovers_final_message_from_turn_items() {
|
||||
|
||||
#[test]
|
||||
fn turn_completion_reconciles_started_items_from_turn_items() {
|
||||
let mut processor = EventProcessorWithJsonOutput::new(None);
|
||||
let mut processor = EventProcessorWithJsonOutput::new(/*last_message_path*/ None);
|
||||
|
||||
let started =
|
||||
processor.collect_thread_events(ServerNotification::ItemStarted(ItemStartedNotification {
|
||||
@@ -1340,7 +1340,7 @@ fn turn_completion_reconciles_started_items_from_turn_items() {
|
||||
|
||||
#[test]
|
||||
fn turn_completion_overwrites_stale_final_message_from_turn_items() {
|
||||
let mut processor = EventProcessorWithJsonOutput::new(None);
|
||||
let mut processor = EventProcessorWithJsonOutput::new(/*last_message_path*/ None);
|
||||
let _ = processor.collect_thread_events(ServerNotification::ItemCompleted(
|
||||
ItemCompletedNotification {
|
||||
item: ThreadItem::AgentMessage {
|
||||
@@ -1385,7 +1385,7 @@ fn turn_completion_overwrites_stale_final_message_from_turn_items() {
|
||||
|
||||
#[test]
|
||||
fn turn_completion_preserves_streamed_final_message_when_turn_items_are_empty() {
|
||||
let mut processor = EventProcessorWithJsonOutput::new(None);
|
||||
let mut processor = EventProcessorWithJsonOutput::new(/*last_message_path*/ None);
|
||||
let _ = processor.collect_thread_events(ServerNotification::ItemCompleted(
|
||||
ItemCompletedNotification {
|
||||
item: ThreadItem::AgentMessage {
|
||||
@@ -1425,7 +1425,7 @@ fn turn_completion_preserves_streamed_final_message_when_turn_items_are_empty()
|
||||
|
||||
#[test]
|
||||
fn failed_turn_clears_stale_final_message() {
|
||||
let mut processor = EventProcessorWithJsonOutput::new(None);
|
||||
let mut processor = EventProcessorWithJsonOutput::new(/*last_message_path*/ None);
|
||||
|
||||
let collected = processor.collect_thread_events(ServerNotification::ItemCompleted(
|
||||
ItemCompletedNotification {
|
||||
@@ -1465,7 +1465,7 @@ fn failed_turn_clears_stale_final_message() {
|
||||
|
||||
#[test]
|
||||
fn turn_completion_falls_back_to_final_plan_text() {
|
||||
let mut processor = EventProcessorWithJsonOutput::new(None);
|
||||
let mut processor = EventProcessorWithJsonOutput::new(/*last_message_path*/ None);
|
||||
|
||||
let completed = processor.collect_thread_events(ServerNotification::TurnCompleted(
|
||||
TurnCompletedNotification {
|
||||
@@ -1496,7 +1496,7 @@ fn turn_completion_falls_back_to_final_plan_text() {
|
||||
|
||||
#[test]
|
||||
fn turn_failure_prefers_structured_error_message() {
|
||||
let mut processor = EventProcessorWithJsonOutput::new(None);
|
||||
let mut processor = EventProcessorWithJsonOutput::new(/*last_message_path*/ None);
|
||||
|
||||
let error = processor.collect_thread_events(ServerNotification::Error(ErrorNotification {
|
||||
error: TurnError {
|
||||
@@ -1544,7 +1544,7 @@ fn turn_failure_prefers_structured_error_message() {
|
||||
|
||||
#[test]
|
||||
fn model_reroute_surfaces_as_error_item() {
|
||||
let mut processor = EventProcessorWithJsonOutput::new(None);
|
||||
let mut processor = EventProcessorWithJsonOutput::new(/*last_message_path*/ None);
|
||||
|
||||
let collected = processor.collect_thread_events(ServerNotification::ModelRerouted(
|
||||
codex_app_server_protocol::ModelReroutedNotification {
|
||||
|
||||
@@ -27,7 +27,7 @@ async fn spawn_command_under_sandbox(
|
||||
sandbox_policy,
|
||||
sandbox_cwd,
|
||||
stdio_policy,
|
||||
None,
|
||||
/*network*/ None,
|
||||
env,
|
||||
)
|
||||
.await
|
||||
|
||||
Reference in New Issue
Block a user