Skip to content

Studio: keep a chat's summary when forking it - #19627

Merged
danielhanchen merged 1 commit into
unslothai:mainfrom
NilayYadav:fork-keeps-compaction-summaries
Nov 27, 2026
Merged

danielhanchen merged 1 commit into
unslothai:mainfrom
NilayYadav:fork-keeps-compaction-summaries

Conversation

@NilayYadav

Copy link
Copy Markdown
Collaborator

Forking a chat that was compacted with /compact gave the fork none of the parent's saved summary. With auto-compact off, the parent kept sending its summary plus the recent turns, but the fork sent the whole history again, so the next message in the fork failed with the provider's context length error. With auto-compact on, the fork first hit that error and then wrote a second summary of the same turns.

A fork now carries the parent's saved summaries along with its messages. A summary only applies when the turns it covers are the start of the fork's own history, so a fork taken before the compacted point, or one that goes a different way, still sends its own turns as before. Deleting the parent leaves the fork's copy in place.

Screenshots

Before (main) After (this PR)

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T01:02:12.117002Z ec0e774 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: ec0e774b80

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

@danielhanchen danielhanchen self-assigned this Nov 27, 2026
@danielhanchen
danielhanchen merged commit dcb74fc into unslothai:main Nov 27, 2026
danielhanchen added a commit that referenced this pull request Nov 27, 2026
…date banner layout red since #19970) (#20005)

## Problem

The update banner layout check
(`tests/studio/playwright_update_banner_layout.py`) fails 6 of its 2159
checks on main. It fails on the Linux `Chat UI Tests (chat)` leg, the
Windows `Chat UI Tests` leg and the Mac `Chat UI, API, Update and GGUF
inference` leg, on every staging run built on current main, for example
#19837, #14119, #14292, #15300 and #19627:

```
[banner] FAIL 921x534 new chat expanded: the bottom card is on the corner, not floating above it lastPaintedFromBottom=4 (want 16)
[banner] FAIL 390x500 new chat collapsed: the bottom card is on the corner, not floating above it lastPaintedFromBottom=9.1 (want 16)
```

The other four failures are the same check on the Train and Model hub
pages, at the same two sizes. The cards in the corner rail (update,
llama.cpp update, downloads, loaded models) are supposed to sit 16 px
above the corner. At these two window sizes the bottom card lands 4 px
and 9 px from the edge instead.

#19970 made the rail `overflow: visible` while its cards fit, and scroll
only once they outgrow it (`data-rail-scrolls`), so WebKit can blur
glass cards against the page. That part is right. But `overlayRailScope`
decided "outgrow" with `scrollHeight > clientHeight`, and for an
`overflow: visible` box Chromium leaves the end padding out of
`scrollHeight`. Cards that run into the rail's 16 px bottom padding, but
not past its border, read as `scrollHeight == clientHeight`: the rail
never starts scrolling, and the bottom card sits in the gutter.

The same 921x534 layout on a bare page in Chromium, cards running 12 px
into the bottom padding:

| rail | `scrollHeight` / `clientHeight` | bottom card from the corner |
|---|---|---|
| `overflow: visible` (main) | 534 / 534 | 4 px, and the rail does not
scroll |
| `overflow: auto` (before #19970) | 546 / 534 | scrolls |

Before #19970 the rail was always a scroll container, so the same layout
scrolled.

## Fix

`railOverflows()` in `studio/frontend/src/lib/toast-offset.ts`:
- It keeps the `scrollHeight` test.
- It also measures the span of the rail's in-flow cards plus its top and
bottom padding against `clientHeight`. Dragged cards are `fixed`
elsewhere and are left out.
- `overlayRailScope` uses it, so the rail scrolls whenever its cards do
not fit.
- While they fit, the rail stays `overflow: visible`, so #19970's WebKit
glass fix is unchanged.

On the bare page above:
- Cards 12 px into the padding: the old test reports no overflow,
`railOverflows` reports overflow.
- Cards that fit with room to spare: both report no overflow, and the
bottom card sits at 16 px.

## Verification

- `tests/toast-offset.test.ts`, new case: cards running into the bottom
padding with `scrollHeight == clientHeight` count as overflow; a fitting
stack, a stack with a dragged `fixed` card, and an empty rail do not; a
real `scrollHeight` overflow still does. `toast-offset.test.ts` and
`glass-floating-cards.test.ts`: 27 passed.
- `npm run typecheck` and `eslint` on both files: clean.
- The browser check itself,
`tests/studio/playwright_update_banner_layout.py`, run against a local
Studio install of main (`6047d3b980`) with the same driver CI uses:
- Before, main: `2159 checks, 6 failed`. The same six as CI: 921x534
expanded and 390x500 collapsed on New chat, Train and Model hub,
`lastPaintedFromBottom=4` / `9.1`.
- After, the same install with only this PR's `toast-offset.ts` rebuilt
in: `2153 checks, 0 failed`.
- The six corner checks are not run in those six layouts any more,
because the rail now scrolls there, exactly as it did before #19970. The
check only judges the corner while the rail is not scrolling. Every
other check, including "can be scrolled into the rail's view" for each
card, passes on both sides.

## Screenshots

Bottom-right corner of the two failing layouts, from the driver's own
screenshots of the run above. At rest the pixels are the same on both
sides: the stack does not fit these windows, and the bottom card runs
into the gutter either way. What changes is that the rail is a scroll
container again when its cards outgrow it, as before #19970, rather than
an `overflow: visible` box that lets them spill into its padding.

![Before and after: bottom-right corner rail at 921x534 and 390x500 on
New chat. The two sides render the same at rest; after the fix the rail
scrolls when its cards do not
fit](https://raw.githubusercontent.com/danielhanchen/unsloth-staging-2/pr-media/pr/20005/composite-255a75480d46.png)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants