mirror of
https://github.com/openai/codex.git
synced 2026-10-25 18:28:38 +00:00
Preserve tool declaration mode across resumed context windows (#51480)
## Why Changing the incremental tools setting on resume should not move tool declarations and base instructions within an existing context window. ## What changed - Determine the current window's tool declaration mode from its history, and apply the incremental tools setting when building a new window after compaction or a context reset. - Use that mode consistently for sampling, remote compaction, startup prewarm, prompt debugging, and Guardian input budgeting. - Preserve tool declarations alongside their comparison baseline in full-history agent forks, including compacted histories; remove them together when rebuilding context. ## Testing Add request snapshots covering legacy resume, migration after remote compaction or a context reset, disabling incremental tools, and tool updates after restart. Extend agent fork and WebSocket startup prewarm tests to cover retained declarations and incremental tools. GitOrigin-RevId: 7c46849a1788027a8435082e4d1f7e7f48d2700c
This commit is contained in:
@@ -6,6 +6,12 @@ use serde::Serialize;
|
||||
#[serde(transparent)]
|
||||
pub struct ContentItemKind(pub String);
|
||||
|
||||
impl ContentItemKind {
|
||||
pub fn as_str(&self) -> &str {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "item_metadata_tests.rs"]
|
||||
mod tests;
|
||||
|
||||
Reference in New Issue
Block a user