Skip to content

Allow the models to retrieve user and assistant messages from the current thread after compaction for richer context #32265

Open

Description

@shouryamaanjain

What variant of Codex are you using?

CLI

What feature would you like to see?

After one or more context compactions, earlier user and assistant messages remain stored and visible in the TUI, but the model can no longer directly retrieve exact details that were omitted from its compacted context. This can cause codex to forget decisions or constraints, repeat questions, or act from an incomplete summary.

I'd like codex to give the model bounded, on-demand access to earlier conversation in the current thread.

Retrieval should use the existing canonical persisted rollout rather than injecting the entire history into every inference request or duplicating conversation storage.

For example, if the user selected architecture A before compaction, Codex could search the current thread for that decision and read the exact earlier exchange instead of asking again or relying on an incomplete summary.

Additional information

A working prototype is available here:
https://github.com/shouryamaanjain/codex/pull/1

Activity

  1. added
    enhancement
    on Jul 10, 2026
  2. added
    CLI
    context
    session
    on Jul 10, 2026
  3. github-actions commented on Jul 10, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  4. dustoil commented on Oct 19, 2026

    @dustoil

    I independently tested a related post-compaction retrieval interface (not this Codex prototype or Codex itself). In 60 paired Russian-language synthetic chats, a local Qwen3.8 27B agent had the latest summary, recent turns, and broad cross-chat lexical search in A. B additionally had chat-state metadata, dated summary history, scoped search of original messages, and exact reads. Complete three-field answers were 37/60 in A versus 60/60 in B; mean attempt time was 6:26 versus 4:01. In 22 of 23 unsuccessful A attempts, the correct original record had already appeared in broad search results, but the model often failed to establish its provenance or chronology.

    This is a bundled synthetic test, so it cannot isolate the benefit of exact reads or predict a Codex result. Your proposed bounded current-thread retrieval seems directly relevant. What failure modes or evaluation criteria would you prioritize for a Codex-specific test? Protocol, raw traces, and skeptical audit: https://huggingface.co/datasets/dustoil/chat-state-awareness-compaction-ab

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

    CLIcontextenhancementsession

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions