Repository navigation
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/web (desktop composer), possibly apps/server
Steps to reproduce
- Settings: "Compact idle threads" = When you return (
idleCompaction: "onReturn"). - Run a long Claude thread (claudeAgent, claude-opus-5-5) well past 200K tokens.
- Leave it idle about 4 hours, far past the prompt-cache TTL.
- Come back. The composer shows the Compact next pill (tooltip: "Next send compacts N tokens first").
- Leave it on Compact next and send an ordinary message.
Expected behavior
The send runs /compact first, then delivers the message on the compacted context.
Actual behavior
The message goes straight to the model on the full, uncached history. No compaction turn item is recorded for that run or for the turns after it. The only compaction in the thread is a manual /compact sent later.
Reproduced on two threads at the same time, on two separate environments of the same desktop install (a WSL server and a Windows server), so it is not specific to one thread or one environment:
| Thread A (WSL env) | Thread B (Windows env) | |
|---|---|---|
| Previous run completed | 2026-10-30 23:02:20Z | 2026-10-30 23:01:18Z |
| Send with Compact next selected | 2026-10-31 02:53:21Z (~3h51m idle) | 2026-10-31 02:54:11Z (~3h53m idle) |
| Compaction before that run | none (first assistant output 8 s later) | none |
| Uncompacted runs before manual fix | 3 | 2 |
| First compaction in thread | manual /compact, 03:07:55Z |
manual /compact, 03:07:41Z |
Diagnosis
- The client never dispatched the
/compact. The effect outbox has exactly oneprovider-turn.startfor each stale send (A: 02:53:21.647Z, B: 02:54:11.037Z), for the user's message only. Per Idle compaction is skipped when the server restarts, including for a desktop update, during the wait #27915, the "When you return" path normally dispatches/compactwithidleCompaction: "onReturn"first and queues the message behind it. No such turn exists, so the compact-before-send step was skipped before anything reached the server. That points to the web composer's send path, not the server. - The full cost was paid. The Claude SDK result for each stale send shows the whole history re-written to the cache, with no
compact_boundaryin the session:- A:
cache_creation_input_tokens: 615301,cache_read_input_tokens: 12825 - B:
cache_creation_input_tokens: 420385,cache_read_input_tokens: 18270
- A:
- In both
orchestration_v2_projection_runsrows,contextHandoffIdis null and nocompactionturn item exists for the run. The onlycompactionitem in each thread belongs to the later manual/compactrun. - The pill showed "Compact next", not "Keep full", at send time on both threads. Nothing was toggled between seeing the pill and pressing Enter.
Impact
Major degradation: the two sends together re-wrote over a million tokens to the cache, and the follow-up turns kept paying on the uncompacted context, while the UI said they would compact first.
Version or commit
Desktop + server 0.1.3 (Windows desktop, servers on Windows and on WSL). I checked the v0.1.4 and v0.1.5 release notes and found no fix for this path.
Environment
Windows 11 desktop app; one server on Windows, one on WSL2 (Ubuntu), both 0.1.3. Provider: Claude (claudeAgent).
Related, but not the same
- [Bug]: Mobile sends skip "When you return" idle compaction #27911 Mobile sends skip "When you return" idle compaction (these sends were from the desktop composer)
- Idle compaction is skipped when the server restarts, including for a desktop update, during the wait #27915 Idle compaction skipped after a server restart (that is about the "before the cache expires" timer; here the compact-before-send fallback itself didn't run, and the Windows server had been up since 2026-10-28)
- [Bug]: Switching from an idle Claude thread to Codex still triggers automatic /compact #25943 / fix(web): scope resume compaction to the selected provider conversation #26142 Claude-to-Codex switch inherits Compact next (no provider switch here)
- [Bug]: Compact idle threads "Never" triggers compaction #26799 "Never" still compacts (the opposite symptom)
Logs or stack traces
orchestration_v2_events had already been pruned for these threads; the outbox rows and provider logs above are what remains. I can share sanitized excerpts on request.
Activity
juliusmarminge commentedon Oct 31, 2026
I tried this on current
main(80a2351) with the web client and a Claude thread (claudeAgent), with "Compact idle threads" set to When you return. To get there in minutes, I lowered the client's stale-thread thresholds; the send path itself was unchanged. The server had already released the idle Claude session, so the next turn resumed it, as it would after 4 hours./compactrun (idleCompaction: "onReturn", compaction itemcompleted), and then the message's run. Each had its ownprovider-turn.start./compactran first, then the message.So the composer does send
/compactahead of the message there. To find where it got lost on your two threads, could you share these rows for one of them, from the previous run's completion to the stale send (02:53Z on thread A)? Sanitized text is fine.orchestration_v2_projection_messages: any user message whose text is/compact, with itsidleCompactionvalue and timestamp.orchestration_v2_projection_runs: every run in that window, withstatus,requested_at,completed_at, and itsuserMessageId. A/compactrun that was stopped or failed before it reached the provider would never get aprovider-turn.start.orchestration_v2_effect_outbox: every row for the thread in that minute (alleffect_types, plusstatusandlast_error), not onlyprovider-turn.start.shivamhwp commentedon Nov 11, 2026
Closing this as not planned for now. It did not reproduce on main at
80a2351on 2026-10-31. With "Compact idle threads" set to When you return,/compactran before the message, both in a tab left open and after a reload.If it still happens on a current build, please reply here with the details asked for above and we'll reopen it.