Revert "rebase"

This reverts commit 9ad5c1386f, reversing
changes made to 4b9e6f4383.
This commit is contained in:
Roy Han
2026-03-24 15:21:52 -07:00
parent 9ad5c1386f
commit 039a64053c
78 changed files with 53 additions and 740 deletions
@@ -82,7 +82,6 @@ use codex_protocol::protocol::SkillMetadata as CoreSkillMetadata;
use codex_protocol::protocol::SkillScope as CoreSkillScope;
use codex_protocol::protocol::SkillToolDependency as CoreSkillToolDependency;
use codex_protocol::protocol::SubAgentSource as CoreSubAgentSource;
use codex_protocol::protocol::SubmissionType;
use codex_protocol::protocol::TokenUsage as CoreTokenUsage;
use codex_protocol::protocol::TokenUsageInfo as CoreTokenUsageInfo;
use codex_protocol::request_permissions::PermissionGrantScope as CorePermissionGrantScope;
@@ -3926,10 +3925,6 @@ pub struct TurnStartParams {
/// Override the personality for this turn and subsequent turns.
#[ts(optional = nullable)]
pub personality: Option<Personality>,
/// Classify the primary input message submitted with `turn/start`.
#[serde(default, skip_serializing_if = "Option::is_none")]
#[ts(optional = nullable)]
pub submission_type: Option<SubmissionType>,
/// Optional JSON Schema used to constrain the final assistant message for
/// this turn.
#[ts(optional = nullable)]
@@ -8049,10 +8044,9 @@ mod tests {
service_tier: None,
effort: None,
summary: None,
personality: None,
submission_type: None,
output_schema: None,
collaboration_mode: None,
personality: None,
};
let serialized_without_override =
serde_json::to_value(&without_override).expect("params should serialize");
@@ -735,7 +735,6 @@ async fn trigger_zsh_fork_multi_cmd_approval(
text: message,
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
};
turn_params.approval_policy = Some(AskForApproval::OnRequest);
@@ -821,7 +820,6 @@ async fn resume_message_v2(
text: user_message,
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})?;
println!("< turn/start response: {turn_response:?}");
@@ -966,7 +964,6 @@ async fn send_message_v2_with_policies(
// Test client sends plain text without UI element ranges.
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
};
turn_params.approval_policy = policies.approval_policy;
@@ -1007,7 +1004,6 @@ async fn send_follow_up_v2(
// Test client sends plain text without UI element ranges.
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
};
let first_turn_response = client.turn_start(first_turn_params)?;
@@ -1021,7 +1017,6 @@ async fn send_follow_up_v2(
// Test client sends plain text without UI element ranges.
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
};
let follow_up_response = client.turn_start(follow_up_params)?;
@@ -1245,7 +1240,6 @@ fn live_elicitation_timeout_pause(
sandbox_policy: Some(SandboxPolicy::DangerFullAccess),
effort: Some(ReasoningEffort::High),
cwd: Some(workspace),
submission_type: None,
..Default::default()
})?;
println!("< turn/start response: {turn_response:?}");
@@ -6112,10 +6112,9 @@ impl CodexMessageProcessor {
.submit_core_op(
&request_id,
thread.as_ref(),
Op::UserInputWithMetadata {
Op::UserInput {
items: mapped_items,
final_output_json_schema: params.output_schema,
submission_type: params.submission_type,
},
)
.await;
@@ -599,7 +599,6 @@ async fn turn_start_jsonrpc_span_parents_core_turn_spans() -> Result<()> {
effort: None,
summary: None,
personality: None,
submission_type: None,
output_schema: None,
collaboration_mode: None,
},
@@ -419,7 +419,6 @@ async fn external_auth_refreshes_on_unauthorized() -> Result<()> {
text: "Hello".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -526,7 +525,6 @@ async fn external_auth_refresh_error_fails_turn() -> Result<()> {
text: "Hello".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -649,7 +647,6 @@ async fn external_auth_refresh_mismatched_workspace_fails_turn() -> Result<()> {
text: "Hello".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -765,7 +762,6 @@ async fn external_auth_refresh_invalid_access_token_fails_turn() -> Result<()> {
text: "Hello".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -342,7 +342,6 @@ async fn send_turn_and_wait(mcp: &mut McpProcess, thread_id: &str, text: &str) -
text: text.to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -202,7 +202,6 @@ async fn send_turn_start_request(stream: &mut WsClient, id: i64, thread_id: &str
text: "Hello".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})?),
)
@@ -86,7 +86,6 @@ async fn thread_start_injects_dynamic_tools_into_model_requests() -> Result<()>
text: "Hello".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -165,7 +164,6 @@ async fn thread_start_keeps_hidden_dynamic_tools_out_of_model_requests() -> Resu
text: "Hello".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -254,7 +252,6 @@ async fn dynamic_tool_call_round_trip_sends_text_content_items_to_model() -> Res
text: "Run the tool".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -423,7 +420,6 @@ async fn dynamic_tool_call_round_trip_sends_content_items_to_model() -> Result<(
text: "Run the tool".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -248,7 +248,6 @@ async fn turn_start_notify_payload_includes_initialize_client_name() -> Result<(
text: "Hello".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -137,7 +137,6 @@ async fn mcp_server_elicitation_round_trip() -> Result<()> {
text_elements: Vec::new(),
}],
model: Some("mock-model".to_string()),
submission_type: None,
..Default::default()
})
.await?;
@@ -170,7 +169,6 @@ async fn mcp_server_elicitation_round_trip() -> Result<()> {
text_elements: Vec::new(),
}],
model: Some("mock-model".to_string()),
submission_type: None,
..Default::default()
})
.await?;
@@ -63,7 +63,6 @@ async fn turn_start_accepts_output_schema_v2() -> Result<()> {
text: "Hello".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
output_schema: Some(output_schema.clone()),
..Default::default()
})
@@ -146,7 +145,6 @@ async fn turn_start_output_schema_is_per_turn_v2() -> Result<()> {
text: "Hello".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
output_schema: Some(output_schema.clone()),
..Default::default()
})
@@ -189,7 +187,6 @@ async fn turn_start_output_schema_is_per_turn_v2() -> Result<()> {
text: "Hello again".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
output_schema: None,
..Default::default()
})
@@ -156,7 +156,6 @@ async fn start_plan_mode_turn(mcp: &mut McpProcess) -> Result<codex_app_server_p
text: "Plan this".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
collaboration_mode: Some(collaboration_mode),
..Default::default()
})
@@ -54,7 +54,6 @@ async fn request_permissions_round_trip() -> Result<()> {
text_elements: Vec::new(),
}],
model: Some("mock-model".to_string()),
submission_type: None,
..Default::default()
})
.await?;
@@ -57,7 +57,6 @@ async fn request_user_input_round_trip() -> Result<()> {
}],
model: Some("mock-model".to_string()),
effort: Some(ReasoningEffort::Medium),
submission_type: None,
collaboration_mode: Some(CollaborationMode {
mode: ModeKind::Plan,
settings: Settings {
@@ -434,7 +434,6 @@ async fn materialize_thread_rollout(mcp: &mut McpProcess, thread_id: &str) -> Re
text: "materialize rollout".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -63,7 +63,6 @@ async fn openai_model_header_mismatch_emits_model_rerouted_notification_v2() ->
text: "trigger safeguard".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -137,7 +136,6 @@ async fn response_model_field_mismatch_emits_model_rerouted_notification_v2_when
text: "trigger response model check".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -92,7 +92,6 @@ async fn thread_archive_requires_materialized_rollout() -> Result<()> {
text: "materialize".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -190,7 +189,6 @@ async fn thread_archive_clears_stale_subscriptions_before_resume() -> Result<()>
text: "materialize".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -268,7 +266,6 @@ async fn thread_archive_clears_stale_subscriptions_before_resume() -> Result<()>
text: "secondary turn".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -463,7 +463,6 @@ async fn thread_fork_ephemeral_remains_pathless_and_omits_listing() -> Result<()
text: "continue".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -217,7 +217,6 @@ async fn thread_list_reports_system_error_idle_flag_after_failed_turn() -> Resul
text: "seed history".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -240,7 +239,6 @@ async fn thread_list_reports_system_error_idle_flag_after_failed_turn() -> Resul
text: "fail turn".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -441,7 +441,6 @@ async fn thread_read_reports_system_error_idle_flag_after_failed_turn() -> Resul
text: "fail this turn".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -564,7 +564,6 @@ async fn thread_resume_without_overrides_does_not_change_updated_at_or_mtime() -
text: "Hello".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -614,7 +613,6 @@ async fn thread_resume_keeps_in_flight_turn_streaming() -> Result<()> {
text: "seed history".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -640,7 +638,6 @@ async fn thread_resume_keeps_in_flight_turn_streaming() -> Result<()> {
text: "respond with docs".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -723,7 +720,6 @@ async fn thread_resume_rejects_history_when_thread_is_running() -> Result<()> {
text: "seed history".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -747,7 +743,6 @@ async fn thread_resume_rejects_history_when_thread_is_running() -> Result<()> {
text: "keep running".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -841,7 +836,6 @@ async fn thread_resume_rejects_mismatched_path_when_thread_is_running() -> Resul
text: "seed history".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -865,7 +859,6 @@ async fn thread_resume_rejects_mismatched_path_when_thread_is_running() -> Resul
text: "keep running".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -949,7 +942,6 @@ async fn thread_resume_rejoins_running_thread_even_with_override_mismatch() -> R
text: "seed history".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -972,7 +964,6 @@ async fn thread_resume_rejoins_running_thread_even_with_override_mismatch() -> R
text: "keep running".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -1064,7 +1055,6 @@ async fn thread_resume_replays_pending_command_execution_request_approval() -> R
text: "seed history".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -1088,7 +1078,6 @@ async fn thread_resume_replays_pending_command_execution_request_approval() -> R
text_elements: Vec::new(),
}],
approval_policy: Some(AskForApproval::UnlessTrusted),
submission_type: None,
..Default::default()
})
.await?;
@@ -1205,7 +1194,6 @@ async fn thread_resume_replays_pending_file_change_request_approval() -> Result<
text_elements: Vec::new(),
}],
cwd: Some(workspace.clone()),
submission_type: None,
..Default::default()
})
.await?;
@@ -1230,7 +1218,6 @@ async fn thread_resume_replays_pending_file_change_request_approval() -> Result<
}],
cwd: Some(workspace.clone()),
approval_policy: Some(AskForApproval::UnlessTrusted),
submission_type: None,
..Default::default()
})
.await?;
@@ -1375,7 +1362,6 @@ async fn thread_resume_with_overrides_defers_updated_at_until_turn_start() -> Re
text: "Hello".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -1555,7 +1541,6 @@ async fn thread_resume_prefers_path_over_thread_id() -> Result<()> {
text: "materialize".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -1676,7 +1661,6 @@ async fn start_materialized_thread_and_restart(
text: seed_text.to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -1751,7 +1735,6 @@ async fn thread_resume_accepts_personality_override() -> Result<()> {
text: "seed history".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -1792,7 +1775,6 @@ async fn thread_resume_accepts_personality_override() -> Result<()> {
text: "Hello".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -61,7 +61,6 @@ async fn thread_rollback_drops_last_turns_and_persists_to_rollout() -> Result<()
text: first_text.to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -83,7 +82,6 @@ async fn thread_rollback_drops_last_turns_and_persists_to_rollout() -> Result<()
text: "Second".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -205,7 +205,6 @@ async fn thread_shell_command_uses_existing_active_turn() -> Result<()> {
text_elements: Vec::new(),
}],
cwd: Some(workspace.clone()),
submission_type: None,
..Default::default()
})
.await?;
@@ -53,7 +53,6 @@ async fn thread_status_changed_emits_runtime_updates() -> Result<()> {
text_elements: Vec::new(),
}],
model: Some("mock-model".to_string()),
submission_type: None,
..Default::default()
})
.await?;
@@ -176,7 +175,6 @@ async fn thread_status_changed_can_be_opted_out() -> Result<()> {
text_elements: Vec::new(),
}],
model: Some("mock-model".to_string()),
submission_type: None,
..Default::default()
})
.await?;
@@ -60,7 +60,6 @@ async fn thread_unarchive_moves_rollout_back_into_sessions_directory() -> Result
text: "materialize".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -177,7 +177,6 @@ async fn thread_unsubscribe_during_turn_interrupts_turn_and_emits_thread_closed(
text_elements: Vec::new(),
}],
cwd: Some(working_directory),
submission_type: None,
..Default::default()
})
.await?;
@@ -251,7 +250,6 @@ async fn thread_unsubscribe_clears_cached_status_before_resume() -> Result<()> {
text: "fail this turn".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -78,7 +78,6 @@ async fn turn_interrupt_aborts_running_turn() -> Result<()> {
text_elements: Vec::new(),
}],
cwd: Some(working_directory.clone()),
submission_type: None,
..Default::default()
})
.await?;
@@ -173,7 +172,6 @@ async fn turn_interrupt_resolves_pending_command_approval_request() -> Result<()
text_elements: Vec::new(),
}],
cwd: Some(working_directory),
submission_type: None,
..Default::default()
})
.await?;
@@ -121,7 +121,6 @@ async fn turn_start_sends_originator_header() -> Result<()> {
text: "Hello".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -193,7 +192,6 @@ async fn turn_start_emits_user_message_item_with_text_elements() -> Result<()> {
text: "Hello".to_string(),
text_elements: text_elements.clone(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -282,7 +280,6 @@ async fn turn_start_accepts_text_at_limit_with_mention_item() -> Result<()> {
path: "app://demo-app".to_string(),
},
],
submission_type: None,
..Default::default()
})
.await?;
@@ -346,7 +343,6 @@ async fn turn_start_rejects_combined_oversized_text_input() -> Result<()> {
text_elements: Vec::new(),
},
],
submission_type: None,
..Default::default()
})
.await?;
@@ -423,7 +419,6 @@ async fn turn_start_emits_notifications_and_accepts_model_override() -> Result<(
text: "Hello".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -473,7 +468,6 @@ async fn turn_start_emits_notifications_and_accepts_model_override() -> Result<(
text_elements: Vec::new(),
}],
model: Some("mock-model-override".to_string()),
submission_type: None,
..Default::default()
})
.await?;
@@ -570,7 +564,6 @@ async fn turn_start_accepts_collaboration_mode_override_v2() -> Result<()> {
model: Some("mock-model-override".to_string()),
effort: Some(ReasoningEffort::Low),
summary: Some(ReasoningSummary::Auto),
submission_type: None,
output_schema: None,
collaboration_mode: Some(collaboration_mode),
..Default::default()
@@ -658,7 +651,6 @@ async fn turn_start_uses_thread_feature_overrides_for_collaboration_mode_instruc
model: Some("mock-model-override".to_string()),
effort: Some(ReasoningEffort::Low),
summary: Some(ReasoningSummary::Auto),
submission_type: None,
output_schema: None,
collaboration_mode: Some(collaboration_mode),
..Default::default()
@@ -728,7 +720,6 @@ async fn turn_start_accepts_personality_override_v2() -> Result<()> {
text_elements: Vec::new(),
}],
personality: Some(Personality::Friendly),
submission_type: None,
..Default::default()
})
.await?;
@@ -810,7 +801,6 @@ async fn turn_start_change_personality_mid_thread_v2() -> Result<()> {
text_elements: Vec::new(),
}],
personality: None,
submission_type: None,
..Default::default()
})
.await?;
@@ -835,7 +825,6 @@ async fn turn_start_change_personality_mid_thread_v2() -> Result<()> {
text_elements: Vec::new(),
}],
personality: Some(Personality::Friendly),
submission_type: None,
..Default::default()
})
.await?;
@@ -938,7 +927,6 @@ async fn turn_start_uses_migrated_pragmatic_personality_without_override_v2() ->
text_elements: Vec::new(),
}],
personality: None,
submission_type: None,
..Default::default()
})
.await?;
@@ -1007,7 +995,6 @@ async fn turn_start_accepts_local_image_input() -> Result<()> {
.send_turn_start_request(TurnStartParams {
thread_id: thread.id.clone(),
input: vec![V2UserInput::LocalImage { path: image_path }],
submission_type: None,
..Default::default()
})
.await?;
@@ -1095,7 +1082,6 @@ async fn turn_start_exec_approval_toggle_v2() -> Result<()> {
text: "run python".to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -1165,7 +1151,6 @@ async fn turn_start_exec_approval_toggle_v2() -> Result<()> {
model: Some("mock-model".to_string()),
effort: Some(ReasoningEffort::Medium),
summary: Some(ReasoningSummary::Auto),
submission_type: None,
..Default::default()
})
.await?;
@@ -1239,7 +1224,6 @@ async fn turn_start_exec_approval_decline_v2() -> Result<()> {
text_elements: Vec::new(),
}],
cwd: Some(workspace.clone()),
submission_type: None,
..Default::default()
})
.await?;
@@ -1408,7 +1392,6 @@ async fn turn_start_updates_sandbox_and_cwd_between_turns_v2() -> Result<()> {
summary: Some(ReasoningSummary::Auto),
service_tier: None,
personality: None,
submission_type: None,
output_schema: None,
collaboration_mode: None,
})
@@ -1442,7 +1425,6 @@ async fn turn_start_updates_sandbox_and_cwd_between_turns_v2() -> Result<()> {
summary: Some(ReasoningSummary::Auto),
service_tier: None,
personality: None,
submission_type: None,
output_schema: None,
collaboration_mode: None,
})
@@ -1545,7 +1527,6 @@ async fn turn_start_file_change_approval_v2() -> Result<()> {
text_elements: Vec::new(),
}],
cwd: Some(workspace.clone()),
submission_type: None,
..Default::default()
})
.await?;
@@ -1763,7 +1744,6 @@ async fn turn_start_emits_spawn_agent_item_with_model_metadata_v2() -> Result<()
text: PARENT_PROMPT.to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -1978,7 +1958,6 @@ config_file = "./custom-role.toml"
text: PARENT_PROMPT.to_string(),
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
})
.await?;
@@ -2125,7 +2104,6 @@ async fn turn_start_file_change_approval_accept_for_session_persists_v2() -> Res
text_elements: Vec::new(),
}],
cwd: Some(workspace.clone()),
submission_type: None,
..Default::default()
})
.await?;
@@ -2203,7 +2181,6 @@ async fn turn_start_file_change_approval_accept_for_session_persists_v2() -> Res
text_elements: Vec::new(),
}],
cwd: Some(workspace.clone()),
submission_type: None,
..Default::default()
})
.await?;
@@ -2307,7 +2284,6 @@ async fn turn_start_file_change_approval_decline_v2() -> Result<()> {
text_elements: Vec::new(),
}],
cwd: Some(workspace.clone()),
submission_type: None,
..Default::default()
})
.await?;
@@ -2453,7 +2429,6 @@ async fn command_execution_notifications_include_process_id() -> Result<()> {
text_elements: Vec::new(),
}],
sandbox_policy: Some(codex_app_server_protocol::SandboxPolicy::DangerFullAccess),
submission_type: None,
..Default::default()
})
.await?;
@@ -127,7 +127,6 @@ async fn turn_start_shell_zsh_fork_executes_command_v2() -> Result<()> {
model: Some("mock-model".to_string()),
effort: Some(codex_protocol::openai_models::ReasoningEffort::Medium),
summary: Some(codex_protocol::config_types::ReasoningSummary::Auto),
submission_type: None,
..Default::default()
})
.await?;
@@ -242,7 +241,6 @@ async fn turn_start_shell_zsh_fork_exec_approval_decline_v2() -> Result<()> {
text_elements: Vec::new(),
}],
cwd: Some(workspace.clone()),
submission_type: None,
..Default::default()
})
.await?;
@@ -376,7 +374,6 @@ async fn turn_start_shell_zsh_fork_exec_approval_cancel_v2() -> Result<()> {
text_elements: Vec::new(),
}],
cwd: Some(workspace.clone()),
submission_type: None,
..Default::default()
})
.await?;
@@ -547,7 +544,6 @@ async fn turn_start_shell_zsh_fork_subcommand_decline_marks_parent_declined_v2()
model: Some("mock-model".to_string()),
effort: Some(codex_protocol::openai_models::ReasoningEffort::Medium),
summary: Some(codex_protocol::config_types::ReasoningSummary::Auto),
submission_type: None,
..Default::default()
})
.await?;
@@ -121,7 +121,6 @@ async fn turn_steer_rejects_oversized_text_input() -> Result<()> {
text_elements: Vec::new(),
}],
cwd: Some(working_directory.clone()),
submission_type: None,
..Default::default()
})
.await?;
@@ -225,7 +224,6 @@ async fn turn_steer_returns_active_turn_id() -> Result<()> {
text_elements: Vec::new(),
}],
cwd: Some(working_directory.clone()),
submission_type: None,
..Default::default()
})
.await?;
+3 -90
View File
@@ -1,16 +1,15 @@
use crate::AuthManager;
use crate::config::Config;
use crate::default_client::create_client;
use crate::git_info::collect_git_info;
use crate::git_info::get_git_repo_root;
use crate::plugins::PluginTelemetryMetadata;
use codex_git_utils::collect_git_info;
use codex_git_utils::get_git_repo_root;
use codex_protocol::config_types::ModeKind;
use codex_protocol::config_types::ReasoningSummary;
use codex_protocol::config_types::ServiceTier;
use codex_protocol::openai_models::ReasoningEffort;
use codex_protocol::protocol::SandboxPolicy;
use codex_protocol::protocol::SkillScope;
use codex_protocol::protocol::SubmissionType;
use serde::Serialize;
use sha1::Digest;
use sha1::Sha1;
@@ -31,7 +30,6 @@ pub(crate) struct TrackEventsContext {
#[derive(Clone)]
pub(crate) struct CodexTurnEvent {
pub(crate) submission_type: Option<SubmissionType>,
pub(crate) sandbox_policy: SandboxPolicy,
pub(crate) reasoning_effort: Option<ReasoningEffort>,
pub(crate) reasoning_summary: ReasoningSummary,
@@ -39,9 +37,6 @@ pub(crate) struct CodexTurnEvent {
pub(crate) collaboration_mode: ModeKind,
}
#[derive(Clone, Copy)]
pub(crate) struct CodexTurnSteerEvent;
pub(crate) fn build_track_events_context(
model_slug: String,
thread_id: String,
@@ -106,9 +101,6 @@ impl AnalyticsEventsQueue {
TrackEventsJob::TurnEvent(job) => {
send_track_turn_event(&auth_manager, job).await;
}
TrackEventsJob::TurnSteer(job) => {
send_track_turn_steer(&auth_manager, job).await;
}
TrackEventsJob::PluginUsed(job) => {
send_track_plugin_used(&auth_manager, job).await;
}
@@ -235,19 +227,6 @@ impl AnalyticsEventsClient {
);
}
pub(crate) fn track_turn_steer(
&self,
tracking: TrackEventsContext,
turn_steer: CodexTurnSteerEvent,
) {
track_turn_steer(
&self.queue,
Arc::clone(&self.config),
Some(tracking),
turn_steer,
);
}
pub fn track_plugin_installed(&self, plugin: PluginTelemetryMetadata) {
track_plugin_management(
&self.queue,
@@ -290,7 +269,6 @@ enum TrackEventsJob {
AppMentioned(TrackAppMentionedJob),
AppUsed(TrackAppUsedJob),
TurnEvent(TrackTurnEventJob),
TurnSteer(TrackTurnSteerJob),
PluginUsed(TrackPluginUsedJob),
PluginInstalled(TrackPluginManagementJob),
PluginUninstalled(TrackPluginManagementJob),
@@ -322,12 +300,6 @@ struct TrackTurnEventJob {
turn_event: CodexTurnEvent,
}
struct TrackTurnSteerJob {
config: Arc<Config>,
tracking: TrackEventsContext,
turn_steer: CodexTurnSteerEvent,
}
struct TrackPluginUsedJob {
config: Arc<Config>,
tracking: TrackEventsContext,
@@ -411,27 +383,16 @@ struct CodexAppUsedEventRequest {
event_params: CodexAppMetadata,
}
#[derive(Default, Serialize)]
#[derive(Serialize)]
struct CodexTurnEventParams {
#[serde(skip_serializing_if = "Option::is_none")]
thread_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
turn_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
product_client_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
model_slug: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
submission_type: Option<SubmissionType>,
#[serde(skip_serializing_if = "Option::is_none")]
sandbox_policy: Option<&'static str>,
#[serde(skip_serializing_if = "Option::is_none")]
reasoning_effort: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
reasoning_summary: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
service_tier: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
collaboration_mode: Option<&'static str>,
}
@@ -562,26 +523,6 @@ pub(crate) fn track_turn_event(
queue.try_send(job);
}
pub(crate) fn track_turn_steer(
queue: &AnalyticsEventsQueue,
config: Arc<Config>,
tracking: Option<TrackEventsContext>,
turn_steer: CodexTurnSteerEvent,
) {
if config.analytics_enabled == Some(false) {
return;
}
let Some(tracking) = tracking else {
return;
};
let job = TrackEventsJob::TurnSteer(TrackTurnSteerJob {
config,
tracking,
turn_steer,
});
queue.try_send(job);
}
pub(crate) fn track_plugin_used(
queue: &AnalyticsEventsQueue,
config: Arc<Config>,
@@ -721,20 +662,6 @@ async fn send_track_turn_event(auth_manager: &AuthManager, job: TrackTurnEventJo
send_track_events(auth_manager, config, events).await;
}
async fn send_track_turn_steer(auth_manager: &AuthManager, job: TrackTurnSteerJob) {
let TrackTurnSteerJob {
config,
tracking,
turn_steer,
} = job;
let events = vec![TrackEventRequest::TurnEvent(CodexTurnEventRequest {
event_type: "codex_turn_event",
event_params: codex_turn_steer_event_params(&tracking, turn_steer),
})];
send_track_events(auth_manager, config, events).await;
}
async fn send_track_plugin_used(auth_manager: &AuthManager, job: TrackPluginUsedJob) {
let TrackPluginUsedJob {
config,
@@ -808,7 +735,6 @@ fn codex_turn_event_params(
turn_id: Some(tracking.turn_id.clone()),
product_client_id: Some(crate::default_client::originator().value),
model_slug: Some(tracking.model_slug.clone()),
submission_type: turn_event.submission_type,
sandbox_policy: Some(sandbox_policy_mode(&turn_event.sandbox_policy)),
reasoning_effort: turn_event.reasoning_effort.map(|value| value.to_string()),
reasoning_summary: Some(turn_event.reasoning_summary.to_string()),
@@ -817,19 +743,6 @@ fn codex_turn_event_params(
}
}
fn codex_turn_steer_event_params(
tracking: &TrackEventsContext,
_turn_steer: CodexTurnSteerEvent,
) -> CodexTurnEventParams {
CodexTurnEventParams {
thread_id: Some(tracking.thread_id.clone()),
turn_id: Some(tracking.turn_id.clone()),
product_client_id: Some(crate::default_client::originator().value),
model_slug: Some(tracking.model_slug.clone()),
..Default::default()
}
}
fn sandbox_policy_mode(sandbox_policy: &SandboxPolicy) -> &'static str {
match sandbox_policy {
SandboxPolicy::DangerFullAccess => "full_access",
+1 -34
View File
@@ -6,16 +6,13 @@ use super::CodexPluginEventRequest;
use super::CodexPluginUsedEventRequest;
use super::CodexTurnEvent;
use super::CodexTurnEventRequest;
use super::CodexTurnSteerEvent;
use super::InvocationType;
use super::SubmissionType;
use super::TrackEventRequest;
use super::TrackEventsContext;
use super::codex_app_metadata;
use super::codex_plugin_metadata;
use super::codex_plugin_used_metadata;
use super::codex_turn_event_params;
use super::codex_turn_steer_event_params;
use super::normalize_path_for_skill_id;
use crate::plugins::AppConnectorId;
use crate::plugins::PluginCapabilitySummary;
@@ -208,7 +205,6 @@ fn turn_event_serializes_expected_shape() {
event_params: codex_turn_event_params(
&tracking,
CodexTurnEvent {
submission_type: Some(SubmissionType::Prompt),
sandbox_policy: SandboxPolicy::new_read_only_policy(),
reasoning_effort: Some(ReasoningEffort::High),
reasoning_summary: ReasoningSummary::Detailed,
@@ -218,7 +214,7 @@ fn turn_event_serializes_expected_shape() {
),
});
let payload = serde_json::to_value(&event).expect("serialize codex turn event");
let payload = serde_json::to_value(&event).expect("serialize turn event");
assert_eq!(
payload,
@@ -229,7 +225,6 @@ fn turn_event_serializes_expected_shape() {
"turn_id": "turn-2",
"product_client_id": crate::default_client::originator().value,
"model_slug": "gpt-5",
"submission_type": "prompt",
"sandbox_policy": "read_only",
"reasoning_effort": "high",
"reasoning_summary": "detailed",
@@ -240,34 +235,6 @@ fn turn_event_serializes_expected_shape() {
);
}
#[test]
fn turn_steer_event_serializes_expected_shape() {
let tracking = TrackEventsContext {
model_slug: "gpt-5".to_string(),
thread_id: "thread-2".to_string(),
turn_id: "turn-2".to_string(),
};
let event = TrackEventRequest::TurnEvent(CodexTurnEventRequest {
event_type: "codex_turn_event",
event_params: codex_turn_steer_event_params(&tracking, CodexTurnSteerEvent),
});
let payload = serde_json::to_value(&event).expect("serialize codex turn steer event");
assert_eq!(
payload,
json!({
"event_type": "codex_turn_event",
"event_params": {
"thread_id": "thread-2",
"turn_id": "turn-2",
"product_client_id": crate::default_client::originator().value,
"model_slug": "gpt-5"
}
})
);
}
#[test]
fn plugin_used_event_serializes_expected_shape() {
let tracking = TrackEventsContext {
+41 -75
View File
@@ -15,7 +15,6 @@ use crate::agent::agent_status_from_event;
use crate::analytics_client::AnalyticsEventsClient;
use crate::analytics_client::AppInvocation;
use crate::analytics_client::CodexTurnEvent;
use crate::analytics_client::CodexTurnSteerEvent;
use crate::analytics_client::InvocationType;
use crate::analytics_client::build_track_events_context;
use crate::apps::render_apps_section;
@@ -105,7 +104,6 @@ use codex_protocol::protocol::ReviewRequest;
use codex_protocol::protocol::RolloutItem;
use codex_protocol::protocol::SessionSource;
use codex_protocol::protocol::SubAgentSource;
use codex_protocol::protocol::SubmissionType;
use codex_protocol::protocol::TurnAbortReason;
use codex_protocol::protocol::TurnContextItem;
use codex_protocol::protocol::TurnContextNetworkItem;
@@ -238,9 +236,6 @@ pub(crate) struct PreviousTurnSettings {
use crate::exec_policy::ExecPolicyUpdateError;
use crate::feedback_tags;
use crate::file_watcher::FileWatcher;
use crate::file_watcher::FileWatcherEvent;
use crate::git_info::get_git_repo_root;
use crate::guardian::GuardianReviewSessionManager;
use crate::hook_runtime::PendingInputHookDisposition;
use crate::hook_runtime::inspect_pending_input;
@@ -325,6 +320,8 @@ use crate::skills::injection::ToolMentionKind;
use crate::skills::injection::app_id_from_path;
use crate::skills::injection::tool_kind_for_path;
use crate::skills::resolve_skill_dependencies_for_turn;
use crate::skills_watcher::SkillsWatcher;
use crate::skills_watcher::SkillsWatcherEvent;
use crate::state::ActiveTurn;
use crate::state::SessionServices;
use crate::state::SessionState;
@@ -353,6 +350,7 @@ use crate::unified_exec::UnifiedExecProcessManager;
use crate::util::backoff;
use crate::windows_sandbox::WindowsSandboxLevelExt;
use codex_async_utils::OrCancelExt;
use codex_git_utils::get_git_repo_root;
use codex_otel::SessionTelemetry;
use codex_otel::TelemetryAuthMode;
use codex_otel::metrics::names::THREAD_STARTED_METRIC;
@@ -406,7 +404,7 @@ pub(crate) struct CodexSpawnArgs {
pub(crate) skills_manager: Arc<SkillsManager>,
pub(crate) plugins_manager: Arc<PluginsManager>,
pub(crate) mcp_manager: Arc<McpManager>,
pub(crate) file_watcher: Arc<FileWatcher>,
pub(crate) skills_watcher: Arc<SkillsWatcher>,
pub(crate) conversation_history: InitialHistory,
pub(crate) session_source: SessionSource,
pub(crate) agent_control: AgentControl,
@@ -459,7 +457,7 @@ impl Codex {
skills_manager,
plugins_manager,
mcp_manager,
file_watcher,
skills_watcher,
conversation_history,
session_source,
agent_control,
@@ -647,7 +645,7 @@ impl Codex {
skills_manager,
plugins_manager,
mcp_manager.clone(),
file_watcher,
skills_watcher,
agent_control,
)
.await
@@ -850,7 +848,6 @@ pub(crate) struct TurnContext {
pub(crate) user_instructions: Option<String>,
pub(crate) collaboration_mode: CollaborationMode,
pub(crate) personality: Option<Personality>,
pub(crate) submission_type: Option<SubmissionType>,
pub(crate) approval_policy: Constrained<AskForApproval>,
pub(crate) sandbox_policy: Constrained<SandboxPolicy>,
pub(crate) file_system_sandbox_policy: FileSystemSandboxPolicy,
@@ -947,7 +944,6 @@ impl TurnContext {
provider: self.provider.clone(),
reasoning_effort,
reasoning_summary: self.reasoning_summary,
submission_type: None,
session_source: self.session_source.clone(),
environment: Arc::clone(&self.environment),
cwd: self.cwd.clone(),
@@ -1189,7 +1185,6 @@ pub(crate) struct SessionSettingsUpdate {
pub(crate) final_output_json_schema: Option<Option<Value>>,
pub(crate) personality: Option<Personality>,
pub(crate) app_server_client_name: Option<String>,
pub(crate) submission_type: Option<SubmissionType>,
}
impl Session {
@@ -1303,13 +1298,13 @@ impl Session {
self.out_of_band_elicitation_paused.send_replace(paused);
}
fn start_file_watcher_listener(self: &Arc<Self>) {
let mut rx = self.services.file_watcher.subscribe();
fn start_skills_watcher_listener(self: &Arc<Self>) {
let mut rx = self.services.skills_watcher.subscribe();
let weak_sess = Arc::downgrade(self);
tokio::spawn(async move {
loop {
match rx.recv().await {
Ok(FileWatcherEvent::SkillsChanged { .. }) => {
Ok(SkillsWatcherEvent::SkillsChanged { .. }) => {
let Some(sess) = weak_sess.upgrade() else {
break;
};
@@ -1408,7 +1403,6 @@ impl Session {
user_instructions: session_configuration.user_instructions.clone(),
collaboration_mode: session_configuration.collaboration_mode.clone(),
personality: session_configuration.personality,
submission_type: None,
approval_policy: session_configuration.approval_policy.clone(),
sandbox_policy: session_configuration.sandbox_policy.clone(),
file_system_sandbox_policy: session_configuration.file_system_sandbox_policy.clone(),
@@ -1446,7 +1440,7 @@ impl Session {
skills_manager: Arc<SkillsManager>,
plugins_manager: Arc<PluginsManager>,
mcp_manager: Arc<McpManager>,
file_watcher: Arc<FileWatcher>,
skills_watcher: Arc<SkillsWatcher>,
agent_control: AgentControl,
) -> anyhow::Result<Arc<Self>> {
debug!(
@@ -1865,7 +1859,7 @@ impl Session {
skills_manager,
plugins_manager: Arc::clone(&plugins_manager),
mcp_manager: Arc::clone(&mcp_manager),
file_watcher,
skills_watcher,
agent_control,
network_proxy,
network_approval: Arc::clone(&network_approval),
@@ -1944,7 +1938,7 @@ impl Session {
}
// Start the watcher after SessionConfigured so it cannot emit earlier events.
sess.start_file_watcher_listener();
sess.start_skills_watcher_listener();
// Construct sandbox_state before MCP startup so it can be sent to each
// MCP server immediately after it becomes ready (avoiding blocking).
let sandbox_state = SandboxState {
@@ -2400,7 +2394,6 @@ impl Session {
sub_id,
session_configuration,
updates.final_output_json_schema,
updates.submission_type,
sandbox_policy_changed,
)
.await)
@@ -2411,7 +2404,6 @@ impl Session {
sub_id: String,
session_configuration: SessionConfiguration,
final_output_json_schema: Option<Option<Value>>,
submission_type: Option<SubmissionType>,
sandbox_policy_changed: bool,
) -> Arc<TurnContext> {
let per_turn_config = Self::build_per_turn_config(&session_configuration);
@@ -2479,7 +2471,6 @@ impl Session {
if let Some(final_schema) = final_output_json_schema {
turn_context.final_output_json_schema = final_schema;
}
turn_context.submission_type = submission_type;
let turn_context = Arc::new(turn_context);
turn_context.turn_metadata_state.spawn_git_enrichment_task();
turn_context
@@ -2584,7 +2575,6 @@ impl Session {
sub_id,
session_configuration,
/*final_output_json_schema*/ None,
/*submission_type*/ None,
/*sandbox_policy_changed*/ false,
)
.await
@@ -2749,16 +2739,6 @@ impl Session {
))
}
async fn active_turn_tracking(&self) -> Option<crate::analytics_client::TrackEventsContext> {
let active = self.active_turn.lock().await;
let (_, task) = active.as_ref()?.tasks.first()?;
Some(build_track_events_context(
task.turn_context.model_info.slug.clone(),
self.conversation_id.to_string(),
task.turn_context.sub_id.clone(),
))
}
pub(crate) async fn record_execpolicy_amendment_message(
&self,
sub_id: &str,
@@ -3906,7 +3886,6 @@ impl Session {
let Some((active_turn_id, _)) = active_turn.tasks.first() else {
return Err(SteerInputError::NoActiveTurn(input));
};
let active_turn_id = active_turn_id.clone();
if let Some(expected_turn_id) = expected_turn_id
&& expected_turn_id != active_turn_id
@@ -3934,14 +3913,7 @@ impl Session {
let mut turn_state = active_turn.turn_state.lock().await;
turn_state.push_pending_input(input.into());
drop(turn_state);
drop(active);
if let Some(tracking) = self.active_turn_tracking().await {
self.services
.analytics_events_client
.track_turn_steer(tracking, CodexTurnSteerEvent);
}
Ok(active_turn_id)
Ok(active_turn_id.clone())
}
/// Returns the input if there was no task running to inject into.
@@ -3985,6 +3957,17 @@ impl Session {
}
}
pub(crate) async fn pending_input_snapshot(&self) -> Vec<ResponseInputItem> {
let active = self.active_turn.lock().await;
match active.as_ref() {
Some(at) => {
let ts = at.turn_state.lock().await;
ts.pending_input_snapshot()
}
None => Vec::with_capacity(0),
}
}
/// Queue response items to be injected into the next active turn created for this session.
pub(crate) async fn queue_response_items_for_next_turn(&self, items: Vec<ResponseInputItem>) {
if items.is_empty() {
@@ -3999,6 +3982,12 @@ impl Session {
std::mem::take(&mut *self.idle_pending_input.lock().await)
}
pub(crate) async fn queued_response_items_for_next_turn_snapshot(
&self,
) -> Vec<ResponseInputItem> {
self.idle_pending_input.lock().await.clone()
}
pub(crate) async fn has_queued_response_items_for_next_turn(&self) -> bool {
!self.idle_pending_input.lock().await.is_empty()
}
@@ -4331,7 +4320,7 @@ async fn submission_loop(sess: Arc<Session>, config: Arc<Config>, rx_sub: Receiv
.await;
false
}
Op::UserInput { .. } | Op::UserInputWithMetadata { .. } | Op::UserTurn { .. } => {
Op::UserInput { .. } | Op::UserTurn { .. } => {
handlers::user_input_or_turn(&sess, sub.id.clone(), sub.op).await;
false
}
@@ -4589,7 +4578,6 @@ mod handlers {
items,
collaboration_mode,
personality,
submission_type,
} => {
let collaboration_mode = collaboration_mode.or_else(|| {
Some(CollaborationMode {
@@ -4615,7 +4603,6 @@ mod handlers {
final_output_json_schema: Some(final_output_json_schema),
personality,
app_server_client_name: None,
submission_type,
},
)
}
@@ -4626,19 +4613,6 @@ mod handlers {
items,
SessionSettingsUpdate {
final_output_json_schema: Some(final_output_json_schema),
submission_type: None,
..Default::default()
},
),
Op::UserInputWithMetadata {
items,
final_output_json_schema,
submission_type,
} => (
items,
SessionSettingsUpdate {
final_output_json_schema: Some(final_output_json_schema),
submission_type,
..Default::default()
},
),
@@ -4677,27 +4651,27 @@ mod handlers {
}
}
/// Records an inter-agent assistant envelope and, when requested, wakes the recipient by
/// starting a regular turn if the session is currently idle.
pub async fn inter_agent_communication(
sess: &Arc<Session>,
sub_id: String,
communication: InterAgentCommunication,
) {
let pending_item = communication.to_response_input_item();
if sess
.inject_response_items(vec![pending_item.clone()])
.await
.is_ok()
{
if let Ok(()) = sess.inject_response_items(vec![pending_item.clone()]).await {
return;
}
let turn_context = sess.new_default_turn_with_sub_id(sub_id).await;
sess.maybe_emit_unknown_model_warning_for_turn(turn_context.as_ref())
.await;
sess.queue_response_items_for_next_turn(vec![pending_item])
.await;
sess.spawn_task(turn_context, Vec::new(), crate::tasks::RegularTask::new())
.await;
if communication.trigger_turn {
let turn_context = sess.new_default_turn_with_sub_id(sub_id).await;
sess.maybe_emit_unknown_model_warning_for_turn(turn_context.as_ref())
.await;
sess.spawn_task(turn_context, Vec::new(), crate::tasks::RegularTask::new())
.await;
}
}
pub async fn run_user_shell_command(sess: &Arc<Session>, sub_id: String, command: String) {
@@ -5406,7 +5380,6 @@ async fn spawn_review_thread(
provider: provider_for_context,
reasoning_effort,
reasoning_summary,
submission_type: None,
session_source,
environment: Arc::clone(&parent_turn_context.environment),
tools_config,
@@ -6019,16 +5992,9 @@ pub(crate) async fn run_turn(
}
if !input.is_empty() {
let submission_type = turn_context
.submission_type
.unwrap_or(SubmissionType::Prompt);
sess.services.analytics_events_client.track_turn_event(
tracking,
CodexTurnEvent {
submission_type: match submission_type {
SubmissionType::Prompt => Some(SubmissionType::Prompt),
SubmissionType::PromptQueued => Some(SubmissionType::PromptQueued),
},
sandbox_policy: turn_context.sandbox_policy.get().clone(),
reasoning_effort: turn_context.reasoning_effort,
reasoning_summary: turn_context.reasoning_summary,
-1
View File
@@ -3067,7 +3067,6 @@ async fn user_turn_updates_approvals_reviewer() {
final_output_json_schema: None,
collaboration_mode: None,
personality: config.personality,
submission_type: None,
},
)
.await;
@@ -523,7 +523,6 @@ async fn run_review_on_session(
final_output_json_schema: Some(params.schema.clone()),
collaboration_mode: None,
personality: params.personality,
submission_type: None,
})
.await
}),
-1
View File
@@ -731,7 +731,6 @@ impl TestCodex {
service_tier,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -318,7 +318,6 @@ async fn apply_patch_cli_move_without_content_change_has_no_turn_diff(
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -929,7 +928,6 @@ async fn apply_patch_shell_command_heredoc_with_cd_emits_turn_diff() -> Result<(
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -1012,7 +1010,6 @@ async fn apply_patch_shell_command_failure_propagates_error_and_skips_diff() ->
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -1165,7 +1162,6 @@ async fn apply_patch_emits_turn_diff_event_with_unified_diff(
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -1231,7 +1227,6 @@ async fn apply_patch_turn_diff_for_rename_with_content_change(
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -1305,7 +1300,6 @@ async fn apply_patch_aggregates_diff_across_multiple_tool_calls() -> Result<()>
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -1379,7 +1373,6 @@ async fn apply_patch_aggregates_diff_preserves_success_after_failure() -> Result
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
-1
View File
@@ -566,7 +566,6 @@ async fn submit_turn(
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
-2
View File
@@ -1323,7 +1323,6 @@ async fn user_turn_collaboration_mode_overrides_model_and_effort() -> anyhow::Re
collaboration_mode: Some(collaboration_mode),
final_output_json_schema: None,
personality: None,
submission_type: None,
})
.await?;
@@ -1438,7 +1437,6 @@ async fn user_turn_explicit_reasoning_summary_overrides_model_catalog_default()
collaboration_mode: None,
final_output_json_schema: None,
personality: None,
submission_type: None,
})
.await
.unwrap();
-1
View File
@@ -2327,7 +2327,6 @@ text(
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -191,7 +191,6 @@ async fn collaboration_instructions_added_on_user_turn() -> Result<()> {
collaboration_mode: Some(collaboration_mode),
final_output_json_schema: None,
personality: None,
submission_type: None,
})
.await?;
wait_for_event(&test.codex, |ev| matches!(ev, EventMsg::TurnComplete(_))).await;
@@ -308,7 +307,6 @@ async fn user_turn_overrides_collaboration_instructions_after_override() -> Resu
collaboration_mode: Some(turn_mode),
final_output_json_schema: None,
personality: None,
submission_type: None,
})
.await?;
wait_for_event(&test.codex, |ev| matches!(ev, EventMsg::TurnComplete(_))).await;
-7
View File
@@ -1666,7 +1666,6 @@ async fn auto_compact_runs_after_resume_when_token_usage_is_over_limit() {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await
.unwrap();
@@ -1758,7 +1757,6 @@ async fn pre_sampling_compact_runs_on_switch_to_smaller_context_model() {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await
.expect("submit first user turn");
@@ -1784,7 +1782,6 @@ async fn pre_sampling_compact_runs_on_switch_to_smaller_context_model() {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await
.expect("submit second user turn");
@@ -1896,7 +1893,6 @@ async fn pre_sampling_compact_runs_after_resume_and_switch_to_smaller_model() {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await
.expect("submit pre-resume turn");
@@ -1946,7 +1942,6 @@ async fn pre_sampling_compact_runs_after_resume_and_switch_to_smaller_model() {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await
.expect("submit resumed user turn");
@@ -3150,7 +3145,6 @@ async fn snapshot_request_shape_pre_turn_compaction_strips_incoming_model_switch
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await
.expect("submit first user turn");
@@ -3176,7 +3170,6 @@ async fn snapshot_request_shape_pre_turn_compaction_strips_incoming_model_switch
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await
.expect("submit second user turn");
-2
View File
@@ -59,7 +59,6 @@ async fn submit_user_turn(
service_tier: None,
collaboration_mode,
personality: None,
submission_type: None,
})
.await?;
Ok(())
@@ -141,7 +140,6 @@ async fn execpolicy_blocks_shell_invocation() -> Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -130,7 +130,6 @@ async fn copy_paste_local_image_persists_rollout_request_shape() -> anyhow::Resu
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -215,7 +214,6 @@ async fn drag_drop_image_persists_rollout_request_shape() -> anyhow::Result<()>
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
+5 -239
View File
@@ -33,7 +33,6 @@ use core_test_support::responses::ev_response_created;
use core_test_support::responses::ev_web_search_call_added_partial;
use core_test_support::responses::ev_web_search_call_done;
use core_test_support::responses::mount_sse_once;
use core_test_support::responses::mount_sse_sequence;
use core_test_support::responses::sse;
use core_test_support::responses::start_mock_server;
use core_test_support::skip_if_no_network;
@@ -47,7 +46,6 @@ use std::path::Path;
use std::path::PathBuf;
use std::time::Duration;
use std::time::Instant;
use tempfile::tempdir;
fn image_generation_artifact_path(codex_home: &Path, session_id: &str, call_id: &str) -> PathBuf {
fn sanitize(value: &str) -> String {
@@ -73,37 +71,6 @@ fn image_generation_artifact_path(codex_home: &Path, session_id: &str, call_id:
.join(format!("{}.png", sanitize(call_id)))
}
async fn wait_for_analytics_event(
server: &wiremock::MockServer,
event_type: &str,
event_match: impl Fn(&Value) -> bool,
) -> Value {
let deadline = Instant::now() + Duration::from_secs(10);
loop {
let requests = server.received_requests().await.unwrap_or_default();
if let Some(event) = requests
.into_iter()
.filter(|request| request.url.path() == "/codex/analytics-events/events")
.find_map(|request| {
let payload: Value =
serde_json::from_slice(&request.body).expect("analytics payload");
payload["events"].as_array().and_then(|events| {
events
.iter()
.find(|event| event["event_type"] == event_type && event_match(event))
.cloned()
})
})
{
return event;
}
if Instant::now() >= deadline {
panic!("timed out waiting for analytics event {event_type}");
}
tokio::time::sleep(Duration::from_millis(50)).await;
}
}
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn user_message_item_is_emitted() -> anyhow::Result<()> {
skip_if_no_network!(Ok(()));
@@ -163,7 +130,7 @@ async fn user_message_item_is_emitted() -> anyhow::Result<()> {
}
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn user_turn_tracks_turn_event_analytics() -> anyhow::Result<()> {
async fn user_turn_tracks_turn_metadata_analytics() -> anyhow::Result<()> {
skip_if_no_network!(Ok(()));
let server = start_mock_server().await;
@@ -210,7 +177,6 @@ async fn user_turn_tracks_turn_event_analytics() -> anyhow::Result<()> {
},
}),
personality: None,
submission_type: None,
})
.await?;
@@ -235,16 +201,14 @@ async fn user_turn_tracks_turn_event_analytics() -> anyhow::Result<()> {
let event = payload["events"]
.as_array()
.and_then(|events| {
events.iter().find(|event| {
event["event_type"] == "codex_turn_event"
&& event["event_params"]["submission_type"] == "prompt"
})
events
.iter()
.find(|event| event["event_type"] == "codex_turn_event")
})
.expect("codex_turn_event prompt event should be present");
.expect("codex_turn_event should be present");
let event_params = &event["event_params"];
assert_eq!(event_params["submission_type"], "prompt");
assert_eq!(event_params["sandbox_policy"], "read_only");
assert_eq!(
event_params["product_client_id"],
@@ -261,199 +225,6 @@ async fn user_turn_tracks_turn_event_analytics() -> anyhow::Result<()> {
Ok(())
}
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn user_turn_tracks_turn_event_prompt_type_analytics() -> anyhow::Result<()> {
skip_if_no_network!(Ok(()));
let server = start_mock_server().await;
mount_sse_once(
&server,
sse(vec![ev_response_created("resp-1"), ev_completed("resp-1")]),
)
.await;
let chatgpt_base_url = server.uri();
let mut builder = test_codex()
.with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing())
.with_config(move |config| {
config.chatgpt_base_url = chatgpt_base_url;
});
let TestCodex {
codex,
session_configured,
config,
..
} = builder.build(&server).await?;
codex
.submit(Op::UserTurn {
items: vec![UserInput::Text {
text: "hello input message analytics".into(),
text_elements: Vec::new(),
}],
final_output_json_schema: None,
cwd: config.cwd.clone(),
approval_policy: AskForApproval::Never,
approvals_reviewer: None,
sandbox_policy: SandboxPolicy::new_read_only_policy(),
model: session_configured.model.clone(),
effort: Some(ReasoningEffort::High),
summary: Some(ReasoningSummary::Detailed),
service_tier: Some(Some(ServiceTier::Flex)),
collaboration_mode: Some(CollaborationMode {
mode: ModeKind::Plan,
settings: Settings {
model: session_configured.model.clone(),
reasoning_effort: Some(ReasoningEffort::High),
developer_instructions: None,
},
}),
personality: None,
submission_type: None,
})
.await?;
wait_for_event(&codex, |event| matches!(event, EventMsg::TurnComplete(_))).await;
let event = wait_for_analytics_event(&server, "codex_turn_event", |event| {
event["event_params"]["submission_type"] == "prompt"
})
.await;
let event_params = &event["event_params"];
assert_eq!(event_params["submission_type"], "prompt");
assert_eq!(
event_params["product_client_id"],
serde_json::json!(codex_core::default_client::originator().value)
);
assert_eq!(event_params["model_slug"], session_configured.model);
assert!(event_params["thread_id"].as_str().is_some());
assert!(event_params["turn_id"].as_str().is_some());
Ok(())
}
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn user_turn_tracks_turn_steer_analytics() -> anyhow::Result<()> {
skip_if_no_network!(Ok(()));
let server = start_mock_server().await;
let temp = tempdir()?;
let unblock_path = temp.path().join("unblock-steering");
let command = format!(
"while [ ! -f \"{}\" ]; do sleep 0.01; done; echo done",
unblock_path.display()
);
let call_id = "shell-steering-call";
mount_sse_sequence(
&server,
vec![
sse(vec![
ev_response_created("resp-1"),
core_test_support::responses::ev_function_call(
call_id,
"shell",
&serde_json::to_string(&serde_json::json!({
"command": ["/bin/sh", "-c", command],
}))?,
),
ev_completed("resp-1"),
]),
sse(vec![
ev_assistant_message("msg-2", "done"),
ev_completed("resp-2"),
]),
],
)
.await;
let chatgpt_base_url = server.uri();
let test = test_codex()
.with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing())
.with_model("gpt-5")
.with_config(move |config| {
config.chatgpt_base_url = chatgpt_base_url;
})
.build(&server)
.await?;
let codex = test.codex.clone();
let turn_model = test.session_configured.model.clone();
codex
.submit(Op::UserTurn {
items: vec![UserInput::Text {
text: "start steering flow".into(),
text_elements: Vec::new(),
}],
final_output_json_schema: None,
cwd: test.cwd_path().to_path_buf(),
approval_policy: AskForApproval::Never,
approvals_reviewer: None,
sandbox_policy: SandboxPolicy::DangerFullAccess,
model: turn_model,
effort: None,
summary: None,
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
let turn_id = wait_for_event_match(&codex, |ev| match ev {
EventMsg::TurnStarted(event) => Some(event.turn_id.clone()),
_ => None,
})
.await;
wait_for_event_match(&codex, |ev| match ev {
EventMsg::ExecCommandBegin(event) if event.call_id == call_id => Some(()),
_ => None,
})
.await;
let steering_text = "steering metadata check";
let steered_turn_id = codex
.steer_input(
vec![UserInput::Text {
text: steering_text.into(),
text_elements: Vec::new(),
}],
Some(turn_id.as_str()),
)
.await
.expect("steer should succeed on active turn");
assert_eq!(steered_turn_id, turn_id);
std::fs::write(&unblock_path, "go")?;
wait_for_event(&codex, |event| matches!(event, EventMsg::TurnComplete(_))).await;
let event = wait_for_analytics_event(&server, "codex_turn_event", |event| {
event["event_params"].get("submission_type").is_none()
&& event["event_params"].get("sandbox_policy").is_none()
})
.await;
let event_params = &event["event_params"];
assert!(event_params.get("submission_type").is_none());
assert!(event_params.get("sandbox_policy").is_none());
assert!(event_params.get("reasoning_effort").is_none());
assert!(event_params.get("reasoning_summary").is_none());
assert!(event_params.get("service_tier").is_none());
assert!(event_params.get("collaboration_mode").is_none());
assert_eq!(
event_params["product_client_id"],
serde_json::json!(codex_core::default_client::originator().value)
);
assert_eq!(event_params["model_slug"], "gpt-5");
assert!(event_params["thread_id"].as_str().is_some());
assert!(event_params["turn_id"].as_str().is_some());
Ok(())
}
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn assistant_message_item_is_emitted() -> anyhow::Result<()> {
skip_if_no_network!(Ok(()));
@@ -864,7 +635,6 @@ async fn plan_mode_emits_plan_item_from_proposed_plan_block() -> anyhow::Result<
service_tier: None,
collaboration_mode: Some(collaboration_mode),
personality: None,
submission_type: None,
})
.await?;
@@ -942,7 +712,6 @@ async fn plan_mode_strips_plan_from_agent_messages() -> anyhow::Result<()> {
service_tier: None,
collaboration_mode: Some(collaboration_mode),
personality: None,
submission_type: None,
})
.await?;
@@ -1052,7 +821,6 @@ async fn plan_mode_streaming_citations_are_stripped_across_added_deltas_and_done
service_tier: None,
collaboration_mode: Some(collaboration_mode),
personality: None,
submission_type: None,
})
.await?;
@@ -1240,7 +1008,6 @@ async fn plan_mode_streaming_proposed_plan_tag_split_across_added_and_delta_is_p
service_tier: None,
collaboration_mode: Some(collaboration_mode),
personality: None,
submission_type: None,
})
.await?;
@@ -1355,7 +1122,6 @@ async fn plan_mode_handles_missing_plan_close_tag() -> anyhow::Result<()> {
service_tier: None,
collaboration_mode: Some(collaboration_mode),
personality: None,
submission_type: None,
})
.await?;
-1
View File
@@ -88,7 +88,6 @@ async fn codex_returns_json_result(model: String) -> anyhow::Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
-1
View File
@@ -69,7 +69,6 @@ async fn submit_skill_turn(test: &TestCodex, skill_path: PathBuf, prompt: &str)
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -134,7 +134,6 @@ async fn model_change_appends_model_instructions_developer_message() -> Result<(
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
wait_for_event(&test.codex, |ev| matches!(ev, EventMsg::TurnComplete(_))).await;
@@ -172,7 +171,6 @@ async fn model_change_appends_model_instructions_developer_message() -> Result<(
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
wait_for_event(&test.codex, |ev| matches!(ev, EventMsg::TurnComplete(_))).await;
@@ -233,7 +231,6 @@ async fn model_and_personality_change_only_appends_model_instructions() -> Resul
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
wait_for_event(&test.codex, |ev| matches!(ev, EventMsg::TurnComplete(_))).await;
@@ -271,7 +268,6 @@ async fn model_and_personality_change_only_appends_model_instructions() -> Resul
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
wait_for_event(&test.codex, |ev| matches!(ev, EventMsg::TurnComplete(_))).await;
@@ -414,7 +410,6 @@ async fn model_change_from_image_to_text_strips_prior_image_content() -> Result<
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
wait_for_event(&test.codex, |ev| matches!(ev, EventMsg::TurnComplete(_))).await;
@@ -436,7 +431,6 @@ async fn model_change_from_image_to_text_strips_prior_image_content() -> Result<
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
wait_for_event(&test.codex, |ev| matches!(ev, EventMsg::TurnComplete(_))).await;
@@ -545,7 +539,6 @@ async fn generated_image_is_replayed_for_image_capable_models() -> Result<()> {
summary: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
wait_for_event(&test.codex, |ev| matches!(ev, EventMsg::TurnComplete(_))).await;
@@ -567,7 +560,6 @@ async fn generated_image_is_replayed_for_image_capable_models() -> Result<()> {
summary: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
wait_for_event(&test.codex, |ev| matches!(ev, EventMsg::TurnComplete(_))).await;
@@ -679,7 +671,6 @@ async fn model_change_from_generated_image_to_text_preserves_prior_generated_ima
summary: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
wait_for_event(&test.codex, |ev| matches!(ev, EventMsg::TurnComplete(_))).await;
@@ -701,7 +692,6 @@ async fn model_change_from_generated_image_to_text_preserves_prior_generated_ima
summary: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
wait_for_event(&test.codex, |ev| matches!(ev, EventMsg::TurnComplete(_))).await;
@@ -815,7 +805,6 @@ async fn thread_rollback_after_generated_image_drops_entire_image_turn_history()
summary: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
wait_for_event(&test.codex, |ev| matches!(ev, EventMsg::TurnComplete(_))).await;
@@ -845,7 +834,6 @@ async fn thread_rollback_after_generated_image_drops_entire_image_turn_history()
summary: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
wait_for_event(&test.codex, |ev| matches!(ev, EventMsg::TurnComplete(_))).await;
@@ -1001,7 +989,6 @@ async fn model_switch_to_smaller_model_updates_token_context_window() -> Result<
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -1061,7 +1048,6 @@ async fn model_switch_to_smaller_model_updates_token_context_window() -> Result<
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -129,7 +129,6 @@ async fn snapshot_model_visible_layout_turn_overrides() -> Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
wait_for_event(&test.codex, |event| {
@@ -154,7 +153,6 @@ async fn snapshot_model_visible_layout_turn_overrides() -> Result<()> {
service_tier: None,
collaboration_mode: None,
personality: Some(Personality::Friendly),
submission_type: None,
})
.await?;
wait_for_event(&test.codex, |event| {
@@ -234,7 +232,6 @@ async fn snapshot_model_visible_layout_cwd_change_does_not_refresh_agents() -> R
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
wait_for_event(&test.codex, |event| {
@@ -259,7 +256,6 @@ async fn snapshot_model_visible_layout_cwd_change_does_not_refresh_agents() -> R
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
wait_for_event(&test.codex, |event| {
@@ -370,7 +366,6 @@ async fn snapshot_model_visible_layout_resume_with_personality_change() -> Resul
service_tier: None,
collaboration_mode: None,
personality: Some(Personality::Friendly),
submission_type: None,
})
.await?;
wait_for_event(&resumed.codex, |event| {
@@ -104,7 +104,6 @@ async fn renews_cache_ttl_on_matching_models_etag() -> Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -110,7 +110,6 @@ async fn refresh_models_on_models_etag_mismatch_and_avoid_duplicate_models_fetch
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
-13
View File
@@ -111,7 +111,6 @@ async fn user_turn_personality_none_does_not_add_update_message() -> anyhow::Res
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -163,7 +162,6 @@ async fn config_personality_some_sets_instructions_template() -> anyhow::Result<
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -222,7 +220,6 @@ async fn config_personality_none_sends_no_personality() -> anyhow::Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -287,7 +284,6 @@ async fn default_personality_is_pragmatic_without_config_toml() -> anyhow::Resul
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -340,7 +336,6 @@ async fn user_turn_personality_some_adds_update_message() -> anyhow::Result<()>
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -379,7 +374,6 @@ async fn user_turn_personality_some_adds_update_message() -> anyhow::Result<()>
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -447,7 +441,6 @@ async fn user_turn_personality_same_value_does_not_add_update_message() -> anyho
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -486,7 +479,6 @@ async fn user_turn_personality_same_value_does_not_add_update_message() -> anyho
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -567,7 +559,6 @@ async fn user_turn_personality_skips_if_feature_disabled() -> anyhow::Result<()>
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -606,7 +597,6 @@ async fn user_turn_personality_skips_if_feature_disabled() -> anyhow::Result<()>
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -724,7 +714,6 @@ async fn remote_model_friendly_personality_instructions_with_feature() -> anyhow
service_tier: None,
collaboration_mode: None,
personality: Some(Personality::Friendly),
submission_type: None,
})
.await?;
@@ -844,7 +833,6 @@ async fn user_turn_personality_remote_model_template_includes_update_message() -
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -883,7 +871,6 @@ async fn user_turn_personality_remote_model_template_includes_update_message() -
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -712,7 +712,6 @@ async fn per_turn_overrides_keep_cached_prefix_and_key_constant() -> anyhow::Res
collaboration_mode: None,
final_output_json_schema: None,
personality: None,
submission_type: None,
})
.await?;
wait_for_event(&codex, |ev| matches!(ev, EventMsg::TurnComplete(_))).await;
@@ -826,7 +825,6 @@ async fn send_user_turn_with_no_changes_does_not_send_environment_context() -> a
collaboration_mode: None,
final_output_json_schema: None,
personality: None,
submission_type: None,
})
.await?;
wait_for_event(&codex, |ev| matches!(ev, EventMsg::TurnComplete(_))).await;
@@ -848,7 +846,6 @@ async fn send_user_turn_with_no_changes_does_not_send_environment_context() -> a
collaboration_mode: None,
final_output_json_schema: None,
personality: None,
submission_type: None,
})
.await?;
wait_for_event(&codex, |ev| matches!(ev, EventMsg::TurnComplete(_))).await;
@@ -954,7 +951,6 @@ async fn send_user_turn_with_changes_sends_environment_context() -> anyhow::Resu
collaboration_mode: None,
final_output_json_schema: None,
personality: None,
submission_type: None,
})
.await?;
wait_for_event(&codex, |ev| matches!(ev, EventMsg::TurnComplete(_))).await;
@@ -976,7 +972,6 @@ async fn send_user_turn_with_changes_sends_environment_context() -> anyhow::Resu
collaboration_mode: None,
final_output_json_schema: None,
personality: None,
submission_type: None,
})
.await?;
wait_for_event(&codex, |ev| matches!(ev, EventMsg::TurnComplete(_))).await;
@@ -181,7 +181,6 @@ async fn remote_models_long_model_slug_is_sent_with_high_reasoning() -> Result<(
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -245,7 +244,6 @@ async fn namespaced_model_slug_uses_catalog_metadata_without_fallback_warning()
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -406,7 +404,6 @@ async fn remote_models_remote_model_uses_unified_exec() -> Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -626,7 +623,6 @@ async fn remote_models_apply_remote_base_instructions() -> Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -201,7 +201,6 @@ async fn submit_turn(
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
Ok(())
@@ -153,7 +153,6 @@ async fn submit_turn(
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
Ok(())
@@ -153,7 +153,6 @@ async fn request_user_input_round_trip_for_mode(mode: ModeKind) -> anyhow::Resul
},
}),
personality: None,
submission_type: None,
})
.await?;
@@ -265,7 +264,6 @@ where
service_tier: None,
collaboration_mode: Some(collaboration_mode),
personality: None,
submission_type: None,
})
.await?;
-6
View File
@@ -137,7 +137,6 @@ async fn stdio_server_round_trip() -> anyhow::Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -308,7 +307,6 @@ async fn stdio_image_responses_round_trip() -> anyhow::Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -513,7 +511,6 @@ async fn stdio_image_responses_are_sanitized_for_text_only_model() -> anyhow::Re
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -629,7 +626,6 @@ async fn stdio_server_propagates_whitelisted_env_vars() -> anyhow::Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -792,7 +788,6 @@ async fn streamable_http_tool_call_round_trip() -> anyhow::Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -1040,7 +1035,6 @@ async fn streamable_http_with_oauth_round_trip_impl() -> anyhow::Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -53,7 +53,6 @@ async fn openai_model_header_mismatch_emits_warning_event_and_warning_item() ->
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -153,7 +152,6 @@ async fn response_model_field_mismatch_emits_warning_when_header_matches_request
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -240,7 +238,6 @@ async fn openai_model_header_mismatch_only_emits_one_warning_per_turn() -> Resul
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -291,7 +288,6 @@ async fn openai_model_header_casing_only_mismatch_does_not_warn() -> Result<()>
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -172,7 +172,6 @@ async fn run_snapshot_command_with_options(
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -264,7 +263,6 @@ async fn run_shell_command_snapshot_with_options(
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -336,7 +334,6 @@ async fn run_tool_turn_on_harness(
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -571,7 +568,6 @@ async fn shell_command_snapshot_still_intercepts_apply_patch() -> Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -73,7 +73,6 @@ async fn submit_turn_with_policies(
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
Ok(())
-1
View File
@@ -82,7 +82,6 @@ async fn user_turn_includes_skill_instructions() -> Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -403,7 +403,6 @@ async fn mcp_call_marks_thread_memory_mode_polluted_when_configured() -> Result<
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
wait_for_event(&test.codex, |event| {
@@ -93,7 +93,6 @@ async fn shell_tool_executes_command_and_streams_output() -> anyhow::Result<()>
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -165,7 +164,6 @@ async fn update_plan_tool_emits_plan_update_event() -> anyhow::Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -247,7 +245,6 @@ async fn update_plan_tool_rejects_malformed_payload() -> anyhow::Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -344,7 +341,6 @@ async fn apply_patch_tool_executes_and_emits_patch_events() -> anyhow::Result<()
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -449,7 +445,6 @@ async fn apply_patch_reports_parse_diagnostics() -> anyhow::Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -50,7 +50,6 @@ async fn run_turn(test: &TestCodex, prompt: &str) -> anyhow::Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -368,7 +367,6 @@ async fn shell_tools_start_before_response_completed_when_stream_delayed() -> an
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
-1
View File
@@ -494,7 +494,6 @@ async fn mcp_image_output_preserves_image_and_no_text_summary() -> Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
-26
View File
@@ -200,7 +200,6 @@ async fn unified_exec_intercepts_apply_patch_exec_command() -> Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -335,7 +334,6 @@ async fn unified_exec_emits_exec_command_begin_event() -> Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -419,7 +417,6 @@ async fn unified_exec_resolves_relative_workdir() -> Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -506,7 +503,6 @@ async fn unified_exec_respects_workdir_override() -> Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -605,7 +601,6 @@ async fn unified_exec_emits_exec_command_end_event() -> Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -686,7 +681,6 @@ async fn unified_exec_emits_output_delta_for_exec_command() -> Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -768,7 +762,6 @@ async fn unified_exec_full_lifecycle_with_background_end_event() -> Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -904,7 +897,6 @@ async fn unified_exec_emits_terminal_interaction_for_write_stdin() -> Result<()>
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -1047,7 +1039,6 @@ async fn unified_exec_terminal_interaction_captures_delayed_output() -> Result<(
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -1213,7 +1204,6 @@ async fn unified_exec_emits_one_begin_and_one_end_event() -> Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -1317,7 +1307,6 @@ async fn exec_command_reports_chunk_and_exit_metadata() -> Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -1441,7 +1430,6 @@ async fn unified_exec_defaults_to_pipe() -> Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -1537,7 +1525,6 @@ async fn unified_exec_can_enable_tty() -> Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -1624,7 +1611,6 @@ async fn unified_exec_respects_early_exit_notifications() -> Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -1761,7 +1747,6 @@ async fn write_stdin_returns_exit_metadata_and_clears_session() -> Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -1935,7 +1920,6 @@ async fn unified_exec_emits_end_event_when_session_dies_via_stdin() -> Result<()
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -2018,7 +2002,6 @@ async fn unified_exec_keeps_long_running_session_after_turn_end() -> Result<()>
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -2112,7 +2095,6 @@ async fn unified_exec_interrupt_preserves_long_running_session() -> Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -2222,7 +2204,6 @@ async fn unified_exec_reuses_session_via_stdin() -> Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -2363,7 +2344,6 @@ PY
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
// This is a worst case scenario for the truncate logic.
@@ -2483,7 +2463,6 @@ async fn unified_exec_timeout_and_followup_poll() -> Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -2585,7 +2564,6 @@ PY
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -2687,7 +2665,6 @@ async fn unified_exec_runs_under_sandbox() -> Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -2797,7 +2774,6 @@ async fn unified_exec_python_prompt_under_seatbelt() -> Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -2898,7 +2874,6 @@ async fn unified_exec_runs_on_all_platforms() -> Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -3039,7 +3014,6 @@ async fn unified_exec_prunes_exited_sessions_first() -> Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -184,7 +184,6 @@ async fn user_shell_command_does_not_replace_active_turn() -> anyhow::Result<()>
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
-14
View File
@@ -178,7 +178,6 @@ async fn user_turn_with_local_image_attaches_image() -> anyhow::Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -288,7 +287,6 @@ async fn view_image_tool_attaches_local_image() -> anyhow::Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -430,7 +428,6 @@ async fn view_image_tool_can_preserve_original_resolution_when_requested_on_gpt5
summary: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -530,7 +527,6 @@ async fn view_image_tool_errors_clearly_for_unsupported_detail_values() -> anyho
summary: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -623,7 +619,6 @@ async fn view_image_tool_treats_null_detail_as_omitted() -> anyhow::Result<()> {
summary: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -724,7 +719,6 @@ async fn view_image_tool_resizes_when_model_lacks_original_detail_support() -> a
summary: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -836,7 +830,6 @@ async fn view_image_tool_does_not_force_original_resolution_with_capability_feat
summary: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -939,7 +932,6 @@ await codex.emitImage(out);
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -1060,7 +1052,6 @@ console.log(out.type);
summary: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -1154,7 +1145,6 @@ async fn view_image_tool_errors_when_path_is_directory() -> anyhow::Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -1231,7 +1221,6 @@ async fn view_image_tool_errors_for_non_image_files() -> anyhow::Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -1313,7 +1302,6 @@ async fn view_image_tool_errors_when_file_missing() -> anyhow::Result<()> {
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -1437,7 +1425,6 @@ async fn view_image_tool_returns_unsupported_message_for_text_only_model() -> an
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -1513,7 +1500,6 @@ async fn replaces_invalid_local_image_after_bad_request() -> anyhow::Result<()>
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
@@ -164,7 +164,6 @@ async fn websocket_fallback_hides_first_websocket_retry_stream_error() -> Result
service_tier: None,
collaboration_mode: None,
personality: None,
submission_type: None,
})
.await?;
-1
View File
@@ -199,7 +199,6 @@ impl AppServerClient {
// Debug client sends plain text with no UI markup spans.
text_elements: Vec::new(),
}],
submission_type: None,
..Default::default()
},
};
-1
View File
@@ -674,7 +674,6 @@ async fn run_exec_session(args: ExecRunArgs) -> anyhow::Result<()> {
summary: None,
personality: None,
output_schema,
submission_type: None,
collaboration_mode: None,
},
},
-26
View File
@@ -205,13 +205,6 @@ pub struct ConversationTextParams {
pub text: String,
}
#[derive(Debug, Clone, Copy, Deserialize, Serialize, PartialEq, Eq, JsonSchema, TS)]
#[serde(rename_all = "snake_case")]
pub enum SubmissionType {
Prompt,
PromptQueued,
}
/// Submission operation
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, JsonSchema)]
#[serde(tag = "type", rename_all = "snake_case")]
@@ -250,19 +243,6 @@ pub enum Op {
final_output_json_schema: Option<Value>,
},
/// User input with additional turn-scoped metadata supplied by a higher-level
/// surface such as app-server `turn/start`.
UserInputWithMetadata {
/// User input items, see `InputItem`
items: Vec<UserInput>,
/// Optional JSON Schema used to constrain the final assistant message for this turn.
#[serde(skip_serializing_if = "Option::is_none")]
final_output_json_schema: Option<Value>,
/// Semantic classification of this submitted user input.
#[serde(default, skip_serializing_if = "Option::is_none")]
submission_type: Option<SubmissionType>,
},
/// Similar to [`Op::UserInput`], but contains additional context required
/// for a turn of a [`crate::codex_thread::CodexThread`].
UserTurn {
@@ -318,11 +298,6 @@ pub enum Op {
/// Optional personality override for this turn.
#[serde(skip_serializing_if = "Option::is_none")]
personality: Option<Personality>,
/// Semantic classification of this submitted user message when known by
/// the higher-level surface.
#[serde(default, skip_serializing_if = "Option::is_none")]
submission_type: Option<SubmissionType>,
},
/// Inter-agent communication that should be recorded as assistant history
@@ -597,7 +572,6 @@ impl Op {
Self::RealtimeConversationText(_) => "realtime_conversation_text",
Self::RealtimeConversationClose => "realtime_conversation_close",
Self::UserInput { .. } => "user_input",
Self::UserInputWithMetadata { .. } => "user_input",
Self::UserTurn { .. } => "user_turn",
Self::InterAgentCommunication { .. } => "inter_agent_communication",
Self::OverrideTurnContext { .. } => "override_turn_context",
-1
View File
@@ -5279,7 +5279,6 @@ impl ChatWidget {
final_output_json_schema: None,
collaboration_mode,
personality,
submission_type: None,
};
if !self.submit_op(op) {
-2
View File
@@ -2020,7 +2020,6 @@ impl App {
final_output_json_schema,
collaboration_mode,
personality,
submission_type,
} => {
if let Some(turn_id) = self.active_turn_id_for_thread(thread_id).await {
match app_server
@@ -2054,7 +2053,6 @@ impl App {
*service_tier,
collaboration_mode.clone(),
*personality,
*submission_type,
final_output_json_schema.clone(),
)
.await?;
@@ -17,7 +17,6 @@ use codex_protocol::protocol::Op;
use codex_protocol::protocol::ReviewDecision;
use codex_protocol::protocol::ReviewRequest;
use codex_protocol::protocol::SandboxPolicy;
use codex_protocol::protocol::SubmissionType;
use codex_protocol::request_permissions::RequestPermissionsResponse;
use codex_protocol::request_user_input::RequestUserInputResponse;
use codex_protocol::user_input::UserInput;
@@ -52,7 +51,6 @@ pub(crate) enum AppCommandView<'a> {
final_output_json_schema: &'a Option<Value>,
collaboration_mode: &'a Option<CollaborationMode>,
personality: &'a Option<Personality>,
submission_type: &'a Option<SubmissionType>,
},
OverrideTurnContext {
cwd: &'a Option<PathBuf>,
@@ -157,7 +155,6 @@ impl AppCommand {
final_output_json_schema: Option<Value>,
collaboration_mode: Option<CollaborationMode>,
personality: Option<Personality>,
submission_type: Option<SubmissionType>,
) -> Self {
Self(Op::UserTurn {
items,
@@ -172,7 +169,6 @@ impl AppCommand {
final_output_json_schema,
collaboration_mode,
personality,
submission_type,
})
}
@@ -318,7 +314,6 @@ impl AppCommand {
final_output_json_schema,
collaboration_mode,
personality,
submission_type,
} => AppCommandView::UserTurn {
items,
cwd,
@@ -332,7 +327,6 @@ impl AppCommand {
final_output_json_schema,
collaboration_mode,
personality,
submission_type,
},
Op::OverrideTurnContext {
cwd,
@@ -75,7 +75,6 @@ use codex_protocol::protocol::ReviewRequest;
use codex_protocol::protocol::ReviewTarget as CoreReviewTarget;
use codex_protocol::protocol::SandboxPolicy;
use codex_protocol::protocol::SessionNetworkProxyRuntime;
use codex_protocol::protocol::SubmissionType;
use color_eyre::eyre::ContextCompat;
use color_eyre::eyre::Result;
use color_eyre::eyre::WrapErr;
@@ -390,7 +389,6 @@ impl AppServerSession {
service_tier: Option<Option<codex_protocol::config_types::ServiceTier>>,
collaboration_mode: Option<codex_protocol::config_types::CollaborationMode>,
personality: Option<codex_protocol::config_types::Personality>,
submission_type: Option<SubmissionType>,
output_schema: Option<serde_json::Value>,
) -> Result<TurnStartResponse> {
let request_id = self.next_request_id();
@@ -409,7 +407,6 @@ impl AppServerSession {
effort,
summary,
personality,
submission_type,
output_schema,
collaboration_mode,
},
+1 -15
View File
@@ -5210,14 +5210,6 @@ impl ChatWidget {
}
fn submit_user_message(&mut self, user_message: UserMessage) {
self.submit_user_message_with_type(user_message, None);
}
fn submit_user_message_with_type(
&mut self,
user_message: UserMessage,
submission_type: Option<SubmissionType>,
) {
if !self.is_session_configured() {
tracing::warn!("cannot submit user message before session is configured; queueing");
self.queued_user_messages.push_front(user_message);
@@ -5433,7 +5425,6 @@ impl ChatWidget {
/*final_output_json_schema*/ None,
collaboration_mode,
personality,
submission_type,
);
if !self.submit_op(op) {
@@ -6893,13 +6884,8 @@ impl ChatWidget {
if self.bottom_pane.is_task_running() {
return;
}
let submission_type = if self.rejected_steers_queue.is_empty() {
Some(SubmissionType::PromptQueued)
} else {
None
};
if let Some(user_message) = self.pop_next_queued_user_message() {
self.submit_user_message_with_type(user_message, submission_type);
self.submit_user_message(user_message);
}
// Update the list to reflect the remaining queued messages (if any).
self.refresh_pending_input_preview();