Fix sticky environment lint failures

Group thread-start options for clippy and make the new environment tests comply with stricter CI lint settings.

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
starr-openai
2026-04-21 11:49:14 -07:00
co-authored by Codex
parent 63d6375c9d
commit ce5fca8b23
5 changed files with 58 additions and 38 deletions
@@ -218,6 +218,7 @@ use codex_core::ForkSnapshot;
use codex_core::NewThread;
use codex_core::RolloutRecorder;
use codex_core::SessionMeta;
use codex_core::StartThreadWithToolsOptions;
use codex_core::SteerInputError;
use codex_core::ThreadConfigSnapshot;
use codex_core::ThreadManager;
@@ -2612,20 +2613,20 @@ impl CodexMessageProcessor {
match listener_task_context
.thread_manager
.start_thread_with_tools_and_service_name(
.start_thread_with_tools_and_service_name(StartThreadWithToolsOptions {
config,
match session_start_source
initial_history: match session_start_source
.unwrap_or(codex_app_server_protocol::ThreadStartSource::Startup)
{
codex_app_server_protocol::ThreadStartSource::Startup => InitialHistory::New,
codex_app_server_protocol::ThreadStartSource::Clear => InitialHistory::Cleared,
},
core_dynamic_tools,
dynamic_tools: core_dynamic_tools,
persist_extended_history,
service_name,
request_trace,
metrics_service_name: service_name,
parent_trace: request_trace,
environment_selections,
)
})
.instrument(tracing::info_span!(
"app_server.thread_start.create_thread",
otel.name = "app_server.thread_start.create_thread",
@@ -1969,8 +1969,11 @@ async fn run_environment_selection_case(
mcp.read_stream_until_notification_message("turn/started"),
)
.await??;
let started: TurnStartedNotification =
serde_json::from_value(started_notification.params.expect("turn/started params"))?;
let started: TurnStartedNotification = serde_json::from_value(
started_notification
.params
.ok_or_else(|| anyhow::anyhow!("turn/started notification should include params"))?,
)?;
assert_eq!(started.turn.id, turn.id, "{}", case.name);
let completed_notification = timeout(
@@ -1978,11 +1981,10 @@ async fn run_environment_selection_case(
mcp.read_stream_until_notification_message("turn/completed"),
)
.await??;
let completed: TurnCompletedNotification = serde_json::from_value(
completed_notification
.params
.expect("turn/completed params"),
)?;
let completed: TurnCompletedNotification =
serde_json::from_value(completed_notification.params.ok_or_else(|| {
anyhow::anyhow!("turn/completed notification should include params")
})?)?;
assert_eq!(completed.turn.id, turn.id, "{}", case.name);
assert_eq!(
completed.turn.status,