mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
Remove personality selection from the TUI (#44935)
## What changed Remove the `/personality` command, selection popup, tooltip, and associated settings update and persistence handlers. Stop sending a personality override with TUI user turns. GitOrigin-RevId: 0549a1f9dcfd8118340fad4b60fd24d4eee7f93a
This commit is contained in:
1 parent
e8271aa8b4
commit
12e82f44f8
24 files changed
+36
-440
No files matched your search
@@ -1083,11 +1083,6 @@ impl App {
|
||||
false
|
||||
}
|
||||
|
||||
pub(super) fn on_update_personality(&mut self, personality: Personality) {
|
||||
self.config.personality = Some(personality);
|
||||
self.chat_widget.set_personality(personality);
|
||||
}
|
||||
|
||||
pub(super) fn sync_tui_theme_selection(&mut self, name: String) {
|
||||
self.local_settings.tui.theme = Some(name.clone());
|
||||
self.chat_widget.set_tui_theme(Some(name));
|
||||
@@ -1125,14 +1120,6 @@ impl App {
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) fn personality_label(personality: Personality) -> &'static str {
|
||||
match personality {
|
||||
Personality::None => "None",
|
||||
Personality::Friendly => "Friendly",
|
||||
Personality::Pragmatic => "Pragmatic",
|
||||
}
|
||||
}
|
||||
|
||||
fn sync_feature_state_from_effective_config(
|
||||
&mut self,
|
||||
effective_config: &ConfigReadResponse,
|
||||
|
||||
@@ -1732,11 +1732,6 @@ impl App {
|
||||
.await;
|
||||
}
|
||||
}
|
||||
AppEvent::UpdatePersonality(personality) => {
|
||||
self.on_update_personality(personality);
|
||||
self.sync_active_thread_personality_setting(app_server, personality)
|
||||
.await;
|
||||
}
|
||||
AppEvent::RealtimeWebrtcOfferCreated {
|
||||
thread_id,
|
||||
attempt_id,
|
||||
@@ -2367,32 +2362,6 @@ impl App {
|
||||
AppEvent::PersistRealtimeVoiceSelection { voice } => {
|
||||
self.persist_realtime_voice(app_server, voice).await;
|
||||
}
|
||||
AppEvent::PersistPersonalitySelection { personality } => {
|
||||
match crate::config_update::write_config_batch(
|
||||
app_server.request_handle(),
|
||||
vec![crate::config_update::replace_config_value(
|
||||
"personality",
|
||||
serde_json::json!(personality.to_string()),
|
||||
)],
|
||||
)
|
||||
.await
|
||||
{
|
||||
Ok(_) => {
|
||||
let label = Self::personality_label(personality);
|
||||
let message = format!("Personality set to {label}");
|
||||
self.chat_widget.add_info_message(message, /*hint*/ None);
|
||||
}
|
||||
Err(err) => {
|
||||
tracing::error!(
|
||||
error = %err,
|
||||
"failed to persist personality selection"
|
||||
);
|
||||
self.chat_widget.add_error_message(format!(
|
||||
"Failed to save default personality: {err}"
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
AppEvent::PersistServiceTierSelection { service_tier } => {
|
||||
self.refresh_status_line();
|
||||
self.config.service_tier = service_tier.clone();
|
||||
|
||||
@@ -144,22 +144,6 @@ impl App {
|
||||
self.send_thread_settings_update(app_server, params).await;
|
||||
}
|
||||
|
||||
pub(super) async fn sync_active_thread_personality_setting(
|
||||
&mut self,
|
||||
app_server: &mut AppServerSession,
|
||||
personality: codex_protocol::config_types::Personality,
|
||||
) {
|
||||
let Some(thread_id) = self.active_thread_id else {
|
||||
return;
|
||||
};
|
||||
let params = ThreadSettingsUpdateParams {
|
||||
thread_id: thread_id.to_string(),
|
||||
personality: Some(personality),
|
||||
..ThreadSettingsUpdateParams::default()
|
||||
};
|
||||
self.send_thread_settings_update(app_server, params).await;
|
||||
}
|
||||
|
||||
pub(super) async fn sync_override_turn_context_settings(
|
||||
&mut self,
|
||||
app_server: &mut AppServerSession,
|
||||
|
||||
Reference in new issue
Block a user