mirror of
https://github.com/openai/codex.git
synced 2026-04-27 08:05:51 +00:00
Add stage field for experimental flags. (#10793)
- [x] Add stage field for experimental flags.
This commit is contained in:
@@ -6,6 +6,7 @@ use app_test_support::to_response;
|
||||
use codex_app_server_protocol::ExperimentalFeature;
|
||||
use codex_app_server_protocol::ExperimentalFeatureListParams;
|
||||
use codex_app_server_protocol::ExperimentalFeatureListResponse;
|
||||
use codex_app_server_protocol::ExperimentalFeatureStage;
|
||||
use codex_app_server_protocol::JSONRPCResponse;
|
||||
use codex_app_server_protocol::RequestId;
|
||||
use codex_core::features::FEATURES;
|
||||
@@ -17,7 +18,7 @@ use tokio::time::timeout;
|
||||
const DEFAULT_TIMEOUT: Duration = Duration::from_secs(10);
|
||||
|
||||
#[tokio::test]
|
||||
async fn experimental_feature_list_returns_experimental_feature_metadata() -> Result<()> {
|
||||
async fn experimental_feature_list_returns_feature_metadata_with_stage() -> Result<()> {
|
||||
let codex_home = TempDir::new()?;
|
||||
let mut mcp = McpProcess::new(codex_home.path()).await?;
|
||||
|
||||
@@ -36,24 +37,35 @@ async fn experimental_feature_list_returns_experimental_feature_metadata() -> Re
|
||||
let actual = to_response::<ExperimentalFeatureListResponse>(response)?;
|
||||
let expected_data = FEATURES
|
||||
.iter()
|
||||
.filter_map(|spec| {
|
||||
let Stage::Experimental {
|
||||
name,
|
||||
menu_description,
|
||||
announcement,
|
||||
} = spec.stage
|
||||
else {
|
||||
return None;
|
||||
.map(|spec| {
|
||||
let (stage, display_name, description, announcement) = match spec.stage {
|
||||
Stage::Experimental {
|
||||
name,
|
||||
menu_description,
|
||||
announcement,
|
||||
} => (
|
||||
ExperimentalFeatureStage::Beta,
|
||||
Some(name.to_string()),
|
||||
Some(menu_description.to_string()),
|
||||
Some(announcement.to_string()),
|
||||
),
|
||||
Stage::UnderDevelopment => {
|
||||
(ExperimentalFeatureStage::UnderDevelopment, None, None, None)
|
||||
}
|
||||
Stage::Stable => (ExperimentalFeatureStage::Stable, None, None, None),
|
||||
Stage::Deprecated => (ExperimentalFeatureStage::Deprecated, None, None, None),
|
||||
Stage::Removed => (ExperimentalFeatureStage::Removed, None, None, None),
|
||||
};
|
||||
|
||||
Some(ExperimentalFeature {
|
||||
flag_name: spec.key.to_string(),
|
||||
display_name: name.to_string(),
|
||||
description: menu_description.to_string(),
|
||||
announcement: announcement.to_string(),
|
||||
ExperimentalFeature {
|
||||
name: spec.key.to_string(),
|
||||
stage,
|
||||
display_name,
|
||||
description,
|
||||
announcement,
|
||||
enabled: spec.default_enabled,
|
||||
default_enabled: spec.default_enabled,
|
||||
})
|
||||
}
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
let expected = ExperimentalFeatureListResponse {
|
||||
|
||||
Reference in New Issue
Block a user