Let the current model help decide what matters during compaction

Open
#34,888 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Quiet
Domain
ai

Research direction

The issue does not name any files, tests, or entry points. Start by reading the related discussions linked in the issue; the desired behavior, implementation scope, and concrete definition of done still need to be established.

Written by the indexing model from the issue text.

Description

context enhancement

I have been using one Codex thread for a long-running project. After manually running compaction, the context indicator still showed about 81% usage.

What surprised me was what seemed to survive: the thread still retained a long sequence of my earlier messages, including casual comments, repeated confirmations, and details from troubleshooting that was already finished.

Those messages are part of the history, but I do not need all of them to remain in the active context. What I care about more is:

  • corrections I made;
  • important terms and how their meaning changed;
  • why we made certain decisions;
  • questions that are still unresolved;
  • where detailed information has already been saved;
  • details that are now safe to forget.

This made me wonder whether the model that is currently in the conversation could help with compaction.

The current model has seen which ideas became important, which interpretations I corrected, and which details were only useful for a temporary task. It could provide a short note saying:

Here is what should continue to matter, and here is what can be dropped.

The system could still separately preserve the practical information it is better suited to protect, such as task status, files, tool results, safety rules, and unfinished work. The two notes could then be combined.

I would not want the current model to control the whole process. It could misunderstand the conversation or treat its own wording as more important than it really is. Its note should therefore be only one input, with system facts and safety rules taking priority.

It would also be helpful if users could see the compacted summary and correct it. Even a small optional field such as “remember this” or “this can be forgotten” could make compaction much more useful for long-running conversations.

The main goal is not only to make the summary shorter. It is to preserve the parts that should still affect the future conversation, instead of mainly preserving a record of everything that happened.

Related discussions:

Dominant language
Rust
Stars
125k
Forks
19.5k
Avg merge
1m
Merged PRs (30d)
1k

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openai/codex

All issues in openai/codex

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.