mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
Preserve null developer instructions (#16976)
Preserve explicit null developer-instruction overrides across app-server resume and fork flows.
This commit is contained in:
committed by
GitHub
Unverified
parent
feb4f0051a
commit
cd591dc457
@@ -615,6 +615,14 @@ impl Codex {
|
||||
dynamic_tools
|
||||
};
|
||||
|
||||
let developer_instructions_override = config
|
||||
.developer_instructions_override
|
||||
.clone()
|
||||
.or_else(|| conversation_history.get_developer_instructions());
|
||||
let developer_instructions = developer_instructions_override
|
||||
.clone()
|
||||
.unwrap_or_else(|| config.developer_instructions.clone());
|
||||
|
||||
// TODO (aibrahim): Consolidate config.model and config.model_reasoning_effort into config.collaboration_mode
|
||||
// to avoid extracting these fields separately and constructing CollaborationMode here.
|
||||
let collaboration_mode = CollaborationMode {
|
||||
@@ -630,7 +638,8 @@ impl Codex {
|
||||
collaboration_mode,
|
||||
model_reasoning_summary: config.model_reasoning_summary,
|
||||
service_tier: config.service_tier,
|
||||
developer_instructions: config.developer_instructions.clone(),
|
||||
developer_instructions,
|
||||
developer_instructions_override,
|
||||
user_instructions,
|
||||
personality: config.personality,
|
||||
base_instructions,
|
||||
@@ -1095,6 +1104,10 @@ pub(crate) struct SessionConfiguration {
|
||||
/// Developer instructions that supplement the base instructions.
|
||||
developer_instructions: Option<String>,
|
||||
|
||||
/// Explicit developer instructions override, preserving `null` as distinct
|
||||
/// from a missing override.
|
||||
developer_instructions_override: Option<Option<String>>,
|
||||
|
||||
/// Model instructions that are appended to the base instructions.
|
||||
user_instructions: Option<String>,
|
||||
|
||||
@@ -1545,6 +1558,9 @@ impl Session {
|
||||
.base_instructions
|
||||
.clone()
|
||||
.map(|text| BaseInstructions { text }),
|
||||
session_configuration
|
||||
.developer_instructions_override
|
||||
.clone(),
|
||||
session_configuration.dynamic_tools.clone(),
|
||||
if session_configuration.persist_extended_history {
|
||||
EventPersistenceMode::Extended
|
||||
|
||||
Reference in New Issue
Block a user