Add text element metadata to types (#9235)

Initial type tweaking PR to make the diff of
https://github.com/openai/codex/pull/9116 smaller

This should not change any behavior, just adds some fields to types
This commit is contained in:
charley-oai
2026-01-14 16:41:50 -08:00
committed by GitHub
parent 2a68b74b9b
commit 4a9c2bcc5a
62 changed files with 483 additions and 41 deletions

View File

@@ -289,6 +289,7 @@ async fn resume_includes_initial_messages_and_sends_prior_items() {
.submit(Op::UserInput {
items: vec![UserInput::Text {
text: "hello".into(),
text_elements: Vec::new(),
}],
final_output_json_schema: None,
})
@@ -387,6 +388,7 @@ async fn includes_conversation_id_and_model_headers_in_request() {
.submit(Op::UserInput {
items: vec![UserInput::Text {
text: "hello".into(),
text_elements: Vec::new(),
}],
final_output_json_schema: None,
})
@@ -440,6 +442,7 @@ async fn includes_base_instructions_override_in_request() {
.submit(Op::UserInput {
items: vec![UserInput::Text {
text: "hello".into(),
text_elements: Vec::new(),
}],
final_output_json_schema: None,
})
@@ -496,6 +499,7 @@ async fn chatgpt_auth_sends_correct_request() {
.submit(Op::UserInput {
items: vec![UserInput::Text {
text: "hello".into(),
text_elements: Vec::new(),
}],
final_output_json_schema: None,
})
@@ -588,6 +592,7 @@ async fn prefers_apikey_when_config_prefers_apikey_even_with_chatgpt_tokens() {
.submit(Op::UserInput {
items: vec![UserInput::Text {
text: "hello".into(),
text_elements: Vec::new(),
}],
final_output_json_schema: None,
})
@@ -629,6 +634,7 @@ async fn includes_user_instructions_message_in_request() {
.submit(Op::UserInput {
items: vec![UserInput::Text {
text: "hello".into(),
text_elements: Vec::new(),
}],
final_output_json_schema: None,
})
@@ -708,6 +714,7 @@ async fn skills_append_to_instructions() {
.submit(Op::UserInput {
items: vec![UserInput::Text {
text: "hello".into(),
text_elements: Vec::new(),
}],
final_output_json_schema: None,
})
@@ -760,6 +767,7 @@ async fn includes_configured_effort_in_request() -> anyhow::Result<()> {
.submit(Op::UserInput {
items: vec![UserInput::Text {
text: "hello".into(),
text_elements: Vec::new(),
}],
final_output_json_schema: None,
})
@@ -797,6 +805,7 @@ async fn includes_no_effort_in_request() -> anyhow::Result<()> {
.submit(Op::UserInput {
items: vec![UserInput::Text {
text: "hello".into(),
text_elements: Vec::new(),
}],
final_output_json_schema: None,
})
@@ -832,6 +841,7 @@ async fn includes_default_reasoning_effort_in_request_when_defined_by_model_info
.submit(Op::UserInput {
items: vec![UserInput::Text {
text: "hello".into(),
text_elements: Vec::new(),
}],
final_output_json_schema: None,
})
@@ -871,6 +881,7 @@ async fn configured_reasoning_summary_is_sent() -> anyhow::Result<()> {
.submit(Op::UserInput {
items: vec![UserInput::Text {
text: "hello".into(),
text_elements: Vec::new(),
}],
final_output_json_schema: None,
})
@@ -910,6 +921,7 @@ async fn reasoning_summary_is_omitted_when_disabled() -> anyhow::Result<()> {
.submit(Op::UserInput {
items: vec![UserInput::Text {
text: "hello".into(),
text_elements: Vec::new(),
}],
final_output_json_schema: None,
})
@@ -943,6 +955,7 @@ async fn includes_default_verbosity_in_request() -> anyhow::Result<()> {
.submit(Op::UserInput {
items: vec![UserInput::Text {
text: "hello".into(),
text_elements: Vec::new(),
}],
final_output_json_schema: None,
})
@@ -983,6 +996,7 @@ async fn configured_verbosity_not_sent_for_models_without_support() -> anyhow::R
.submit(Op::UserInput {
items: vec![UserInput::Text {
text: "hello".into(),
text_elements: Vec::new(),
}],
final_output_json_schema: None,
})
@@ -1022,6 +1036,7 @@ async fn configured_verbosity_is_sent() -> anyhow::Result<()> {
.submit(Op::UserInput {
items: vec![UserInput::Text {
text: "hello".into(),
text_elements: Vec::new(),
}],
final_output_json_schema: None,
})
@@ -1077,6 +1092,7 @@ async fn includes_developer_instructions_message_in_request() {
.submit(Op::UserInput {
items: vec![UserInput::Text {
text: "hello".into(),
text_elements: Vec::new(),
}],
final_output_json_schema: None,
})
@@ -1326,6 +1342,7 @@ async fn token_count_includes_rate_limits_snapshot() {
.submit(Op::UserInput {
items: vec![UserInput::Text {
text: "hello".into(),
text_elements: Vec::new(),
}],
final_output_json_schema: None,
})
@@ -1484,6 +1501,7 @@ async fn usage_limit_error_emits_rate_limit_event() -> anyhow::Result<()> {
.submit(Op::UserInput {
items: vec![UserInput::Text {
text: "hello".into(),
text_elements: Vec::new(),
}],
final_output_json_schema: None,
})
@@ -1554,6 +1572,7 @@ async fn context_window_error_sets_total_tokens_to_model_window() -> anyhow::Res
.submit(Op::UserInput {
items: vec![UserInput::Text {
text: "seed turn".into(),
text_elements: Vec::new(),
}],
final_output_json_schema: None,
})
@@ -1565,6 +1584,7 @@ async fn context_window_error_sets_total_tokens_to_model_window() -> anyhow::Res
.submit(Op::UserInput {
items: vec![UserInput::Text {
text: "trigger context window".into(),
text_elements: Vec::new(),
}],
final_output_json_schema: None,
})
@@ -1685,6 +1705,7 @@ async fn azure_overrides_assign_properties_used_for_responses_url() {
.submit(Op::UserInput {
items: vec![UserInput::Text {
text: "hello".into(),
text_elements: Vec::new(),
}],
final_output_json_schema: None,
})
@@ -1768,6 +1789,7 @@ async fn env_var_overrides_loaded_auth() {
.submit(Op::UserInput {
items: vec![UserInput::Text {
text: "hello".into(),
text_elements: Vec::new(),
}],
final_output_json_schema: None,
})
@@ -1840,7 +1862,10 @@ async fn history_dedupes_streamed_and_final_messages_across_turns() {
// Turn 1: user sends U1; wait for completion.
codex
.submit(Op::UserInput {
items: vec![UserInput::Text { text: "U1".into() }],
items: vec![UserInput::Text {
text: "U1".into(),
text_elements: Vec::new(),
}],
final_output_json_schema: None,
})
.await
@@ -1850,7 +1875,10 @@ async fn history_dedupes_streamed_and_final_messages_across_turns() {
// Turn 2: user sends U2; wait for completion.
codex
.submit(Op::UserInput {
items: vec![UserInput::Text { text: "U2".into() }],
items: vec![UserInput::Text {
text: "U2".into(),
text_elements: Vec::new(),
}],
final_output_json_schema: None,
})
.await
@@ -1860,7 +1888,10 @@ async fn history_dedupes_streamed_and_final_messages_across_turns() {
// Turn 3: user sends U3; wait for completion.
codex
.submit(Op::UserInput {
items: vec![UserInput::Text { text: "U3".into() }],
items: vec![UserInput::Text {
text: "U3".into(),
text_elements: Vec::new(),
}],
final_output_json_schema: None,
})
.await