mirror of
https://github.com/openai/codex.git
synced 2026-05-01 09:56:37 +00:00
chore: prep memories for AB (#18973)
This commit is contained in:
@@ -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
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user