mirror of
https://github.com/openai/codex.git
synced 2026-04-24 14:45:27 +00:00
codex: keep test developer instructions at config root (#16976)
This commit is contained in:
@@ -202,12 +202,11 @@ async fn thread_fork_honors_explicit_null_thread_instructions() -> Result<()> {
|
||||
create_config_toml(codex_home.path(), &server.uri())?;
|
||||
let config_path = codex_home.path().join("config.toml");
|
||||
let mut config_toml = std::fs::read_to_string(&config_path)?;
|
||||
let provider_table = "\n[model_providers.mock_provider]";
|
||||
let provider_table_index = config_toml
|
||||
.find(provider_table)
|
||||
.expect("test config must include mock provider table");
|
||||
let first_table_index = config_toml
|
||||
.find("\n[")
|
||||
.expect("test config must include a table header");
|
||||
config_toml.insert_str(
|
||||
provider_table_index,
|
||||
first_table_index,
|
||||
"\ndeveloper_instructions = \"Config developer instructions sentinel\"\n",
|
||||
);
|
||||
std::fs::write(config_path, config_toml)?;
|
||||
|
||||
@@ -168,12 +168,11 @@ async fn turn_start_honors_explicit_null_thread_instructions() -> Result<()> {
|
||||
create_config_toml(codex_home.path(), &server.uri(), "never", &BTreeMap::new())?;
|
||||
let config_path = codex_home.path().join("config.toml");
|
||||
let mut config_toml = std::fs::read_to_string(&config_path)?;
|
||||
let provider_table = "\n[model_providers.mock_provider]";
|
||||
let provider_table_index = config_toml
|
||||
.find(provider_table)
|
||||
.expect("test config must include mock provider table");
|
||||
let first_table_index = config_toml
|
||||
.find("\n[")
|
||||
.expect("test config must include a table header");
|
||||
config_toml.insert_str(
|
||||
provider_table_index,
|
||||
first_table_index,
|
||||
"\ndeveloper_instructions = \"Config developer instructions sentinel\"\n",
|
||||
);
|
||||
std::fs::write(config_path, config_toml)?;
|
||||
|
||||
Reference in New Issue
Block a user