Feature: Ability to add the "/compact" command to the task queue

Resolved 💬 6 comments Opened Sep 9, 2025 by temowemo Closed Jan 21, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What feature would you like to see?

I think it would be really useful to have the ability to add the "/compact" command to the task queue so that users can queue up a lot more tasks and avoid hitting the context limit.

Currently, users receive this message:
🖐  '/compact' is disabled while a task is in progress.

Are you interested in implementing this feature?

_No response_

Additional information

_No response_

View original on GitHub ↗

6 Comments

santiago-afonso · 10 months ago

This is a super important feature to have.

s-smits · 7 months ago

This is very important coming from Claude Code.

etraut-openai contributor · 7 months ago

Manual compaction of context was important in the past, but with the latest OpenAI models like gpt-5.2, it should no longer be needed. We've implemented a reliable auto-compaction mechanism that is performed automatically when the context window nears exhaustion. Our goal is to eliminate the need for developers to manually manage compactions.

santiago-afonso · 7 months ago
Manual compaction of context was important in the past, but with the latest OpenAI models like gpt-5.2, it should no longer be needed. We've implemented a reliable auto-compaction mechanism that is performed automatically when the context window nears exhaustion. Our goal is to eliminate the need for developers to manually manage compactions.

auto-compaction works well but is far from perfect. I'm sure you'll improve it with time. Currently it sometimes losses context for the task at hand, forgets what it was supposed to do next. In other cases it losses key repo context. I've asked codex to spit out the compaction summary verbatim - it seems too compressed, perhaps using 1.5x or 2x the lines would solve these issues.

etraut-openai contributor · 7 months ago

Yes, you can assume we'll continue to improve it over time. Manual compaction uses the same underlying mechanism as auto compaction, so exposing a manual compaction API won't result in improved results.

lc0rp · 6 months ago

See this issue for some compelling reasons for manual compaction, or at least a way to advise codex to compact before next task: https://github.com/openai/codex/issues/11325#issuecomment-3976274099