Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
Studio: only offer Agent Skills when Code is on (#12118)
Daniel Handbe2c6ff520d
diff --git a/studio/frontend/src/features/chat/api/chat-adapter.ts b/studio/frontend/src/features/chat/api/chat-adapter.tsindex 4b572ef98df..30bcee4f0ff 100644--- a/studio/frontend/src/features/chat/api/chat-adapter.ts+++ b/studio/frontend/src/features/chat/api/chat-adapter.ts@@ -200,6 +200,7 @@ import {providerSupportsFastMode,} from "../provider-capabilities";import { selectCodeToolNames } from "./code-tool-placement";+import { skillToolsOffered } from "./skill-tools";import { ragScopeContextLength } from "./rag-context-length";import {type PendingImageEditReference,@@ -2001,8 +2002,9 @@ export async function buildLocalTokenCountExtras(const ragOn = ragEnabled || projectRagEnabled;await settleSkillsForText("");- const hasEnabledSkills = getSkillsSnapshot().skills.some(- (skill) => skill.valid && !skill.shadowed && skill.enabled,+ const hasEnabledSkills = skillToolsOffered(+ getSkillsSnapshot().skills,+ codeToolsEnabled,);if (!toolsEnabled &&@@ -6153,8 +6155,9 @@ export function createOpenAIStreamAdapter(if (supportsStudioToolsForThisTurn) {await settleSkillsForText(lastUserText(outboundMessages));}- const hasEnabledSkills = getSkillsSnapshot().skills.some(- (skill) => skill.valid && !skill.shadowed && skill.enabled,+ const hasEnabledSkills = skillToolsOffered(+ getSkillsSnapshot().skills,+ codeToolsEnabled,);if (externalSelection && externalProvider) {// Per-thread container reuse; empty falls back to container_auto. Anthropic uses its own key.diff --git a/studio/frontend/src/features/chat/api/skill-tools.ts b/studio/frontend/src/features/chat/api/skill-tools.tsnew file mode 100644index 00000000000..673c8dd7c97--- /dev/null+++ b/studio/frontend/src/features/chat/api/skill-tools.ts@@ -0,0 +1,20 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0++// Home-dir skills are on by default with no pill of their own, so they follow Code (#11671).++export interface SkillToolEntry {+ valid: boolean;+ shadowed: boolean;+ enabled: boolean;+}++export function skillToolsOffered(+ skills: readonly SkillToolEntry[],+ codeToolsOn: boolean,+): boolean {+ return (+ codeToolsOn &&+ skills.some((skill) => skill.valid && !skill.shadowed && skill.enabled)+ );+}diff --git a/studio/frontend/tests/skill-tools.test.ts b/studio/frontend/tests/skill-tools.test.tsnew file mode 100644index 00000000000..8e6eeff9b47--- /dev/null+++ b/studio/frontend/tests/skill-tools.test.ts@@ -0,0 +1,21 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0++import assert from "node:assert/strict";+import test from "node:test";++import { skillToolsOffered } from "../src/features/chat/api/skill-tools.ts";++const enabled = { valid: true, shadowed: false, enabled: true };++test("an enabled skill is offered only while Code is on (#11671)", () => {+ assert.equal(skillToolsOffered([enabled], true), true);+ assert.equal(skillToolsOffered([enabled], false), false);+});++test("Code alone offers nothing without a usable skill", () => {+ assert.equal(skillToolsOffered([], true), false);+ assert.equal(skillToolsOffered([{ ...enabled, enabled: false }], true), false);+ assert.equal(skillToolsOffered([{ ...enabled, shadowed: true }], true), false);+ assert.equal(skillToolsOffered([{ ...enabled, valid: false }], true), false);+});diff --git a/studio/frontend/tests/skills-token-count-discovery.test.ts b/studio/frontend/tests/skills-token-count-discovery.test.tsindex 17f53b7c0e3..49eb93b4884 100644--- a/studio/frontend/tests/skills-token-count-discovery.test.ts+++ b/studio/frontend/tests/skills-token-count-discovery.test.ts@@ -26,7 +26,7 @@ test("token counting waits for the initial skills discovery", () => {assert.match(CHAT_ADAPTER_SOURCE, /await settleSkillsForText\(""\);/);assert.match(CHAT_ADAPTER_SOURCE,- /const hasEnabledSkills = getSkillsSnapshot\(\)\.skills\.some\(/,+ /const hasEnabledSkills = skillToolsOffered\(\s*getSkillsSnapshot\(\)\.skills,\s*codeToolsEnabled,\s*\);/,);});@@ -63,6 +63,10 @@ test("request building waits for skills and preserves the launcher tool catalog"payloadBuilder,/if \(supportsStudioToolsForThisTurn\) \{\s*await settleSkillsForText\(lastUserText\(outboundMessages\)\);/,);+ assert.match(+ payloadBuilder,+ /const hasEnabledSkills = skillToolsOffered\(\s*getSkillsSnapshot\(\)\.skills,\s*codeToolsEnabled,\s*\);/,+ );assert.match(payloadBuilder,/supportsTools &&\s*\([\s\S]*hasEnabledSkills[\s\S]*\)\s*\? \{\s*enable_tools: true/,