Preserve null developer instructions (#16976)

Preserve explicit null developer-instruction overrides across app-server
resume and fork flows.
This commit is contained in:
Ahmed Ibrahim
2026-04-07 09:32:14 -07:00
committed by GitHub
parent feb4f0051a
commit cd591dc457
19 changed files with 121 additions and 1 deletions

View File

@@ -200,6 +200,16 @@ async fn thread_fork_honors_explicit_null_thread_instructions() -> Result<()> {
let codex_home = TempDir::new()?;
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 first_table_index = config_toml
.find("\n[")
.expect("test config must include a table header");
config_toml.insert_str(
first_table_index,
"\ndeveloper_instructions = \"Config developer instructions sentinel\"\n",
);
std::fs::write(config_path, config_toml)?;
let conversation_id = create_fake_rollout(
codex_home.path(),
@@ -323,6 +333,13 @@ async fn thread_fork_honors_explicit_null_thread_instructions() -> Result<()> {
"unexpected instructions field in payload: {payload:?}"
);
let developer_texts = request.message_input_texts("developer");
assert_eq!(
developer_texts
.iter()
.any(|text| { text.contains("Config developer instructions sentinel") }),
expect_instructions,
"unexpected config developer instruction presence: {developer_texts:?}"
);
assert!(
developer_texts.iter().all(|text| !text.is_empty()),
"did not expect empty developer instruction messages: {developer_texts:?}"