mirror of
https://github.com/openai/codex.git
synced 2026-11-29 00:00:54 +00:00
Preserve login shell default in config reads
This commit is contained in:
@@ -131,6 +131,7 @@ impl ConfigManager {
|
||||
layers
|
||||
.requirements_toml()
|
||||
.apply_exact_to_config(&mut effective_config_toml);
|
||||
effective_config_toml.allow_login_shell.get_or_insert(true);
|
||||
|
||||
let json_value = serde_json::to_value(&effective_config_toml)
|
||||
.map_err(|err| ConfigManagerError::json("failed to serialize configuration", err))?;
|
||||
|
||||
@@ -807,6 +807,26 @@ async fn read_reflects_exact_managed_requirement() {
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn read_materializes_default_allow_login_shell() {
|
||||
let tmp = tempdir().expect("tempdir");
|
||||
std::fs::write(tmp.path().join(CONFIG_TOML_FILE), "").unwrap();
|
||||
|
||||
let service = ConfigManager::without_managed_config_for_tests(tmp.path().to_path_buf());
|
||||
let response = service
|
||||
.read(ConfigReadParams {
|
||||
include_layers: false,
|
||||
cwd: None,
|
||||
})
|
||||
.await
|
||||
.expect("config read should succeed");
|
||||
|
||||
assert_eq!(
|
||||
response.config.additional.get("allow_login_shell"),
|
||||
Some(&serde_json::json!(true))
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn write_value_allows_unmanaged_sibling_of_exact_requirement() {
|
||||
let tmp = tempdir().expect("tempdir");
|
||||
|
||||
Reference in New Issue
Block a user