Skip to content

Studio: mark where a chat was compacted with an inline divider - #360

Closed
oobabooga wants to merge 5 commits into
mainfrom
worktree-compaction-divider
Closed

oobabooga wants to merge 5 commits into
mainfrom
worktree-compaction-divider

Conversation

@oobabooga

Copy link
Copy Markdown
Owner

When Studio compacts a chat, the transcript now shows a one-line "Context compacted" divider where the compaction happened, directly above the prompt whose request compacted. It replaces the four-sentence box that opened the reply. The explanation and the numbers (messages dropped, passages recalled, prompt tokens before and after) move into a tooltip on the label. The divider uses the same style as the existing "Continued from chat" rule.

Screenshots

Merge base vs this branch, Qwen3.5-0.8B GGUF at a 2,048 token window, same prompts. The first compaction fires on turn 6 on both sides.

1-before-after

The detail behind the label:

2-divider-tooltip

Placement

  • Where it goes: each compaction draws one divider, in the row slot above the prompt its request answered. If no prompt precedes the reply, for example a continuation round, the divider goes above the reply itself.
  • Under the default checkpoint policy: this is also where the kept context begins, because a reset evicts everything ahead of the newest user turn.
  • Under the rolling window: the divider marks when compaction happened, not how far back the kept context reaches.
  • What was not changed: which replies count as a compaction (compactionNoticeMessageIds). So the context meter count (Studio: show the compaction count in the context meter unslothai/unsloth#13355) equals the number of dividers on screen.
  • What it is built from: the existing persisted contextTruncation record. Nothing new is stored, and nothing reaches the model or the export.

At a 2,048 window a marker appears on almost every turn on both main and this branch: 9 boxes vs 8 dividers over 16 turns. Each marker is now a 13 px line instead of a 77 px box.

The label has a padded touch target (33 px tall) without changing the drawn line. Studio's tooltip opens on tap as well as hover and focus.

Validation

  • Live A/B on two installs. Before: the box sits inside the reply. After: the divider sits between rows, directly above the prompt, and is redrawn in the same place after a reload.
  • Frontend: tsc -b is clean. npm test passes 11,707 of 11,719; the 12 failures also fail on the merge base. New tests cover divider placement and that the divider count equals the meter count.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T00:47:02.778403Z 3c1ac4f Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@oobabooga

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 3c1ac4fd98

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@oobabooga oobabooga closed this Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants