Skip to content

Commit e2746fd

Browse files
authored
Recognize Work web and mobile thread originators (#29988)
## Summary - recognize `codex_work_web` and `codex_work_mobile` as supported `thread/start.serviceName` values - use the recognized value as the thread-scoped originator, with the same persistence and request propagation added for `codex_work_desktop` - cover precedence over persisted and inherited originators This is the Codex consumer for the service names introduced by [openai/openai#1073178](openai/openai#1073178). ## Rollout / Compatibility The producer is ChatGPT's app-server integration in openai/openai#1073178. This PR is the Codex app-server consumer that converts those service names into the outgoing per-thread `originator`. Until this change is deployed, the new service names are ignored and Codex continues using its fallback originator. Deploy this mapper and the matching codex-backend compatibility change in [openai/openai#1073594](openai/openai#1073594) while the existing Flora egress overwrite remains in place. Remove that overwrite in [openai/openai#1073197](openai/openai#1073197) only after both consumers are deployed. ## Validation - `just test -p codex-core effective_originator_prefers_thread_scoped_sources_before_env_originator` - `just fix -p codex-core` - `just fmt`
1 parent a6d20ed commit e2746fd

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

codex-rs/core/src/thread_manager.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,10 @@ pub struct StartThreadOptions {
196196

197197
fn originator_from_service_name(service_name: Option<&str>) -> Option<String> {
198198
let service_name = service_name?.trim();
199-
if service_name.eq_ignore_ascii_case("codex_work_desktop") {
200-
return Some("codex_work_desktop".to_string());
199+
for originator in ["codex_work_desktop", "codex_work_web", "codex_work_mobile"] {
200+
if service_name.eq_ignore_ascii_case(originator) {
201+
return Some(originator.to_string());
202+
}
201203
}
202204
None
203205
}

codex-rs/core/src/thread_manager_tests.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,18 @@ fn effective_originator_prefers_thread_scoped_sources_before_env_originator() {
122122
Some("inherited_originator"),
123123
"codex_work_desktop",
124124
),
125+
(
126+
Some("codex_work_web"),
127+
Some("persisted_originator"),
128+
Some("inherited_originator"),
129+
"codex_work_web",
130+
),
131+
(
132+
Some("codex_work_mobile"),
133+
Some("persisted_originator"),
134+
Some("inherited_originator"),
135+
"codex_work_mobile",
136+
),
125137
(
126138
None,
127139
Some("persisted_originator"),

0 commit comments

Comments
 (0)