mirror of
https://github.com/openai/codex.git
synced 2026-11-20 22:40:37 +00:00
Add thread and child retention policies for injected items (#62654)
## Why The `always` policy ties retention across context windows to inheritance by spawned agents. Callers need to control those behaviors independently. ## What changed - `alwaysInThread` carries items across context windows in the current thread and excludes them from spawned agents, including full-history forks. - `alwaysInChildren` passes items still in the parent's context to spawned agents and leaves each thread's context-window retention to the usual rules. - `always` continues to apply in both scopes, including for items saved by older versions. Retained tool calls and outputs must be adjacent, with the call first and the same retention policy on both items. ## Testing Extend integration coverage for retention across remote compaction, inheritance by spawned agents, and injection through the app server. GitOrigin-RevId: aafede69cfbe149aa52292e6029d248d4bdf6401
This commit is contained in:
@@ -91,6 +91,11 @@ pub enum ItemRetention {
|
||||
Default,
|
||||
/// Carry the item into later context windows and newly spawned children.
|
||||
Always,
|
||||
/// Carry the item into later windows of this thread and exclude it from spawned agents.
|
||||
AlwaysInThread,
|
||||
/// Carry the item into spawned agents while it is in the parent's context.
|
||||
/// Each thread applies ordinary retention when its own context window changes.
|
||||
AlwaysInChildren,
|
||||
}
|
||||
|
||||
impl From<ResponseItem> for InjectedResponseItem {
|
||||
|
||||
Reference in New Issue
Block a user