[codex] Add user input client ids (#24653)

## Summary

Adds an optional `clientId` field to app-server v2 `UserInput` and
carries it through the core `UserInput` model so clients can correlate
echoed user input items without relying on payload equality.

## Details

- Adds `client_id: Option<String>` to core `UserInput` variants.
- Exposes the v2 app-server field as `clientId` on the wire and in
generated TypeScript.
- Preserves the id when converting between app-server v2 and core
protocol types.
- Regenerates app-server schema fixtures.

## Validation

- `just fmt`
- `just write-app-server-schema`
- `cargo test -p codex-app-server-protocol`
- `cargo test -p codex-protocol`
- `just fix -p codex-app-server-protocol`
- `just fix -p codex-protocol`
- `git diff --check`
This commit is contained in:
Alexi Christakis authored and GitHub committed 2026-05-28 14:54:39 -07:00
1 parent a027135bc6
commit e92c952b2e
113 files changed
+793 -97

No files matched your search

@@ -734,6 +734,7 @@ async fn trigger_zsh_fork_multi_cmd_approval(
let mut turn_params = TurnStartParams {
thread_id: thread_response.thread.id.clone(),
client_user_message_id: None,
input: vec![V2UserInput::Text {
text: message,
text_elements: Vec::new(),
@@ -818,6 +819,7 @@ async fn resume_message_v2(
let turn_response = client.turn_start(TurnStartParams {
thread_id: resume_response.thread.id.clone(),
client_user_message_id: None,
input: vec![V2UserInput::Text {
text: user_message,
text_elements: Vec::new(),
@@ -959,6 +961,7 @@ async fn send_message_v2_with_policies(
println!("< thread/start response: {thread_response:?}");
let mut turn_params = TurnStartParams {
thread_id: thread_response.thread.id.clone(),
client_user_message_id: None,
input: vec![V2UserInput::Text {
text: user_message,
// Test client sends plain text without UI element ranges.
@@ -999,6 +1002,7 @@ async fn send_follow_up_v2(
let first_turn_params = TurnStartParams {
thread_id: thread_response.thread.id.clone(),
client_user_message_id: None,
input: vec![V2UserInput::Text {
text: first_message,
// Test client sends plain text without UI element ranges.
@@ -1012,6 +1016,7 @@ async fn send_follow_up_v2(
let follow_up_params = TurnStartParams {
thread_id: thread_response.thread.id.clone(),
client_user_message_id: None,
input: vec![V2UserInput::Text {
text: follow_up_message,
// Test client sends plain text without UI element ranges.
@@ -1255,6 +1260,7 @@ fn live_elicitation_timeout_pause(
let started_at = Instant::now();
let turn_response = client.turn_start(TurnStartParams {
thread_id: thread_id.clone(),
client_user_message_id: None,
input: vec![V2UserInput::Text {
text: prompt,
text_elements: Vec::new(),