Skip to content

Studio: remember thinking Off after eject - #15093

Merged
danielhanchen merged 14 commits into
unslothai:mainfrom
Souravrajvi0:fix/remember-thinking-disabled
Nov 4, 2026
Merged

danielhanchen merged 14 commits into
unslothai:mainfrom
Souravrajvi0:fix/remember-thinking-disabled

Conversation

@Souravrajvi0

@Souravrajvi0 Souravrajvi0 commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #14743

Loading a model, turning thinking off in the composer, ejecting, then loading the same checkpoint turned thinking back on. Eject resets the store to the family default, and a fresh load ignored the last user choice.

This keeps a per-model on/off pin (separate from reasoning effort pins). Reloading that checkpoint reuses Off or On. Temporary persist: false toggles (Kimi search) do not write the pin. Models that cannot disable thinking (reasoning_always_on / reasoning_effort) still stay on.

Test plan

  • node --experimental-strip-types --test tests/model-reasoning-preferences.test.ts tests/qwen-defaults-migration-safety.test.ts tests/chat-tool-selection-lifecycle.test.ts (115 passed)
  • In Studio: load a reasoning model, turn thinking Off, eject, load the same model: thinking stays Off
  • Turn thinking On, eject, reload: thinking stays On
  • Load a different model that never had a pin: it still uses the family default

Before / after

Real Studio, two isolated installs (merge base be64e0d78 vs this branch), unsloth/Qwen3-0.6B-GGUF Q4_K_M on CPU, driven through the picker: load, turn Thinking off, eject, load the same model again.

Thinking pill after eject and reload: BEFORE on, AFTER off

Stage Before After
First load on on
Toggled off off off
Eject, then reload on off
Stored pin none unsloth/Qwen3-0.6B-GGUF = false

A same-model reload (for example after changing context) keeps the value currently shown; the pin only seeds fresh loads, since switching chats restores a chat's own value without writing the pin.

Fixes unslothai#14743

Eject resets the composer toggle to the family default, so loading the
same checkpoint turned thinking back on. Pin the user's on/off choice
per model (not the session-only persist:false path) and reuse it on
load unless the model cannot turn thinking off.
@danielhanchen

Copy link
Copy Markdown
Member

The Frontend build + bundle sanity failure here is the startup bundle budget. Main sits right at it, so any extra code that loads on the first screen tips it over:

over the startup budget: transfer 2040.0 KB > 2039.7 KB, raw 6772.1 KB > 6770.5 KB

This PR adds about 0.4 KB transfer to the startup chunks, through the chat runtime store and the model picker files it touches. If that code really is needed on the first screen, raise BUDGET in studio/frontend/scripts/check-bundle-budget.ts in this PR with a one-line reason. Otherwise load the new part on use, with a dynamic import at the call site.

The zustand store is only for tests and cross-tab sync. Chat load/save
now uses a small localStorage helper so CI stays inside the startup
bundle budget.
CI measured +135 B on the eager path for per-checkpoint thinking
Off/On localStorage (unslothai#15093). Sync budget limits from main, then bump
transfer with the measured growth.
@Souravrajvi0

Copy link
Copy Markdown
Contributor Author

@danielhanchen Thanks for flagging the startup budget — agreed the thinking-pin helpers belong on the eager load path.

Raised BUDGET.transferBytes to 2_089_025 in studio/frontend/scripts/check-bundle-budget.ts with a one-line note for #15093 (+135 B transfer in Frontend CI). Also merged latest main (including the #15084 budget line) and fixed a bad merge conflict in that file on 54fac7420d.

Latest push should be ready for Frontend build + bundle sanity when CI finishes.

@danielhanchen

Copy link
Copy Markdown
Member

The latest merge of main into this branch (e0e3816711, then 54fac7420d) did not land cleanly. The PR now changes 26 files under .github/ that it never meant to touch. They are older versions of workflows main has updated since, codeql.yml among them (main runs it weekly and on dispatch only; this branch puts back the push and pull request triggers). That is why workflow-trigger lint fails here, and both tests pass on main:

tests/studio/test_main_runs_survive_merge_bursts.py::test_a_push_never_replaces_a_nightly_or_a_dispatch_on_main
    {'codeql.yml': ['schedule', 'workflow_dispatch']} share the push group on main with ...
tests/studio/test_workflow_guards_run_unfiltered.py::test_every_workflow_reading_guard_runs_in_the_unfiltered_job

Taking main's version of everything under .github/ (git checkout origin/main -- .github, then commit) should leave only this PR's own frontend changes in the diff. The startup bundle budget comment above still applies after that.

The last merge of main left older copies of .github/workflows on this
branch, including push and pull_request triggers on codeql.yml. Take
main's .github tree so workflow-trigger lint matches main.

The thinking Off/On pin stays on the eager chat path. It fits inside
main's current startup bundle budget (6791.3 KB raw, 2046.4 KB transfer,
99 chunks), so that budget is left as main set it.
@danielhanchen danielhanchen self-assigned this Nov 4, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 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-11-04T16:02:22.568728Z 322dd0c 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.

danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 4, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@danielhanchen

Copy link
Copy Markdown
Member

pre-commit.ci run

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 322dd0cc68

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

# Conflicts:
#	studio/frontend/src/features/chat/lib/apply-inference-status-to-store.ts
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Nov 4, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Nov 4, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Nov 4, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Nov 4, 2026
@danielhanchen
danielhanchen merged commit 4722f03 into unslothai:main Nov 4, 2026
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.

[Feature] Remember disabled thinking setting

2 participants