Files
codex/codex-rs
Charlie Marsh 87bc50f9d4 Cache OS discovery for user agents and telemetry (#47038)
## 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
2026-09-21 14:04:41 +00:00
..
…
…