mirror of
https://github.com/openai/codex.git
synced 2026-11-05 20:10:33 +00:00
## What changed - Build Responses Lite base instructions through a dedicated context fragment so the developer message carries the `model.base_instructions` content kind. - Apply provider metadata cleanup after adding the base-instructions message, preserving the existing behavior for non-OpenAI providers. ## Testing - Extend Responses Lite request coverage to verify the annotation is present for OpenAI requests and omitted for a third-party provider. GitOrigin-RevId: b0317f92dfb9570860688b49e3a7668da516ee8c
32 lines
729 B
Rust
32 lines
729 B
Rust
use super::ContextualUserFragment;
|
|
use codex_protocol::models::ContentItemKind;
|
|
|
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
|
pub(crate) struct BaseInstructionsFragment(pub(crate) String);
|
|
|
|
impl ContextualUserFragment for BaseInstructionsFragment {
|
|
fn content_kind(&self) -> ContentItemKind {
|
|
ContentItemKind("model.base_instructions".to_string())
|
|
}
|
|
|
|
fn role(&self) -> &'static str {
|
|
"developer"
|
|
}
|
|
|
|
fn requires_separate_message(&self) -> bool {
|
|
true
|
|
}
|
|
|
|
fn markers(&self) -> (&'static str, &'static str) {
|
|
Self::type_markers()
|
|
}
|
|
|
|
fn type_markers() -> (&'static str, &'static str) {
|
|
("", "")
|
|
}
|
|
|
|
fn body(&self) -> String {
|
|
self.0.clone()
|
|
}
|
|
}
|