mirror of
https://github.com/openai/codex.git
synced 2026-04-28 18:32:04 +03:00
fix(app-server) revert null instructions changes (#17047)
This commit is contained in:
@@ -48,8 +48,6 @@ use crate::plan_tool::UpdatePlanArgs;
|
||||
use crate::request_permissions::RequestPermissionsEvent;
|
||||
use crate::request_permissions::RequestPermissionsResponse;
|
||||
use crate::request_user_input::RequestUserInputResponse;
|
||||
use crate::serde_helpers::deserialize_double_option;
|
||||
use crate::serde_helpers::serialize_double_option;
|
||||
use crate::user_input::UserInput;
|
||||
use codex_git_utils::GitSha;
|
||||
use codex_utils_absolute_path::AbsolutePathBuf;
|
||||
@@ -2320,7 +2318,7 @@ impl InitialHistory {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_base_instructions(&self) -> Option<Option<BaseInstructions>> {
|
||||
pub fn get_base_instructions(&self) -> Option<BaseInstructions> {
|
||||
// TODO: SessionMeta should (in theory) always be first in the history, so we can probably only check the first item?
|
||||
match self {
|
||||
InitialHistory::New => None,
|
||||
@@ -2337,26 +2335,6 @@ impl InitialHistory {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_developer_instructions(&self) -> Option<Option<String>> {
|
||||
match self {
|
||||
InitialHistory::New => None,
|
||||
InitialHistory::Resumed(resumed) => {
|
||||
resumed.history.iter().find_map(|item| match item {
|
||||
RolloutItem::SessionMeta(meta_line) => {
|
||||
meta_line.meta.developer_instructions.clone()
|
||||
}
|
||||
_ => None,
|
||||
})
|
||||
}
|
||||
InitialHistory::Forked(items) => items.iter().find_map(|item| match item {
|
||||
RolloutItem::SessionMeta(meta_line) => {
|
||||
meta_line.meta.developer_instructions.clone()
|
||||
}
|
||||
_ => None,
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_dynamic_tools(&self) -> Option<Vec<DynamicToolSpec>> {
|
||||
match self {
|
||||
InitialHistory::New => None,
|
||||
@@ -2548,20 +2526,7 @@ pub struct SessionMeta {
|
||||
/// base_instructions for the session. This *should* always be present when creating a new session,
|
||||
/// but may be missing for older sessions. If not present, fall back to rendering the base_instructions
|
||||
/// from ModelsManager.
|
||||
#[serde(
|
||||
default,
|
||||
deserialize_with = "deserialize_double_option",
|
||||
serialize_with = "serialize_double_option",
|
||||
skip_serializing_if = "Option::is_none"
|
||||
)]
|
||||
pub base_instructions: Option<Option<BaseInstructions>>,
|
||||
#[serde(
|
||||
default,
|
||||
deserialize_with = "deserialize_double_option",
|
||||
serialize_with = "serialize_double_option",
|
||||
skip_serializing_if = "Option::is_none"
|
||||
)]
|
||||
pub developer_instructions: Option<Option<String>>,
|
||||
pub base_instructions: Option<BaseInstructions>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub dynamic_tools: Option<Vec<DynamicToolSpec>>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
@@ -2583,7 +2548,6 @@ impl Default for SessionMeta {
|
||||
agent_path: None,
|
||||
model_provider: None,
|
||||
base_instructions: None,
|
||||
developer_instructions: None,
|
||||
dynamic_tools: None,
|
||||
memory_mode: None,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user