Files
codex/codex-rs/analytics
peilin-openai c19525e55e Record initialization analytics for resumed subagents (#51206)
## Why

Reloaded subagent threads did not emit initialization analytics, and subagent initialization events always reported `new`.

## What changed

Emit initialization events for resumed spawned subagents before notifying thread listeners. Inherit parent client metadata before reserving a residency slot can evict the parent, preserve the thread's original `created_at`, and report `initialization_mode` as `resumed`. Refresh stored analytics metadata when a subagent resumes; newly created subagents continue to report `new`.

## Testing

Extend the cold-resume integration test to verify a single worker initialization event with the expected session, parent, source, resume mode, and original creation timestamp. Update serialization and session tests to check initialization modes.

GitOrigin-RevId: e78b0c4d88b6ddbe993ca7e1fe7717b6f74bf3d9
2026-10-06 00:16:18 +00:00
..