Patching Codex: Managed Amnesia Without Losing Context
OpenAI
A developer proposed a method to make the Codex model autonomously decide when to compact its context. The model explains the reason and creates a plan for future work, using checkpoints to restore state after compaction. The approach is implemented in a GitHub repository, though conclusions are not yet drawn.
A developer gave the model (in codex) the ability to decide on its own when a compact is needed and required it to explain the reason and build a plan for the future. The motivation is that compacting in the middle of editing a large, coherent project part raises some doubts. The method involves adding current context situation to tool call responses and instructions for writing checkpoints in agent rules. Before a large phase, the agent checks the remaining context window. If the planned work does not fit, it saves a checkpoint with information about what is being done and what is planned after the compact, then compresses its context. Upon waking up, it reads the checkpoint, verifies the repository state, and continues work according to the planned schedule. It seems interesting but no conclusions yet. You can test it at the provided GitHub link, though you will need to patch codex, which is not a big deal.
Source: Habr — хаб ИИ —
original
