mirror of
https://github.com/openai/codex.git
synced 2026-10-20 17:38:45 +00:00
Fix rebase conflict fallout
This commit is contained in:
@@ -7,6 +7,7 @@ use codex_app_server_protocol::RemoteControlClientsListParams;
|
||||
use codex_app_server_protocol::RemoteControlClientsListResponse;
|
||||
use codex_app_server_protocol::RemoteControlClientsRevokeParams;
|
||||
use codex_app_server_protocol::RemoteControlClientsRevokeResponse;
|
||||
use codex_login::AuthKeyringBackendKind;
|
||||
use pretty_assertions::assert_eq;
|
||||
|
||||
fn client_management_handle(
|
||||
@@ -172,6 +173,7 @@ async fn list_remote_control_clients_recovers_auth_after_unauthorized() {
|
||||
codex_home.path(),
|
||||
&stale_auth,
|
||||
AuthCredentialsStoreMode::File,
|
||||
AuthKeyringBackendKind::default(),
|
||||
)
|
||||
.expect("stale auth should save");
|
||||
let auth_manager = AuthManager::shared(
|
||||
@@ -179,6 +181,7 @@ async fn list_remote_control_clients_recovers_auth_after_unauthorized() {
|
||||
/*enable_codex_api_key_env*/ false,
|
||||
AuthCredentialsStoreMode::File,
|
||||
/*chatgpt_base_url*/ None,
|
||||
AuthKeyringBackendKind::default(),
|
||||
)
|
||||
.await;
|
||||
let mut fresh_auth = remote_control_auth_dot_json(Some("account_id"));
|
||||
@@ -191,6 +194,7 @@ async fn list_remote_control_clients_recovers_auth_after_unauthorized() {
|
||||
codex_home.path(),
|
||||
&fresh_auth,
|
||||
AuthCredentialsStoreMode::File,
|
||||
AuthKeyringBackendKind::default(),
|
||||
)
|
||||
.expect("fresh auth should save");
|
||||
|
||||
@@ -253,6 +257,7 @@ async fn list_remote_control_clients_retries_unauthorized_only_once() {
|
||||
codex_home.path(),
|
||||
&stale_auth,
|
||||
AuthCredentialsStoreMode::File,
|
||||
AuthKeyringBackendKind::default(),
|
||||
)
|
||||
.expect("stale auth should save");
|
||||
let auth_manager = AuthManager::shared(
|
||||
@@ -260,6 +265,7 @@ async fn list_remote_control_clients_retries_unauthorized_only_once() {
|
||||
/*enable_codex_api_key_env*/ false,
|
||||
AuthCredentialsStoreMode::File,
|
||||
/*chatgpt_base_url*/ None,
|
||||
AuthKeyringBackendKind::default(),
|
||||
)
|
||||
.await;
|
||||
let mut fresh_auth = remote_control_auth_dot_json(Some("account_id"));
|
||||
@@ -272,6 +278,7 @@ async fn list_remote_control_clients_retries_unauthorized_only_once() {
|
||||
codex_home.path(),
|
||||
&fresh_auth,
|
||||
AuthCredentialsStoreMode::File,
|
||||
AuthKeyringBackendKind::default(),
|
||||
)
|
||||
.expect("fresh auth should save");
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use super::super::protocol::RemoteControlPairingStatusRequest;
|
||||
use super::super::protocol::StartRemoteControlPairingRequest;
|
||||
use super::*;
|
||||
use codex_login::AuthKeyringBackendKind;
|
||||
use pretty_assertions::assert_eq;
|
||||
use std::io;
|
||||
|
||||
@@ -528,6 +529,7 @@ async fn remote_control_handle_recovers_auth_before_refreshing_pairing() {
|
||||
codex_home.path(),
|
||||
&stale_auth,
|
||||
AuthCredentialsStoreMode::File,
|
||||
AuthKeyringBackendKind::default(),
|
||||
)
|
||||
.expect("stale auth should save");
|
||||
let auth_manager = AuthManager::shared(
|
||||
@@ -535,6 +537,7 @@ async fn remote_control_handle_recovers_auth_before_refreshing_pairing() {
|
||||
/*enable_codex_api_key_env*/ false,
|
||||
AuthCredentialsStoreMode::File,
|
||||
/*chatgpt_base_url*/ None,
|
||||
AuthKeyringBackendKind::default(),
|
||||
)
|
||||
.await;
|
||||
let mut fresh_auth = remote_control_auth_dot_json(Some("account_id"));
|
||||
@@ -547,6 +550,7 @@ async fn remote_control_handle_recovers_auth_before_refreshing_pairing() {
|
||||
codex_home.path(),
|
||||
&fresh_auth,
|
||||
AuthCredentialsStoreMode::File,
|
||||
AuthKeyringBackendKind::default(),
|
||||
)
|
||||
.expect("fresh auth should save");
|
||||
let remote_handle =
|
||||
@@ -784,6 +788,7 @@ async fn remote_control_handle_discards_pairing_response_after_auth_change() {
|
||||
codex_home.path(),
|
||||
&remote_control_auth_dot_json(Some("account_id")),
|
||||
AuthCredentialsStoreMode::File,
|
||||
AuthKeyringBackendKind::default(),
|
||||
)
|
||||
.expect("initial auth should save");
|
||||
let auth_manager = AuthManager::shared(
|
||||
@@ -791,6 +796,7 @@ async fn remote_control_handle_discards_pairing_response_after_auth_change() {
|
||||
/*enable_codex_api_key_env*/ false,
|
||||
AuthCredentialsStoreMode::File,
|
||||
/*chatgpt_base_url*/ None,
|
||||
AuthKeyringBackendKind::default(),
|
||||
)
|
||||
.await;
|
||||
let remote_handle =
|
||||
@@ -812,6 +818,7 @@ async fn remote_control_handle_discards_pairing_response_after_auth_change() {
|
||||
codex_home.path(),
|
||||
&remote_control_auth_dot_json(Some("next_account_id")),
|
||||
AuthCredentialsStoreMode::File,
|
||||
AuthKeyringBackendKind::default(),
|
||||
)
|
||||
.expect("next auth should save");
|
||||
auth_manager.reload().await;
|
||||
|
||||
@@ -2123,6 +2123,7 @@ mod tests {
|
||||
codex_home.path(),
|
||||
&remote_control_auth_dot_json("stale-token"),
|
||||
AuthCredentialsStoreMode::File,
|
||||
AuthKeyringBackendKind::default(),
|
||||
)
|
||||
.expect("stale auth should save");
|
||||
let state_db = remote_control_state_runtime(&codex_home).await;
|
||||
@@ -2131,6 +2132,7 @@ mod tests {
|
||||
/*enable_codex_api_key_env*/ false,
|
||||
AuthCredentialsStoreMode::File,
|
||||
/*chatgpt_base_url*/ None,
|
||||
AuthKeyringBackendKind::default(),
|
||||
)
|
||||
.await;
|
||||
let mut auth_recovery = auth_manager.unauthorized_recovery();
|
||||
@@ -2143,6 +2145,7 @@ mod tests {
|
||||
codex_home.path(),
|
||||
&remote_control_auth_dot_json("fresh-token"),
|
||||
AuthCredentialsStoreMode::File,
|
||||
AuthKeyringBackendKind::default(),
|
||||
)
|
||||
.expect("fresh auth should save");
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ use codex_config::CloudConfigTomlBundle;
|
||||
use codex_config::CloudRequirementsFragment;
|
||||
use codex_config::CloudRequirementsTomlBundle;
|
||||
use codex_config::types::AuthCredentialsStoreMode;
|
||||
use codex_login::AuthKeyringBackendKind;
|
||||
use pretty_assertions::assert_eq;
|
||||
use serde_json::json;
|
||||
use std::collections::VecDeque;
|
||||
@@ -48,6 +49,7 @@ async fn auth_manager_with_api_key() -> Arc<AuthManager> {
|
||||
/*enable_codex_api_key_env*/ false,
|
||||
AuthCredentialsStoreMode::File,
|
||||
/*chatgpt_base_url*/ None,
|
||||
AuthKeyringBackendKind::default(),
|
||||
)
|
||||
.await,
|
||||
)
|
||||
@@ -76,6 +78,7 @@ async fn auth_manager_with_plan_and_identity(
|
||||
/*enable_codex_api_key_env*/ false,
|
||||
AuthCredentialsStoreMode::File,
|
||||
/*chatgpt_base_url*/ None,
|
||||
AuthKeyringBackendKind::default(),
|
||||
)
|
||||
.await,
|
||||
)
|
||||
@@ -633,6 +636,7 @@ async fn get_bundle_recovers_after_unauthorized_reload() {
|
||||
/*enable_codex_api_key_env*/ false,
|
||||
AuthCredentialsStoreMode::File,
|
||||
/*chatgpt_base_url*/ None,
|
||||
AuthKeyringBackendKind::default(),
|
||||
)
|
||||
.await,
|
||||
);
|
||||
@@ -687,6 +691,7 @@ async fn get_bundle_recovers_after_unauthorized_reload_updates_cache_identity()
|
||||
/*enable_codex_api_key_env*/ false,
|
||||
AuthCredentialsStoreMode::File,
|
||||
/*chatgpt_base_url*/ None,
|
||||
AuthKeyringBackendKind::default(),
|
||||
)
|
||||
.await,
|
||||
);
|
||||
@@ -749,6 +754,7 @@ async fn get_bundle_surfaces_auth_recovery_message() {
|
||||
/*enable_codex_api_key_env*/ false,
|
||||
AuthCredentialsStoreMode::File,
|
||||
/*chatgpt_base_url*/ None,
|
||||
AuthKeyringBackendKind::default(),
|
||||
)
|
||||
.await,
|
||||
);
|
||||
@@ -813,6 +819,7 @@ async fn get_bundle_unauthorized_without_recovery_uses_generic_message() {
|
||||
/*enable_codex_api_key_env*/ false,
|
||||
AuthCredentialsStoreMode::File,
|
||||
/*chatgpt_base_url*/ None,
|
||||
AuthKeyringBackendKind::default(),
|
||||
)
|
||||
.await,
|
||||
);
|
||||
|
||||
@@ -21,7 +21,6 @@ use codex_config::Constrained;
|
||||
use codex_config::McpServerConfig;
|
||||
use codex_config::McpServerTransportConfig;
|
||||
use codex_config::types::AppToolApproval;
|
||||
use codex_config::types::ApprovalsReviewer;
|
||||
use codex_config::types::AuthKeyringBackendKind;
|
||||
use codex_config::types::OAuthCredentialsStoreMode;
|
||||
use codex_login::CodexAuth;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
use super::*;
|
||||
use codex_config::Constrained;
|
||||
use codex_config::types::AppToolApproval;
|
||||
use codex_config::types::ApprovalsReviewer;
|
||||
use codex_config::types::AuthKeyringBackendKind;
|
||||
use codex_login::CodexAuth;
|
||||
use codex_plugin::AppConnectorId;
|
||||
|
||||
@@ -497,9 +497,6 @@ impl App {
|
||||
message,
|
||||
"feature flag config write was overridden by effective config"
|
||||
);
|
||||
self.chat_widget.add_error_message(format!(
|
||||
"Experimental feature changes were saved but not applied: {message}"
|
||||
));
|
||||
if let Some(effective_config) = self
|
||||
.read_effective_config_after_overridden_write(
|
||||
app_server,
|
||||
@@ -507,6 +504,21 @@ impl App {
|
||||
)
|
||||
.await
|
||||
{
|
||||
let guardian_approval_was_updated = feature_updates_to_apply
|
||||
.iter()
|
||||
.any(|(feature, _)| *feature == Feature::GuardianApproval);
|
||||
let guardian_disable_applied = feature_updates_to_apply
|
||||
.iter()
|
||||
.any(|(feature, enabled)| *feature == Feature::GuardianApproval && !*enabled)
|
||||
&& !feature_enabled_from_effective_config(
|
||||
&effective_config,
|
||||
Feature::GuardianApproval,
|
||||
);
|
||||
if !guardian_disable_applied {
|
||||
self.chat_widget.add_error_message(format!(
|
||||
"Experimental feature changes were saved but not applied: {message}"
|
||||
));
|
||||
}
|
||||
self.sync_feature_state_from_effective_config(
|
||||
&effective_config,
|
||||
&feature_updates_to_apply,
|
||||
@@ -519,6 +531,41 @@ impl App {
|
||||
if windows_sandbox_changed {
|
||||
self.propagate_windows_sandbox_turn_context();
|
||||
}
|
||||
if guardian_approval_was_updated
|
||||
&& !self.config.features.enabled(Feature::GuardianApproval)
|
||||
{
|
||||
self.sync_active_thread_permission_settings_to_cached_session()
|
||||
.await;
|
||||
let op = AppCommand::override_turn_context(
|
||||
/*cwd*/ None,
|
||||
/*approval_policy*/ None,
|
||||
Some(self.config.approvals_reviewer),
|
||||
/*permission_profile*/ None,
|
||||
/*active_permission_profile*/ None,
|
||||
/*windows_sandbox_level*/ None,
|
||||
/*model*/ None,
|
||||
/*effort*/ None,
|
||||
/*summary*/ None,
|
||||
/*service_tier*/ None,
|
||||
/*collaboration_mode*/ None,
|
||||
/*personality*/ None,
|
||||
);
|
||||
let replay_state_op = ThreadEventStore::op_can_change_pending_replay_state(&op)
|
||||
.then(|| op.clone());
|
||||
let submitted = self.chat_widget.submit_op(op);
|
||||
if submitted && let Some(op) = replay_state_op.as_ref() {
|
||||
self.note_active_thread_outbound_op(op).await;
|
||||
self.refresh_pending_thread_approvals().await;
|
||||
}
|
||||
}
|
||||
if guardian_disable_applied && let Some(label) = permissions_history_label {
|
||||
self.chat_widget
|
||||
.add_info_message(format!("Permissions updated to {label}"), None);
|
||||
}
|
||||
} else {
|
||||
self.chat_widget.add_error_message(format!(
|
||||
"Experimental feature changes were saved but not applied: {message}"
|
||||
));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user