chore: prep memories for AB (#18973)

This commit is contained in:
jif-oai
2026-04-22 11:46:15 +01:00
committed by GitHub
parent ddf65c9647
commit 65420737e8
2 changed files with 21 additions and 9 deletions

View File

@@ -129,18 +129,20 @@ async fn experimental_feature_enablement_set_does_not_override_user_config() ->
let codex_home = TempDir::new()?;
std::fs::write(
codex_home.path().join("config.toml"),
"[features]\napps = false\n",
"[features]\nmemories = false\n",
)?;
let mut mcp = McpProcess::new(codex_home.path()).await?;
timeout(DEFAULT_TIMEOUT, mcp.initialize()).await??;
let actual =
set_experimental_feature_enablement(&mut mcp, BTreeMap::from([("apps".to_string(), true)]))
.await?;
let actual = set_experimental_feature_enablement(
&mut mcp,
BTreeMap::from([("memories".to_string(), true)]),
)
.await?;
assert_eq!(
actual,
ExperimentalFeatureEnablementSetResponse {
enablement: BTreeMap::from([("apps".to_string(), true)]),
enablement: BTreeMap::from([("memories".to_string(), true)]),
}
);
@@ -150,7 +152,7 @@ async fn experimental_feature_enablement_set_does_not_override_user_config() ->
config
.additional
.get("features")
.and_then(|features| features.get("apps")),
.and_then(|features| features.get("memories")),
Some(&json!(false))
);
@@ -168,6 +170,7 @@ async fn experimental_feature_enablement_set_only_updates_named_features() -> Re
let actual = set_experimental_feature_enablement(
&mut mcp,
BTreeMap::from([
("memories".to_string(), true),
("plugins".to_string(), true),
("tool_search".to_string(), true),
("tool_suggest".to_string(), true),
@@ -180,6 +183,7 @@ async fn experimental_feature_enablement_set_only_updates_named_features() -> Re
actual,
ExperimentalFeatureEnablementSetResponse {
enablement: BTreeMap::from([
("memories".to_string(), true),
("plugins".to_string(), true),
("tool_search".to_string(), true),
("tool_suggest".to_string(), true),
@@ -197,6 +201,13 @@ async fn experimental_feature_enablement_set_only_updates_named_features() -> Re
.and_then(|features| features.get("apps")),
Some(&json!(true))
);
assert_eq!(
config
.additional
.get("features")
.and_then(|features| features.get("memories")),
Some(&json!(true))
);
assert_eq!(
config
.additional
@@ -285,9 +296,9 @@ async fn experimental_feature_enablement_set_rejects_non_allowlisted_feature() -
error.message
);
assert!(
error
.message
.contains("apps, plugins, tool_search, tool_suggest, tool_call_mcp_elicitation"),
error.message.contains(
"apps, memories, plugins, tool_search, tool_suggest, tool_call_mcp_elicitation"
),
"{}",
error.message
);