mirror of
https://github.com/openai/codex.git
synced 2026-05-02 02:17:22 +00:00
[codex-analytics] feature plumbing and emittance (#16640)
--- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/openai/codex/pull/16640). * #16870 * #16706 * #16641 * __->__ #16640
This commit is contained in:
@@ -2444,6 +2444,14 @@ pub enum InitialHistory {
|
||||
}
|
||||
|
||||
impl InitialHistory {
|
||||
pub fn scan_rollout_items(&self, mut predicate: impl FnMut(&RolloutItem) -> bool) -> bool {
|
||||
match self {
|
||||
InitialHistory::New | InitialHistory::Cleared => false,
|
||||
InitialHistory::Resumed(resumed) => resumed.history.iter().any(&mut predicate),
|
||||
InitialHistory::Forked(items) => items.iter().any(predicate),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn forked_from_id(&self) -> Option<ThreadId> {
|
||||
match self {
|
||||
InitialHistory::New | InitialHistory::Cleared => None,
|
||||
|
||||
Reference in New Issue
Block a user