Enrich thread archive analytics with thread context (#39797)

## What changed

- Add app-server client, runtime, thread source, and parent thread ID metadata to archive and unarchive analytics events when the reducer has that context.
- Omit non-automation feature thread sources and skip unavailable metadata.

## Testing

- Cover archive and unarchive event enrichment, filtered feature sources, and threads without cached context.
- Verify the app-server archive flow emits the enriched analytics payload.

GitOrigin-RevId: 163f9c30721cee0172bb4581b6dcd269e44cd941
This commit is contained in:
Eddie Chen authored and copyberry committed 2026-08-20 20:44:31 +00:00
1 parent d9fd91edab
commit cc801d7048
5 files changed
+198 -12

No files matched your search

+8
View File
@@ -264,6 +264,14 @@ pub(crate) struct ThreadArchiveEventParams {
pub(crate) thread_id: String,
pub(crate) action: ThreadArchiveAction,
pub(crate) occurred_at_ms: u64,
#[serde(skip_serializing_if = "Option::is_none")]
pub(crate) app_server_client: Option<CodexAppServerClientMetadata>,
#[serde(skip_serializing_if = "Option::is_none")]
pub(crate) runtime: Option<CodexRuntimeMetadata>,
#[serde(skip_serializing_if = "Option::is_none")]
pub(crate) thread_source: Option<ThreadSource>,
#[serde(skip_serializing_if = "Option::is_none")]
pub(crate) parent_thread_id: Option<String>,
}
#[derive(Serialize)]