t3code icon indicating copy to clipboard operation
t3code copied to clipboard

[Bug]: Idle threads compact on the first message after the cache is cold; add an off switch or a timed idle compaction

Open electro56435 opened this issue 1 month ago • 1 comments

Before submitting

  • [x] I searched existing issues and did not find a duplicate.
  • [x] I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

  1. Work in a Claude thread until it holds more than 100K tokens.
  2. Leave it idle past its prompt cache TTL (60 minutes on a subscription, 5 minutes on an API key).
  3. Type a message and press Enter.

Expected behavior

Compaction never runs as a side effect of the first message after a long idle. Two settings cover this:

  1. Off switch. A setting in Settings > General turns compact-before-send off completely. With it off, Enter sends the message with the full history and no Compact chip shows. PR #15773 already built this as compactBeforeResumeEnabled (default off, under Follow-up behavior), but it was closed without merging.
  2. Idle compaction on a timer. T3 compacts an idle thread by itself, a set time after its last turn and before the prompt cache expires, for example the TTL minus 5 minutes. The delay is configurable, and the feature can be turned off. The compaction then reads a warm cache. When the user comes back hours later, the thread is already small and the first message sends at once.

Actual behavior

The amber Compact chip is on by default (#16631, #17127). Enter runs /compact first, then sends the message from the queue. The only way to skip it is to click the chip to "Full" before every send on every stale thread. "Don't ask again" works only per thread, and only if Claude's own resume dialog appeared.

The offer fires only after the cache has expired (#17945). So the compaction itself re-reads the whole context at the uncached rate. #13988 measured $0.90 for a cold compact against $0.10 for a warm one. Users who manage context by hand pay for that cold read, then lose the history they chose to keep.

Today a thread idle for 8 hours compacts on the first message. That costs a full cold read and delays the message, and the user gets nothing for it: the cache is gone either way. Compaction either has to happen while the cache is warm, or not at all.

Impact

Major degradation or frequent failure

Version or commit

T3 Code nightly 0.0.46-nightly.20261012.3035; code checked on main @ a01c48f862 (apps/web/src/components/chat/ContextWindowMeter.logic.ts)

Environment

macOS 26.6.2, desktop app, Claude Code 2.1.296, claude-opus-5-5

Workaround

Click the Compact chip to "Full" before each send on a stale thread.

electro56435 avatar Oct 13 '26 22:10 electro56435

[!NOTE] Grok responding on behalf of Julius.

Thanks for the detailed write-up. This is a duplicate of #17467, and both things you're asking for are already being discussed:

  • A lasting off switch for compact-before-send. The default-on Compact chip for stale Claude threads is deliberate (#16631, #17127). Making it optional is being discussed in Ideas #17170, and #18486 adds a "Compact old Claude threads" setting under Settings > General. #15773 was closed by its author without merging and isn't coming back as-is.
  • Compacting idle threads before the cache goes cold. This is the warm-cache point from #13988, which now continues in Ideas #18011. #18713 adds an opt-in setting that compacts large idle threads before their prompt cache expires.

Please add your use case and the cold-vs-warm cost numbers to #17170 or #18011, or review those PRs, so the feedback stays in one place. Closing as a duplicate of #17467.

juliusmarminge avatar Oct 13 '26 22:10 juliusmarminge