Files
codex/codex-rs/ext/extension-api/src/contributors/context.rs
T
jif c44c4de7b4 Add step-scoped data to extension contributors (#34525)
## What changed

- Add an `ExtensionData` store to each `StepContext`.
- Pass the step store to context, world-state, turn-input, and tool contributors so extensions can use capabilities bound to the current sampling step.
- Preserve the captured step context when rebuilding initial context during compaction.

GitOrigin-RevId: 51f3105d3a793f60534f122f9be8247c131c2ca5
2026-07-21 11:53:56 +00:00

23 lines
802 B
Rust

use codex_protocol::ThreadId;
use crate::ExtensionData;
/// Host context available while extensions contribute turn-scoped context fragments.
#[derive(Clone, Copy)]
pub struct TurnContextContributionInput<'a> {
/// Stable host-owned thread identifier.
pub thread_id: ThreadId,
/// Stable host-owned turn identifier.
pub turn_id: &'a str,
/// Store scoped to the host session runtime.
pub session_store: &'a ExtensionData,
/// Store scoped to this thread runtime.
pub thread_store: &'a ExtensionData,
/// Store scoped to this turn.
pub turn_store: &'a ExtensionData,
/// Store scoped to this sampling step.
pub step_store: &'a ExtensionData,
/// Effective model context window for this turn, when known.
pub model_context_window: Option<i64>,
}