mirror of
https://github.com/openai/codex.git
synced 2026-11-19 22:30:42 +00:00
## Why A thread can start while managed Guardian policy is being refreshed. Startup and refresh need to coordinate so the thread does not register with policy that the refresh has already superseded. ## What changed Let hosts provide a `GuardianPolicyLoader` to `ThreadManager` for startup and on-demand refresh. Pause thread registration while a refresh loads and publishes policy. If publication overtakes a thread's startup configuration, reload Guardian policy before registering the thread. Apply the published policy to live threads concurrently. Once published, the updates continue even if the refresh caller is canceled. Return an error if any live thread rejects the update. ## Testing Add regression coverage for an idle thread receiving the update while another thread holds its session lock, and for reporting a live thread's rejection of invalid Guardian configuration. GitOrigin-RevId: ca0cfa2a30f0d45c4ac5ded3400e0e18177ede1d