[codex] add developer instructions (#5897)

we are using developer instructions for code reviews, we need to pass
them in cli as well.
This commit is contained in:
Anton Panasenko
2025-10-30 11:18:31 -07:00
committed by GitHub
parent 4a55646a02
commit 9572cfc782
11 changed files with 192 additions and 4 deletions

View File

@@ -40,3 +40,31 @@ impl From<UserInstructions> for ResponseItem {
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[serde(rename = "developer_instructions", rename_all = "snake_case")]
pub(crate) struct DeveloperInstructions {
text: String,
}
impl DeveloperInstructions {
pub fn new<T: Into<String>>(text: T) -> Self {
Self { text: text.into() }
}
pub fn into_text(self) -> String {
self.text
}
}
impl From<DeveloperInstructions> for ResponseItem {
fn from(di: DeveloperInstructions) -> Self {
ResponseItem::Message {
id: None,
role: "developer".to_string(),
content: vec![ContentItem::InputText {
text: di.into_text(),
}],
}
}
}