mirror of
https://github.com/openai/codex.git
synced 2026-11-05 16:29:31 +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:
1 parent
8444cf63b5
commit
4347f94d55
4 files changed
+35
-8
No files matched your search
@@ -133,15 +133,19 @@ fn strict_config_is_not_supported_for_cloud_command() -> Result<()> {
|
|||||||
async fn features_enable_writes_feature_flag_to_config() -> Result<()> {
|
async fn features_enable_writes_feature_flag_to_config() -> Result<()> {
|
||||||
let codex_home = TempDir::new()?;
|
let codex_home = TempDir::new()?;
|
||||||
|
|
||||||
let mut cmd = codex_command(codex_home.path())?;
|
for feature in ["unified_exec", "transcript_v2"] {
|
||||||
cmd.args(["features", "enable", "unified_exec"])
|
let mut cmd = codex_command(codex_home.path())?;
|
||||||
.assert()
|
cmd.args(["features", "enable", feature])
|
||||||
.success()
|
.assert()
|
||||||
.stdout(contains("Enabled feature `unified_exec` in config.toml."));
|
.success()
|
||||||
|
.stdout(contains(format!(
|
||||||
|
"Enabled feature `{feature}` in config.toml."
|
||||||
|
)));
|
||||||
|
|
||||||
let config = std::fs::read_to_string(codex_home.path().join("config.toml"))?;
|
let config = std::fs::read_to_string(codex_home.path().join("config.toml"))?;
|
||||||
assert!(config.contains("[features]"));
|
assert!(config.contains("[features]"));
|
||||||
assert!(config.contains("unified_exec = true"));
|
assert!(config.contains(&format!("{feature} = true")));
|
||||||
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -931,6 +931,9 @@
|
|||||||
"tool_suggest": {
|
"tool_suggest": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
|
"transcript_v2": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
"tui_app_server": {
|
"tui_app_server": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
@@ -5934,6 +5937,9 @@
|
|||||||
"tool_suggest": {
|
"tool_suggest": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
|
"transcript_v2": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
"tui_app_server": {
|
"tui_app_server": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -88,6 +88,8 @@ impl Stage {
|
|||||||
/// Unique features toggled via configuration.
|
/// Unique features toggled via configuration.
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||||
pub enum Feature {
|
pub enum Feature {
|
||||||
|
/// Enable the interactive transcript composer and turn-selection UI.
|
||||||
|
TranscriptV2,
|
||||||
// Stable.
|
// Stable.
|
||||||
/// Enable the default shell tool.
|
/// Enable the default shell tool.
|
||||||
ShellTool,
|
ShellTool,
|
||||||
@@ -834,6 +836,12 @@ pub struct FeatureSpec {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub const FEATURES: &[FeatureSpec] = &[
|
pub const FEATURES: &[FeatureSpec] = &[
|
||||||
|
FeatureSpec {
|
||||||
|
id: Feature::TranscriptV2,
|
||||||
|
key: "transcript_v2",
|
||||||
|
stage: Stage::UnderDevelopment,
|
||||||
|
default_enabled: false,
|
||||||
|
},
|
||||||
// Stable features.
|
// Stable features.
|
||||||
FeatureSpec {
|
FeatureSpec {
|
||||||
id: Feature::GhostCommit,
|
id: Feature::GhostCommit,
|
||||||
|
|||||||
@@ -14,6 +14,15 @@ use std::collections::BTreeMap;
|
|||||||
use toml::Table;
|
use toml::Table;
|
||||||
use toml::Value as TomlValue;
|
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]
|
#[test]
|
||||||
fn under_development_features_are_disabled_by_default() {
|
fn under_development_features_are_disabled_by_default() {
|
||||||
for spec in crate::FEATURES {
|
for spec in crate::FEATURES {
|
||||||
|
|||||||
Reference in new issue
Block a user