Repository navigation
fix(server): background compactions no longer flip threads to Working - #25122
Merged
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #24334. When T3 Code compacts an idle Claude thread on its own, the thread flipped to "Working" in the sidebar, inbox and mobile list. When the compaction finished, the inbox moved the thread to the top as a "return" and the sidebar showed an unread "Completed" pill. The hidden
/compactprompt also bumped the thread's sort time, and the run restarted the auto-settle clock.Fix
The thread shell now skips T3 Code's own idle compaction runs, and their
/compactprompts, unless the compaction fails. This covers the in-memorythreadShellFromProjectionand the SQL shell and settlement queries, which share one SQL predicate that mirrorsidleCompactionOf. The shell is what lists, notifications and the relay read, so they all keep presenting the user's last turn without any client changes:This replaces the
latestRunSilentshell flag from #24334 and its client-side checks in the notification coordinator andagentAwareness. Those clients now see no change at all instead of having to filter one.The open thread is unaffected: web and mobile build their live state from the full projection, so the timeline still shows the live "Compacting before the cache expires…" divider. A
/compactyou type is an ordinary turn. When you send to an idle thread and the composer compacts first, the sidebar shows activity once your queued message's own turn starts.Evidence
This was checked against a real Claude Haiku thread on a dev server. To avoid waiting an hour, the idle compaction was patched to fire 15 seconds after the turn, for recording only. The page sampled the sidebar row every 250 ms:
The row stayed in the same position (index 0, y=102) throughout, and no pill appeared.
Tests
ProjectionStore.test.ts, in both shell paths: a running idle compaction, from the server or from compacting on return, is not the latest, active or activity run, and its prompt is not the latest user message. A typed/compactand an ordinary prompt are. A failed idle compaction surfaces.Not run: mobile in a simulator.
Claude Opus 5.5 via Claude Code in T3 Code.
🤖 Generated with Claude Code