diff --git a/codex-rs/app-server/tests/suite/list_resume.rs b/codex-rs/app-server/tests/suite/list_resume.rs index a4178b0873..58c887da34 100644 --- a/codex-rs/app-server/tests/suite/list_resume.rs +++ b/codex-rs/app-server/tests/suite/list_resume.rs @@ -174,7 +174,8 @@ fn create_fake_rollout(codex_home: &Path, filename_ts: &str, meta_rfc3339: &str, "cwd": "/", "originator": "codex", "cli_version": "0.0.0", - "instructions": null + "instructions": null, + "model_provider": "test-provider" } }) .to_string(), diff --git a/codex-rs/core/src/rollout/recorder.rs b/codex-rs/core/src/rollout/recorder.rs index 95f5d479b8..ff8ab301a2 100644 --- a/codex-rs/core/src/rollout/recorder.rs +++ b/codex-rs/core/src/rollout/recorder.rs @@ -137,6 +137,7 @@ impl RolloutRecorder { cli_version: env!("CARGO_PKG_VERSION").to_string(), instructions, source, + model_provider: Some(config.model_provider_id.clone()), }), ) } diff --git a/codex-rs/core/src/rollout/tests.rs b/codex-rs/core/src/rollout/tests.rs index 617e5189c2..27c8509a67 100644 --- a/codex-rs/core/src/rollout/tests.rs +++ b/codex-rs/core/src/rollout/tests.rs @@ -63,6 +63,7 @@ fn write_session_file( "cwd": ".", "originator": "test_originator", "cli_version": "test_version", + "model_provider": "test-provider", }); if let Some(source) = source { @@ -166,6 +167,7 @@ async fn test_list_conversations_latest_first() { "originator": "test_originator", "cli_version": "test_version", "source": "vscode", + "model_provider": "test-provider", })]; let head_2 = vec![serde_json::json!({ "id": u2, @@ -175,6 +177,7 @@ async fn test_list_conversations_latest_first() { "originator": "test_originator", "cli_version": "test_version", "source": "vscode", + "model_provider": "test-provider", })]; let head_1 = vec![serde_json::json!({ "id": u1, @@ -184,6 +187,7 @@ async fn test_list_conversations_latest_first() { "originator": "test_originator", "cli_version": "test_version", "source": "vscode", + "model_provider": "test-provider", })]; let expected_cursor: Cursor = @@ -298,6 +302,7 @@ async fn test_pagination_cursor() { "originator": "test_originator", "cli_version": "test_version", "source": "vscode", + "model_provider": "test-provider", })]; let head_4 = vec![serde_json::json!({ "id": u4, @@ -307,6 +312,7 @@ async fn test_pagination_cursor() { "originator": "test_originator", "cli_version": "test_version", "source": "vscode", + "model_provider": "test-provider", })]; let expected_cursor1: Cursor = serde_json::from_str(&format!("\"2025-03-04T09-00-00|{u4}\"")).unwrap(); @@ -361,6 +367,7 @@ async fn test_pagination_cursor() { "originator": "test_originator", "cli_version": "test_version", "source": "vscode", + "model_provider": "test-provider", })]; let head_2 = vec![serde_json::json!({ "id": u2, @@ -370,6 +377,7 @@ async fn test_pagination_cursor() { "originator": "test_originator", "cli_version": "test_version", "source": "vscode", + "model_provider": "test-provider", })]; let expected_cursor2: Cursor = serde_json::from_str(&format!("\"2025-03-02T09-00-00|{u2}\"")).unwrap(); @@ -418,6 +426,7 @@ async fn test_pagination_cursor() { "originator": "test_originator", "cli_version": "test_version", "source": "vscode", + "model_provider": "test-provider", })]; let expected_cursor3: Cursor = serde_json::from_str(&format!("\"2025-03-01T09-00-00|{u1}\"")).unwrap(); @@ -467,6 +476,7 @@ async fn test_get_conversation_contents() { "originator": "test_originator", "cli_version": "test_version", "source": "vscode", + "model_provider": "test-provider", })]; let expected_cursor: Cursor = serde_json::from_str(&format!("\"{ts}|{uuid}\"")).unwrap(); let expected_page = ConversationsPage { @@ -495,6 +505,7 @@ async fn test_get_conversation_contents() { "originator": "test_originator", "cli_version": "test_version", "source": "vscode", + "model_provider": "test-provider", } }); let user_event = serde_json::json!({ @@ -532,6 +543,7 @@ async fn test_tail_includes_last_response_items() -> Result<()> { originator: "test_originator".into(), cli_version: "test_version".into(), source: SessionSource::VSCode, + model_provider: Some("test-provider".into()), }, git: None, }), @@ -615,6 +627,7 @@ async fn test_tail_handles_short_sessions() -> Result<()> { originator: "test_originator".into(), cli_version: "test_version".into(), source: SessionSource::VSCode, + model_provider: Some("test-provider".into()), }, git: None, }), @@ -699,6 +712,7 @@ async fn test_tail_skips_trailing_non_responses() -> Result<()> { originator: "test_originator".into(), cli_version: "test_version".into(), source: SessionSource::VSCode, + model_provider: Some("test-provider".into()), }, git: None, }), @@ -810,6 +824,7 @@ async fn test_stable_ordering_same_second_pagination() { "originator": "test_originator", "cli_version": "test_version", "source": "vscode", + "model_provider": "test-provider", })] }; let expected_cursor1: Cursor = serde_json::from_str(&format!("\"{ts}|{u2}\"")).unwrap(); diff --git a/codex-rs/core/tests/suite/client.rs b/codex-rs/core/tests/suite/client.rs index 8730f1f38f..e302a1c114 100644 --- a/codex-rs/core/tests/suite/client.rs +++ b/codex-rs/core/tests/suite/client.rs @@ -154,7 +154,8 @@ async fn resume_includes_initial_messages_and_sends_prior_items() { "instructions": "be nice", "cwd": ".", "originator": "test_originator", - "cli_version": "test_version" + "cli_version": "test_version", + "model_provider": "test-provider" } }) ) diff --git a/codex-rs/core/tests/suite/review.rs b/codex-rs/core/tests/suite/review.rs index 422acd922f..d4c9f66d81 100644 --- a/codex-rs/core/tests/suite/review.rs +++ b/codex-rs/core/tests/suite/review.rs @@ -375,7 +375,8 @@ async fn review_input_isolated_from_parent_history() { "instructions": null, "cwd": ".", "originator": "test_originator", - "cli_version": "test_version" + "cli_version": "test_version", + "model_provider": "test-provider" } }); f.write_all(format!("{meta_line}\n").as_bytes()) diff --git a/codex-rs/core/tests/suite/rollout_list_find.rs b/codex-rs/core/tests/suite/rollout_list_find.rs index a38f0565c0..1d40718d4b 100644 --- a/codex-rs/core/tests/suite/rollout_list_find.rs +++ b/codex-rs/core/tests/suite/rollout_list_find.rs @@ -28,7 +28,8 @@ fn write_minimal_rollout_with_id(codex_home: &Path, id: Uuid) -> PathBuf { "instructions": null, "cwd": ".", "originator": "test", - "cli_version": "test" + "cli_version": "test", + "model_provider": "test-provider" } }) ) diff --git a/codex-rs/protocol/src/protocol.rs b/codex-rs/protocol/src/protocol.rs index 105f028049..244c499614 100644 --- a/codex-rs/protocol/src/protocol.rs +++ b/codex-rs/protocol/src/protocol.rs @@ -933,6 +933,7 @@ pub struct SessionMeta { pub instructions: Option, #[serde(default)] pub source: SessionSource, + pub model_provider: Option, } impl Default for SessionMeta { @@ -945,6 +946,7 @@ impl Default for SessionMeta { cli_version: String::new(), instructions: None, source: SessionSource::default(), + model_provider: None, } } }