support per-thread `model_auto_compact_token_limit_scope` in Codex App
What variant of Codex are you using?
Powered by Codex & OWL Version 26.915.31029 Released Sep 18, 2026
What feature would you like to see?
support per-thread model_auto_compact_token_limit_scope in Codex App
I use Codex App for long-running multi-thread workflows where different threads have different responsibilities but collaborate on the same codebase. A representative setup is:
- Thread A — Research worker: long-running research, spawning many subagents and continuously persisting research evidence/results into the codebase.
- Thread B — Supervisor: periodically monitors Thread A, resolves lightweight blockers, and escalates unresolved structural blockers.
- Thread C — Escalation / MASTER: invoked for heavyweight blockers that Thread B cannot resolve, potentially using multiple agents to investigate, modify, validate, and unblock Thread A. All three threads share the same codebase as persistent state/SSOT, but their conversation-context lifecycles are different. For example, a research thread may benefit from:
model_auto_compact_token_limit_scope = "body_after_prefix"
because preserving a substantial amount of newly accumulated research context after the previous compaction can be useful. A monitoring/supervisor thread may instead benefit from:
model_auto_compact_token_limit_scope = "total"
because much of its historical context consists of transient operational state that can be compacted more aggressively. My current global configuration is:
model_context_window = 1000000
model_auto_compact_token_limit = 500000
model_auto_compact_token_limit_scope = "total"
With such a large context window and a codebase-backed SSOT, using total globally is currently a reasonable default. Therefore, per-thread scope is not a hard dependency for this workflow.
However, it would still be useful as a per-thread tuning capability when a specific long-running research thread demonstrates that repeated compaction is occurring too soon after a carried compacted prefix.
The important distinction is that model_auto_compact_token_limit_scope controls a different policy from merely selecting a larger or smaller context window:
total:
carried prefix + new body >= threshold
→ compact
body_after_prefix:
new body >= threshold
→ compact
Therefore, a per-thread context-window profile alone does not necessarily solve this use case unless the profile can also control the auto-compaction scope. Related issue:
- #40429 — per-thread context-window profile selector
That proposal appears to provide the correct per-thread configuration layer, but it does not currently specify whether
model_auto_compact_token_limit_scopecan be overridden per thread. A useful extension would be:
Global / project default
↓
Thread-specific context override
├── model_auto_compact_token_limit
└── model_auto_compact_token_limit_scope
├── total
└── body_after_prefix
The selected values should stay with the thread/session and be editable (and configured through the prompts) in Codex App, without needing separate CLI --profile sessions.
This would allow long-running research, supervision, debugging, and escalation threads within the same project to use context-management policies appropriate to their actual information lifecycle, while keeping total as the conservative global default.
Additional information
With such a large context window and a codebase-backed SSOT, using total globally is currently a reasonable default. Therefore, per-thread scope is not a hard dependency for this workflow.
Please include live application semantics for these per-thread settings, alongside the context-window control in #40429.
I'd like to be able to change an existing chat's context size and compaction settings and have the validated combination take effect automatically before the next safe model request, without restarting or creating a new chat. For the scope setting requested here, changing from body_after_prefix to total could make compaction due immediately, so the next compaction decision should use the new scope and threshold together.
Please show the effective values, keep explicit per-chat overrides separate from reloaded global defaults, and make any compaction required by the change visible. Saving settings should not look like they have already been applied when the running session is still using the old values.
This would connect the per-thread policy requested here with the hot-reload behavior discussed in #3860, while retaining each chat's own settings.