Track history notes thread hint outcomes (#42247)

## What changed

- Emit a `codex_thread_hint_status` analytics event for each native history-notes thread hint attempt.
- Report whether retrieval was successful or failed along with thread context and timing, without including hint contents.
- Treat valid empty responses as successful retrievals while continuing to omit them from the context window.

## Testing

- Extend the app-server history-notes tests to verify success, empty-result success, and backend failure statuses.

GitOrigin-RevId: b9462f312847e8c871ed2be0c8cf8df0928a7fdd
This commit is contained in:
pmccrary-oai authored and copyberry committed 2026-09-02 09:12:17 +00:00
1 parent eb10d91e48
commit bdfd769640
10 files changed
+118 -10

No files matched your search

+28
View File
@@ -621,6 +621,34 @@ impl AnalyticsReducer {
CustomAnalyticsFact::Goal(input) => {
self.ingest_goal(*input, out);
}
CustomAnalyticsFact::ThreadHintStatus(input) => {
if let Some((connection, thread, metadata)) =
self.thread_context_or_warn(AnalyticsDropSite {
event_name: "codex_thread_hint_status",
thread_id: &input.thread_id,
turn_id: None,
review_id: None,
item_id: None,
})
{
out.push(TrackEventRequest::ThreadHintStatus(Box::new(
crate::thread_hint::ThreadHintStatusEventRequest {
event_type: "codex_thread_hint_status",
event_params: crate::thread_hint::ThreadHintStatusEventParams {
thread_id: input.thread_id,
session_id: metadata.session_id.clone(),
app_server_client: thread.app_server_client(connection),
runtime: connection.runtime.clone(),
thread_source: metadata.thread_source.clone(),
subagent_source: metadata.subagent_source.clone(),
parent_thread_id: metadata.parent_thread_id.clone(),
status: input.status,
occurred_at_ms: input.occurred_at_ms,
},
},
)));
}
}
CustomAnalyticsFact::GuardianV2(input) => {
let event_type = match &input.kind {
GuardianV2EventKind::Classification { .. } => {