Introduce Rollout Policy (#3116)

Have a helper function for deciding if we are rolling out a function or
not
This commit is contained in:
Ahmed Ibrahim
2025-09-03 10:37:07 -07:00
committed by GitHub
parent c636f821ae
commit daaadfb260
3 changed files with 30 additions and 36 deletions

View File

@@ -0,0 +1,16 @@
use codex_protocol::models::ResponseItem;
/// Whether a `ResponseItem` should be persisted in rollout files.
#[inline]
pub(crate) fn is_persisted_response_item(item: &ResponseItem) -> bool {
match item {
ResponseItem::Message { .. }
| ResponseItem::Reasoning { .. }
| ResponseItem::LocalShellCall { .. }
| ResponseItem::FunctionCall { .. }
| ResponseItem::FunctionCallOutput { .. }
| ResponseItem::CustomToolCall { .. }
| ResponseItem::CustomToolCallOutput { .. } => true,
ResponseItem::WebSearchCall { .. } | ResponseItem::Other => false,
}
}