mirror of
https://github.com/openai/codex.git
synced 2026-11-09 00:39:32 +00:00
## What changed - Update the status heading from the latest usable reasoning line and retain it through tool activity and empty reasoning items. Keep completed reasoning in the expanded transcript only. - Restore active reasoning after resume, thread switches, and session refreshes, including when earlier events have left the replay buffer. - Default new embedded TUI threads to `model_reasoning_summary = "detailed"`, honoring explicit summary settings. Keep `concurrent_reasoning_summaries` opt-in and disable it when summaries are `none`. - Persist the request's captured reasoning summary setting in context updates and local and remote compaction checkpoints. - Animate status text with a smooth, grapheme-aware shimmer that respects terminal colors and reduced motion. ## Testing Add regression coverage for reasoning status updates, transcript visibility, resume and buffered replay, outbound summary configuration, and summary settings across all three compaction modes. Add shimmer snapshots and checks for smooth brightness changes and Unicode grapheme preservation. GitOrigin-RevId: 725c7de20f23166d7a3da6daeca617add5cbc600
47 lines
2.2 KiB
Rust
47 lines
2.2 KiB
Rust
//! Request-scoped settings and capabilities, including the durable context snapshot.
|
|
|
|
use std::sync::Arc;
|
|
|
|
use crate::agents_md::LoadedAgentsMd;
|
|
use crate::config::TokenBudgetConfig;
|
|
use crate::environment_selection::TurnEnvironmentSnapshot;
|
|
use crate::session::step_settings::ResolvedStepSettings;
|
|
use crate::session::turn_context::TurnContext;
|
|
use crate::tools::router::ToolRouter;
|
|
use codex_exec_server::ExecutorCapabilityDiscoverySnapshot;
|
|
use codex_exec_server::ResolvedSelectedCapabilityRoot;
|
|
use codex_mcp::McpBinding;
|
|
use codex_otel::SessionTelemetry;
|
|
use codex_protocol::protocol::TurnContextItem;
|
|
|
|
/// Request-scoped state that may change between model sampling requests.
|
|
pub(crate) struct StepContext {
|
|
pub(crate) turn: Arc<TurnContext>,
|
|
/// One immutable settings version captured before request preparation.
|
|
pub(crate) settings: Arc<ResolvedStepSettings>,
|
|
/// Frozen turn preferences resolved against this step's captured model.
|
|
pub(crate) token_budget: Option<TokenBudgetConfig>,
|
|
/// Telemetry context tagged with this sampling request's model.
|
|
pub(crate) session_telemetry: SessionTelemetry,
|
|
pub(crate) environments: TurnEnvironmentSnapshot,
|
|
/// Capability roots bound to ready environments in this exact step.
|
|
pub(crate) selected_capability_roots: Vec<ResolvedSelectedCapabilityRoot>,
|
|
/// Executor-materialized capability files shared by MCP and skills in this exact step.
|
|
pub(crate) executor_capability_discovery: Option<Arc<ExecutorCapabilityDiscoverySnapshot>>,
|
|
/// The exact MCP connections, configuration, and catalog captured for this step.
|
|
pub(crate) mcp: Arc<McpBinding>,
|
|
/// The finalized tool plan advertised and executed for this exact sampling request.
|
|
pub(crate) tool_router: Arc<ToolRouter>,
|
|
/// The canonical AGENTS.md value observed with this environment snapshot.
|
|
pub(crate) loaded_agents_md: Option<Arc<LoadedAgentsMd>>,
|
|
}
|
|
|
|
impl StepContext {
|
|
/// Persist the summary captured for this request, even after a live settings update.
|
|
pub(crate) fn to_turn_context_item(&self) -> TurnContextItem {
|
|
let mut item = self.turn.to_turn_context_item();
|
|
item.summary = self.settings.reasoning_summary;
|
|
item
|
|
}
|
|
}
|