Repository navigation
Studio: keep a chat's own settings when its send waits on a model load - #17565
danielhanchen merged 14 commits into
Conversation
Codex Review Summary: ✅ CompletedThis 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. |
…ffective values when the model stays
|
Codex Review: Didn't find any major issues. What shall we delve into next? 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". |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! 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". |
…ck (#17571) ## Summary `studiobench CI` (`Real-path session, every action ran`) has failed on main since #17504, and so have `Merge base vs head` and `Merge base vs itself, the null` on PRs that touch the thread (e.g. #17565): ``` thread_reopen: ran EXPECT FAILED -- the reopened thread never reached a ready state: the thread was not ready in windowed mode: pin_settled (mounted 8 of 25; aria-setsize 25; aria-posinset 18..25 on 8 of 8 rows, 8 distinct; last row 'assistant'; 0px from the bottom) ``` #17504 switched these jobs to the windowed readiness gate (`--windowed-arm`), which is the only mode that checks `pin_settled`. That condition read "the autoscroll is still pinning" as "`--aui-scroll-stabilizer` is set on the viewport". But `use-intent-aware-autoscroll.tsx` leaves the stabilizer's last value in place as residual padding once the follow window ends, and drops it only when the user scrolls up ("Drop residual stabilizer padding once the user scrolls up so the bottom stays flush"). So a thread that has finished pinning can keep the property for as long as the reader stays at the bottom, and the gate times out on a page that is otherwise ready (in the log above, every other condition held for the whole wait). This is not caused by the windowing itself. The null control on #17504 ran the merge base (fully mounted, before #17504) on both sides and failed the same way: ``` cell FAILED: ThreadNotReady: the thread was not ready in windowed mode: pin_settled (mounted 18 of 18; aria-setsize None; ...; 0px from the bottom) ``` The app behaves as designed, and #17504 is right to run the windowed gate. The gate's reading of the stabilizer is what is wrong. ## Change - `tests/studio/studiobench/runtime/readiness.py`: the probe also returns the stabilizer's value. `pin_settled` holds when the property is absent, or when it carries the same value as on the previous probe and the page has settled (same mounted count, element count and scroll height). A value that is still changing, or a page whose height is still moving, still counts as mid-pin, and the gate still needs its consecutive settled samples before it passes. - `INTERFACES.md`: the `pin_settled` row says the same. - No app code changes, so nothing changes for Studio or Desktop users. ## Guard New `test_residual_stabilizer_padding_settles_the_pin` in `test_studiobench_readiness_live.py`: - residual padding unchanged across two settled probes passes; - the first probe, a changed value, or a moving scroll height does not pass; - a cleared stabilizer passes. With the old `pin_settled` line, the test fails. ## Testing - `test_studiobench_readiness_live.py` (including its live browser cases), `test_studiobench_thread_reopen_gate.py`, `test_studiobench_windowed_parity.py`, `test_studiobench_completeness_gate_rows.py`: 142 passed. - This PR's own `studiobench CI` run is the end-to-end check.
|
The three red checks here are not from this PR:
|
|
Codex Review: Didn't find any major issues. Another round soon, please! 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". |
A message sent while a model is loading waits for the load inside the chat adapter. If you open another chat during that wait, the first chat's turn runs with the other chat's settings: permission mode, tool toggles, system prompt, sampling and RAG. With chat A on "Ask for approval" and chat B on "Auto", chat A's Python tool call ran without asking.
After the wait,
createOpenAIStreamAdapterre-readsuseChatRuntimeStoreto pick up the model that just loaded. Queued sends merge their own snapshot over that read, but a direct send took the whole store, which by then held chat B's settings.withRunThreadScopedSettings). Model fields and installation-wide settings still come from the live store.Verification
Live A/B in Chromium (Playwright) against a local Studio with Qwen3-8B-GGUF. Chat A: Ask, temperature 0.3, top_p 0.81. Chat B: Auto, 1.4, 0.55. Send in A with no model loaded, then switch to B while the model loads. The
/api/inference/loadrequest was held until B was on screen, so the switch always lands inside the wait. Values are from chat A's run request:auto, 1.4 / 0.55, B's system promptask, 0.3 / 0.81, A's system promptask, 0.3 / 0.81, A's system promptChat A after the switch, on main (the tool ran):
With this PR (waiting for approval):
tests/run-keeps-chat-settings-across-model-load.test.tsruns the adapter's own post-wait selection block, taken from the adapter source. It checks another chat on screen, the same chat, a first send, and a pending settings read; the cases with a different chat or a pending read fail on main. It also covers every chat-scoped key, a chat-only Full access grant, and, using the real store setters, Full access with Code switched off: Code stays off after another chat picks Ask.node scripts/typecheck.mjs --testspasses, and the related store and settings tests pass (130). Fullnpm testwas run before the Full access Code-off fix: 10 files fail, and they fail the same way on main.Before / after (two isolated Studio installs)
BEFORE is merge base
ecf4aaf595, AFTER is the merged headae95a860b, each built and launched as its own Studio home with an offline HF cache holding onlyunsloth/Qwen3.5-0.8B-MTP-GGUF(UD-Q4_K_XL, real weights, CPU llama-server). Chat A: Ask for approval, temperature 0.3, top_p 0.81, "You are chat A.". Chat B: Approve for me, 1.4, 0.55, "You are chat B.". Chat A sends with no model loaded, the auto-load's/api/inference/loadis held until chat B is on screen, then released. The table is read from chat A's real/api/inference/chat-runsrequest body on each side; the shot is chat A 20 s after returning to it (its permission pill reads "Ask for approval" at 1 s, 5 s and 20 s on both sides; nothing persisted to either chat changed).