mirror of
https://github.com/openai/codex.git
synced 2026-10-20 17:38:45 +00:00
## Why User messages could fill the root context limit before assistant questions were considered, while commentary could displace relevant conversational context. Guardian needs that context to interpret user authorization when reviewing subagent actions. ## What changed - Select recent user and assistant evidence together under a shared message limit, discarding assistants with unknown ordering first. - Exclude explicit assistant commentary and retain message phases across compaction. For older retained records, check available source messages for commentary phases. - Mark missing instructions or assistant context when the shared limit removes corresponding evidence, and use remaining space for legacy instructions. ## Testing Update Guardian authorization tests to cover shared message limits, commentary filtering across compaction and resume, and preservation of ordered replies when legacy assistant context has unknown ordering. GitOrigin-RevId: c369a2760917cba9d7dfca37fb5e85a7ec49012f