diff --git a/codex-rs/core/src/context_manager/history.rs b/codex-rs/core/src/context_manager/history.rs index d92d5b9a0d..5ad389f6c5 100644 --- a/codex-rs/core/src/context_manager/history.rs +++ b/codex-rs/core/src/context_manager/history.rs @@ -225,7 +225,7 @@ impl ContextManager { } fn process_item(&self, item: &ResponseItem, policy: TruncationPolicy) -> ResponseItem { - let policy_with_serialization_budget = policy.mul(1.2); + let policy_with_serialization_budget = policy * 1.2; match item { ResponseItem::FunctionCallOutput { call_id, output } => { let truncated = diff --git a/codex-rs/docs/protocol_v1.md b/codex-rs/docs/protocol_v1.md index 805abb0ea8..7b373a34fc 100644 --- a/codex-rs/docs/protocol_v1.md +++ b/codex-rs/docs/protocol_v1.md @@ -173,3 +173,17 @@ 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. diff --git a/codex-rs/tui2/src/lib.rs b/codex-rs/tui2/src/lib.rs index e31194b5b8..7ab9fa7751 100644 --- a/codex-rs/tui2/src/lib.rs +++ b/codex-rs/tui2/src/lib.rs @@ -58,6 +58,8 @@ pub mod live_wrap; mod markdown; mod markdown_render; mod markdown_stream; +// Model migration prompt UI is no longer used in production; keep it for snapshot tests. +#[cfg(test)] mod model_migration; mod notifications; pub mod onboarding; diff --git a/codex-rs/tui2/src/model_migration.rs b/codex-rs/tui2/src/model_migration.rs index 0b74ad40a5..6e1b7e3c13 100644 --- a/codex-rs/tui2/src/model_migration.rs +++ b/codex-rs/tui2/src/model_migration.rs @@ -1,9 +1,12 @@ +#![allow(dead_code)] + use crate::key_hint; use crate::render::Insets; use crate::render::renderable::ColumnRenderable; use crate::render::renderable::Renderable; use crate::render::renderable::RenderableExt as _; use crate::selection_list::selection_option_row; + use crate::tui::FrameRequester; use crate::tui::Tui; use crate::tui::TuiEvent; diff --git a/codex-rs/tui2/src/test_backend.rs b/codex-rs/tui2/src/test_backend.rs index 47f17e6b93..7fa0e3fdb7 100644 --- a/codex-rs/tui2/src/test_backend.rs +++ b/codex-rs/tui2/src/test_backend.rs @@ -25,7 +25,8 @@ pub struct VT100Backend { impl VT100Backend { /// Creates a new `TestBackend` with the specified width and height. pub fn new(width: u16, height: u16) -> Self { - crossterm::style::Colored::set_ansi_color_disabled(false); + // Force ANSI color output even when the writer isn't a real TTY (e.g., vt100::Parser in tests). + crossterm::style::force_color_output(true); Self { crossterm_backend: CrosstermBackend::new(vt100::Parser::new(height, width, 0)), }