mirror of
https://github.com/openai/codex.git
synced 2026-10-21 17:48:44 +00:00
inline model instructions in initial context
This commit is contained in:
@@ -3035,6 +3035,10 @@ pub struct TurnContextNetworkItem {
|
||||
pub struct TurnContextItem {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub turn_id: Option<String>,
|
||||
/// Whether base model instructions are present in the model input as a developer message.
|
||||
/// Missing values come from legacy rollouts that used the top-level Responses API field.
|
||||
#[serde(default, skip_serializing_if = "std::ops::Not::not")]
|
||||
pub inline_instructions: bool,
|
||||
pub cwd: AbsolutePathBuf,
|
||||
/// Effective workspace roots used to materialize symbolic
|
||||
/// `:workspace_roots` filesystem permissions in `permission_profile`.
|
||||
@@ -5372,6 +5376,7 @@ mod tests {
|
||||
assert_eq!(item.network, None);
|
||||
assert_eq!(item.file_system_sandbox_policy, None);
|
||||
assert_eq!(item.comp_hash, None);
|
||||
assert!(!item.inline_instructions);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -5437,6 +5442,7 @@ mod tests {
|
||||
fn turn_context_item_serializes_network_when_present() -> Result<()> {
|
||||
let item = TurnContextItem {
|
||||
turn_id: None,
|
||||
inline_instructions: true,
|
||||
cwd: test_path_buf("/tmp").abs(),
|
||||
workspace_roots: None,
|
||||
current_date: None,
|
||||
@@ -5468,6 +5474,7 @@ mod tests {
|
||||
};
|
||||
|
||||
let value = serde_json::to_value(item)?;
|
||||
assert_eq!(value["inline_instructions"], true);
|
||||
assert_eq!(
|
||||
value["network"],
|
||||
json!({
|
||||
|
||||
Reference in New Issue
Block a user