Repository navigation
Studio: honor Claude Code's thinking-off setting on /v1/messages - #17557
Merged
danielhanchen merged 2 commits intoNov 12, 2026
Merged
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. |
Member
Author
|
@codex review |
1 similar comment
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. 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". |
danielhanchen
added a commit
that referenced
this pull request
Nov 12, 2026
…#17592) ## Summary `Repo tests (CPU, studio)` fails on main since #17213, and on every PR based on it (seen in staging runs for #17496 and #17557): ``` tests/studio/test_desktop_reliability_frontend_contract.py::test_fixed_sheets_start_below_the_custom_titlebar E assert 'set("--studio-custom-titlebar-height", usesCustomTitlebar ? "34px" : null)' in '...' ``` #17213 (F11 fullscreen) hides the custom titlebar in fullscreen, so the `<html>` mirror in `provider.tsx` now reads: ```ts const customTop = customTitlebarHidden ? "0px" : "34px"; set("--studio-custom-titlebar-height", usesCustomTitlebar ? customTop : null); ``` That is correct: in fullscreen the titlebar band is gone, and portalled sheets should start at the top edge. The test pinned the old line character for character, so it failed on a change that keeps everything it was written to protect. The mirror is still there, and it still gives 34px whenever the titlebar shows. ## Change `tests/studio/test_desktop_reliability_frontend_contract.py`: - `_mirrored_titlebar_heights()` finds the `set("--studio-custom-titlebar-height", usesCustomTitlebar ? <value> : null)` call and resolves `<value>`. A string literal is read directly; a local such as `customTop` is read from its `const` declaration. - `test_fixed_sheets_start_below_the_custom_titlebar` now asserts that the mirror exists, that it yields `34px`, and that it yields nothing other than `34px` or the fullscreen `0px`. The rest of the test is unchanged. - `test_the_titlebar_mirror_reader_follows_a_local` covers the reader: the old literal form, the new local form, and a different property that must not match. No app code changes. ## Testing - `tests/studio/test_desktop_reliability_frontend_contract.py`: 46 passed (1 failed on main). - With the mirror line removed from `provider.tsx`, the test fails. With the shown height changed from `34px` to `30px`, it also fails.
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.
Turning thinking off in Claude Code does not stop a local model from thinking when Claude Code talks to Studio. With
MAX_THINKING_TOKENS=0, or with thinking turned off in/config, a model whose template thinks by default (Qwen3, GLM and similar) still reasons on every turn. This was reported on Discord.Cause
Claude Code only sends
thinking: {"type": "disabled"}for Claude model ids it knows. For any other id, which is every model Studio serves, it sendsthinking: {"type": "adaptive"}when thinking is on and leavesthinkingout when thinking is off. The review capture in #9941 showed this on 2.1.251, and it is the same on 2.1.322:thinkingsentunsloth/Qwen3-0.6B-GGUF{"type": "adaptive"}MAX_THINKING_TOKENS=0unsloth/Qwen3-0.6B-GGUFalwaysThinkingEnabled: falseunsloth/Qwen3-0.6B-GGUFMAX_THINKING_TOKENS=0claude-sonnet-4-6{"type": "disabled"}AnthropicMessagesRequest.resolved_enable_thinking()reads a missingthinkingas "use the model default", so the template default applies and the model thinks.Fix
/v1/messagesrequest comes from Claude Code, a missing or nullthinkingnow resolves to off. Claude Code is recognized by itsclaude-cli/User-Agent or itsclaude-code-*entry inanthropic-beta. Both are present under the environmentunsloth start claudesets./v1/messages/count_tokensapplies the same rule, so counting renders the same prompt as generation.Behavior boundaries
thinkingstill means the model default. This matches Anthropic's API, where the default depends on the model (per-model table), and llama.cpp's and vLLM's/v1/messages, which also leave the template default in place. Making a missing field mean off for every client would break clients that rely on that default.enable_thinkingandreasoning_effortsent in the body still take precedence overthinking, sounsloth start claude --reasoning onkeeps thinking on.CLAUDE_CODE_DISABLE_THINKING=1sends the same request shape, so it now also turns thinking off. Claude Code's docs say the two settings behave the same on third-party providers.output_config.effort, which Claude Code sends even with thinking off, still does not turn thinking back on.Testing
Live, with Claude Code 2.1.322 (
claude -p) against Studio on CPU withunsloth/Qwen3-0.6B-GGUFQ4_K_M, a model that thinks by default. Main is5d5c1381b0.MAX_THINKING_TOKENS=0alwaysThinkingEnabled: falseA direct
/v1/messagesrequest withoutthinkingand with anAnthropic/PythonUser-Agent returns a thinking block on both main and this PR.Automated:
test_anthropic_messages.py. They cover header detection, precedence against explicit controls, and the generation and count paths through the real route handlers. 12 of them fail on main.The in-session thinking toggle (Alt+T) was not tested.