mirror of
https://github.com/openai/codex.git
synced 2026-10-18 17:18:52 +00:00
## Why OS discovery can launch subprocesses on Linux. Repeating it for requests, analytics events, and metrics provider creation adds unnecessary work for stable metadata. ## What changed Cache `os_info::get()` with a separate `LazyLock` in user-agent generation, analytics runtime metadata, and metrics OS resource attributes. Continue reading the user-agent originator and suffix on each call so updates remain effective. ## Testing Add an isolated Linux regression test that races initial user-agent lookups and repeats calls, verifies `lsb_release` and `getconf` each run once, and checks that subsequent originator and suffix updates appear in the user agent. GitOrigin-RevId: 337e45ff88b863d2a4aa387a8e7d2e291c045906