codex: seed turn metadata from app-server turn start

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
nicholasclark-openai
2026-03-19 12:03:57 -07:00
co-authored by Codex
parent db3ddeae35
commit 6e8ebdc5bc
47 changed files with 911 additions and 6 deletions
+7
View File
@@ -3,6 +3,7 @@
//! Uses a SQ (Submission Queue) / EQ (Event Queue) pattern to asynchronously communicate
//! between user and agent.
use std::collections::BTreeMap;
use std::collections::HashMap;
use std::collections::HashSet;
use std::ffi::OsStr;
@@ -238,6 +239,9 @@ pub enum Op {
/// Optional JSON Schema used to constrain the final assistant message for this turn.
#[serde(skip_serializing_if = "Option::is_none")]
final_output_json_schema: Option<Value>,
/// Optional metadata attached only to this turn.
#[serde(default, skip_serializing_if = "Option::is_none")]
metadata: Option<BTreeMap<String, String>>,
},
/// Similar to [`Op::UserInput`], but contains additional context required
@@ -4256,6 +4260,7 @@ mod tests {
let op = Op::UserInput {
items: Vec::new(),
final_output_json_schema: None,
metadata: None,
};
let json_op = serde_json::to_value(op)?;
@@ -4273,6 +4278,7 @@ mod tests {
Op::UserInput {
items: Vec::new(),
final_output_json_schema: None,
metadata: None,
}
);
@@ -4292,6 +4298,7 @@ mod tests {
let op = Op::UserInput {
items: Vec::new(),
final_output_json_schema: Some(schema.clone()),
metadata: None,
};
let json_op = serde_json::to_value(op)?;