Repository navigation
Studio: show the compaction count in the context meter - #13355
Merged
danielhanchen merged 8 commits intoOct 12, 2026
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Member
Author
|
@codex review |
1 similar comment
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
danielhanchen
pushed a commit
to danielhanchen/unsloth-staging-2
that referenced
this pull request
Oct 12, 2026
This was referenced Oct 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Fixes #12625. Supersedes #12759 by @Yudeeswaran (their commits are kept here; that branch conflicts with
mainand is not open to maintainer edits).Problem
Long chats compact themselves automatically. The only trace is the "Context compacted" notice in the transcript, which is easy to scroll past in a long session, so there is no way to tell at a glance how many times a chat has been compacted (and so when it is time to start a fresh one).
Change
Compactions Nrow.compactionNoticeMessageIds(thread.messages).size: the same memoized set the transcript uses to decide which assistant messages render the "Context compacted" notice, so the count always equals the notices on screen (active branch, checkpoint starts included, a boundary that moves backwards not re-counted).CompactionCountRegistrarpublishes the count from inside the assistant-ui runtime (the header sits outside it);ChatPagekeeps it keyed by thread id, so a thread switch never shows another chat's count. It is mounted for single-chat and project views, so a chat started from a project landing page is counted too.Testing
tsc -bclean; full frontend suite passes (11325 tests).Before / after
Qwen3.5-0.8B GGUF (UD-Q4_K_XL) at a 2,048 token window, Max Tokens 256, temperature 0. Three turns produce two "Context compacted" notices on both builds, then the header meter is hovered. Before = merge base
fcee6485f, after = this PR at40d563cd7.The tooltip gains a
Compactions 2row, matching the two notices in the transcript; nothing else in it moves.