Skip to content

Fix Studio auto-titles for reasoning models - #7098

Merged
oobabooga merged 1 commit into
unslothai:mainfrom
Lyxot:fix/studio-auto-title-reasoning
Jul 13, 2026
Merged

oobabooga merged 1 commit into
unslothai:mainfrom
Lyxot:fix/studio-auto-title-reasoning

Conversation

@Lyxot

@Lyxot Lyxot commented Jul 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Disable reasoning explicitly for automatic chat-title requests with both enable_thinking: false and reasoning_effort: "none".
  • Reject truncated title completions and output containing think markers so the deterministic first-user-message fallback is used.
  • Preserve tool-call-only first turns by keeping assistant context optional.
  • Extend the focused Studio title-generation regression coverage.

Root cause

Automatic title generation reused the active chat model with a 24-token output limit but did not disable reasoning. Reasoning models could spend the complete budget on reasoning before producing a title. On the GGUF path, reasoning-only output may be promoted to visible content to protect normal chat responses from becoming blank, allowing that text to pass title normalization and become the permanent chat title.

This change keeps the global GGUF behavior intact and hardens only the title-generation request and response handling. It does not special-case any observed title phrase.

Fixes #7071

Validation

python -m pytest tests/studio/test_chat_title_generation.py -q
7 passed

npm run typecheck
passed

ruff check tests/studio/test_chat_title_generation.py
passed

ruff format --check tests/studio/test_chat_title_generation.py
passed

git diff --check
passed

Targeted ESLint reports the same pre-existing ref-during-render error and Fast Refresh warnings as the unchanged base branch; this patch introduces no new lint finding.

Risk

The patch is limited to title generation. If a backend rejects the reasoning controls, the existing failed-request path uses the deterministic title fallback. If a backend ignores them, truncated and think-tagged responses are also rejected. An always-reasoning backend that silently ignores both controls and returns short, untagged reasoning with a non-truncation finish reason remains outside what the response shape can distinguish from a valid title.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request configures the title generation model payload to disable thinking and reasoning efforts, and updates the response parsing to handle truncated responses or the presence of thinking tags. It also adds and updates corresponding unit tests. The review feedback suggests making the thinking-disabled configuration more robust by adding thinking: { type: "disabled" } for models like Claude 3.7, and expanding the regular expression to filter out alternative thinking tags such as <thought>, <thinking>, or <reasoning>.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@Lyxot
Lyxot marked this pull request as ready for review July 13, 2026 07:27
@Lyxot
Lyxot requested a review from danielhanchen as a code owner July 13, 2026 07:27
Copilot AI review requested due to automatic review settings July 13, 2026 07:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.

Hardens Studio’s automatic chat-title generation for reasoning models by explicitly disabling reasoning in the title request and rejecting non-title outputs so the deterministic fallback is used.

Changes:

  • Add enable_thinking: false and reasoning_effort: "none" to the title-generation model payload.
  • Reject title candidates that are truncated (finish_reason === "length") or contain <think> markers.
  • Expand regression tests around title generation, fallback behavior, and tool-call-only first turns.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
tests/studio/test_chat_title_generation.py Extends regression coverage by asserting new payload fields and new rejection/fallback behaviors via source-string checks.
studio/frontend/src/features/chat/runtime-provider.tsx Adds reasoning-disable flags to the title request and rejects truncated / think-tagged model outputs before normalizing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@oobabooga

Copy link
Copy Markdown
Member

Reproduced your root cause live. On a Qwen3.6-27B GGUF, replaying real first-user messages with the old title payload gave the literal "Thinking Process" title on 4 of 5 chats (truncated reasoning, finish_reason: length); Gemma 4 E2B hit the same class on one opener. With your payload both models return clean titles with finish_reason: stop, and your length guard alone would have rejected every old failure.

I also traced the two new request fields through the backend: template-gated on GGUF, peeled off on safetensors/MLX, and the title request never routes to an external provider. Your rebuttals to the bots hold, since the explicit enable_thinking: false makes the suggested thinking object a no-op.

Tests and typecheck pass; CI green on a fork mirror: oobabooga#51. Merging.

@oobabooga
oobabooga merged commit a337c72 into unslothai:main Jul 13, 2026
36 checks passed
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.

[Bug] All Auto-Named Titles where a Tool Call is the first action of the LLM are named "Thinking Process"

3 participants