From 0651e165298823936b0295fa6bd89618a83c22b6 Mon Sep 17 00:00:00 2001 From: Ningyi Xie Date: Wed, 8 Apr 2026 16:45:20 -0700 Subject: [PATCH] Gate feedback mirror behind feature flag Keep the optional feedback mirror disabled unless the app-server config enables the feedback_mirror feature. Co-authored-by: Codex --- codex-rs/app-server/src/codex_message_processor.rs | 13 +++++++------ codex-rs/features/src/lib.rs | 8 ++++++++ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/codex-rs/app-server/src/codex_message_processor.rs b/codex-rs/app-server/src/codex_message_processor.rs index 5648280542..0b1791d0ee 100644 --- a/codex-rs/app-server/src/codex_message_processor.rs +++ b/codex-rs/app-server/src/codex_message_processor.rs @@ -7713,12 +7713,13 @@ impl CodexMessageProcessor { } let session_source = self.thread_manager.session_source(); - let allow_feedback_mirror_upload = is_openai_employee_email( - self.auth_manager - .auth_cached() - .and_then(|auth| auth.get_account_email()) - .as_deref(), - ); + let allow_feedback_mirror_upload = self.config.features.enabled(Feature::FeedbackMirror) + && is_openai_employee_email( + self.auth_manager + .auth_cached() + .and_then(|auth| auth.get_account_email()) + .as_deref(), + ); let upload_result = tokio::task::spawn_blocking(move || { snapshot.upload_feedback( diff --git a/codex-rs/features/src/lib.rs b/codex-rs/features/src/lib.rs index f49e0edc05..934525870c 100644 --- a/codex-rs/features/src/lib.rs +++ b/codex-rs/features/src/lib.rs @@ -124,6 +124,8 @@ pub enum Feature { RuntimeMetrics, /// Enable thread lifecycle analytics emitted via the app-server analytics pipeline. GeneralAnalytics, + /// Mirror internal feedback uploads to a configured endpoint. + FeedbackMirror, /// Persist rollout metadata to a local SQLite database. Sqlite, /// Enable startup memory extraction and file-backed memory consolidation. @@ -600,6 +602,12 @@ pub const FEATURES: &[FeatureSpec] = &[ stage: Stage::UnderDevelopment, default_enabled: false, }, + FeatureSpec { + id: Feature::FeedbackMirror, + key: "feedback_mirror", + stage: Stage::UnderDevelopment, + default_enabled: false, + }, FeatureSpec { id: Feature::Sqlite, key: "sqlite",