This commit is contained in:
Ahmed Ibrahim
2025-12-23 10:58:32 -08:00
parent 4775338ca2
commit 9f436b1a26
3 changed files with 12 additions and 15 deletions
+1 -1
View File
@@ -225,7 +225,7 @@ impl ContextManager {
}
fn process_item(&self, item: &ResponseItem, policy: TruncationPolicy) -> ResponseItem {
let policy_with_serialization_budget = policy * 1.2;
let policy_with_serialization_budget = policy.mul(1.2);
match item {
ResponseItem::FunctionCallOutput { call_id, output } => {
let truncated =
-14
View File
@@ -173,17 +173,3 @@ sequenceDiagram
task2->>user: Event::TurnCompleted
task2->>-user: Event::TaskCompleted
```
## Key Events
### SessionConfigured
`Event::SessionConfigured` is emitted once after `Op::ConfigureSession`.
Notable fields:
- `session_id`: the backend-assigned session identifier (historically named `session_id` for
backwards compatibility).
- `model_family`: model metadata for the model family selected for the session. This matches the
`/models` payload shape; the selected model slug is `model_family.slug`.
- `approval_policy`, `sandbox_policy`, `cwd`: the effective execution and sandbox settings for the
session.
+11
View File
@@ -1344,6 +1344,17 @@ pub enum TruncationPolicy {
Tokens(usize),
}
// Allow core to pass model-family truncation policies (defined in openai_models)
// into the TurnContext payload (defined in protocol) via `.into()`.
impl From<crate::openai_models::TruncationPolicy> for TruncationPolicy {
fn from(value: crate::openai_models::TruncationPolicy) -> Self {
match value {
crate::openai_models::TruncationPolicy::Bytes(bytes) => Self::Bytes(bytes),
crate::openai_models::TruncationPolicy::Tokens(tokens) => Self::Tokens(tokens),
}
}
}
#[derive(Serialize, Deserialize, Clone, JsonSchema)]
pub struct RolloutLine {
pub timestamp: String,