mirror of
https://github.com/openai/codex.git
synced 2026-11-07 00:33:29 +00:00
Add turn-scoped context contributions (#28911)
## Summary - keep context injection on a single ContextContributor trait - split context injection into thread-scoped and turn-scoped contribution methods - wire turn-scoped fragments into initial context assembly so extensions can contribute context from turn-local state
This commit is contained in:
14 files changed
+307
-33
No files matched your search
@@ -0,0 +1,20 @@
|
||||
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,
|
||||
/// Effective model context window for this turn, when known.
|
||||
pub model_context_window: Option<i64>,
|
||||
}
|
||||
Reference in new issue
Block a user