Repository navigation
Studio: show automatic compaction count in context meter - #12759
Closed
Yudeeswaran wants to merge 7 commits into
Closed
Yudeeswaran wants to merge 7 commits into
Yudeeswaran wants to merge 7 commits into
Conversation
danielhanchen
added a commit
that referenced
this pull request
Oct 5, 2026
…test made (#12771) socket.getaddrinfo is patched process-wide, so a lookup from any other thread in the xdist worker also reached the fake and was counted: 'assert 33 == 32' in test_stalled_lookups_do_not_pile_up (#12759) and 'assert 3 == 2' in test_a_timed_out_lookup_is_not_remembered (#12750), on PRs that do not touch the provider code. Route this file's .example hosts to the fake and everything else to the real resolver in the five tests that count calls, and pin the routing.
Yudeeswaran
force-pushed
the
fix/issue-12625-context-compaction-meter
branch
from
October 8, 2026 06:51
8f14f41 to
0b445d3
Compare
This was referenced Oct 12, 2026
danielhanchen
pushed a commit
to danielhanchen/unsloth-staging-2
that referenced
this pull request
Oct 12, 2026
Member
|
Thanks for the PR! This branch conflicts with
Could you merge it (or enable "Allow edits by maintainers")? Checked live against a real llama-server at a 2,048 window: two notices in the transcript, |
danielhanchen
added a commit
that referenced
this pull request
Oct 12, 2026
Adds a Compactions row to the chat header's context meter tooltip, counted from the same set of messages the transcript renders "Context compacted" notices for. The row only appears once a chat has compacted; single-chat and project views are both counted. Fixes #12625. Supersedes #12759. Co-authored-by: Yudeeswaran <[email protected]>
Member
|
Merged in #13355, which keeps your commits (you are credited as co-author) plus the follow-ups from Yudeeswaran#1 and a rename of the row to "Compactions". Thanks for the PR! |
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.
Summary
Closes #12625
Adds an automatic compaction count to the Unsloth Studio Context Length meter.
Changes
countAutomaticCompactions()using the existing compaction notice semantics and high-water boundary.contextTruncationmetadata.Automatic compactionsin the Context Length meter tooltip.Verification
node --experimental-strip-types --test tests/rolling-context-window.test.tsgit diff --checkpassed.Note
The count represents recorded compaction notices/checkpoint starts in the assistant transcript. Multiple internal refits occurring within a single streamed assistant response are merged into one truncation metadata record, so they cannot be counted individually from the persisted frontend metadata.
Before / after
Qwen3.5-0.8B GGUF (UD-Q4_K_XL) loaded at a 2,048 token window, Max Tokens 256, temperature 0. Three chat turns produce two "Context compacted" notices on both builds; then the header meter is hovered. Before =
mainatfcee6485f, after = this PR plus the follow-up fixes in Yudeeswaran#1 ata758c95d9.The tooltip gains an
Automatic compactions 2row, matching the two notices in the transcript. Everything else in the tooltip is unchanged.