mirror of
https://github.com/openai/codex.git
synced 2026-11-12 21:20:34 +00:00
Register the transcript v2 feature flag (#40554)
## What changed - Add the under-development `transcript_v2` feature for the interactive transcript composer and turn-selection UI. - Keep it disabled by default and expose it through the configuration schema and `codex features enable transcript_v2`. ## Testing - Verify explicit configuration overrides and CLI persistence for the new feature. GitOrigin-RevId: 138ab7851621c066e8121cc3eb6cd4e7299f9c31
This commit is contained in:
committed by
copyberry
parent
8444cf63b5
commit
4347f94d55
@@ -133,15 +133,19 @@ fn strict_config_is_not_supported_for_cloud_command() -> Result<()> {
|
||||
async fn features_enable_writes_feature_flag_to_config() -> Result<()> {
|
||||
let codex_home = TempDir::new()?;
|
||||
|
||||
let mut cmd = codex_command(codex_home.path())?;
|
||||
cmd.args(["features", "enable", "unified_exec"])
|
||||
.assert()
|
||||
.success()
|
||||
.stdout(contains("Enabled feature `unified_exec` in config.toml."));
|
||||
for feature in ["unified_exec", "transcript_v2"] {
|
||||
let mut cmd = codex_command(codex_home.path())?;
|
||||
cmd.args(["features", "enable", feature])
|
||||
.assert()
|
||||
.success()
|
||||
.stdout(contains(format!(
|
||||
"Enabled feature `{feature}` in config.toml."
|
||||
)));
|
||||
|
||||
let config = std::fs::read_to_string(codex_home.path().join("config.toml"))?;
|
||||
assert!(config.contains("[features]"));
|
||||
assert!(config.contains("unified_exec = true"));
|
||||
let config = std::fs::read_to_string(codex_home.path().join("config.toml"))?;
|
||||
assert!(config.contains("[features]"));
|
||||
assert!(config.contains(&format!("{feature} = true")));
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -931,6 +931,9 @@
|
||||
"tool_suggest": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"transcript_v2": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"tui_app_server": {
|
||||
"type": "boolean"
|
||||
},
|
||||
@@ -5934,6 +5937,9 @@
|
||||
"tool_suggest": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"transcript_v2": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"tui_app_server": {
|
||||
"type": "boolean"
|
||||
},
|
||||
|
||||
@@ -88,6 +88,8 @@ impl Stage {
|
||||
/// Unique features toggled via configuration.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub enum Feature {
|
||||
/// Enable the interactive transcript composer and turn-selection UI.
|
||||
TranscriptV2,
|
||||
// Stable.
|
||||
/// Enable the default shell tool.
|
||||
ShellTool,
|
||||
@@ -834,6 +836,12 @@ pub struct FeatureSpec {
|
||||
}
|
||||
|
||||
pub const FEATURES: &[FeatureSpec] = &[
|
||||
FeatureSpec {
|
||||
id: Feature::TranscriptV2,
|
||||
key: "transcript_v2",
|
||||
stage: Stage::UnderDevelopment,
|
||||
default_enabled: false,
|
||||
},
|
||||
// Stable features.
|
||||
FeatureSpec {
|
||||
id: Feature::GhostCommit,
|
||||
|
||||
@@ -14,6 +14,15 @@ use std::collections::BTreeMap;
|
||||
use toml::Table;
|
||||
use toml::Value as TomlValue;
|
||||
|
||||
#[test]
|
||||
fn transcript_v2_resolves_explicit_config_overrides() {
|
||||
let mut features = Features::with_defaults();
|
||||
for enabled in [false, true, false] {
|
||||
features.apply_map(&BTreeMap::from([("transcript_v2".to_string(), enabled)]));
|
||||
assert_eq!(features.enabled(Feature::TranscriptV2), enabled);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn under_development_features_are_disabled_by_default() {
|
||||
for spec in crate::FEATURES {
|
||||
|
||||
Reference in New Issue
Block a user