Skip to content

Support message-boundary and range-based context compaction #38953

Description

@beyond-infra

What variant of Codex are you using?

Codex app

What feature would you like to see?

I would like Codex to support user-controlled, message-boundary context compaction.

From any message in a conversation, users should be able to:

  • Compact everything before this message
  • Compact everything after this message
  • Select a range of messages to compact

Messages outside the selected range should remain unchanged. Ideally, Codex should also allow users to preview and edit the generated summary before applying it, and provide an option to undo the compaction.

Possible UI actions:

  • Compact messages above
  • Compact messages below
  • Compact selected range

At the API level, this could be represented using parameters such as beforeTurnId, afterTurnId, or startTurnId / endTurnId.

This would provide more precise context management than the current thread-level /compact behavior. It would be particularly useful when a long conversation contains completed work, verbose logs, failed explorations, or unrelated discussions that no longer need to remain in full context.

Related issue: #36669 discusses model-callable selective compaction. This request focuses specifically on user-controlled message boundaries and chat UI actions.

Additional information

A previewable and reversible workflow would reduce the risk of losing important decisions or constraints during compaction.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appcontextIssues related to context management (including compaction)enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions