Retire the personality feature flag and document deprecated settings (#45809)

## What changed

- Accept and ignore `features.personality` in user configuration, profiles, and managed requirements.
- Remove feature gating from `personality = "none"`, which strips the literal `# Personality` section when preparing model catalog instructions. Preserve explicit base instructions and existing thread instructions.
- Document deprecated personality fields in configuration, app-server schemas, and the Python SDK: `friendly` and `pragmatic` no longer select a style, and `supportsPersonality` is always `false`.

## Testing

Add regression coverage for ignored legacy flag values and managed requirements, personality opt-out behavior with the flag absent or set to either value, role overrides, and preservation of explicit base instructions, including empty strings.

GitOrigin-RevId: 4e12c66b42bfc59d6f151a5b3c28fadc6654ae99
This commit is contained in:
rhan-oai authored and copyberry committed 2026-09-15 23:39:40 +00:00
1 parent 4d2807023a
commit 883af106b9
54 files changed
+389 -264

No files matched your search

+3 -14
View File
@@ -181,14 +181,8 @@ async fn first_turn_model_change_appends_model_instructions_developer_message(
let server = MockServer::start().await;
let resp_mock = mount_sse_once(&server, sse_completed("resp-1")).await;
let mut builder = test_codex()
.with_model_info_override("gpt-5.6-terra", configure_model_switching_fixture)
.with_config(|config| {
config
.features
.enable(Feature::Personality)
.expect("test config should allow feature update");
});
let mut builder =
test_codex().with_model_info_override("gpt-5.6-terra", configure_model_switching_fixture);
let test = builder.build_with_auto_env(&server).await?;
let next_model = "gpt-5.5";
@@ -401,12 +395,7 @@ async fn model_change_with_legacy_personality_override_only_appends_model_instru
)
.await;
let mut builder = test_codex().with_model("gpt-5.5").with_config(|config| {
config
.features
.enable(Feature::Personality)
.expect("test config should allow feature update");
});
let mut builder = test_codex().with_model("gpt-5.5");
let test = builder.build(&server).await?;
let next_model = "exp-codex-personality";
@@ -549,10 +549,6 @@ async fn snapshot_model_visible_layout_resume_with_personality_change() -> Resul
.with_config(|config| {
config.update_plan_enabled = true;
config.model = Some("gpt-5.4".to_string());
config
.features
.enable(Feature::Personality)
.expect("test config should allow feature update");
config.personality = Some(Personality::Pragmatic);
});
let resumed = resume_builder.restart(&server, &initial).await?;
+21 -29
View File
@@ -1,6 +1,5 @@
use codex_config::types::Personality;
use codex_core::TurnInputRequest;
use codex_features::Feature;
use codex_protocol::config_types::CollaborationMode;
use codex_protocol::config_types::ModeKind;
use codex_protocol::config_types::Settings;
@@ -64,10 +63,6 @@ async fn config_personality_none_sends_no_personality() -> anyhow::Result<()> {
let server = start_mock_server().await;
let resp_mock = mount_sse_once(&server, sse_completed("resp-1")).await;
let mut builder = test_codex().with_model("gpt-5.5").with_config(|config| {
config
.features
.enable(Feature::Personality)
.expect("test config should allow feature update");
config.personality = Some(Personality::None);
});
let test = builder.build(&server).await?;
@@ -106,8 +101,13 @@ async fn config_personality_none_sends_no_personality() -> anyhow::Result<()> {
Ok(())
}
#[test_case(None; "without feature config")]
#[test_case(Some(false); "with removed feature disabled")]
#[test_case(Some(true); "with removed feature enabled")]
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn config_personality_none_strips_baked_personality_section() -> anyhow::Result<()> {
async fn config_personality_none_strips_baked_personality_section(
legacy_feature_setting: Option<bool>,
) -> anyhow::Result<()> {
skip_if_no_network!(Ok(()));
let server = start_mock_server().await;
@@ -119,14 +119,14 @@ async fn config_personality_none_strips_baked_personality_section() -> anyhow::R
model_messages.instructions_variables = None;
}
})
.with_config(|config| {
config
.features
.enable(Feature::Personality)
.expect("test config should allow feature update");
config.personality = Some(Personality::None);
.with_pre_build_hook(move |home| {
let mut config = "personality = \"none\"\n".to_string();
if let Some(value) = legacy_feature_setting {
config.push_str(&format!("[features]\npersonality = {value}\n"));
}
std::fs::write(home.join("config.toml"), config).expect("write personality config");
});
let test = builder.build(&server).await?;
let test = builder.build_with_auto_env(&server).await?;
test.codex
.start_or_steer_turn(read_only_text_turn(
@@ -152,7 +152,7 @@ async fn config_personality_none_strips_baked_personality_section() -> anyhow::R
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn config_personality_none_preserves_explicit_base_instructions(
custom_instructions: &'static str,
personality_enabled: bool,
legacy_feature_setting: bool,
) -> anyhow::Result<()> {
skip_if_no_network!(Ok(()));
@@ -160,12 +160,13 @@ async fn config_personality_none_preserves_explicit_base_instructions(
let resp_mock = mount_sse_once(&server, sse_completed("resp-1")).await;
let mut builder = test_codex()
.with_model("gpt-5.5")
.with_pre_build_hook(move |home| {
let config = format!(
"personality = \"none\"\n[features]\npersonality = {legacy_feature_setting}\n"
);
std::fs::write(home.join("config.toml"), config).expect("write personality config");
})
.with_config(move |config| {
config
.features
.set_enabled(Feature::Personality, personality_enabled)
.expect("test config should allow feature update");
config.personality = Some(Personality::None);
config.base_instructions = Some(custom_instructions.to_string());
});
let test = builder.build_with_auto_env(&server).await?;
@@ -198,12 +199,7 @@ async fn default_instructions_are_friendly_without_config_toml() -> anyhow::Resu
let server = start_mock_server().await;
let resp_mock = mount_sse_once(&server, sse_completed("resp-1")).await;
let mut builder = test_codex().with_model("gpt-5.5").with_config(|config| {
config
.features
.enable(Feature::Personality)
.expect("test config should allow feature update");
});
let mut builder = test_codex().with_model("gpt-5.5");
let test = builder.build(&server).await?;
assert_eq!(test.config.personality, None);
@@ -245,10 +241,6 @@ async fn fixed_friendly_personality_ignores_pragmatic_update(
)
.await;
let mut builder = test_codex().with_model(model).with_config(|config| {
config
.features
.enable(Feature::Personality)
.expect("test config should allow feature update");
config.personality = Some(Personality::Friendly);
});
let test = builder.build_with_auto_env(&server).await?;