Skip to content

Ahead of time (background) context compaction to hide latency #6841

Closed as not planned

Description

@lupuletic

What feature would you like to see?

When Codex CLI performs compaction it feels slow and blocking which hammers the developer experience. I was thinking whether Codex could support non-blocking, background compaction that triggers ahead of the context limit, so users can keep using it while context is being compacted.

When the context approaches a particular threshold of the context window (e.g. ~75%), automatically trigger a background compaction - however, keep letting the user continue to submit prompts while compaction runs, as long as there's still context window free / available.

When compaction completes, on next idle occasion, pre-append the compacted context in front of the last user turns / context.

This would make compaction effectively “instant” from the user’s perspective and reduce cases where long sessions feel sluggish.

Additional information

No response

Activity

  1. added
    enhancement
    on Nov 18, 2025
  2. github-actions commented on Nov 18, 2025

    @github-actions
    Contributor

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

    Powered by Codex Action

  3. changed the title [-]Ahead of time (background) background context compaction to hide latency[/-] [+]Ahead of time (background) context compaction to hide latency[/+] on Nov 18, 2025
  4. etraut-openai commented on Jan 10, 2026

    @etraut-openai
    Contributor

    This feature request hasn't received any upvotes in nearly two months, so closing.

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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions