Selective active-context editing ("Exclude from context") for long-running threads

Open
#33,769 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
rust

Research direction

No files, tests, or entry points are identified. Start by reading related issues #21347, #11325, and #21468, then determine how Codex represents thread context and compaction; done means reversible exclusion and restoration, token-impact visibility, and clear separation from transcript deletion across the listed clients.

Written by the indexing model from the issue text.

Description

app context enhancement session
What variant of Codex are you using?

Codex App (also applicable to CLI and IDE Extension)

What feature would you like to see?

Summary

I would like Codex to support selective active-context editing for long-running threads.

This is different from deleting an entire thread or deleting chat history for privacy purposes. The goal is to let users inspect and selectively exclude specific messages, turns, or context blocks from the context sent to the model in future requests.

Possible names include:

  • Exclude from context
  • Forget this block
  • Context editor
  • Modular context
  • Fluid context

Problem

During a long-running coding task, a single incorrect assumption, misleading sentence, outdated requirement, or irrelevant tool result can bias many later responses.

Once I identify the problematic context, my current options are:

  1. Add another instruction telling Codex to ignore it, which may not reliably override the earlier context.
  2. Start a new thread and manually reconstruct the valid context.
  3. Wait for compaction and hope the problematic information is not preserved.

None of these directly fixes the source of the misunderstanding.

Requested behavior

Allow users to:

  • Inspect the context currently active for the thread.
  • Select one or more messages or context blocks.
  • Mark them as Excluded from future context.
  • Restore excluded blocks with Undo/Include.
  • See an estimated token reduction before applying the change.
  • Distinguish between deleting transcript history and excluding content from active model context.
  • Edit or regenerate the compacted summary if excluded information has already been incorporated into it.
  • Optionally fork the thread from the sanitized context instead of mutating the original thread.

For tool calls, Codex could treat a tool call and its corresponding result as one dependency-aware block, preventing invalid partial histories.

Example

A long task contains an early message saying:

Assume the service always returns schema A.

Later, runtime evidence proves that the deployed service returns schema B.

Even after correcting the assumption, Codex may continue reasoning from schema A because it remains in the conversation history or compacted summary.

I want to select the original assumption and choose:

Exclude from active context

Future turns should then be constructed without that assumption, while the original transcript may remain visible for auditing.

Why this matters

This would:

  • Recover long-running tasks from context pollution.
  • Reduce repeated corrective prompting.
  • Make model behavior easier to debug.
  • Potentially reduce future context/token usage.
  • Preserve useful thread history without forcing users to restart.
  • Give users explicit control over what Codex currently "knows".
Additional information

Related issues:

  • #21347 — individual message deletion
  • #20251 / #13018 — deleting threads and local session data
  • #11325 — manual context compaction
  • #21468 — visible and prompt-guided compaction

The key distinction is that this request concerns the effective context sent to the model, not only deletion of stored chat history. A reversible Exclude from context action would also be safer than destructive transcript deletion.

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.