remove turn event type

This commit is contained in:
Roy Han
2026-03-24 14:47:27 -07:00
parent 5d7f0e0c83
commit 903559bd60
3 changed files with 5 additions and 18 deletions

View File

@@ -39,13 +39,6 @@ pub(crate) struct CodexTurnEvent {
pub(crate) collaboration_mode: ModeKind,
}
#[derive(Clone, Copy, Debug, Serialize)]
#[serde(rename_all = "snake_case")]
pub(crate) enum TurnEventType {
Start,
Steer,
}
#[derive(Clone, Copy)]
pub(crate) struct CodexTurnSteerEvent;
@@ -424,7 +417,6 @@ struct CodexTurnEventParams {
turn_id: Option<String>,
product_client_id: Option<String>,
model_slug: Option<String>,
turn_event_type: TurnEventType,
submission_type: Option<SubmissionType>,
sandbox_policy: Option<&'static str>,
reasoning_effort: Option<String>,
@@ -806,7 +798,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()),
turn_event_type: TurnEventType::Start,
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()),
@@ -825,7 +816,6 @@ fn codex_turn_steer_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()),
turn_event_type: TurnEventType::Steer,
submission_type: None,
sandbox_policy: None,
reasoning_effort: None,

View File

@@ -11,7 +11,6 @@ use super::InvocationType;
use super::SubmissionType;
use super::TrackEventRequest;
use super::TrackEventsContext;
use super::TurnEventType;
use super::codex_app_metadata;
use super::codex_plugin_metadata;
use super::codex_plugin_used_metadata;
@@ -230,7 +229,6 @@ fn turn_event_serializes_expected_shape() {
"turn_id": "turn-2",
"product_client_id": crate::default_client::originator().value,
"model_slug": "gpt-5",
"turn_event_type": "start",
"submission_type": "prompt",
"sandbox_policy": "read_only",
"reasoning_effort": "high",
@@ -265,7 +263,6 @@ fn turn_steer_event_serializes_expected_shape() {
"turn_id": "turn-2",
"product_client_id": crate::default_client::originator().value,
"model_slug": "gpt-5",
"turn_event_type": "steer",
"submission_type": null,
"sandbox_policy": null,
"reasoning_effort": null,

View File

@@ -237,10 +237,10 @@ async fn user_turn_tracks_turn_event_analytics() -> anyhow::Result<()> {
.and_then(|events| {
events.iter().find(|event| {
event["event_type"] == "codex_turn_event"
&& event["event_params"]["turn_event_type"] == "start"
&& event["event_params"]["submission_type"] == "prompt"
})
})
.expect("codex_turn_event start event should be present");
.expect("codex_turn_event prompt event should be present");
let event_params = &event["event_params"];
@@ -316,8 +316,7 @@ async fn user_turn_tracks_turn_event_prompt_type_analytics() -> anyhow::Result<(
wait_for_event(&codex, |event| matches!(event, EventMsg::TurnComplete(_))).await;
let event = wait_for_analytics_event(&server, "codex_turn_event", |event| {
event["event_params"]["turn_event_type"] == "start"
&& event["event_params"]["submission_type"] == "prompt"
event["event_params"]["submission_type"] == "prompt"
})
.await;
let event_params = &event["event_params"];
@@ -432,7 +431,8 @@ async fn user_turn_tracks_turn_steer_analytics() -> anyhow::Result<()> {
wait_for_event(&codex, |event| matches!(event, EventMsg::TurnComplete(_))).await;
let event = wait_for_analytics_event(&server, "codex_turn_event", |event| {
event["event_params"]["turn_event_type"] == "steer"
event["event_params"]["submission_type"].is_null()
&& event["event_params"]["sandbox_policy"].is_null()
})
.await;
let event_params = &event["event_params"];