Files
codex/codex-rs/core/tests
Tamir Duberstein 3a047b211f Preserve status for evicted V2 agents
V2 residency eviction removes idle agents from ThreadManager while
leaving their logical identities in AgentRegistry. Status queries
therefore report NotFound for completed and errored agents after
eviction, even though callers can still address those agents.

When eviction removes the expected CodexThread, retain its bounded
terminal status in the matching AgentMetadata. Under the ThreadManager
write lock, publish the status only if the registry still contains the
same metadata generation. This makes the status available before the
matching removal becomes visible without publishing through a stale
metadata handle.

Tie each cached status to its CodexThread source. Reloaded threads clear
the cache, and status reads reject a cache from another CodexThread.

Limit cached text to 128 bytes because status can enter model-visible
tool output. Keep existing behavior for interrupted agents and for
Missing or Replaced removals, where eviction did not remove the
captured thread.
2026-06-25 21:08:57 -04:00
..