Removing the need for compactions, and better token usage

Resolved 💬 4 comments Opened May 1, 2026 by KhurrumMahmood Closed Jul 1, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What variant of Codex are you using?

App

What feature would you like to see?

This suggestion would require updates to the GPT models also, but if you train the models to be able to do this:

Block-Attention paper: https://arxiv.org/abs/2409.15355

Then:

  1. You can dynamically edit context - and remove redundant info, or even bring it back later if it makes sense to - and the same for summaries.
  2. Agent instructions become composable, and also easy to switch in and out based on the requirements of the current stage of an agentic workflow (like bring in advanced Python best practices for a specific situation only while that specific thing is being worked on)

I think this also has potential for the API side offering in general, since it would let people manage more complex agentic workflows at lower costs – in exchange for mildly higher complexity in orchestration.

Additional information

The main way I'd be inclined to use this for Codex is alongside a memory management pattern like Claude Code's pattern of having an index of summary information with additional docs for drill down.

That would make it easier to compose context based on current needs.

I think the natural route would be to have a project level broader memory, and also a current thread level memory for recent work.
Plus, that way you could also decide what portions of current context to pass to sub-agents, without having to either share the whole thread context or explicitly define a complete new context before calling the sub-agent.

... Much potential seriously.

View original on GitHub ↗

4 Comments

github-actions[bot] contributor · 3 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #19758
  • #19672
  • #19671
  • #19061

Powered by Codex Action

KhurrumMahmood · 3 months ago
* Add a post-compaction hook for deterministic memory reinjection #19061

None of them overlap with my main point, although some of them would add value after my main point.

etraut-openai contributor · 1 month ago

This feature request hasn't received enough upvotes, so it is being closed automatically. If you still feel this feature is needed, please open a new feature request with an updated title and description.

KhurrumMahmood · 1 month ago
This feature request hasn't received enough upvotes, so it is being closed automatically. If you still feel this feature is needed, please open a new feature request with an updated title and description.

I would think that whether or not it got many votes shouldn't matter since it's fundamentally a product / UX problem, and it can't be said that anyone likes:

  1. Slow downs due to compaction
  2. The loss of quality and trust in the model properly staying on track long term after compaction.

Although I'll grant that Codex's compactions aren't too bad.