feat: add metric to track the number of turns with memory usage (#18662)

Add a metric `codex.turn.memory` to know if a turn used memories or not.
This is not part of the other turn metrics as a label to limit
cardinality
This commit is contained in:
jif-oai
2026-04-20 14:31:22 +01:00
committed by GitHub
Unverified
parent 1c24347772
commit 2c59806fe0
8 changed files with 138 additions and 26 deletions
+8
View File
@@ -2793,6 +2793,14 @@ impl Session {
.set_mailbox_delivery_phase(MailboxDeliveryPhase::CurrentTurn);
}
pub(crate) async fn record_memory_citation_for_turn(&self, sub_id: &str) {
let turn_state = self.turn_state_for_sub_id(sub_id).await;
let Some(turn_state) = turn_state else {
return;
};
turn_state.lock().await.has_memory_citation = true;
}
async fn turn_state_for_sub_id(
&self,
sub_id: &str,